feat: update op.api doc

This commit is contained in:
miaosiyu 2023-12-04 16:18:51 +08:00
parent 16a1f5d26f
commit 038ca46972
1 changed files with 421 additions and 81 deletions

502
op/API.md
View File

@ -144,12 +144,6 @@ POST /v1/users
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>职位</td> <td>职位</td>
</tr>
<tr>
<td>ext_prop</td>
<td>json</td>
<td>false</td>
<td>扩展信息json对象{&#34;age&#34;: 18, &#34;love&#34;: &#34;足球&#34;}</td>
</tr> </tr>
<tr> <tr>
<td>status</td> <td>status</td>
@ -166,7 +160,7 @@ POST /v1/users
<tr> <tr>
<td>idp_config_id</td> <td>idp_config_id</td>
<td>number</td> <td>number</td>
<td>false</td> <td>true</td>
<td>身份源ID作为创建时记录不做更新</td> <td>身份源ID作为创建时记录不做更新</td>
</tr> </tr>
<tr> <tr>
@ -174,12 +168,24 @@ POST /v1/users
<td>boolean</td> <td>boolean</td>
<td>false</td> <td>false</td>
<td>是否通知默认不传false不通知true通知</td> <td>是否通知默认不传false不通知true通知</td>
</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>
</tr> </tr>
</tbody> </tbody>
</table> </table>
#### 锁定用户 #### 锁定用户(旧)
``` js ``` js
const { data } = await op.api.user.disable(params) ; const { data } = await op.api.user.disable(params) ;
@ -212,7 +218,7 @@ PATCH /v1/users/{id}/disable
</table> </table>
#### 解锁用户 #### 解锁用户(旧)
``` js ``` js
const { data } = await op.api.user.enable(params) ; const { data } = await op.api.user.enable(params) ;
@ -245,7 +251,7 @@ PATCH /v1/users/{id}/enable
</table> </table>
#### 批量锁定用户 #### 批量锁定用户(旧)
``` js ``` js
const { data } = await op.api.user.batchDisable(params) ; const { data } = await op.api.user.batchDisable(params) ;
@ -278,7 +284,7 @@ POST /v1/jobs/users-disable
</table> </table>
#### 批量解锁用户 #### 批量解锁用户(旧)
``` js ``` js
const { data } = await op.api.user.batchEnable(params) ; const { data } = await op.api.user.batchEnable(params) ;
@ -429,12 +435,6 @@ PATCH /v1/users/{id}
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>职位</td> <td>职位</td>
</tr>
<tr>
<td>ext_prop</td>
<td>json</td>
<td>false</td>
<td>扩展信息json对象{&#34;age&#34;: 18, &#34;love&#34;: &#34;足球&#34;}</td>
</tr> </tr>
<tr> <tr>
<td>last_login_ipaddr</td> <td>last_login_ipaddr</td>
@ -447,6 +447,18 @@ PATCH /v1/users/{id}
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>上次登录时间</td> <td>上次登录时间</td>
</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>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -485,7 +497,7 @@ DELETE /v1/users/{id}
</table> </table>
#### 批量删除用户 #### 批量删除用户(旧)
``` js ``` js
const { data } = await op.api.user.batchDelete(params) ; const { data } = await op.api.user.batchDelete(params) ;
@ -556,13 +568,25 @@ GET /v1/users
<td>search_type</td> <td>search_type</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>默认按用户字段搜索,当值为generic时全文检索</td> <td>默认按用户基础字段搜索;当值为generic时全文检索</td>
</tr> </tr>
<tr> <tr>
<td>keyword</td> <td>keyword</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>检索值</td> <td>检索值</td>
</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>
</tr> </tr>
<!-- body 参数 --> <!-- body 参数 -->
</tbody> </tbody>
@ -602,7 +626,7 @@ GET /v1/users/{id}
</table> </table>
#### 修改密码 #### 修改密码(旧)
``` js ``` js
const { data } = await op.api.user.modifyPassword(params) ; const { data } = await op.api.user.modifyPassword(params) ;
@ -874,91 +898,97 @@ POST /v1/applications
<td>name</td> <td>name</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用名称</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>type</td> <td>type</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用类型1自建应用2模板应用市场应用</td> <td>1自建应用2模板应用市场应用</td>
</tr> </tr>
<tr> <tr>
<td>template_id</td> <td>template_id</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>模板id不填写则代表自建应用</td> <td>不填写则代表自建应用</td>
</tr> </tr>
<tr> <tr>
<td>category</td> <td>category</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用分类,1 标准web应用2单页web应用3客户端应用4后端服务</td> <td>1 标准web应用2单页web应用3客户端应用4后端服务</td>
</tr> </tr>
<tr> <tr>
<td>descr</td> <td>descr</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用描述</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>logo</td> <td>logo</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>logo路径格式为http://ip:port/logo.png</td> <td>格式为http://ip:port/logo.png</td>
</tr> </tr>
<tr> <tr>
<td>login_url</td> <td>login_url</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>登录路径</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>redirect_url</td> <td>redirect_url</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>重定向路径</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>logout_url</td> <td>logout_url</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>登出路径</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>sub_account_policy</td> <td>sub_account_policy</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>子账号策略1启用0不启用启用后单点登录返回</td> <td>1启用0不启用启用后单点登录返回</td>
</tr>
<tr>
<td>prop</td>
<td>object</td>
<td>false</td>
<td>kv字典数据</td>
</tr> </tr>
<tr> <tr>
<td>protocol_type</td> <td>protocol_type</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>如果不传默认是oidc</td> <td>默认 oidc</td>
</tr> </tr>
<tr> <tr>
<td>protocol_prop</td> <td>protocol_prop</td>
<td>object</td> <td>object</td>
<td>false</td> <td>false</td>
<td>单点登录协议属性如果不存在则为oidc的配置</td> <td>默认 oidc 相关配置</td>
</tr> </tr>
<tr> <tr>
<td>config_prop</td> <td>config_prop</td>
<td>object</td> <td>object</td>
<td>false</td> <td>false</td>
<td>应用配置属性</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>domain_sn</td> <td>domain_sn</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>域名</td> <td>域名</td>
</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>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -997,73 +1027,67 @@ PATCH /v1/applications/{id}
<td>name</td> <td>name</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用名称</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>type</td> <td>type</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用类型,1自建应用2市场应用</td> <td>1自建应用2市场应用</td>
</tr> </tr>
<tr> <tr>
<td>app_id</td> <td>app_id</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用key</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>app_secret</td> <td>app_secret</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用secret拥有管理员权限时返回</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>category</td> <td>category</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用分类</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>descr</td> <td>descr</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用描述</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>logo</td> <td>logo</td>
<td>null</td> <td>null</td>
<td>false</td> <td>false</td>
<td>logo路径</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>login_url</td> <td>login_url</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>登录路径</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>redirect_url</td> <td>redirect_url</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>重定向路径</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>logout_url</td> <td>logout_url</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>登出路径</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>sub_account_policy</td> <td>sub_account_policy</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>子账号策略</td> <td></td>
</tr>
<tr>
<td>prop</td>
<td>object</td>
<td>false</td>
<td>扩展属性</td>
</tr> </tr>
<tr> <tr>
<td>status</td> <td>status</td>
@ -1075,7 +1099,19 @@ PATCH /v1/applications/{id}
<td>domain_sn</td> <td>domain_sn</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用 Domain SN</td> <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>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1469,7 +1505,7 @@ PATCH /v1/applications/{id}/configs
</tr> </tr>
<tr> <tr>
<td>reg_policy</td> <td>reg_policy</td>
<td>string</td> <td>array</td>
<td>false</td> <td>false</td>
<td>新用户注册策略是否允许自动注册注册验证方式等1是2否,</td> <td>新用户注册策略是否允许自动注册注册验证方式等1是2否,</td>
</tr> </tr>
@ -1933,55 +1969,61 @@ POST /v1/applications/{id}/accounts
<td>user_id</td> <td>user_id</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>用户唯一标识</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>app_id</td> <td>app_id</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用唯一标识</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_name</td> <td>acc_name</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>帐号名</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_name_displayed</td> <td>acc_name_displayed</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>显示名</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_source</td> <td>acc_source</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>帐号来源</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_password</td> <td>acc_password</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>帐号密码</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_status</td> <td>acc_status</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>帐号状态,1启用0禁用</td> <td>1启用0禁用</td>
</tr> </tr>
<tr> <tr>
<td>acc_prop</td> <td>sys_ext_props</td>
<td>object</td> <td>object</td>
<td>false</td> <td>false</td>
<td>扩展属性</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>usernmae</td> <td>free_ext_props</td>
<td>object</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>username</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>用户名称</td> <td></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -2026,49 +2068,55 @@ PUT /v1/applications/{app_id}/accounts/{id}
<td>user_id</td> <td>user_id</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>用户唯一标识</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>app_id</td> <td>app_id</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>应用唯一标识</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_name</td> <td>acc_name</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>帐号名</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_name_displayed</td> <td>acc_name_displayed</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>显示名</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_source</td> <td>acc_source</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>帐号来源</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_password</td> <td>acc_password</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>密码</td> <td></td>
</tr> </tr>
<tr> <tr>
<td>acc_status</td> <td>acc_status</td>
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>状态,1启用0禁用</td> <td>1启用0禁用</td>
</tr> </tr>
<tr> <tr>
<td>acc_prop</td> <td>sys_ext_props</td>
<td>object</td> <td>object</td>
<td>false</td> <td>false</td>
<td>扩展属性</td> <td></td>
</tr>
<tr>
<td>free_ext_props</td>
<td>object</td>
<td>false</td>
<td></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -3828,7 +3876,7 @@ DELETE /v1/core-objects/{id}
</table> </table>
#### 添加用户到节点 #### 添加用户到节点 TODO
``` js ``` js
const { data } = await op.api.organization.addUserToNode(params) ; const { data } = await op.api.organization.addUserToNode(params) ;
@ -4059,7 +4107,7 @@ GET /v1/tree-nodes/{id}/tree-users
</table> </table>
#### 批量从组织关系中移除用户-内部使用 #### 批量从组织关系中移除用户-内部使用 TODO
``` js ``` js
const { data } = await op.api.organization.deleteNodeMembers(params) ; const { data } = await op.api.organization.deleteNodeMembers(params) ;
@ -4248,7 +4296,7 @@ PATCH /v1/tree-nodes/{id}
</table> </table>
#### 删除节点 #### 删除节点 TODO
``` js ``` js
const { data } = await op.api.organization.deleteChildrenNodes(params) ; const { data } = await op.api.organization.deleteChildrenNodes(params) ;
@ -4332,6 +4380,18 @@ GET /v1/tree-nodes
<td>string</td> <td>string</td>
<td>false</td> <td>false</td>
<td>标签</td> <td>标签</td>
</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>
</tr> </tr>
<!-- body 参数 --> <!-- body 参数 -->
</tbody> </tbody>
@ -4417,3 +4477,283 @@ GET /v1/tree-nodes/{id}/children
<!-- body 参数 --> <!-- body 参数 -->
</tbody> </tbody>
</table> </table>
### 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>