flow-doc-deleted/op/API.md

4760 lines
117 KiB
Markdown
Raw Normal View History

2023-12-03 21:09:35 +08:00
# IDMesh API
2023-11-16 18:03:05 +08:00
2023-12-03 21:09:35 +08:00
op.api 对 IDMesh API 进行了封装。op.api 会自行对请求进行签名,因此使用前需要先通过 op.api.init 设置开发者账号。
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
## op.api.init
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
/** 注意!!
* 在使用任何 op.api 封装的接口之前,
* 你需要使用 op.api.init 初始化接口
* AK、SK 来自开发者账号
*/
const onSyncTask = async (config, env, op, eventData) => {
op.api.init('<AK>', '<SK>');
op.api.user.disable({ id: '<User_ID>' });
};
```
2023-11-16 18:03:05 +08:00
2023-12-03 15:59:54 +08:00
## api
### user
2023-12-03 21:09:35 +08:00
#### 创建用户
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.create(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/users
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>username</td>
<td>string</td>
<td>false</td>
<td>用户名,唯一,不传后台自动生成</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>false</td>
<td>密码,不传后台生成默认密码</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>显示名称</td>
</tr>
<tr>
<td>firstname</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>lastname</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>realname</td>
<td>string</td>
<td>false</td>
<td>真实姓名</td>
</tr>
<tr>
<td>pinyin</td>
<td>string</td>
<td>false</td>
<td>拼音</td>
</tr>
<tr>
<td>nickname</td>
<td>string</td>
<td>false</td>
<td>昵称</td>
</tr>
<tr>
<td>user_type</td>
<td>string</td>
<td>false</td>
<td>用户类型,不传后台设置系统默认类型</td>
</tr>
<tr>
<td>mobile</td>
<td>string</td>
<td>false</td>
<td>手机</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
<td>false</td>
<td>邮箱</td>
</tr>
<tr>
<td>gender</td>
<td>string</td>
<td>false</td>
<td>性别</td>
</tr>
<tr>
<td>cert_type</td>
<td>string</td>
<td>false</td>
<td>证件类型</td>
</tr>
<tr>
<td>cert_number</td>
<td>string</td>
<td>false</td>
<td>证件号</td>
</tr>
<tr>
<td>region</td>
<td>string</td>
<td>false</td>
<td>区域</td>
</tr>
<tr>
<td>work_time</td>
<td>string</td>
<td>false</td>
<td>加入时间</td>
</tr>
<tr>
<td>work_title</td>
<td>string</td>
<td>false</td>
<td>职位</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>false</td>
<td>状态1正常0禁用后期扩展离职、休假、借调。</td>
</tr>
<tr>
<td>password_status</td>
<td>string</td>
<td>false</td>
<td>密码状态valid/invalid</td>
</tr>
<tr>
<td>idp_config_id</td>
<td>number</td>
2023-12-04 16:18:51 +08:00
<td>true</td>
2023-12-03 15:59:54 +08:00
<td>身份源ID作为创建时记录不做更新</td>
</tr>
<tr>
<td>is_notify</td>
<td>boolean</td>
<td>false</td>
<td>是否通知默认不传false不通知true通知</td>
2023-12-04 16:18:51 +08:00
</tr>
<tr>
<td>sys_ext_props</td>
<td>object</td>
<td>false</td>
<td>系统扩展属性json对象{&#34;age&#34;: 18, &#34;love&#34;: &#34;足球&#34;}</td>
</tr>
<tr>
<td>free_ext_props</td>
<td>object</td>
<td>false</td>
<td>自由扩展属性json对象</td>
2023-12-03 15:59:54 +08:00
</tr>
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 锁定用户(旧)
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.disable(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/users/{id}/disable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 解锁用户(旧)
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.enable(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/users/{id}/enable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 批量锁定用户(旧)
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.batchDisable(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/jobs/users-disable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>ids</td>
<td>array</td>
<td>true</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 批量解锁用户(旧)
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.batchEnable(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/jobs/users-enable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>ids</td>
<td>array</td>
<td>true</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 编辑用户
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.modify(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/users/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>username</td>
<td>string</td>
<td>false</td>
<td>用户名,验证唯一</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>显示名称</td>
</tr>
<tr>
<td>firstname</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>lastname</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>realname</td>
<td>string</td>
<td>false</td>
<td>真实姓名</td>
</tr>
<tr>
<td>pinyin</td>
<td>string</td>
<td>false</td>
<td>拼音</td>
</tr>
<tr>
<td>nickname</td>
<td>string</td>
<td>false</td>
<td>昵称</td>
</tr>
<tr>
<td>mobile</td>
<td>string</td>
<td>false</td>
<td>手机</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
<td>false</td>
<td>邮箱</td>
</tr>
<tr>
<td>gender</td>
<td>string</td>
<td>false</td>
<td>性别1男0女</td>
</tr>
<tr>
<td>cert_type</td>
<td>string</td>
<td>false</td>
<td>证件类型</td>
</tr>
<tr>
<td>cert_number</td>
<td>string</td>
<td>false</td>
<td>证件号</td>
</tr>
<tr>
<td>region</td>
<td>string</td>
<td>false</td>
<td>区域</td>
</tr>
<tr>
<td>work_time</td>
<td>string</td>
<td>false</td>
<td>加入时间</td>
</tr>
<tr>
<td>work_title</td>
<td>string</td>
<td>false</td>
<td>职位</td>
</tr>
<tr>
<td>last_login_ipaddr</td>
<td>string</td>
<td>false</td>
<td>上次登录IP</td>
</tr>
<tr>
<td>last_login_time</td>
<td>string</td>
<td>false</td>
<td>上次登录时间</td>
2023-12-04 16:18:51 +08:00
</tr>
<tr>
<td>sys_ext_props</td>
<td>object</td>
<td>false</td>
<td>系统扩展信息json对象{&#34;age&#34;: 18, &#34;love&#34;: &#34;足球&#34;}</td>
</tr>
<tr>
<td>free_ext_props</td>
<td>object</td>
<td>false</td>
<td>自由扩展属性json对象</td>
2023-12-03 15:59:54 +08:00
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 删除用户
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.delete(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/users/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 批量删除用户(旧)
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.batchDelete(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/users
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>ids</td>
<td>array</td>
<td>true</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询用户列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.list(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/users
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>page_size</td>
<td>integer</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>page_num</td>
<td>integer</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>search_type</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>默认按用户基础字段搜索当值为generic时全文检索</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>keyword</td>
<td>string</td>
<td>false</td>
<td>检索值</td>
2023-12-04 16:18:51 +08:00
</tr>
<tr>
<td>time_modified_from</td>
<td>string</td>
<td>false</td>
<td>开始时间</td>
</tr>
<tr>
<td>time_modified_to</td>
<td>string</td>
<td>false</td>
<td>结束时间</td>
2023-12-03 15:59:54 +08:00
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询用户详情
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.get(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/users/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 修改密码(旧)
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.modifyPassword(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/users/{id}/passwords
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>old_password</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>new_password</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询用户存储凭证列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.getStoredCredentials(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/user-stored-credentials
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>user_id</td>
<td>number</td>
<td>false</td>
<td>用户id标识</td>
</tr>
<tr>
<td>provider_code</td>
<td>string</td>
<td>false</td>
<td>社会化登录提供者的code</td>
</tr>
<tr>
<td>idp_config_id</td>
<td>number</td>
<td>false</td>
<td>社会化登录配置的ID</td>
</tr>
<tr>
<td>id1</td>
<td>string</td>
<td>false</td>
<td>社会化身份标识1约定此字段保存用户唯一标识如openid</td>
</tr>
<tr>
<td>id2</td>
<td>string</td>
<td>false</td>
<td>社会化身份标识2如unionid</td>
</tr>
<tr>
<td>metadata</td>
<td>string</td>
<td>false</td>
<td>更多社会化身份标识</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>false</td>
<td>状态</td>
</tr>
<tr>
<td>username</td>
<td>string</td>
<td>false</td>
<td>用户名</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>显示名</td>
</tr>
<tr>
<td>page_size</td>
<td>integer</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>page_num</td>
<td>integer</td>
<td>false</td>
<td></td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 创建用户存储凭证
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.user.createStoreCredential(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/user-stored-credentials
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>provider_code</td>
<td>string</td>
<td>false</td>
<td>社会化身份源code</td>
</tr>
<tr>
<td>id1</td>
<td>string</td>
<td>false</td>
<td>社会化身份标识1如openid</td>
</tr>
<tr>
<td>id2</td>
<td>string</td>
<td>false</td>
<td>社会化身份标识2如unionid</td>
</tr>
<tr>
<td>metadata</td>
<td>string</td>
<td>false</td>
<td>更多社会化身份标识</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>false</td>
<td>状态</td>
</tr>
<tr>
<td>nickname</td>
<td>string</td>
<td>false</td>
<td>昵称</td>
</tr>
<tr>
<td>avatar</td>
<td>string</td>
<td>false</td>
<td>头像</td>
</tr>
<tr>
<td>id_provider_connection</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>idp_config_id</td>
<td>number</td>
<td>false</td>
<td>社会化登录配置的ID</td>
</tr>
<tr>
<td>realname</td>
<td>string</td>
<td>false</td>
<td>真实姓名</td>
</tr>
<tr>
<td>mobile</td>
<td>string</td>
<td>false</td>
<td>手机</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
<td>false</td>
<td>邮箱</td>
</tr>
<tr>
<td>gender</td>
<td>string</td>
<td>false</td>
<td>性别</td>
</tr>
</tbody>
</table>
### authentication
### app
2023-12-03 21:09:35 +08:00
#### 创建应用
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.create(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>name</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>1自建应用2模板应用市场应用</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>template_id</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>不填写则代表自建应用</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>category</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>1 标准web应用2单页web应用3客户端应用4后端服务</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>descr</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>logo</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>格式为http://ip:port/logo.png</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>login_url</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>redirect_url</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>logout_url</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>sub_account_policy</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>1启用0不启用启用后单点登录返回</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>protocol_type</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>默认 oidc</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>protocol_prop</td>
<td>object</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>默认 oidc 相关配置</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>config_prop</td>
<td>object</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>domain_sn</td>
<td>string</td>
<td>false</td>
<td>域名</td>
2023-12-04 16:18:51 +08:00
</tr>
<tr>
<td>sys_ext_props</td>
<td>object</td>
<td>false</td>
<td>kv字典数据</td>
</tr>
<tr>
<td>free_ext_props</td>
<td>object</td>
<td>false</td>
<td>kv字典数据</td>
2023-12-03 15:59:54 +08:00
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新应用基本信息
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.modify(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/applications/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>name</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>1自建应用2市场应用</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>app_id</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>app_secret</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>category</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>descr</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>logo</td>
<td>null</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>login_url</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>redirect_url</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>logout_url</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>sub_account_policy</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>false</td>
<td>状态0禁用1启用</td>
</tr>
<tr>
<td>domain_sn</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
</tr>
<tr>
<td>sys_ext_props</td>
<td>object</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>free_ext_props</td>
<td>object</td>
<td>false</td>
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询应用模板列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.getTemplate(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/application-templates
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>name</td>
<td>string</td>
<td>true</td>
<td>应用名称</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询应用列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.list(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/applications
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>name</td>
<td>string</td>
<td>false</td>
<td>应用名称</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
<td>应用类型</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序,格式:字段名[顺序]</td>
</tr>
<tr>
<td>types</td>
<td>string</td>
<td>false</td>
<td>应用类型列表,逗号分隔</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 按条件查询应用
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.getByDomain(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/application
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>domain</td>
<td>string</td>
<td>false</td>
<td>域名</td>
</tr>
<tr>
<td>domain_sn</td>
<td>string</td>
<td>false</td>
<td>域名简写</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 按 ID 查询应用
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.get(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/applications/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>唯一标识</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 启用应用
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.enable(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{id}/enable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>应用标识</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 禁用应用
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.disable(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{id}/disable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>应用标识</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 删除应用
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.delete(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/applications/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 刷新应用安全码
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.createSecrets(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{id}/secrets
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询应用配置信息
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.getConfig(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/applications/{id}/configs
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>应用ID</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新应用配置
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.modifyConfig(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/applications/{id}/configs
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>allowed_login_method</td>
<td>string</td>
<td>false</td>
<td>允许的登录方式,格式为:[&#34;password&#34;, &#34;vercode&#34;]</td>
</tr>
<tr>
<td>default_login_method</td>
<td>string</td>
<td>false</td>
<td>默认登录方式格式为password</td>
</tr>
<tr>
<td>allowed_reg_method</td>
<td>string</td>
<td>false</td>
<td>允许注册方式,格式为:[&#34;mobile&#34;, &#34;email&#34;]</td>
</tr>
<tr>
<td>default_reg_method</td>
<td>string</td>
<td>false</td>
<td>默认注册方式格式为mobile</td>
</tr>
<tr>
<td>default_protocol</td>
<td>string</td>
<td>false</td>
<td>默认登录协议</td>
</tr>
<tr>
<td>access_policy</td>
<td>string</td>
<td>false</td>
<td>应用级访问控制权限all: 所有人可访问 permitted: 拒绝未授权访问</td>
</tr>
<tr>
<td>reg_policy</td>
2023-12-04 16:18:51 +08:00
<td>array</td>
2023-12-03 15:59:54 +08:00
<td>false</td>
<td>新用户注册策略是否允许自动注册注册验证方式等1是2否,</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 禁用应用单点登录
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.disableSSO(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{id}/sso/disable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>应用标识</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 启用应用单点登录
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.enableSSO(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{id}/sso/enable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>应用标识</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 创建应用多因素认证配置
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.createMFA(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{id}/mfa
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td></td>
<td>true</td>
<td>应用id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>config_id</td>
<td>string</td>
<td>true</td>
<td>已配置的idp conn id</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 删除应用多因素认证配置
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.deleteMFA(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/applications/{app_id}/mfa/{config_id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>config_id</td>
<td></td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 创建应用认证源
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.createIDP(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{id}/idp
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td></td>
<td>true</td>
<td>应用id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>config_id</td>
<td>string</td>
<td>true</td>
<td>已配置的idp conn id</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 删除应用认证源
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.deleteIDPConfig(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/applications/{app_id}/idp/{config_id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>config_id</td>
<td></td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 启用应用认证协议
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.enableProtocol(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{app_id}/protocols/{protocol_type}/enable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td></td>
<td>true</td>
<td>应用 id</td>
</tr>
<tr>
<td>protocol_type</td>
<td></td>
<td>true</td>
<td>协议名称,如 oidc</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 禁用应用认证协议
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.disableProtocol(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{app_id}/protocols/{protocol_type}/disable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td></td>
<td>true</td>
<td>应用 id</td>
</tr>
<tr>
<td>protocol_type</td>
<td></td>
<td>true</td>
<td>协议名称,如 oidc</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询应用认证协议列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.getProtocols(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/applications/{id}/protocols
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>应用唯一标识ID</td>
</tr>
<!-- query 参数 -->
<tr>
<td>status</td>
<td>string</td>
<td>false</td>
<td>启用状态 1, 0</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询应用认证协议
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.getProtocol(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/applications/{app_id}/protocols/{protocol_type}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td></td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>protocol_type</td>
<td></td>
<td>true</td>
<td>单点类型cas、oauth2、saml、oidc、sxp</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新应用认证协议
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.modifyProtocol(params) ;
```
2023-12-03 15:59:54 +08:00
PUT /v1/applications/{app_id}/protocols/{protocol_type}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td></td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>protocol_type</td>
<td></td>
<td>true</td>
<td>单点类型cas、oauth2、saml、oidc、sxp</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>config_content</td>
<td>object</td>
<td>false</td>
<td>配置参数</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 创建应用子账号
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.createAccount(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{id}/accounts
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td></td>
<td>true</td>
<td>应用id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>user_id</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>app_id</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_name</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_name_displayed</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_source</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_password</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_status</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>1启用0禁用</td>
</tr>
<tr>
<td>sys_ext_props</td>
<td>object</td>
<td>false</td>
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
2023-12-04 16:18:51 +08:00
<td>free_ext_props</td>
2023-12-03 15:59:54 +08:00
<td>object</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
2023-12-04 16:18:51 +08:00
<td>username</td>
2023-12-03 15:59:54 +08:00
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新应用子账号
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.modifyAccount(params) ;
```
2023-12-03 15:59:54 +08:00
PUT /v1/applications/{app_id}/accounts/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>id</td>
<td></td>
<td>true</td>
<td>子账号id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>user_id</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>app_id</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_name</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_name_displayed</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_source</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_password</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
<td>acc_status</td>
<td>string</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td>1启用0禁用</td>
2023-12-03 15:59:54 +08:00
</tr>
<tr>
2023-12-04 16:18:51 +08:00
<td>sys_ext_props</td>
2023-12-03 15:59:54 +08:00
<td>object</td>
<td>false</td>
2023-12-04 16:18:51 +08:00
<td></td>
</tr>
<tr>
<td>free_ext_props</td>
<td>object</td>
<td>false</td>
<td></td>
2023-12-03 15:59:54 +08:00
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 启用应用子账号
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.enableAccount(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{app_id}/accounts/{id}/enable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td></td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>子账号id</td>
</tr>
<!-- query 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 禁用应用子账号
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.disableAccount(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/applications/{app_id}/accounts/{id}/disable
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td></td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>子账号id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 删除应用子账号
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.deleteAccount(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/applications/{app_id}/accounts/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td></td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>子账号id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 按 APP ID 查询应用子账号列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.getAccountsByApp(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/applications/{app_id}/accounts
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<!-- query 参数 -->
<tr>
<td>user_id</td>
<td>string</td>
<td>false</td>
<td>用户id</td>
</tr>
<tr>
<td>acc_status</td>
<td>string</td>
<td>false</td>
<td>账号状态 1-活跃 0-冻结</td>
</tr>
<tr>
<td>acc_name</td>
<td>string</td>
<td>false</td>
<td>账号名称</td>
</tr>
<tr>
<td>page_num</td>
<td>integer</td>
<td>false</td>
<td>页数</td>
</tr>
<tr>
<td>page_size</td>
<td>integer</td>
<td>false</td>
<td>页大小</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序字段</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询应用子账号列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.getAccounts(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/application-accounts
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>app_id</td>
<td>string</td>
<td>false</td>
<td>应用id</td>
</tr>
<tr>
<td>user_id</td>
<td>string</td>
<td>false</td>
<td>用户id</td>
</tr>
<tr>
<td>acc_status</td>
<td>string</td>
<td>false</td>
<td>账号状态 1-活跃 0-冻结</td>
</tr>
<tr>
<td>acc_name</td>
<td>string</td>
<td>false</td>
<td>账号名称</td>
</tr>
<tr>
<td>page_num</td>
<td>integer</td>
<td>false</td>
<td>页数</td>
</tr>
<tr>
<td>page_size</td>
<td>integer</td>
<td>false</td>
<td>页大小</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序字段</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 按 ID 查询应用子账号
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.app.getAccount(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/applications/{app_id}/accounts/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>app_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>子账号id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
### permission
2023-12-03 21:09:35 +08:00
#### 获取权限列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getPrivileges(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/privileges
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>identity_id</td>
<td>string</td>
<td>false</td>
<td>主体id</td>
</tr>
<tr>
<td>identity_type</td>
<td>string</td>
<td>false</td>
<td>主体类型</td>
</tr>
<tr>
<td>identity_name</td>
<td>string</td>
<td>false</td>
<td>主体名称</td>
</tr>
<tr>
<td>application_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>object_type</td>
<td>string</td>
<td>false</td>
<td>对象类型(可选值: data, api, ui, res_set, app</td>
</tr>
<tr>
<td>object_code</td>
<td>string</td>
<td>false</td>
<td>对象代码</td>
</tr>
<tr>
<td>affect</td>
<td>string</td>
<td>false</td>
<td>作用方式affect,deny</td>
</tr>
<tr>
<td>page_num</td>
<td>string</td>
<td>false</td>
<td>起始页默认1</td>
</tr>
<tr>
<td>page_size</td>
<td>string</td>
<td>false</td>
<td>页大小默认20</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序方式,格式:字段[排序方式]</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 获取授权单元列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getAuthUnits(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/auth-units
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>identity_id</td>
<td>string</td>
<td>false</td>
<td>主体id</td>
</tr>
<tr>
<td>identity_type</td>
<td>string</td>
<td>false</td>
<td>主体类型</td>
</tr>
<tr>
<td>identity_name</td>
<td>string</td>
<td>false</td>
<td>主体名称</td>
</tr>
<tr>
<td>page_num</td>
<td>string</td>
<td>false</td>
<td>起始页默认1</td>
</tr>
<tr>
<td>page_size</td>
<td>string</td>
<td>false</td>
<td>页大小默认20</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序方式,格式:字段[排序方式]</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 按 ID 查询授权单元
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getAuthUnit(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/auth-units/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>au id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 批量创建授权规则
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.createAuthUnitRules(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/batch/auth-unit-rules
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>identities</td>
<td>array</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>rules</td>
<td>array</td>
<td>false</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新授权规则
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.modifyAuthUnit(params) ;
```
2023-12-03 15:59:54 +08:00
PUT /v1/auth-units/{rid}/rules/{tid}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>rid</td>
<td>string</td>
<td>true</td>
<td>AU id</td>
</tr>
<tr>
<td>tid</td>
<td>string</td>
<td>true</td>
<td>规则id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询授权单元下的授权规则列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getAuthUnitsRules(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/auth-units/{rid}/rules
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>rid</td>
<td>string</td>
<td>true</td>
<td>AU id</td>
</tr>
<!-- query 参数 -->
<tr>
<td>application_id</td>
<td>string</td>
<td>false</td>
<td>应用id</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
<td>规则类型</td>
</tr>
<tr>
<td>code</td>
<td>string</td>
<td>false</td>
<td>资源或资源集合code</td>
</tr>
<tr>
<td>self_only</td>
<td>string</td>
<td>false</td>
<td>只查询指定主体下的授权</td>
</tr>
<tr>
<td>resource_id</td>
<td>string</td>
<td>false</td>
<td>资源id当type=api,ui,data时有效</td>
</tr>
<tr>
<td>resource_match_all_resources</td>
<td>string</td>
<td>false</td>
<td>匹配所有资源当type=res时有效</td>
</tr>
<tr>
<td>resource_match_all_actions</td>
<td>string</td>
<td>false</td>
<td>匹配所有资源操作当type=res时有效</td>
</tr>
<tr>
<td>resource_set_id</td>
<td>string</td>
<td>false</td>
<td>资源集合id当type=res_set</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询授权规则列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.queryAuthUnitsRules(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/auth-unit-rules
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>application_id</td>
<td>string</td>
<td>false</td>
<td>应用id</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
<td>规则类型</td>
</tr>
<tr>
<td>code</td>
<td>string</td>
<td>false</td>
<td>资源或资源集合code</td>
</tr>
<tr>
<td>identity_id</td>
<td>string</td>
<td>true</td>
<td>主体id</td>
</tr>
<tr>
<td>identity_type</td>
<td>string</td>
<td>true</td>
<td>主体类型</td>
</tr>
<tr>
<td>identity_name</td>
<td>string</td>
<td>false</td>
<td>主体名称</td>
</tr>
<tr>
<td>self_only</td>
<td>string</td>
<td>false</td>
<td>只查询指定主体下的授权</td>
</tr>
<tr>
<td>resource_id</td>
<td>string</td>
<td>false</td>
<td>资源id当type=api,ui,data时有效</td>
</tr>
<tr>
<td>resource_match_all_resources</td>
<td>string</td>
<td>false</td>
<td>匹配所有资源当type=res时有效</td>
</tr>
<tr>
<td>resource_match_all_actions</td>
<td>string</td>
<td>false</td>
<td>匹配所有资源操作当type=res时有效</td>
</tr>
<tr>
<td>resource_set_id</td>
<td>string</td>
<td>false</td>
<td>资源集合id当type=res_set</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 批量删除授权规则
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.deleteAuthUnitRules(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/batch/auth-unit-rules
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>ids</td>
<td>array</td>
<td>true</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 创建资源
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.createResource(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/resources
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>description</td>
<td>string</td>
<td>false</td>
<td>描述</td>
</tr>
<tr>
<td>code</td>
<td>string</td>
<td>false</td>
<td>资源代码</td>
</tr>
<tr>
<td>application_id</td>
<td>number</td>
<td>false</td>
<td>应用id</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
<td>资源类型data/api/ui</td>
</tr>
<tr>
<td>uri</td>
<td>string</td>
<td>false</td>
<td>资源URI, 当type=api/ui 时有效</td>
</tr>
<tr>
<td>actions</td>
<td>array</td>
<td>false</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新资源
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.modifyResource(params) ;
```
2023-12-03 15:59:54 +08:00
PUT /v1/resources/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>资源id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>description</td>
<td>string</td>
<td>false</td>
<td>描述</td>
</tr>
<tr>
<td>uri</td>
<td>string</td>
<td>false</td>
<td>资源URI, 当type=api/ui 时有效</td>
</tr>
<tr>
<td>actions</td>
<td>array</td>
<td>false</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询资源列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getResources(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/resources
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>application_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
<td>资源类型</td>
</tr>
<tr>
<td>code</td>
<td>string</td>
<td>false</td>
<td>资源代码</td>
</tr>
<tr>
<td>include_global</td>
<td>string</td>
<td>false</td>
<td>是否查询包含全局资源</td>
</tr>
<tr>
<td>page_num</td>
<td>string</td>
<td>false</td>
<td>起始页默认1</td>
</tr>
<tr>
<td>page_size</td>
<td>string</td>
<td>false</td>
<td>页大小默认20</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序方式,格式:字段[排序方式]</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 按 ID 查询资源
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getResource(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/resources/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>资源id</td>
</tr>
<!-- query 参数 -->
<tr>
<td>application_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 删除资源
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.deleteResources(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/batch/resources
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>ids</td>
<td>array</td>
<td>true</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 创建资源集合
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.createResourceSet(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/resource-sets
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>code</td>
<td>string</td>
<td>false</td>
<td>集合代码</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td>false</td>
<td>描述</td>
</tr>
<tr>
<td>application_id</td>
<td>string</td>
<td>false</td>
<td>应用id</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新资源集合
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.modifyResourceSet(params) ;
```
2023-12-03 15:59:54 +08:00
PUT /v1/resource-sets/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>集合id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>code</td>
<td>string</td>
<td>false</td>
<td>集合代码</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td>false</td>
<td>描述</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询资源集合列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getResourceSets(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/resource-sets
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>code</td>
<td>string</td>
<td>false</td>
<td>集合代码</td>
</tr>
<tr>
<td>application_id</td>
<td>string</td>
<td>true</td>
<td>应用id</td>
</tr>
<tr>
<td>include_global</td>
<td>string</td>
<td>false</td>
<td>查询是否包含全局资源集合</td>
</tr>
<tr>
<td>page_num</td>
<td>string</td>
<td>false</td>
<td>起始页默认1</td>
</tr>
<tr>
<td>page_size</td>
<td>string</td>
<td>false</td>
<td>页大小默认20</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序方式,格式:字段[排序方式]</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 按 ID 查询资源集合
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getResourceSet(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/resource-sets/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>资源集合id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 创建资源集合成员
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.createResourceSetMember(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/resource-sets/{id}/members
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>集合id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>resource_id</td>
<td>number</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>resource_scope</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>resource_actions</td>
<td>array</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>match_all_actions</td>
<td>boolean</td>
<td>false</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新资源集合成员
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.modifyResourceSetMember(params) ;
```
2023-12-03 15:59:54 +08:00
PUT /v1/resource-sets/{sid}/members/{mid}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>sid</td>
<td>string</td>
<td>true</td>
<td>资源集合id</td>
</tr>
<tr>
<td>mid</td>
<td>string</td>
<td>true</td>
<td>资源集合成员id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>resource_id</td>
<td>number</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>resource_scope</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>ResourceActions</td>
<td>array</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>match_all_actions</td>
<td>boolean</td>
<td>false</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询资源集合成员列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getResourceMembers(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/resource-sets/{sid}/members
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>sid</td>
<td>string</td>
<td>true</td>
<td>资源集合id</td>
</tr>
<!-- query 参数 -->
<tr>
<td>resource_code</td>
<td>string</td>
<td>false</td>
<td>资源代码</td>
</tr>
<tr>
<td>resource_type</td>
<td>string</td>
<td>false</td>
<td>资源类型</td>
</tr>
<tr>
<td>page_num</td>
<td>string</td>
<td>false</td>
<td>起始页默认1</td>
</tr>
<tr>
<td>page_size</td>
<td>string</td>
<td>false</td>
<td>页大小默认20</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序方式,格式:字段[排序方式]</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 按 ID 查询资源集合成员
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.getResourceMember(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/resource-sets/{sid}/members/{mid}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>sid</td>
<td>string</td>
<td>true</td>
<td>资源集合id</td>
</tr>
<tr>
<td>mid</td>
<td>string</td>
<td>true</td>
<td>成员id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 授权应用
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.authorizeApplications(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/batch/authz-apps
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>identities</td>
<td>array</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>application_id</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>affect</td>
<td>string</td>
<td>false</td>
<td>allow, deny</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询已授权应用列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.permission.listAuthorizedApplications(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/authz-apps
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>identity_id</td>
<td>string</td>
<td>true</td>
<td>授权主体 id</td>
</tr>
<tr>
<td>identity_type</td>
<td>string</td>
<td>true</td>
<td>授权主体类型</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>false</td>
<td>应用类型: 0-默认应用 1-自建应用 2-模板应用 3-组件应用</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
### organization
2023-12-03 21:09:35 +08:00
#### 创建组织关系
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.createOrganization(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/core-objects
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询父节点
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.getNodeParent(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/tree-nodes/{id}/parent
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 删除节点
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.deleteNode(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/tree-nodes/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<tr>
<td>object_code</td>
<td>string</td>
<td>true</td>
<td>树对象code</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 获取组织关系列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.getOrganizations(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/core-objects
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 修改组织关系基本信息
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.updateOrganization(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/core-objects/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 获取组织关系基本信息
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.getOrganization(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/core-objects/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<tr>
<td>code</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 删除组织关系
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.deleteOrganization(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/core-objects/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 添加用户到节点 TODO
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.addUserToNode(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/tree-users
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>relation_data</td>
<td>string</td>
<td>false</td>
<td>关联扩展信息</td>
</tr>
<tr>
<td>relation_type</td>
<td>string</td>
<td>false</td>
<td>用于区分多重关联</td>
</tr>
<tr>
<td>is_default</td>
<td>string</td>
<td>false</td>
<td>1是0否</td>
</tr>
<tr>
<td>node_id</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>user_ids</td>
<td>array</td>
<td>false</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 更新用户节点
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.updateMember(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/tree-users/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td></td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>is_default</td>
<td>string</td>
<td>false</td>
<td>1是0否</td>
</tr>
<tr>
<td>action</td>
<td>string</td>
<td>true</td>
<td>移动节点move, 设置为默认关系as-default</td>
</tr>
<tr>
<td>source_node_id</td>
<td>string</td>
<td>false</td>
<td>移动前节点ID</td>
</tr>
<tr>
<td>dest_node_id</td>
<td>string</td>
<td>false</td>
<td>移动后节点ID</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 获取与用户关联的组织关系列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.getMembers(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/tree-users
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>user_id</td>
<td>string</td>
<td>true</td>
<td>用户ID</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 获取成员信息列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.getNodeMembers(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/tree-nodes/{id}/tree-users
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>node id</td>
</tr>
<!-- query 参数 -->
<tr>
<td>relation_type</td>
<td>string</td>
<td>false</td>
<td>关联类型,用于区分多重关联</td>
</tr>
<tr>
<td>is_default</td>
<td>string</td>
<td>false</td>
<td>是否默认关系 1是0否</td>
</tr>
<tr>
<td>display_name</td>
<td>string</td>
<td>false</td>
<td>用户显示名</td>
</tr>
<tr>
<td>username</td>
<td>string</td>
<td>false</td>
<td>用户名,支持模糊搜索(仅前缀)</td>
</tr>
<tr>
<td>mode</td>
<td>string</td>
<td>false</td>
<td>// mode - 低-&gt;高 bit
// 第1位是否获得指针节点所对应的真实结点1-是0-否
// 第2位是否展开WeakNode即节点中类型不同的节点1-展开0-不展开
// 第3位是否递归地展开节点不建议</td>
</tr>
<tr>
<td>page_num</td>
<td>integer</td>
<td>false</td>
<td>起始页默认1</td>
</tr>
<tr>
<td>page_size</td>
<td>integer</td>
<td>false</td>
<td>页大小默认10</td>
</tr>
<tr>
<td>page_sort</td>
<td>string</td>
<td>false</td>
<td>排序方式,格式:字段[排序方式]</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 批量从组织关系中移除用户-内部使用 TODO
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.deleteNodeMembers(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/tree-nodes/{node_id}/tree-users
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>node_id</td>
<td>string</td>
<td>true</td>
<td>node id</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>ids</td>
<td>array</td>
<td>true</td>
<td></td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 从组织关系中移除用户-内部使用
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.deleteMember(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/tree-users/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>用户节点ID</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>ids</td>
<td>array</td>
<td>false</td>
<td>用户与组织的关系ID</td>
</tr>
<tr>
<td>node_id</td>
<td>string</td>
<td>false</td>
<td>节点ID</td>
</tr>
<tr>
<td>user_id</td>
<td>string</td>
<td>false</td>
<td>用户原始ID</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 从节点移除用户
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.deleteMembers(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/tree-users
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>node_id</td>
<td>string</td>
<td>false</td>
<td>节点ID</td>
</tr>
<tr>
<td>user_id</td>
<td>string</td>
<td>false</td>
<td>用户原始ID</td>
</tr>
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 创建节点
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.createNode(params) ;
```
2023-12-03 15:59:54 +08:00
POST /v1/tree-nodes
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 编辑节点
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.updateNode(params) ;
```
2023-12-03 15:59:54 +08:00
PATCH /v1/tree-nodes/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td>更新树节点</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-04 16:18:51 +08:00
#### 删除节点 TODO
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.deleteChildrenNodes(params) ;
```
2023-12-03 15:59:54 +08:00
DELETE /v1/tree-nodes/{id}/children
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<tr>
<td>object_code</td>
<td>string</td>
<td>true</td>
<td>树对象code</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询节点信息列表
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.getNodes(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/tree-nodes
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>object_code</td>
<td>string</td>
<td>true</td>
<td>创建树时的object_code</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>false</td>
<td>名字,支持前缀搜索</td>
</tr>
<tr>
<td>code</td>
<td>string</td>
<td>false</td>
<td>编号</td>
</tr>
<tr>
<td>tag</td>
<td>string</td>
<td>false</td>
<td>标签</td>
2023-12-04 16:18:51 +08:00
</tr>
<tr>
<td>time_modified_from</td>
<td>string</td>
<td>false</td>
<td>更新时间起点</td>
</tr>
<tr>
<td>time_modified_to</td>
<td>string</td>
<td>false</td>
<td>更新时间终点,默认至今</td>
2023-12-03 15:59:54 +08:00
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 查询节点信息
2023-12-03 15:59:54 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.getNode(params) ;
```
2023-12-03 15:59:54 +08:00
GET /v1/tree-nodes/{id}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
2023-12-03 21:09:35 +08:00
#### 获取子节点列表
2023-11-16 19:38:44 +08:00
2023-12-03 21:09:35 +08:00
``` js
const { data } = await op.api.organization.getChildrenNodes(params) ;
```
2023-11-16 19:38:44 +08:00
2023-12-03 15:59:54 +08:00
GET /v1/tree-nodes/{id}/children
2023-11-16 19:38:44 +08:00
2023-12-03 15:59:54 +08:00
##### param properties
2023-11-16 19:38:44 +08:00
2023-12-03 15:59:54 +08:00
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>id</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<tr>
<td>mode</td>
<td>string</td>
<td>true</td>
<td>// mode - 低-&gt;高 bit
// 第1位是否获得指针节点所对应的真实结点1-是0-否
// 第2位是否展开WeakNode即节点中类型不同的节点1-展开0-不展开
// 第3位是否递归地展开节点不建议</td>
</tr>
<tr>
<td>object_code</td>
<td>string</td>
<td>true</td>
<td>当id = 0时必填创建树时的object_code</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
2023-12-04 16:18:51 +08:00
### storage
#### 获取 Bucket 列表
``` js
const { data } = await op.api.storage.getBuckets(params) ;
```
GET /v1/buckets
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<!-- query 参数 -->
<tr>
<td>last</td>
<td>string</td>
<td>false</td>
<td>最后一个bucket的名字</td>
</tr>
<tr>
<td>limit</td>
<td>integer</td>
<td>false</td>
<td>页大小</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
#### 获取 Object 列表
``` js
const { data } = await op.api.storage.getObjects(params) ;
```
GET /v1/buckets/{bucket}/objects
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>bucket</td>
<td>string</td>
<td>true</td>
<td>bucket名称</td>
</tr>
<!-- query 参数 -->
<tr>
<td>last</td>
<td>string</td>
<td>false</td>
<td>最后一个object的名字</td>
</tr>
<tr>
<td>limit</td>
<td>integer</td>
<td>false</td>
<td>页大小</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>
#### 获取 Bucket 详情
``` js
const { data } = await op.api.storage.getBucket(params) ;
```
GET /v1/buckets/{bucket}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>bucket</td>
<td>string</td>
<td>true</td>
<td>bucket 名称</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
#### 删除 Bucket
``` js
const { data } = await op.api.storage.deleteBucket(params) ;
```
DELETE /v1/buckets/{bucket}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>bucket</td>
<td>string</td>
<td>true</td>
<td>bucket 名称</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
#### 创建 Object
``` js
const { data } = await op.api.storage.saveObject(params) ;
```
POST /v1/buckets/{bucket}/objects
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>bucket</td>
<td>string</td>
<td>true</td>
<td>bucket名称</td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
<tr>
<td>key</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>value</td>
<td>string</td>
<td>false</td>
<td></td>
</tr>
</tbody>
</table>
#### 获取 Object 详情
``` js
const { data } = await op.api.storage.getObject(params) ;
```
GET /v1/buckets/{bucket}/objects/{key}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>bucket</td>
<td>string</td>
<td>true</td>
<td>bucket名称</td>
</tr>
<tr>
<td>key</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<!-- body 参数 -->
</tbody>
</table>
#### 删除 Object
``` js
const { data } = await op.api.storage.deleteObject(params) ;
```
DELETE /v1/buckets/{bucket}/objects/{key}
##### param properties
<table class="param-table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>是否必须</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<!-- path 参数 -->
<tr>
<td>bucket</td>
<td>string</td>
<td>true</td>
<td>bucket名称</td>
</tr>
<tr>
<td>key</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<!-- query 参数 -->
<tr>
<td>key_as_prefix</td>
<td>string</td>
<td>false</td>
<td>将键名称作为前缀执行删除</td>
</tr>
<!-- body 参数 -->
</tbody>
</table>