From c6e588dbae8ee64b4f2c3b84e426a19a0dc82b2c Mon Sep 17 00:00:00 2001 From: miaosiyu Date: Wed, 6 Dec 2023 19:08:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- op/API.md | 7972 ++++++++++++++++++++++++++--------------------------- 1 file changed, 3959 insertions(+), 4013 deletions(-) diff --git a/op/API.md b/op/API.md index 509560f..b101974 100644 --- a/op/API.md +++ b/op/API.md @@ -17,4861 +17,4807 @@ const onSyncTask = async (config, env, op, eventData) => { ``` ## api - -### user + +### user #### 创建用户 ``` js -const { data } = await op.api.user.create(params) ; +const { data } = await op.api.user.create(params); ``` POST /v1/users -##### param properties +``` ts + +{ + Content-Type: string; + // 用户名,唯一,不传后台自动生成 + username?: string; + // 密码,不传后台生成默认密码 + password?: string; + // 密码状态(valid/invalid) + password_status?: string; + // 显示名称 + display_name?: string; + // 名 + firstname?: string; + // 姓 + lastname?: string; + // 真实姓名 + realname?: string; + // 拼音 + pinyin?: string; + // 昵称 + nickname?: string; + // 用户类型,不传后台设置系统默认类型 + user_type?: string; + // 手机 + mobile?: string; + // 邮箱 + email?: string; + // 性别 + gender?: string; + // 证件类型 + cert_type?: string; + // 证件号 + cert_number?: string; + // 区域 + region?: string; + // 加入时间 + work_time?: string; + // 职位 + work_title?: string; + // 身份源ID,作为创建时记录,不做更新 + idp_config_id: number; + // 系统扩展属性,json对象{"age": 18, "love": "足球"} + sys_ext_props: { + } + // 自由扩展属性,json对象 + free_ext_props: { + } + // 是否通知:默认不传false不通知,true通知 + is_notify?: boolean; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // http状态码,成功不显示 + code?: number; + // 返回错误码 + errno: number; + // 返回描述 + message: string; + // 返回用户id + data: { + } +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
usernamestringfalse用户名,唯一,不传后台自动生成
passwordstringfalse密码,不传后台生成默认密码
display_namestringfalse显示名称
firstnamestringfalse
lastnamestringfalse
realnamestringfalse真实姓名
pinyinstringfalse拼音
nicknamestringfalse昵称
user_typestringfalse用户类型,不传后台设置系统默认类型
mobilestringfalse手机
emailstringfalse邮箱
genderstringfalse性别
cert_typestringfalse证件类型
cert_numberstringfalse证件号
regionstringfalse区域
work_timestringfalse加入时间
work_titlestringfalse职位
statusstringfalse状态:1正常,0禁用,后期扩展:离职、休假、借调。
password_statusstringfalse密码状态(valid/invalid)
idp_config_idnumbertrue身份源ID,作为创建时记录,不做更新
is_notifybooleanfalse是否通知:默认不传false不通知,true通知
sys_ext_propsobjectfalse系统扩展属性,json对象{"age": 18, "love": "足球"}
free_ext_propsobjectfalse自由扩展属性,json对象
- #### 锁定用户(旧) ``` js -const { data } = await op.api.user.disable(params) ; +const { data } = await op.api.user.disable(params); ``` PATCH /v1/users/{id}/disable -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // http状态码,成功不显示 + code?: number; + // 返回错误码 + errno: number; + // 返回描述 + message: string; + // 返回用户id + data?: boolean; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 解锁用户(旧) ``` js -const { data } = await op.api.user.enable(params) ; +const { data } = await op.api.user.enable(params); ``` PATCH /v1/users/{id}/enable -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // http状态码,成功不显示 + code?: number; + // 返回错误码 + errno: number; + // 返回描述 + message: string; + // 返回用户id + data?: boolean; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 批量锁定用户(旧) ``` js -const { data } = await op.api.user.batchDisable(params) ; +const { data } = await op.api.user.batchDisable(params); ``` POST /v1/jobs/users-disable -##### param properties +``` ts + +{ + Content-Type: string; + ids?: string;[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + effect_rows: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idsarraytrue
- #### 批量解锁用户(旧) ``` js -const { data } = await op.api.user.batchEnable(params) ; +const { data } = await op.api.user.batchEnable(params); ``` POST /v1/jobs/users-enable -##### param properties +``` ts + +{ + Content-Type: string; + ids?: string;[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + effect_rows: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idsarraytrue
- #### 编辑用户 ``` js -const { data } = await op.api.user.modify(params) ; +const { data } = await op.api.user.modify(params); ``` PATCH /v1/users/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + // 用户名,验证唯一 + username?: string; + // 显示名称 + display_name?: string; + // 名 + firstname?: string; + // 姓 + lastname?: string; + // 真实姓名 + realname?: string; + // 拼音 + pinyin?: string; + // 昵称 + nickname?: string; + // 手机 + mobile?: string; + // 邮箱 + email?: string; + // 性别:1男,0女 + gender?: string; + // 证件类型 + cert_type?: string; + // 证件号 + cert_number?: string; + // 区域 + region?: string; + // 加入时间 + work_time?: string; + // 职位 + work_title?: string; + // 上次登录IP + last_login_ipaddr?: string; + // 上次登录时间 + last_login_time?: string; + // 系统扩展信息,json对象{"age": 18, "love": "足球"} + sys_ext_props: { + } + // 自由扩展属性,json对象 + free_ext_props: { + } +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // http状态码,成功不显示 + code?: number; + // 返回错误码 + errno: number; + // 返回描述 + message: string; + // 返回用户id + data: { + } +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
usernamestringfalse用户名,验证唯一
display_namestringfalse显示名称
firstnamestringfalse
lastnamestringfalse
realnamestringfalse真实姓名
pinyinstringfalse拼音
nicknamestringfalse昵称
mobilestringfalse手机
emailstringfalse邮箱
genderstringfalse性别:1男,0女
cert_typestringfalse证件类型
cert_numberstringfalse证件号
regionstringfalse区域
work_timestringfalse加入时间
work_titlestringfalse职位
last_login_ipaddrstringfalse上次登录IP
last_login_timestringfalse上次登录时间
sys_ext_propsobjectfalse系统扩展信息,json对象{"age": 18, "love": "足球"}
free_ext_propsobjectfalse自由扩展属性,json对象
- #### 删除用户 ``` js -const { data } = await op.api.user.delete(params) ; +const { data } = await op.api.user.delete(params); ``` DELETE /v1/users/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // http状态码,成功不显示 + code?: number; + // 返回错误码 + errno: number; + // 返回描述 + message: string; + // 用户id + data: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 批量删除用户(旧) ``` js -const { data } = await op.api.user.batchDelete(params) ; +const { data } = await op.api.user.batchDelete(params); ``` DELETE /v1/users -##### param properties +``` ts + +{ + Content-Type: string; + ids?: string;[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + effect_rows: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idsarraytrue
- #### 查询用户列表 ``` js -const { data } = await op.api.user.list(params) ; +const { data } = await op.api.user.list(params); ``` GET /v1/users -##### param properties +``` ts + +{ + page_size?: integer; + page_num?: integer; + search_type?: string; + keyword?: string; + time_modified_from?: string; + time_modified_to?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + data: { + // 用户id标识 + id?: number; + // 用户名,唯一 + username: string; + // 密码 + password: string; + // 显示名称 + display_name?: string; + // 名 + firstname?: string; + // 姓 + lastname?: string; + // 真实姓名 + realname?: string; + // 拼音 + pinyin?: string; + // 昵称 + nickname?: string; + // 用户类型 + user_type: string; + // 手机 + mobile?: string; + // 邮箱 + email?: string; + // 性别 + gender?: string; + // 证件类型 + cert_type?: string; + // 证件号 + cert_number?: string; + // 区域 + region?: string; + // 加入时间 + work_time?: date; + // 职位 + work_title?: string; + // 扩展信息,json对象{"age": 18, "love": "足球"} + ext_prop?: json; + // arn + arn?: string; + // 身份源ID + id_provider_connection: number; + // 开发者id + developer_id?: number; + // 租户id + tenant_id?: number; + // 上次登录IP + last_login_ipaddr?: string; + // 上次登录时间 + last_login_time?: datetime; + // 创建时间 + time_created?: datetime; + // 修改时间 + time_modified?: number; + // 状态:1正常,0禁用 + status: string; + }[]; + // 总数 + total_num?: number; + // 当前页 + page_num?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
page_sizeintegerfalse
page_numintegerfalse
search_typestringfalse默认按用户基础字段搜索;当值为:generic时,全文检索
keywordstringfalse检索值
time_modified_fromstringfalse开始时间
time_modified_tostringfalse结束时间
- #### 查询用户详情 ``` js -const { data } = await op.api.user.get(params) ; +const { data } = await op.api.user.get(params); ``` GET /v1/users/{id} -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 用户id标识 + id?: number; + // 用户名,唯一 + username?: string; + // 密码 + password?: string; + // 显示名称 + display_name?: string; + // 名 + firstname?: string; + // 姓 + lastname?: string; + // 真实姓名 + realname?: string; + // 拼音 + pinyin?: string; + // 昵称 + nickname?: string; + // 用户类型 + user_type?: string; + // 手机 + mobile?: string; + // 邮箱 + email?: string; + // 性别 + gender?: string; + // 证件类型 + cert_type?: string; + // 证件号 + cert_number?: string; + // 区域 + region?: string; + // 加入时间 + work_time?: date; + // 职位 + work_title?: string; + // 扩展信息,json对象{"age": 18, "love": "足球"} + ext_prop?: json; + // arn + arn?: string; + // 身份源ID + id_provider_connection?: number; + // 开发者id + developer_id?: number; + // 租户id + tenant_id?: number; + // 上次登录IP + last_login_ipaddr?: string; + // 上次登录时间 + last_login_time?: datetime; + // 创建时间 + time_created?: datetime; + // 修改时间 + time_modified?: number; + // 状态:1正常,0禁用 + status?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 修改密码(旧) ``` js -const { data } = await op.api.user.modifyPassword(params) ; +const { data } = await op.api.user.modifyPassword(params); ``` PATCH /v1/users/{id}/passwords -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + old_password: string; + new_password: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + +- Examples + +```json +{ + "summary": "成功示例", + "value": true +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
old_passwordstringfalse
new_passwordstringfalse
- #### 查询用户存储凭证列表 ``` js -const { data } = await op.api.user.getStoredCredentials(params) ; +const { data } = await op.api.user.getStoredCredentials(params); ``` GET /v1/user-stored-credentials -##### param properties +``` ts + +{ + Content-Type: string; + user_id?: number; + provider_code?: string; + idp_config_id?: number; + id1?: string; + id2?: string; + metadata?: string; + status?: string; + username?: string; + display_name?: string; + page_size?: integer; + page_num?: integer; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + data: { + id?: integer; + username?: string; + password?: string; + display_name?: string; + firstname?: string; + lastname?: string; + realname?: string; + pinyin?: string; + nickname?: string; + // json对象 + avatar: { + } + user_type?: string; + mobile?: string; + email?: string; + gender?: string; + cert_type?: string; + cert_number?: string; + region?: string; + work_time?: null; + work_title?: string; + arn?: string; + idp_config_id?: integer; + developer_id?: integer; + tenant_id?: integer; + last_login_ipaddr?: string; + last_login_time?: null; + time_created?: null; + time_modified?: integer; + status?: string; + // json对象 + sys_ext_props: { + } + // json对象 + free_ext_props: { + } + }[]; + total_num: integer; + page_num: integer; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
user_idnumberfalse用户id标识
provider_codestringfalse社会化登录提供者的code
idp_config_idnumberfalse社会化登录配置的ID
id1stringfalse社会化身份标识1,约定此字段保存用户唯一标识,如openid
id2stringfalse社会化身份标识2,如unionid
metadatastringfalse更多社会化身份标识
statusstringfalse状态
usernamestringfalse用户名
display_namestringfalse显示名
page_sizeintegerfalse
page_numintegerfalse
- #### 创建用户存储凭证 ``` js -const { data } = await op.api.user.createStoreCredential(params) ; +const { data } = await op.api.user.createStoreCredential(params); ``` POST /v1/user-stored-credentials -##### param properties +``` ts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
provider_codestringfalse社会化身份源code
id1stringfalse社会化身份标识1,如openid
id2stringfalse社会化身份标识2,如unionid
metadatastringfalse更多社会化身份标识
statusstringfalse状态
nicknamestringfalse昵称
avatarstringfalse头像
id_provider_connectionstringfalse
idp_config_idnumberfalse社会化登录配置的ID
realnamestringfalse真实姓名
mobilestringfalse手机
emailstringfalse邮箱
genderstringfalse性别
- -### authentication -### app +{ + Content-Type: string; + // 社会化身份源code + provider_code: string; + // 社会化登录配置的ID + idp_config_id: number; + // 社会化身份标识1,如openid + id1: string; + // 社会化身份标识2,如unionid + id2?: string; + // 更多社会化身份标识 + metadata?: string; + // 状态 + status?: string; + // 昵称 + nickname?: string; + // 头像 + avatar?: string; + // 真实姓名 + realname?: string; + // 手机 + mobile?: string; + // 邮箱 + email?: string; + // 性别 + gender?: string; + id_provider_connection?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // http状态码,成功不显示 + code?: number; + // 返回错误码 + errno: number; + // 返回描述 + message: string; + // 返回id标识 + data?: string; +} +``` + + + +### authentication + +### app #### 创建应用 ``` js -const { data } = await op.api.app.create(params) ; +const { data } = await op.api.app.create(params); ``` POST /v1/applications -##### param properties +``` ts + +{ + Content-Type: string; + name: string; + // 1,自建应用,2模板应用(市场应用) + type: string; + // 域名 + domain_sn: string; + // 不填写则代表自建应用 + template_id?: string; + // 1 标准web应用,2单页web应用,3客户端应用,4后端服务 + category: string; + descr?: string; + // 格式为:http://ip:port/logo.png + logo?: string; + login_url?: string; + redirect_url?: string; + logout_url?: string; + // 1启用,0不启用,启用后单点登录返回 + sub_account_policy?: string; + // kv字典数据 + sys_ext_props: { + } + // kv字典数据 + free_ext_props: { + } + // 默认 oidc + protocol_type?: string; + // 默认 oidc 相关配置 + protocol_prop: { + acs_url?: string; + sp_entity?: string; + response_attr: { + value: string; + attribute: string; + nameFormat: string; + }[]; + digest_algorithm?: string; + lifetime_in_seconds?: number; + signature_algorithm?: string; + name_identifier_format?: string; + authn_context_class_ref?: string; + saml_response_signing_key?: string; + saml_response_signing_cert?: string; + saml_response_signing_cert_fingerprint?: string; + } + config_prop: { + status?: string; + tenant_id?: string; + mfa_config: { + } + reg_policy?: string;[]; + mfa_enabled?: string; + sso_enabled?: string; + developer_id?: string; + access_policy: { + forget_password?: string;[]; + } + allowed_reg_method: { + } + default_reg_method?: string; + allowed_login_method: { + name?: string; + } + default_login_method?: string; + allowed_social_login_provider: { + wechat_scan_qr?: number; + dingding_scan_qr?: number; + } + } +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 唯一标识 + id?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
namestringfalse
typestringfalse1,自建应用,2模板应用(市场应用)
template_idstringfalse不填写则代表自建应用
categorystringfalse1 标准web应用,2单页web应用,3客户端应用,4后端服务
descrstringfalse
logostringfalse格式为:http://ip:port/logo.png
login_urlstringfalse
redirect_urlstringfalse
logout_urlstringfalse
sub_account_policystringfalse1启用,0不启用,启用后单点登录返回
protocol_typestringfalse默认 oidc
protocol_propobjectfalse默认 oidc 相关配置
config_propobjectfalse
domain_snstringfalse域名
sys_ext_propsobjectfalsekv字典数据
free_ext_propsobjectfalsekv字典数据
- #### 更新应用基本信息 ``` js -const { data } = await op.api.app.modify(params) ; +const { data } = await op.api.app.modify(params); ``` PATCH /v1/applications/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + name?: string; + domain_sn?: string; + // 1自建应用,2市场应用 + type?: string; + app_id?: string; + app_secret?: string; + category?: string; + descr?: string; + logo?: null; + login_url?: string; + redirect_url?: string; + logout_url?: string; + sub_account_policy?: string; + sys_ext_props: { + } + free_ext_props: { + } + // 状态,0禁用,1启用 + status?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + message?: string; + data?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
namestringfalse
typestringfalse1自建应用,2市场应用
app_idstringfalse
app_secretstringfalse
categorystringfalse
descrstringfalse
logonullfalse
login_urlstringfalse
redirect_urlstringfalse
logout_urlstringfalse
sub_account_policystringfalse
statusstringfalse状态,0禁用,1启用
domain_snstringfalse
sys_ext_propsobjectfalse
free_ext_propsobjectfalse
- #### 查询应用模板列表 ``` js -const { data } = await op.api.app.getTemplate(params) ; +const { data } = await op.api.app.getTemplate(params); ``` GET /v1/application-templates -##### param properties +``` ts + +{ + name: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + current_page?: number; + data: { + // 唯一标识 + id?: string; + // 应用名称 + name?: string; + // 应用类型,1自建应用,2市场应用 + type?: string; + // 应用分类 + category?: string; + // 应用描述 + descr?: string; + // logo路径 + logo?: string; + // 登录路径 + login_url?: string; + // 重定向路径 + redirect_url?: string; + // 登出路径 + logout_url?: string; + // 子账号策略,1启用,2不启用 + sub_account_policy?: string; + // 扩展属性 + prop: { + } + // 单点登录协议属性 + protocol_prop: { + acs_url?: string; + sp_entity?: string; + response_attr: { + value: string; + attribute: string; + nameFormat: string; + }[]; + digest_algorithm?: string; + lifetime_in_seconds?: number; + signature_algorithm?: string; + name_identifier_format?: string; + authn_context_class_ref?: string; + saml_response_signing_key?: string; + saml_response_signing_cert?: string; + saml_response_signing_cert_fingerprint?: string; + } + // 应用配置属性 + config_prop: { + status?: string; + tenant_id?: string; + mfa_config: { + } + reg_policy?: number; + mfa_enabled?: string; + sso_enabled?: string; + developer_id?: string; + access_policy: { + forget_password?: string;[]; + } + allowed_reg_method: { + } + default_reg_method?: string; + allowed_login_method: { + name?: string; + } + default_login_method?: string; + allowed_id_provider: { + wechat_scan_qr?: number; + dingding_scan_qr?: number; + } + } + // 创建事件 + time_created?: string; + time_modified?: string; + status?: string; + }[]; + total_num?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
namestringtrue应用名称
- #### 查询应用列表 ``` js -const { data } = await op.api.app.list(params) ; +const { data } = await op.api.app.list(params); ``` GET /v1/applications -##### param properties +``` ts + +{ + name?: string; + type?: string; + page_sort?: string; + types?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + data: { + // 唯一标识 + id?: string; + // 开发者ID + developer_id: string; + // 租户ID + tenant_id: string; + // 应用名称 + name?: string; + // 应用类型,1自建应用,2市场应用 + type?: string; + // APPID + app_id?: string; + // 应用分类,1 标准web应用,2单页web应用,3客户端应用,4后端服务 + category?: string; + // APPSEC,开发者用户调用返回 + app_secret?: string; + // 应用描述 + descr?: string; + // logo路径 + logo?: string; + // 登录路径 + login_url?: string; + // 应用绑定的唯一域名 + domain?: string; + // 重定向url + redirect_url?: string; + // 登出url + logout_url?: string; + // 子账号策略 + sub_account_policy?: integer; + // 扩展属性 + prop: { + } + // 创建时间 + time_created?: string; + // 更新时间 + time_modified?: string; + // 状态,1启用,0禁用 + status?: string; + allowed_provider_id: { + config_id: string; + name: string; + provider_type: string; + }[]; + }[]; + total_num?: number; + current_page?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
namestringfalse应用名称
typestringfalse应用类型
page_sortstringfalse排序,格式:字段名[顺序]
typesstringfalse应用类型列表,逗号分隔
- #### 按条件查询应用 ``` js -const { data } = await op.api.app.getByDomain(params) ; +const { data } = await op.api.app.getByDomain(params); ``` GET /v1/application -##### param properties +``` ts + +{ + domain?: string; + domain_sn?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 唯一标识 + id?: string; + // 开发者ID + developer_id: string; + // 租户ID + tenant_id: string; + // 应用名称 + name?: string; + // 应用类型,1自建应用,2市场应用 + type?: string; + // APPID + app_id?: string; + // 应用分类,1 标准web应用,2单页web应用,3客户端应用,4后端服务 + category?: string; + // APPSEC,开发者用户调用返回 + app_secret?: string; + // 应用描述 + descr?: string; + // logo路径 + logo?: string; + // 登录路径 + login_url?: string; + // 应用绑定的唯一域名 + domain?: string; + // 应用域名 SN + domain_sn?: string; + // 重定向url + redirect_url?: string; + // 登出url + logout_url?: string; + // 子账号策略 + sub_account_policy?: integer; + // 扩展属性 + prop: { + } + // 创建时间 + time_created?: string; + // 更新时间 + time_modified?: string; + // 状态,1启用,0禁用 + status?: string; + config: { + id: string; + app_id: string; + // 格式为:["password", "vercode"] + allowed_login_method?: string; + // 格式为:password + default_login_method?: string; + // 格式为:["mobile", "email"] + allowed_reg_method?: string; + // 格式为:mobile + default_reg_method?: string; + // permitted,all + access_policy?: string; + reg_policy?: string; + // 格式为:{"wechat_scan_qr": 1, "dingding_scan_qr": 2} + allowed_id_provider: { + id: string; + idp_code: string; + idp_config_id: string; + auth_method_code: string; + auth_method_display_name: string; + } + sso_enabled: boolean; + mfa_enabled: boolean; + mfa_config: { + name: string; + provider_type: string; + config_id: string; + scenarios?: string;[]; + } + access_control_enabled: boolean; + time_created: string; + time_modified: string; + // 1启用,0禁用 + status: string; + } + protocols: { + }[]; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
domainstringfalse域名
domain_snstringfalse域名简写
- #### 按 ID 查询应用 ``` js -const { data } = await op.api.app.get(params) ; +const { data } = await op.api.app.get(params); ``` GET /v1/applications/{id} -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 唯一标识 + id?: string; + // 开发者ID + developer_id: string; + // 租户ID + tenant_id: string; + // 应用名称 + name?: string; + // 应用类型,1自建应用,2市场应用 + type?: string; + // APPID + app_id?: string; + // 应用分类,1 标准web应用,2单页web应用,3客户端应用,4后端服务 + category?: string; + // APPSEC,开发者用户调用返回 + app_secret?: string; + // 应用描述 + descr?: string; + // logo路径 + logo?: string; + // 登录路径 + login_url?: string; + // 应用绑定的唯一域名 + domain?: string; + // 应用域名 SN + domain_sn?: string; + // 重定向url + redirect_url?: string; + // 登出url + logout_url?: string; + // 子账号策略 + sub_account_policy?: integer; + // 扩展属性 + prop: { + } + // 创建时间 + time_created?: string; + // 更新时间 + time_modified?: string; + // 状态,1启用,0禁用 + status?: string; + config: { + id: string; + app_id: string; + // 格式为:["password", "vercode"] + allowed_login_method?: string; + // 格式为:password + default_login_method?: string; + // 格式为:["mobile", "email"] + allowed_reg_method?: string; + // 格式为:mobile + default_reg_method?: string; + // permitted,all + access_policy?: string; + reg_policy?: string; + // 格式为:{"wechat_scan_qr": 1, "dingding_scan_qr": 2} + allowed_id_provider: { + id: string; + idp_code: string; + idp_config_id: string; + auth_method_code: string; + auth_method_display_name: string; + } + sso_enabled: boolean; + mfa_enabled: boolean; + mfa_config: { + name: string; + provider_type: string; + config_id: string; + scenarios?: string;[]; + } + access_control_enabled: boolean; + time_created: string; + time_modified: string; + // 1启用,0禁用 + status: string; + } + protocols: { + }[]; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue唯一标识
- #### 启用应用 ``` js -const { data } = await op.api.app.enable(params) ; +const { data } = await op.api.app.enable(params); ``` POST /v1/applications/{id}/enable -##### param properties +``` ts + +{ + Content-Type: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + message: string; + // 操作ID + data: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue应用标识
- #### 禁用应用 ``` js -const { data } = await op.api.app.disable(params) ; +const { data } = await op.api.app.disable(params); ``` POST /v1/applications/{id}/disable -##### param properties +``` ts + +{ + Content-Type: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + message?: string; + // 操作ID + data?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue应用标识
- #### 删除应用 ``` js -const { data } = await op.api.app.delete(params) ; +const { data } = await op.api.app.delete(params); ``` DELETE /v1/applications/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + message?: string; + // 结果标识true/false + data: { + } +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 刷新应用安全码 ``` js -const { data } = await op.api.app.createSecrets(params) ; +const { data } = await op.api.app.createSecrets(params); ``` POST /v1/applications/{id}/secrets -##### param properties +``` ts + +{ + Content-Type: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 操作结果 + message?: string; + data: { + // 安全码 + appSecret?: string; + // 唯一标识 + id?: string; + } +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 查询应用配置信息 ``` js -const { data } = await op.api.app.getConfig(params) ; +const { data } = await op.api.app.getConfig(params); ``` GET /v1/applications/{id}/configs -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 唯一标识 + id: string; + // 应用ID + app_id: string; + // 允许的登录方式,格式为:["password", "vercode"] + allowed_login_method?: string; + // 默认登录方式,格式为:password + default_login_method: string; + // 允许注册方式,格式为:["mobile", "email"] + allowed_reg_method?: string; + // 默认注册方式,格式为:mobile + default_reg_method: string; + // 应用级访问控制权限,格式为:{"password_recovery": ["email"]} + access_policy?: string; + // 新用户注册策略(是否允许自动注册,注册验证方式等),1是,2否, + reg_policy?: string; + // 允许的登录身份提供商,格式为:{"wechat_scan_qr": 1, "dingding_scan_qr": 2} + allowed_id_provider?: string; + // 是否允许SSO + sso_enabled: boolean; + // 是否开启MFA + mfa_enabled?: boolean; + // 开启的MFA配置 + mfa_config: { + name: string; + provider_type: string; + config_id: string; + } + // 创建时间 + time_created?: string; + // 修改时间 + time_modified?: string; + // 状态,1启用,0禁用 + status?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue应用ID
- #### 更新应用配置 ``` js -const { data } = await op.api.app.modifyConfig(params) ; +const { data } = await op.api.app.modifyConfig(params); ``` PATCH /v1/applications/{id}/configs -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + // 允许的登录方式,格式为:["password", "vercode"] + allowed_login_method?: string; + // 默认登录方式,格式为:password + default_login_method?: string; + // 允许注册方式,格式为:["mobile", "email"] + allowed_reg_method?: string; + // 默认注册方式,格式为:mobile + default_reg_method?: string; + // 默认登录协议 + default_protocol?: string; + // 应用级访问控制权限,all: 所有人可访问 permitted: 拒绝未授权访问 + access_policy?: string; + reg_policy?: string;[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + message?: string; + data?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
allowed_login_methodstringfalse允许的登录方式,格式为:["password", "vercode"]
default_login_methodstringfalse默认登录方式,格式为:password
allowed_reg_methodstringfalse允许注册方式,格式为:["mobile", "email"]
default_reg_methodstringfalse默认注册方式,格式为:mobile
default_protocolstringfalse默认登录协议
access_policystringfalse应用级访问控制权限,all: 所有人可访问 permitted: 拒绝未授权访问
reg_policyarrayfalse新用户注册策略(是否允许自动注册,注册验证方式等),1是,2否,
- #### 禁用应用单点登录 ``` js -const { data } = await op.api.app.disableSSO(params) ; +const { data } = await op.api.app.disableSSO(params); ``` POST /v1/applications/{id}/sso/disable -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue应用标识
- #### 启用应用单点登录 ``` js -const { data } = await op.api.app.enableSSO(params) ; +const { data } = await op.api.app.enableSSO(params); ``` POST /v1/applications/{id}/sso/enable -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue应用标识
- #### 创建应用多因素认证配置 ``` js -const { data } = await op.api.app.createMFA(params) ; +const { data } = await op.api.app.createMFA(params); ``` POST /v1/applications/{id}/mfa -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + // 已配置的idp conn id + config_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idtrue应用id
config_idstringtrue已配置的idp conn id
- #### 删除应用多因素认证配置 ``` js -const { data } = await op.api.app.deleteMFA(params) ; +const { data } = await op.api.app.deleteMFA(params); ``` DELETE /v1/applications/{app_id}/mfa/{config_id} -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + config_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idstringtrue应用id
config_idtrue
- #### 创建应用认证源 ``` js -const { data } = await op.api.app.createIDP(params) ; +const { data } = await op.api.app.createIDP(params); ``` POST /v1/applications/{id}/idp -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + // 已配置的idp conn id + config_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idtrue应用id
config_idstringtrue已配置的idp conn id
- #### 删除应用认证源 ``` js -const { data } = await op.api.app.deleteIDPConfig(params) ; +const { data } = await op.api.app.deleteIDPConfig(params); ``` DELETE /v1/applications/{app_id}/idp/{config_id} -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + config_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idstringtrue应用id
config_idtrue
- #### 启用应用认证协议 ``` js -const { data } = await op.api.app.enableProtocol(params) ; +const { data } = await op.api.app.enableProtocol(params); ``` POST /v1/applications/{app_id}/protocols/{protocol_type}/enable -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + protocol_type: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + message?: string; + data?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idtrue应用 id
protocol_typetrue协议名称,如 oidc
- #### 禁用应用认证协议 ``` js -const { data } = await op.api.app.disableProtocol(params) ; +const { data } = await op.api.app.disableProtocol(params); ``` POST /v1/applications/{app_id}/protocols/{protocol_type}/disable -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + protocol_type: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idtrue应用 id
protocol_typetrue协议名称,如 oidc
- #### 查询应用认证协议列表 ``` js -const { data } = await op.api.app.getProtocols(params) ; +const { data } = await op.api.app.getProtocols(params); ``` GET /v1/applications/{id}/protocols -##### param properties +``` ts + +{ + id: string; + status?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue应用唯一标识ID
statusstringfalse启用状态 1, 0
- #### 查询应用认证协议 ``` js -const { data } = await op.api.app.getProtocol(params) ; +const { data } = await op.api.app.getProtocol(params); ``` GET /v1/applications/{app_id}/protocols/{protocol_type} -##### param properties +``` ts + +{ + app_id: string; + protocol_type: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idtrue应用id
protocol_typetrue单点类型,cas、oauth2、saml、oidc、sxp
- #### 更新应用认证协议 ``` js -const { data } = await op.api.app.modifyProtocol(params) ; +const { data } = await op.api.app.modifyProtocol(params); ``` PUT /v1/applications/{app_id}/protocols/{protocol_type} -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + protocol_type: string; + // 配置参数 + config_content: { + } +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idtrue应用id
protocol_typetrue单点类型,cas、oauth2、saml、oidc、sxp
config_contentobjectfalse配置参数
- #### 创建应用子账号 ``` js -const { data } = await op.api.app.createAccount(params) ; +const { data } = await op.api.app.createAccount(params); ``` POST /v1/applications/{id}/accounts -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + user_id: string; + username: string; + app_id: string; + acc_name: string; + acc_name_displayed?: string; + acc_source?: string; + acc_password: string; + // 1启用,0禁用 + acc_status: string; + sys_ext_props: { + } + free_ext_props: { + } +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + message?: string; + data?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idtrue应用id
user_idstringfalse
app_idstringfalse
acc_namestringfalse
acc_name_displayedstringfalse
acc_sourcestringfalse
acc_passwordstringfalse
acc_statusstringfalse1启用,0禁用
sys_ext_propsobjectfalse
free_ext_propsobjectfalse
usernamestringfalse
- #### 更新应用子账号 ``` js -const { data } = await op.api.app.modifyAccount(params) ; +const { data } = await op.api.app.modifyAccount(params); ``` PUT /v1/applications/{app_id}/accounts/{id} -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + id: string; + user_id?: string; + app_id?: string; + acc_name?: string; + acc_name_displayed?: string; + acc_source?: string; + acc_password?: string; + // 1启用,0禁用 + acc_status?: string; + sys_ext_props: { + } + free_ext_props: { + } +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + message?: string; + data?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idstringtrue应用id
idtrue子账号id
user_idstringfalse
app_idstringfalse
acc_namestringfalse
acc_name_displayedstringfalse
acc_sourcestringfalse
acc_passwordstringfalse
acc_statusstringfalse1启用,0禁用
sys_ext_propsobjectfalse
free_ext_propsobjectfalse
- #### 启用应用子账号 ``` js -const { data } = await op.api.app.enableAccount(params) ; +const { data } = await op.api.app.enableAccount(params); ``` POST /v1/applications/{app_id}/accounts/{id}/enable -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + id: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idtrue应用id
idstringtrue子账号id
idstringtrue
- #### 禁用应用子账号 ``` js -const { data } = await op.api.app.disableAccount(params) ; +const { data } = await op.api.app.disableAccount(params); ``` POST /v1/applications/{app_id}/accounts/{id}/disable -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idtrue应用id
idstringtrue子账号id
- #### 删除应用子账号 ``` js -const { data } = await op.api.app.deleteAccount(params) ; +const { data } = await op.api.app.deleteAccount(params); ``` DELETE /v1/applications/{app_id}/accounts/{id} -##### param properties +``` ts + +{ + Content-Type: string; + app_id: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idtrue应用id
idstringtrue子账号id
- #### 按 APP ID 查询应用子账号列表 ``` js -const { data } = await op.api.app.getAccountsByApp(params) ; +const { data } = await op.api.app.getAccountsByApp(params); ``` GET /v1/applications/{app_id}/accounts -##### param properties +``` ts + +{ + app_id: string; + user_id?: string; + acc_status?: string; + acc_name?: string; + page_num?: integer; + page_size?: integer; + page_sort?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + records: { + id: string; + user_id: string; + username: string; + app_id: string; + app_name: string; + acc_name: string; + acc_name_displayed: string; + acc_source: string; + developer_id: string; + tenant_id: string; + acc_password: string; + acc_status: string; + acc_sync_status: string; + acc_prop: { + } + time_created: string; + time_modified: string; + }[]; + total?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idstringtrue应用id
user_idstringfalse用户id
acc_statusstringfalse账号状态 1-活跃 0-冻结
acc_namestringfalse账号名称
page_numintegerfalse页数
page_sizeintegerfalse页大小
page_sortstringfalse排序字段
- #### 查询应用子账号列表 ``` js -const { data } = await op.api.app.getAccounts(params) ; +const { data } = await op.api.app.getAccounts(params); ``` GET /v1/application-accounts -##### param properties +``` ts + +{ + app_id?: string; + user_id?: string; + acc_status?: string; + acc_name?: string; + page_num?: integer; + page_size?: integer; + page_sort?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + records: { + id: string; + user_id: string; + username: string; + app_id: string; + app_name: string; + acc_name: string; + acc_name_displayed: string; + acc_source: string; + developer_id: string; + tenant_id: string; + acc_password: string; + acc_status: string; + acc_sync_status: string; + acc_prop: { + } + time_created: string; + time_modified: string; + }[]; + total?: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idstringfalse应用id
user_idstringfalse用户id
acc_statusstringfalse账号状态 1-活跃 0-冻结
acc_namestringfalse账号名称
page_numintegerfalse页数
page_sizeintegerfalse页大小
page_sortstringfalse排序字段
- #### 按 ID 查询应用子账号 ``` js -const { data } = await op.api.app.getAccount(params) ; +const { data } = await op.api.app.getAccount(params); ``` GET /v1/applications/{app_id}/accounts/{id} -##### param properties +``` ts - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
app_idstringtrue应用id
idstringtrue子账号id
- -### permission +{ + app_id: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; + user_id: string; + username: string; + app_id: string; + app_name: string; + acc_name: string; + acc_name_displayed: string; + acc_source: string; + developer_id: string; + tenant_id: string; + acc_password: string; + acc_status: string; + acc_sync_status: string; + acc_prop: { + } + time_created: string; + time_modified: string; +} +``` + + + +### permission #### 获取权限列表 ``` js -const { data } = await op.api.permission.getPrivileges(params) ; +const { data } = await op.api.permission.getPrivileges(params); ``` GET /v1/privileges -##### param properties +``` ts + +{ + identity_id?: string; + identity_type?: string; + identity_name?: string; + application_id: string; + object_type?: string; + object_code?: string; + affect?: string; + page_num?: string; + page_size?: string; + page_sort?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 数据总数 + total_num?: number; + // 当前页数(废弃) + current_page?: number; + data: { + id: number; + identity_type: string; + identity_id: string; + auth_unit_rule_id: string; + application_id: string; + object_type: string; + object_code: string; + affect_scope: string; + affect: string; + time_created: string; + time_modified: string; + }[]; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
identity_idstringfalse主体id
identity_typestringfalse主体类型
identity_namestringfalse主体名称
application_idstringtrue应用id
object_typestringfalse对象类型(可选值: data, api, ui, res_set, app)
object_codestringfalse对象代码
affectstringfalse作用方式(affect,deny)
page_numstringfalse起始页,默认1
page_sizestringfalse页大小,默认20
page_sortstringfalse排序方式,格式:字段[排序方式]
- #### 获取授权单元列表 ``` js -const { data } = await op.api.permission.getAuthUnits(params) ; +const { data } = await op.api.permission.getAuthUnits(params); ``` GET /v1/auth-units -##### param properties +``` ts + +{ + identity_id?: string; + identity_type?: string; + identity_name?: string; + page_num?: string; + page_size?: string; + page_sort?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 总数量 + total_num?: number; + data: { + id: string; + identity_id: string; + identity_name: string; + // user 用户 ,programmer 编程者,node 组织/自定义关系 + identity_type: string; + rules: { + id: string; + auth_unit_id: string; + resource: { + id: string; + developer_id: string; + tenant_id: string; + application_id: string; + applicatioin_name: string; + is_global: boolean; + description: string; + type: string; + code: string; + uri?: string; + time_modified: string; + time_created: string; + scope: string; + selected_actions?: string;[]; + match_all_actions?: boolean; + match_all_resources?: boolean; + } + resource_set: { + id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + code?: string; + description?: string; + time_modified?: string; + time_created?: string; + members: { + id?: string; + set_id?: string; + developer_id?: string; + tenant_id?: string; + resource_id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + resource_type?: string; + resource_code?: string; + resource_scope?: string; + resource_actions: { + code: string; + description?: string; + } + selected_resource_actions?: string;[]; + match_all_resource_actions: boolean; + time_modified?: string; + time_created?: string; + }[]; + match_all_resources?: boolean; + } + // allow/deny + affect: string; + // 当resource存在时 + resource_type?: string; + // 当 resource 存在时表示 resource_code + // + // 当 resource_set存在时表示 resource_set_code + code: string; + description?: string; + application_name: string; + identity_id: string; + identity_type: string; + identity_name: string; + inherited: boolean; + }[]; + time_created: string; + time_modified: string; + }[]; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
identity_idstringfalse主体id
identity_typestringfalse主体类型
identity_namestringfalse主体名称
page_numstringfalse起始页,默认1
page_sizestringfalse页大小,默认20
page_sortstringfalse排序方式,格式:字段[排序方式]
- #### 按 ID 查询授权单元 ``` js -const { data } = await op.api.permission.getAuthUnit(params) ; +const { data } = await op.api.permission.getAuthUnit(params); ``` GET /v1/auth-units/{id} -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; + identity_id: string; + identity_name: string; + // user 用户 ,programmer 编程者,node 组织/自定义关系 + identity_type: string; + rules: { + id: string; + auth_unit_id: string; + resource: { + id: string; + developer_id: string; + tenant_id: string; + application_id: string; + applicatioin_name: string; + is_global: boolean; + description: string; + type: string; + code: string; + uri?: string; + time_modified: string; + time_created: string; + scope: string; + selected_actions?: string;[]; + match_all_actions?: boolean; + match_all_resources?: boolean; + } + resource_set: { + id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + code?: string; + description?: string; + time_modified?: string; + time_created?: string; + members: { + id?: string; + set_id?: string; + developer_id?: string; + tenant_id?: string; + resource_id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + resource_type?: string; + resource_code?: string; + resource_scope?: string; + resource_actions: { + code: string; + description?: string; + } + selected_resource_actions?: string;[]; + match_all_resource_actions: boolean; + time_modified?: string; + time_created?: string; + }[]; + match_all_resources?: boolean; + } + // allow/deny + affect: string; + // 当resource存在时 + resource_type?: string; + // 当 resource 存在时表示 resource_code + // + // 当 resource_set存在时表示 resource_set_code + code: string; + description?: string; + application_name: string; + identity_id: string; + identity_type: string; + identity_name: string; + inherited: boolean; + }[]; + time_created: string; + time_modified: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrueau id
- #### 批量创建授权规则 ``` js -const { data } = await op.api.permission.createAuthUnitRules(params) ; +const { data } = await op.api.permission.createAuthUnitRules(params); ``` POST /v1/batch/auth-unit-rules -##### param properties +``` ts + +{ + Content-Type: string; + identities: { + identity_id: string; + identity_name: string; + // user 用户 ,programmer 编程者,node 组织/自定义关系 + identity_type: string; + }[]; + rules: { + resource: { + id: string; + scope: string; + actions?: string;[]; + match_all_actions?: boolean; + match_all_resources?: boolean; + // 当match_all_resources=true时必填 + application_id?: string; + // 当match_all_resources=true时必填 + application_name?: string; + } + resource_set: { + id: string; + } + application: { + id: string; + } + // allow/deny + affect: string; + // 用于标识应用(尤其是在使用全局资源的场景下) + owner_app_id: string; + }[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
identitiesarrayfalse
rulesarrayfalse
- #### 更新授权规则 ``` js -const { data } = await op.api.permission.modifyAuthUnit(params) ; +const { data } = await op.api.permission.modifyAuthUnit(params); ``` PUT /v1/auth-units/{rid}/rules/{tid} -##### param properties +``` ts + +{ + Content-Type: string; + rid: string; + tid: string; + resource: { + id: string; + scope: string; + actions?: string;[]; + match_all_actions?: boolean; + match_all_resources?: boolean; + // 当match_all_resources=true时必填 + application_id?: string; + // 当match_all_resources=true时必填 + application_name?: string; + } + resource_set: { + id: string; + } + application: { + id: string; + } + // allow/deny + affect: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
ridstringtrueAU id
tidstringtrue规则id
- #### 查询授权单元下的授权规则列表 ``` js -const { data } = await op.api.permission.getAuthUnitsRules(params) ; +const { data } = await op.api.permission.getAuthUnitsRules(params); ``` GET /v1/auth-units/{rid}/rules -##### param properties +``` ts + +{ + rid: string; + application_id?: string; + type?: string; + code?: string; + self_only?: string; + resource_id?: string; + resource_match_all_resources?: string; + resource_match_all_actions?: string; + resource_set_id?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; + auth_unit_id: string; + resource: { + id: string; + developer_id: string; + tenant_id: string; + application_id: string; + applicatioin_name: string; + is_global: boolean; + description: string; + type: string; + code: string; + uri?: string; + time_modified: string; + time_created: string; + scope: string; + selected_actions?: string;[]; + match_all_actions?: boolean; + match_all_resources?: boolean; + } + resource_set: { + id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + code?: string; + description?: string; + time_modified?: string; + time_created?: string; + members: { + id?: string; + set_id?: string; + developer_id?: string; + tenant_id?: string; + resource_id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + resource_type?: string; + resource_code?: string; + resource_scope?: string; + resource_actions: { + code: string; + description?: string; + } + selected_resource_actions?: string;[]; + match_all_resource_actions: boolean; + time_modified?: string; + time_created?: string; + }[]; + match_all_resources?: boolean; + } + // allow/deny + affect: string; + // 当resource存在时 + resource_type?: string; + // 当 resource 存在时表示 resource_code + // + // 当 resource_set存在时表示 resource_set_code + code: string; + description?: string; + application_name: string; + identity_id: string; + identity_type: string; + identity_name: string; + inherited: boolean; +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
ridstringtrueAU id
application_idstringfalse应用id
typestringfalse规则类型
codestringfalse资源或资源集合code
self_onlystringfalse只查询指定主体下的授权
resource_idstringfalse资源id,当type=api,ui,data时有效
resource_match_all_resourcesstringfalse匹配所有资源,当type=res时有效
resource_match_all_actionsstringfalse匹配所有资源操作,当type=res时有效
resource_set_idstringfalse资源集合id,当type=res_set
- #### 查询授权规则列表 ``` js -const { data } = await op.api.permission.queryAuthUnitsRules(params) ; +const { data } = await op.api.permission.queryAuthUnitsRules(params); ``` GET /v1/auth-unit-rules -##### param properties +``` ts + +{ + application_id?: string; + type?: string; + code?: string; + identity_id: string; + identity_type: string; + identity_name?: string; + self_only?: string; + resource_id?: string; + resource_match_all_resources?: string; + resource_match_all_actions?: string; + resource_set_id?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; + auth_unit_id: string; + resource: { + id: string; + developer_id: string; + tenant_id: string; + application_id: string; + applicatioin_name: string; + is_global: boolean; + description: string; + type: string; + code: string; + uri?: string; + time_modified: string; + time_created: string; + scope: string; + selected_actions?: string;[]; + match_all_actions?: boolean; + match_all_resources?: boolean; + } + resource_set: { + id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + code?: string; + description?: string; + time_modified?: string; + time_created?: string; + members: { + id?: string; + set_id?: string; + developer_id?: string; + tenant_id?: string; + resource_id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + resource_type?: string; + resource_code?: string; + resource_scope?: string; + resource_actions: { + code: string; + description?: string; + } + selected_resource_actions?: string;[]; + match_all_resource_actions: boolean; + time_modified?: string; + time_created?: string; + }[]; + match_all_resources?: boolean; + } + // allow/deny + affect: string; + // 当resource存在时 + resource_type?: string; + // 当 resource 存在时表示 resource_code + // + // 当 resource_set存在时表示 resource_set_code + code: string; + description?: string; + application_name: string; + identity_id: string; + identity_type: string; + identity_name: string; + inherited: boolean; +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
application_idstringfalse应用id
typestringfalse规则类型
codestringfalse资源或资源集合code
identity_idstringtrue主体id
identity_typestringtrue主体类型
identity_namestringfalse主体名称
self_onlystringfalse只查询指定主体下的授权
resource_idstringfalse资源id,当type=api,ui,data时有效
resource_match_all_resourcesstringfalse匹配所有资源,当type=res时有效
resource_match_all_actionsstringfalse匹配所有资源操作,当type=res时有效
resource_set_idstringfalse资源集合id,当type=res_set
- #### 批量删除授权规则 ``` js -const { data } = await op.api.permission.deleteAuthUnitRules(params) ; +const { data } = await op.api.permission.deleteAuthUnitRules(params); ``` DELETE /v1/batch/auth-unit-rules -##### param properties +``` ts + +{ + Content-Type: string; + ids?: string;[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idsarraytrue
- #### 创建资源 ``` js -const { data } = await op.api.permission.createResource(params) ; +const { data } = await op.api.permission.createResource(params); ``` POST /v1/resources -##### param properties +``` ts + +{ + Content-Type: string; + // 描述 + description?: string; + // 资源代码 + code: string; + // 应用id + application_id: number; + // 资源类型,data/api/ui + type: string; + // 资源URI, 当type=api/ui 时有效 + uri?: string; + actions: { + code: string; + description?: string; + }[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 资源id + resource_id: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
descriptionstringfalse描述
codestringfalse资源代码
application_idnumberfalse应用id
typestringfalse资源类型,data/api/ui
uristringfalse资源URI, 当type=api/ui 时有效
actionsarrayfalse
- #### 更新资源 ``` js -const { data } = await op.api.permission.modifyResource(params) ; +const { data } = await op.api.permission.modifyResource(params); ``` PUT /v1/resources/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + // 描述 + description?: string; + // 资源URI, 当type=api/ui 时有效 + uri?: string; + actions: { + // 如果不携带id,会认为是新创建的code + id?: string; + code: string; + description?: string; + }[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue资源id
descriptionstringfalse描述
uristringfalse资源URI, 当type=api/ui 时有效
actionsarrayfalse
- #### 查询资源列表 ``` js -const { data } = await op.api.permission.getResources(params) ; +const { data } = await op.api.permission.getResources(params); ``` GET /v1/resources -##### param properties +``` ts + +{ + application_id: string; + type?: string; + code?: string; + include_global?: string; + page_num?: string; + page_size?: string; + page_sort?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 数据总数 + total_num?: number; + data: { + // 资源id + id?: string; + // 开发者id + developer_id?: string; + // 租户id + tenant_id?: string; + // 应用id + application_id?: string; + // 描述 + description?: string; + // 类型 + type?: string; + // 代码 + code?: string; + // 修改时间 rfc3339 + time_modified?: string; + // 创建时间 rfc3339 + time_created?: string; + }[]; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
application_idstringtrue应用id
typestringfalse资源类型
codestringfalse资源代码
include_globalstringfalse是否查询包含全局资源
page_numstringfalse起始页,默认1
page_sizestringfalse页大小,默认20
page_sortstringfalse排序方式,格式:字段[排序方式]
- #### 按 ID 查询资源 ``` js -const { data } = await op.api.permission.getResource(params) ; +const { data } = await op.api.permission.getResource(params); ``` GET /v1/resources/{id} -##### param properties +``` ts + +{ + id: string; + application_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 资源id + id?: string; + // 开发者id + developer_id?: string; + // 租户id + tenant_id?: string; + // 应用id + application_id?: string; + // 描述 + description?: string; + // 类型 + type?: string; + // 代码 + code?: string; + // 修改时间 rfc3339 + time_modified?: string; + // 创建时间 rfc3339 + time_created?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue资源id
application_idstringtrue应用id
- #### 删除资源 ``` js -const { data } = await op.api.permission.deleteResources(params) ; +const { data } = await op.api.permission.deleteResources(params); ``` DELETE /v1/batch/resources -##### param properties +``` ts + +{ + Content-Type: string; + ids?: string;[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idsarraytrue
- #### 创建资源集合 ``` js -const { data } = await op.api.permission.createResourceSet(params) ; +const { data } = await op.api.permission.createResourceSet(params); ``` POST /v1/resource-sets -##### param properties +``` ts + +{ + Content-Type: string; + X-Tenant-id: string; + // 应用id + application_id: string; + // 集合代码 + code: string; + // 描述 + description?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: number; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
X-Tenant-idstringtrue租户id
codestringfalse集合代码
descriptionstringfalse描述
application_idstringfalse应用id
- #### 更新资源集合 ``` js -const { data } = await op.api.permission.modifyResourceSet(params) ; +const { data } = await op.api.permission.modifyResourceSet(params); ``` PUT /v1/resource-sets/{id} -##### param properties +``` ts + +{ + Content-Type: string; + X-Tenant-Id: string; + id: string; + // 集合代码 + code: string; + // 描述 + description: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
X-Tenant-Idstringtrue租户id
idstringtrue集合id
codestringfalse集合代码
descriptionstringfalse描述
- #### 查询资源集合列表 ``` js -const { data } = await op.api.permission.getResourceSets(params) ; +const { data } = await op.api.permission.getResourceSets(params); ``` GET /v1/resource-sets -##### param properties +``` ts + +{ + code?: string; + application_id: string; + include_global?: string; + page_num?: string; + page_size?: string; + page_sort?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 数据总数 + total_num?: number; + data: { + id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + code?: string; + description?: string; + time_modified?: string; + time_created?: string; + }[]; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
codestringfalse集合代码
application_idstringtrue应用id
include_globalstringfalse查询是否包含全局资源集合
page_numstringfalse起始页,默认1
page_sizestringfalse页大小,默认20
page_sortstringfalse排序方式,格式:字段[排序方式]
- #### 按 ID 查询资源集合 ``` js -const { data } = await op.api.permission.getResourceSet(params) ; +const { data } = await op.api.permission.getResourceSet(params); ``` GET /v1/resource-sets/{id} -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + code?: string; + description?: string; + time_modified?: string; + time_created?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue资源集合id
- #### 创建资源集合成员 ``` js -const { data } = await op.api.permission.createResourceSetMember(params) ; +const { data } = await op.api.permission.createResourceSetMember(params); ``` POST /v1/resource-sets/{id}/members -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + resource_id: number; + resource_scope: string; + resource_actions?: string;[]; + match_all_actions: boolean; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 成员id + member_id: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue集合id
resource_idnumberfalse
resource_scopestringfalse
resource_actionsarrayfalse
match_all_actionsbooleanfalse
- #### 更新资源集合成员 ``` js -const { data } = await op.api.permission.modifyResourceSetMember(params) ; +const { data } = await op.api.permission.modifyResourceSetMember(params); ``` PUT /v1/resource-sets/{sid}/members/{mid} -##### param properties +``` ts + +{ + Content-Type: string; + sid: string; + mid: string; + resource_id: number; + resource_scope: string; + ResourceActions: { + // 操作id + id: number; + // 操作代码 + code: string; + }[]; + match_all_actions: boolean; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
sidstringtrue资源集合id
midstringtrue资源集合成员id
resource_idnumberfalse
resource_scopestringfalse
ResourceActionsarrayfalse
match_all_actionsbooleanfalse
- #### 查询资源集合成员列表 ``` js -const { data } = await op.api.permission.getResourceMembers(params) ; +const { data } = await op.api.permission.getResourceMembers(params); ``` GET /v1/resource-sets/{sid}/members -##### param properties +``` ts + +{ + sid: string; + resource_code?: string; + resource_type?: string; + page_num?: string; + page_size?: string; + page_sort?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 数据总数 + total_num?: number; + data: { + id?: string; + set_id?: string; + developer_id?: string; + tenant_id?: string; + resource_id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + resource_type?: string; + resource_code?: string; + resource_scope?: string; + resource_actions: { + code: string; + description?: string; + } + selected_resource_actions?: string;[]; + match_all_resource_actions: boolean; + time_modified?: string; + time_created?: string; + }[]; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
sidstringtrue资源集合id
resource_codestringfalse资源代码
resource_typestringfalse资源类型
page_numstringfalse起始页,默认1
page_sizestringfalse页大小,默认20
page_sortstringfalse排序方式,格式:字段[排序方式]
- #### 按 ID 查询资源集合成员 ``` js -const { data } = await op.api.permission.getResourceMember(params) ; +const { data } = await op.api.permission.getResourceMember(params); ``` GET /v1/resource-sets/{sid}/members/{mid} -##### param properties +``` ts + +{ + sid: string; + mid: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id?: string; + set_id?: string; + developer_id?: string; + tenant_id?: string; + resource_id?: string; + application_id?: string; + application_name?: string; + is_global?: boolean; + resource_type?: string; + resource_code?: string; + resource_scope?: string; + resource_actions: { + code: string; + description?: string; + } + selected_resource_actions?: string;[]; + match_all_resource_actions: boolean; + time_modified?: string; + time_created?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
sidstringtrue资源集合id
midstringtrue成员id
- #### 授权应用 ``` js -const { data } = await op.api.permission.authorizeApplications(params) ; +const { data } = await op.api.permission.authorizeApplications(params); ``` POST /v1/batch/authz-apps -##### param properties +``` ts + +{ + X-Tenant-Id: string; + identities: { + identity_id: string; + identity_name: string; + // user 用户 ,programmer 编程者,node 组织/自定义关系 + identity_type: string; + }[]; + application_id: string; + // allow, deny + affect: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
X-Tenant-Idstringtrue租户id
identitiesarrayfalse
application_idstringfalse
affectstringfalseallow, deny
- #### 查询已授权应用列表 ``` js -const { data } = await op.api.permission.listAuthorizedApplications(params) ; +const { data } = await op.api.permission.listAuthorizedApplications(params); ``` GET /v1/authz-apps -##### param properties +``` ts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
X-Tenant-Idstringtrue租户id
identity_idstringtrue授权主体 id
identity_typestringtrue授权主体类型
typestringfalse应用类型: 0-默认应用 1-自建应用 2-模板应用 3-组件应用
- -### organization +{ + X-Tenant-Id: string; + identity_id: string; + identity_type: string; + type?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; + developer_id: string; + tenant_id: string; + name: string; + // - 0 默认应用 + // - 1 自建应用 + // - 2 模板应用 + // - 3 组件应用 + type: string; + access_policy: string; + decr?: string; + // base64编码 + logo: string; + access_url: string; + enabled_protocols?: string;[]; + // rfc3339 + time_modified: string; + // rfc3339 + time_created: string; +}[]; +``` + + + +### organization #### 创建组织关系 ``` js -const { data } = await op.api.organization.createOrganization(params) ; +const { data } = await op.api.organization.createOrganization(params); ``` POST /v1/core-objects -##### param properties +``` ts + +{ + Content-Type: string; + object_display_name: string; + // 固定值:tree + object_type: string; + // 唯一,不可改,外键关联引用 + object_code: string; + object_props: string; + // 是否默认组织关系,1是,0否 + is_default: string; + status: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 创建ID + id?: string; +} +``` + - - - - - - - - - - - - - - - -
名称类型是否必须描述
- #### 查询父节点 ``` js -const { data } = await op.api.organization.getNodeParent(params) ; +const { data } = await op.api.organization.getNodeParent(params); ``` GET /v1/tree-nodes/{id}/parent -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 节点ID + id?: string; + // 开发者ID + developer_id?: string; + // 租户ID + tenant_id?: string; + arn?: string; + // 创建时间 + time_created?: string; + // 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组) + tag?: string; + // 状态 + status?: string; + // 是否指针类型 + is_pointer?: string; + // 节点code + code: string; + // 节点名字 + name: string; + // 抽象权限容器的ARN + perm_namespace_arn?: string; + condition?: string; + // 是否动态节点(0普通结点,1动态结点) + is_dynamic?: string; + // 系统code + sys_code: string; + // 操作者id + operator_id?: string; + // 指针指向的实体节点 + pointer_id?: string; + // 序号 + seq?: integer; + // 描述 + description?: string; + // 最后修改时间 + time_modified?: string; + // OBJ_ID,组织,角色,岗位,职级等 + object_code: string; + // 父节点id + parent_id?: string; + // 额外属性 + ext_props: { + } +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 删除节点 ``` js -const { data } = await op.api.organization.deleteNode(params) ; +const { data } = await op.api.organization.deleteNode(params); ``` DELETE /v1/tree-nodes/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + object_code: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
object_codestringtrue树对象code
- #### 获取组织关系列表 ``` js -const { data } = await op.api.organization.getOrganizations(params) ; +const { data } = await op.api.organization.getOrganizations(params); ``` GET /v1/core-objects -##### param properties +``` ts + +{ +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; + object_display_name: string; + // 固定值:tree + object_type: string; + // 唯一,不可改,外键关联引用 + object_code: string; + object_props: string; + // 是否默认组织关系,1是,0否 + is_default: string; + status: string; + time_created: string; + time_modified: string; +}[]; +``` + - - - - - - - - - - - - - - - -
名称类型是否必须描述
- #### 修改组织关系基本信息 ``` js -const { data } = await op.api.organization.updateOrganization(params) ; +const { data } = await op.api.organization.updateOrganization(params); ``` PATCH /v1/core-objects/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + object_display_name: string; + // 固定值:tree + object_type: string; + // 唯一,不可改,外键关联引用 + object_code: string; + object_props: string; + // 是否默认组织关系,1是,0否 + is_default: string; + status: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 获取组织关系基本信息 ``` js -const { data } = await op.api.organization.getOrganization(params) ; +const { data } = await op.api.organization.getOrganization(params); ``` GET /v1/core-objects/{id} -##### param properties +``` ts + +{ + id: string; + code: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; + object_display_name: string; + // 固定值:tree + object_type: string; + // 唯一,不可改,外键关联引用 + object_code: string; + object_props: string; + // 是否默认组织关系,1是,0否 + is_default: string; + status: string; + time_created: string; + time_modified: string; +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
codestringtrue
- #### 删除组织关系 ``` js -const { data } = await op.api.organization.deleteOrganization(params) ; +const { data } = await op.api.organization.deleteOrganization(params); ``` DELETE /v1/core-objects/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 添加用户到节点 TODO ``` js -const { data } = await op.api.organization.addUserToNode(params) ; +const { data } = await op.api.organization.addUserToNode(params); ``` POST /v1/tree-users -##### param properties +``` ts + +{ + Content-Type: string; + // 关联扩展信息 + relation_data?: string; + // user_id + user_ids?: string;[]; + // 用于区分多重关联 + relation_type?: string; + // 1是,0否 + is_default?: string; + node_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
relation_datastringfalse关联扩展信息
relation_typestringfalse用于区分多重关联
is_defaultstringfalse1是,0否
node_idstringfalse
user_idsarrayfalse
- #### 更新用户节点 ``` js -const { data } = await op.api.organization.updateMember(params) ; +const { data } = await op.api.organization.updateMember(params); ``` PATCH /v1/tree-users/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + // 移动节点move, 设置为默认关系as-default + action: string; + // 1是,0否 + is_default?: string; + // 移动前节点ID + source_node_id?: string; + // 移动后节点ID + dest_node_id?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idtrue
is_defaultstringfalse1是,0否
actionstringtrue移动节点move, 设置为默认关系as-default
source_node_idstringfalse移动前节点ID
dest_node_idstringfalse移动后节点ID
- #### 获取与用户关联的组织关系列表 ``` js -const { data } = await op.api.organization.getMembers(params) ; +const { data } = await op.api.organization.getMembers(params); ``` GET /v1/tree-users -##### param properties +``` ts + +{ + user_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 全局唯一ID + id: string; + // 节点ID + node_id: string; + // 用户ID + user_id: string; + // 所属组织关系路径 + path: string; + // 显示名 + display_name: string; + // 用户名 + username: string; + // 关联类型(用于区分多重关联) + relation_type?: string; + // 关联扩展信息 + relation_data?: string; + // 是否默认关系 + is_default?: string; + // 创建时间 + time_created: string; + // 修改时间 + time_modified: string; + // 状态 + status: string; + tree_node: { + // 节点ID + id?: string; + // 开发者ID + developer_id?: string; + // 租户ID + tenant_id?: string; + arn?: string; + // 创建时间 + time_created?: string; + // 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组) + tag?: string; + // 状态 + status?: string; + // 是否指针类型 + is_pointer?: string; + // 节点code + code: string; + // 节点名字 + name: string; + // 抽象权限容器的ARN + perm_namespace_arn?: string; + condition?: string; + // 是否动态节点(0普通结点,1动态结点) + is_dynamic?: string; + // 系统code + sys_code: string; + // 操作者id + operator_id?: string; + // 指针指向的实体节点 + pointer_id?: string; + // 序号 + seq?: integer; + // 描述 + description?: string; + // 最后修改时间 + time_modified?: string; + // OBJ_ID,组织,角色,岗位,职级等 + object_code: string; + // 父节点id + parent_id?: string; + // 额外属性 + ext_props: { + } + } +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
user_idstringtrue用户ID
- #### 获取成员信息列表 ``` js -const { data } = await op.api.organization.getNodeMembers(params) ; +const { data } = await op.api.organization.getNodeMembers(params); ``` GET /v1/tree-nodes/{id}/tree-users -##### param properties +``` ts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtruenode id
relation_typestringfalse关联类型,用于区分多重关联
is_defaultstringfalse是否默认关系 1是,0否
display_namestringfalse用户显示名
usernamestringfalse用户名,支持模糊搜索(仅前缀)
modestringfalse// mode - 低->高 bit -// 第1位:是否获得指针节点所对应的真实结点,1-是,0-否 -// 第2位:是否展开WeakNode,即节点中类型不同的节点,1-展开,0-不展开 -// 第3位:是否递归地展开节点(不建议)
page_numintegerfalse起始页,默认1
page_sizeintegerfalse页大小,默认10
page_sortstringfalse排序方式,格式:字段[排序方式]
- +{ + id: string; + relation_type?: string; + is_default?: string; + display_name?: string; + username?: string; + mode?: string; + page_num?: integer; + page_size?: integer; + page_sort?: string; +} +``` -#### 批量从组织关系中移除用户-内部使用 TODO +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 总数 + total_num: integer; + // 当前页码 + current_page: integer; + data: { + // 用户ID + user_id: string; + // 用户名 + username: string; + // 用户显示名 + display_name: string; + node_info: { + // 全局唯一ID + id: string; + // 节点ID + node_id: string; + // 用户ID + user_id: string; + // 所属组织关系路径 + path: string; + // 显示名 + display_name: string; + // 用户名 + username: string; + // 关联类型(用于区分多重关联) + relation_type?: string; + // 关联扩展信息 + relation_data?: string; + // 是否默认关系 + is_default?: string; + // 创建时间 + time_created: string; + // 修改时间 + time_modified: string; + // 状态 + status: string; + }[]; + }[]; +} +``` + + + +#### 批量从组织关系中移除用户-内部使用 ``` js -const { data } = await op.api.organization.deleteNodeMembers(params) ; +const { data } = await op.api.organization.deleteNodeMembers(params); ``` DELETE /v1/tree-nodes/{node_id}/tree-users -##### param properties +``` ts + +{ + node_id: string; + ids?: string;[]; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // node_id + id: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
node_idstringtruenode id
idsarraytrue
- #### 从组织关系中移除用户-内部使用 ``` js -const { data } = await op.api.organization.deleteMember(params) ; +const { data } = await op.api.organization.deleteMember(params); ``` DELETE /v1/tree-users/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + ids?: string;[]; + // 节点ID + node_id: string; + // 用户原始ID + user_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue用户节点ID
idsarrayfalse用户与组织的关系ID
node_idstringfalse节点ID
user_idstringfalse用户原始ID
- #### 从节点移除用户 ``` js -const { data } = await op.api.organization.deleteMembers(params) ; +const { data } = await op.api.organization.deleteMembers(params); ``` DELETE /v1/tree-users -##### param properties +``` ts + +{ + Content-Type: string; + // 节点ID + node_id: string; + // 用户原始ID + user_id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
node_idstringfalse节点ID
user_idstringfalse用户原始ID
- #### 创建节点 ``` js -const { data } = await op.api.organization.createNode(params) ; +const { data } = await op.api.organization.createNode(params); ``` POST /v1/tree-nodes -##### param properties +``` ts + +{ + Content-Type: string; + // 节点ID + id?: string; + arn?: string; + // 创建时间 + time_created?: string; + // 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组) + tag?: string; + // 状态 + status?: string; + // 是否指针类型 + is_pointer?: string; + // 节点code + code: string; + // 节点名字 + name: string; + // 抽象权限容器的ARN + perm_namespace_arn?: string; + condition?: string; + // 是否动态节点(0普通结点,1动态结点) + is_dynamic?: string; + // 系统code + sys_code: string; + // 操作者id + operator_id?: string; + // 指针指向的实体节点 + pointer_id?: string; + // 序号 + seq?: integer; + // 描述 + description?: string; + // 最后修改时间 + time_modified?: string; + // OBJ_ID,组织,角色,岗位,职级等 + object_code: string; + // 父节点id + parent_id?: string; + // 额外属性 + ext_props: { + } +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id?: string; +} +``` + - - - - - - - - - - - - - - - -
名称类型是否必须描述
- #### 编辑节点 ``` js -const { data } = await op.api.organization.updateNode(params) ; +const { data } = await op.api.organization.updateNode(params); ``` PATCH /v1/tree-nodes/{id} -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + // 开发者ID + developer_id?: string; + // 租户ID + tenant_id?: string; + arn?: string; + // 创建时间 + time_created?: string; + // 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组) + tag?: string; + // 状态 + status?: string; + // 是否指针类型 + is_pointer?: string; + // 节点code + code: string; + // 节点名字 + name: string; + // 抽象权限容器的ARN + perm_namespace_arn?: string; + condition?: string; + // 是否动态节点(0普通结点,1动态结点) + is_dynamic?: string; + // 系统code + sys_code: string; + // 操作者id + operator_id?: string; + // 指针指向的实体节点 + pointer_id?: string; + // 序号 + seq?: integer; + // 描述 + description?: string; + // 最后修改时间 + time_modified?: string; + // OBJ_ID,组织,角色,岗位,职级等 + object_code: string; + // 父节点id + parent_id?: string; + // 额外属性 + ext_props: { + } +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 系统分配的用于处理树型关系的编码 + sys_code?: string; + // 节点代码 + code?: string; + // 是否指针节点(0普通结点,1指针结点) + is_pointer?: string; + // 操作人ID + operator_id?: number; + // 备注 + description?: string; + // 抽象权限容器的ARN + perm_namespace_arn?: string; + // 指针指向的实体节点 + pointer_id?: number; + // 动态节点的条件(如满足某后缀表达式) + condition?: string; + // 源上级节点ID(根为0) + source_parent_id?: number; + // 目标上级节点ID(根为0) + dest_parent_id?: number; + // 节点名称 + name?: string; + // 是否动态节点(0普通结点,1动态结点) + is_dynamic?: string; + // 节点类型(OBJ_ID,组织,角色,岗位,职级等) + object_code?: string; + // ARN + arn?: string; + // 显示顺序 + seq?: number; + // 状态 + status?: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue更新树节点
- #### 删除节点 TODO ``` js -const { data } = await op.api.organization.deleteChildrenNodes(params) ; +const { data } = await op.api.organization.deleteChildrenNodes(params); ``` DELETE /v1/tree-nodes/{id}/children -##### param properties +``` ts + +{ + Content-Type: string; + id: string; + object_code: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + id: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
object_codestringtrue树对象code
- #### 查询节点信息列表 ``` js -const { data } = await op.api.organization.getNodes(params) ; +const { data } = await op.api.organization.getNodes(params); ``` GET /v1/tree-nodes -##### param properties +``` ts + +{ + object_code: string; + name?: string; + code?: string; + tag?: string; + time_modified_from?: string; + time_modified_to?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 节点ID + id?: string; + // 开发者ID + developer_id?: string; + // 租户ID + tenant_id?: string; + arn?: string; + // 创建时间 + time_created?: string; + // 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组) + tag?: string; + // 状态 + status?: string; + // 是否指针类型 + is_pointer?: string; + // 节点code + code: string; + // 节点名字 + name: string; + // 抽象权限容器的ARN + perm_namespace_arn?: string; + condition?: string; + // 是否动态节点(0普通结点,1动态结点) + is_dynamic?: string; + // 系统code + sys_code: string; + // 操作者id + operator_id?: string; + // 指针指向的实体节点 + pointer_id?: string; + // 序号 + seq?: integer; + // 描述 + description?: string; + // 最后修改时间 + time_modified?: string; + // OBJ_ID,组织,角色,岗位,职级等 + object_code: string; + // 父节点id + parent_id?: string; + // 额外属性 + ext_props: { + } +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
object_codestringtrue组织编码
namestringfalse名字,支持前缀搜索
codestringfalse编号
tagstringfalse标签
time_modified_fromstringfalse更新时间起点
time_modified_tostringfalse更新时间终点,默认至今
- #### 查询节点信息 ``` js -const { data } = await op.api.organization.getNode(params) ; +const { data } = await op.api.organization.getNode(params); ``` GET /v1/tree-nodes/{id} -##### param properties +``` ts + +{ + id: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 节点ID + id?: string; + // 开发者ID + developer_id?: string; + // 租户ID + tenant_id?: string; + arn?: string; + // 创建时间 + time_created?: string; + // 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组) + tag?: string; + // 状态 + status?: string; + // 是否指针类型 + is_pointer?: string; + // 节点code + code: string; + // 节点名字 + name: string; + // 抽象权限容器的ARN + perm_namespace_arn?: string; + condition?: string; + // 是否动态节点(0普通结点,1动态结点) + is_dynamic?: string; + // 系统code + sys_code: string; + // 操作者id + operator_id?: string; + // 指针指向的实体节点 + pointer_id?: string; + // 序号 + seq?: integer; + // 描述 + description?: string; + // 最后修改时间 + time_modified?: string; + // OBJ_ID,组织,角色,岗位,职级等 + object_code: string; + // 父节点id + parent_id?: string; + // 额外属性 + ext_props: { + } +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
- #### 获取子节点列表 ``` js -const { data } = await op.api.organization.getChildrenNodes(params) ; +const { data } = await op.api.organization.getChildrenNodes(params); ``` GET /v1/tree-nodes/{id}/children -##### param properties +``` ts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
idstringtrue
modestringtrue// mode - 低->高 bit -// 第1位:是否获得指针节点所对应的真实结点,1-是,0-否 -// 第2位:是否展开WeakNode,即节点中类型不同的节点,1-展开,0-不展开 -// 第3位:是否递归地展开节点(不建议)
object_codestringtrue当id = 0时必填,创建树时的object_code
- -### storage +{ + id: string; + mode: string; + object_code: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + // 节点ID + id?: string; + // 开发者ID + developer_id?: string; + // 租户ID + tenant_id?: string; + arn?: string; + // 创建时间 + time_created?: string; + // 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组) + tag?: string; + // 状态 + status?: string; + // 是否指针类型 + is_pointer?: string; + // 节点code + code: string; + // 节点名字 + name: string; + // 抽象权限容器的ARN + perm_namespace_arn?: string; + condition?: string; + // 是否动态节点(0普通结点,1动态结点) + is_dynamic?: string; + // 系统code + sys_code: string; + // 操作者id + operator_id?: string; + // 指针指向的实体节点 + pointer_id?: string; + // 序号 + seq?: integer; + // 描述 + description?: string; + // 最后修改时间 + time_modified?: string; + // OBJ_ID,组织,角色,岗位,职级等 + object_code: string; + // 父节点id + parent_id?: string; + // 额外属性 + ext_props: { + } +}[]; +``` + + + +### storage #### 获取 Bucket 列表 ``` js -const { data } = await op.api.storage.getBuckets(params) ; +const { data } = await op.api.storage.getBuckets(params); ``` GET /v1/buckets -##### param properties +``` ts + +{ + last?: string; + limit?: integer; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + bucket: string; + // 单位:byte + data_size: integer; + object_count: integer; +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
laststringfalse最后一个bucket的名字
limitintegerfalse页大小
- #### 获取 Object 列表 ``` js -const { data } = await op.api.storage.getObjects(params) ; +const { data } = await op.api.storage.getObjects(params); ``` GET /v1/buckets/{bucket}/objects -##### param properties +``` ts + +{ + bucket: string; + last?: string; + limit?: integer; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + bucket: string; + key: string; + value: string; + // rfc3339 + updated_at: string; + // rfc3339 + created_at: string; +}[]; +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
bucketstringtruebucket名称
laststringfalse最后一个object的名字
limitintegerfalse页大小
- #### 获取 Bucket 详情 ``` js -const { data } = await op.api.storage.getBucket(params) ; +const { data } = await op.api.storage.getBucket(params); ``` GET /v1/buckets/{bucket} -##### param properties +``` ts + +{ + bucket: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + bucket: string; + // 单位:byte + data_size: integer; + object_count: integer; +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
bucketstringtruebucket 名称
- #### 删除 Bucket ``` js -const { data } = await op.api.storage.deleteBucket(params) ; +const { data } = await op.api.storage.deleteBucket(params); ``` DELETE /v1/buckets/{bucket} -##### param properties +``` ts + +{ + bucket: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
bucketstringtruebucket 名称
- #### 创建 Object ``` js -const { data } = await op.api.storage.saveObject(params) ; +const { data } = await op.api.storage.saveObject(params); ``` POST /v1/buckets/{bucket}/objects -##### param properties +``` ts + +{ + bucket: string; + key: string; + value: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
bucketstringtruebucket名称
keystringfalse
valuestringfalse
- #### 获取 Object 详情 ``` js -const { data } = await op.api.storage.getObject(params) ; +const { data } = await op.api.storage.getObject(params); ``` GET /v1/buckets/{bucket}/objects/{key} -##### param properties +``` ts + +{ + bucket: string; + key: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + bucket: string; + key: string; + value: string; + // rfc3339 + updated_at: string; + // rfc3339 + created_at: string; +} +``` + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
bucketstringtruebucket名称
keystringtrue
- #### 删除 Object ``` js -const { data } = await op.api.storage.deleteObject(params) ; +const { data } = await op.api.storage.deleteObject(params); ``` DELETE /v1/buckets/{bucket}/objects/{key} -##### param properties +``` ts + +{ + bucket: string; + key: string; + key_as_prefix?: string; +} +``` + +#### 响应 + +- 200 成功 + +`application/json` + +``` ts + +{ + bucket: string; + key: string; + value: string; + // rfc3339 + updated_at: string; + // rfc3339 + created_at: string; +} +``` + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名称类型是否必须描述
bucketstringtruebucket名称
keystringtrue
key_as_prefixstringfalse将键名称作为前缀执行删除