agentbase-web-sdk 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +41 -0
  3. package/dist/cjs/sdk.js +16322 -0
  4. package/dist/cjs/sdk.js.map +1 -0
  5. package/dist/esm/sdk.js +16292 -0
  6. package/dist/esm/sdk.js.map +1 -0
  7. package/dist/iife/sdk.js +20121 -0
  8. package/package.json +54 -0
  9. package/types/channel.d.ts +79 -0
  10. package/types/client.d.ts +289 -0
  11. package/types/enums/authentication-factor.d.ts +6 -0
  12. package/types/enums/authenticator-type.d.ts +3 -0
  13. package/types/enums/browser-permission.d.ts +22 -0
  14. package/types/enums/browser.d.ts +16 -0
  15. package/types/enums/credit-card.d.ts +19 -0
  16. package/types/enums/data-api-catalog-data-source-database-type.d.ts +6 -0
  17. package/types/enums/data-api-catalog-data-source-visibility-source.d.ts +7 -0
  18. package/types/enums/data-api-catalog-database-availability.d.ts +5 -0
  19. package/types/enums/data-api-catalog-database-classification.d.ts +4 -0
  20. package/types/enums/data-api-catalog-database-status.d.ts +4 -0
  21. package/types/enums/data-api-catalog-database-visibility-source.d.ts +7 -0
  22. package/types/enums/data-api-filter-logic.d.ts +4 -0
  23. package/types/enums/data-api-owned-binding-principal-type.d.ts +4 -0
  24. package/types/enums/data-api-owned-binding-status.d.ts +4 -0
  25. package/types/enums/distillation-message-role.d.ts +6 -0
  26. package/types/enums/distillation-mode.d.ts +4 -0
  27. package/types/enums/distillation-tool-status.d.ts +4 -0
  28. package/types/enums/execution-method.d.ts +9 -0
  29. package/types/enums/execution-status.d.ts +7 -0
  30. package/types/enums/execution-trigger.d.ts +5 -0
  31. package/types/enums/export-job-mode.d.ts +4 -0
  32. package/types/enums/export-mode.d.ts +3 -0
  33. package/types/enums/feedback-type.d.ts +5 -0
  34. package/types/enums/flag.d.ts +197 -0
  35. package/types/enums/format.d.ts +4 -0
  36. package/types/enums/image-format.d.ts +9 -0
  37. package/types/enums/image-gravity.d.ts +11 -0
  38. package/types/enums/kind.d.ts +6 -0
  39. package/types/enums/kinds.d.ts +6 -0
  40. package/types/enums/knowledge-base-data-source-document-import-result-status.d.ts +5 -0
  41. package/types/enums/memory-access-mode.d.ts +4 -0
  42. package/types/enums/memory-batch-operation.d.ts +5 -0
  43. package/types/enums/memory-bulk-delete-item-status.d.ts +4 -0
  44. package/types/enums/memory-bulk-delete-response-status.d.ts +4 -0
  45. package/types/enums/memory-handling-policy.d.ts +5 -0
  46. package/types/enums/memory-message-role.d.ts +5 -0
  47. package/types/enums/memory-pipeline-run-result-status.d.ts +4 -0
  48. package/types/enums/memory-pipeline-run-scenario.d.ts +6 -0
  49. package/types/enums/memory-pipeline-run-status.d.ts +6 -0
  50. package/types/enums/memory-record-kind.d.ts +5 -0
  51. package/types/enums/memory-record-sensitivity.d.ts +5 -0
  52. package/types/enums/memory-scope.d.ts +7 -0
  53. package/types/enums/memory-sensitivity.d.ts +6 -0
  54. package/types/enums/memory-share-subject-type.d.ts +4 -0
  55. package/types/enums/method.d.ts +9 -0
  56. package/types/enums/o-auth-provider.d.ts +45 -0
  57. package/types/enums/organization-project-deletion-deletion-status.d.ts +5 -0
  58. package/types/enums/organization-role.d.ts +8 -0
  59. package/types/enums/organization-usage-range.d.ts +5 -0
  60. package/types/enums/outcome.d.ts +6 -0
  61. package/types/enums/path-match.d.ts +4 -0
  62. package/types/enums/profile-extraction-mode.d.ts +4 -0
  63. package/types/enums/profile-type.d.ts +4 -0
  64. package/types/enums/project-deletion-restore-status.d.ts +3 -0
  65. package/types/enums/project-deletion-result-deletion-status.d.ts +5 -0
  66. package/types/enums/project-deletion-result-status.d.ts +5 -0
  67. package/types/enums/record-kind.d.ts +5 -0
  68. package/types/enums/retention-policy.d.ts +3 -0
  69. package/types/enums/scenario.d.ts +6 -0
  70. package/types/enums/scene.d.ts +4 -0
  71. package/types/enums/scope.d.ts +5 -0
  72. package/types/enums/source-type.d.ts +6 -0
  73. package/types/enums/status.d.ts +23 -0
  74. package/types/enums/theme.d.ts +4 -0
  75. package/types/enums/timezone.d.ts +422 -0
  76. package/types/enums/transaction-action.d.ts +12 -0
  77. package/types/enums/validation-status.d.ts +6 -0
  78. package/types/enums/verification-source.d.ts +5 -0
  79. package/types/id.d.ts +20 -0
  80. package/types/index.d.ts +105 -0
  81. package/types/models.d.ts +3368 -0
  82. package/types/operator.d.ts +180 -0
  83. package/types/permission.d.ts +43 -0
  84. package/types/query.d.ts +442 -0
  85. package/types/role.d.ts +70 -0
  86. package/types/service.d.ts +11 -0
  87. package/types/services/account.d.ts +1350 -0
  88. package/types/services/agent-runtime.d.ts +370 -0
  89. package/types/services/ai-gateway.d.ts +888 -0
  90. package/types/services/avatars.d.ts +320 -0
  91. package/types/services/data-api.d.ts +257 -0
  92. package/types/services/databases.d.ts +441 -0
  93. package/types/services/documents-db.d.ts +409 -0
  94. package/types/services/functions.d.ts +175 -0
  95. package/types/services/graphql.d.ts +43 -0
  96. package/types/services/knowledge-bases.d.ts +304 -0
  97. package/types/services/llm-gateway.d.ts +289 -0
  98. package/types/services/locale.d.ts +64 -0
  99. package/types/services/memory.d.ts +2352 -0
  100. package/types/services/messaging.d.ts +53 -0
  101. package/types/services/projects.d.ts +129 -0
  102. package/types/services/realtime.d.ts +197 -0
  103. package/types/services/self-hosted-organizations.d.ts +495 -0
  104. package/types/services/storage.d.ts +265 -0
  105. package/types/services/tables-db.d.ts +438 -0
  106. package/types/services/teams.d.ts +341 -0
  107. package/types/services/vectors-db.d.ts +297 -0
@@ -0,0 +1,495 @@
1
+ import { Client } from '../client';
2
+ import type { Models } from '../models';
3
+ import { OrganizationRole } from '../enums/organization-role';
4
+ import { OrganizationUsageRange } from '../enums/organization-usage-range';
5
+ export declare class SelfHostedOrganizations {
6
+ client: Client;
7
+ constructor(client: Client);
8
+ /**
9
+ * 列出当前用户可访问的组织。列表、名称/ID 搜索、分页和 `total` 只包含调用者具有与
10
+ * 当前 user generation、当前 organization generation 精确匹配的 active membership
11
+ * 的组织;平台管理员身份本身不构成可见性旁路。
12
+ *
13
+ * `queries` 支持 `limit`、`offset` 和 cursor。`defaultTeamId` 可按组织的默认 Team ID
14
+ * 精确反查组织,用于兼容组织 ID 与历史 Team ID 不一致的数据。用于可见性判断的
15
+ * active membership 会用稳定 cursor 完整分页读取,不受内部默认页大小影响;
16
+ * `total=false` 时跳过总数计算并返回 `0`。
17
+ *
18
+ *
19
+ * @param {string[]} params.queries - Array of query strings generated using the Query class. Limit, offset, and cursor pagination are supported.
20
+ * @param {string} params.defaultTeamId - Filter organizations by the exact default Team ID.
21
+ * @param {string} params.search - Search organizations by ID or name.
22
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
23
+ * @throws {AgentbaseException}
24
+ * @returns {Promise<Models.SelfHostedOrganizationList>}
25
+ */
26
+ list(params?: {
27
+ queries?: string[];
28
+ defaultTeamId?: string;
29
+ search?: string;
30
+ total?: boolean;
31
+ }): Promise<Models.SelfHostedOrganizationList>;
32
+ /**
33
+ * 列出当前用户可访问的组织。列表、名称/ID 搜索、分页和 `total` 只包含调用者具有与
34
+ * 当前 user generation、当前 organization generation 精确匹配的 active membership
35
+ * 的组织;平台管理员身份本身不构成可见性旁路。
36
+ *
37
+ * `queries` 支持 `limit`、`offset` 和 cursor。`defaultTeamId` 可按组织的默认 Team ID
38
+ * 精确反查组织,用于兼容组织 ID 与历史 Team ID 不一致的数据。用于可见性判断的
39
+ * active membership 会用稳定 cursor 完整分页读取,不受内部默认页大小影响;
40
+ * `total=false` 时跳过总数计算并返回 `0`。
41
+ *
42
+ *
43
+ * @param {string[]} queries - Array of query strings generated using the Query class. Limit, offset, and cursor pagination are supported.
44
+ * @param {string} defaultTeamId - Filter organizations by the exact default Team ID.
45
+ * @param {string} search - Search organizations by ID or name.
46
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
47
+ * @throws {AgentbaseException}
48
+ * @returns {Promise<Models.SelfHostedOrganizationList>}
49
+ * @deprecated Use the object parameter style method for a better developer experience.
50
+ */
51
+ list(queries?: string[], defaultTeamId?: string, search?: string, total?: boolean): Promise<Models.SelfHostedOrganizationList>;
52
+ /**
53
+ * 创建组织,并为组织建立兼容的默认 Team。接口仅接受已认证的 Console 用户;调用者会成为组织 `owner`,不会创建无 owner 的组织。
54
+ *
55
+ * `organizationId` 支持自定义 ID,`name` 必填,`description` 可选。创建过程以事务方式写入 Organization、默认 Team 和初始成员关系,任一步失败都不会留下半成品数据。
56
+ *
57
+ *
58
+ * @param {string} params.organizationId - Organization ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
59
+ * @param {string} params.name - Organization name. Max length: 128 chars.
60
+ * @param {string} params.description - Organization description. Max length: 512 chars.
61
+ * @throws {AgentbaseException}
62
+ * @returns {Promise<Models.SelfHostedOrganization>}
63
+ */
64
+ create(params: {
65
+ organizationId: string;
66
+ name: string;
67
+ description?: string;
68
+ }): Promise<Models.SelfHostedOrganization>;
69
+ /**
70
+ * 创建组织,并为组织建立兼容的默认 Team。接口仅接受已认证的 Console 用户;调用者会成为组织 `owner`,不会创建无 owner 的组织。
71
+ *
72
+ * `organizationId` 支持自定义 ID,`name` 必填,`description` 可选。创建过程以事务方式写入 Organization、默认 Team 和初始成员关系,任一步失败都不会留下半成品数据。
73
+ *
74
+ *
75
+ * @param {string} organizationId - Organization ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
76
+ * @param {string} name - Organization name. Max length: 128 chars.
77
+ * @param {string} description - Organization description. Max length: 512 chars.
78
+ * @throws {AgentbaseException}
79
+ * @returns {Promise<Models.SelfHostedOrganization>}
80
+ * @deprecated Use the object parameter style method for a better developer experience.
81
+ */
82
+ create(organizationId: string, name: string, description?: string): Promise<Models.SelfHostedOrganization>;
83
+ /**
84
+ * 获取单个组织及其默认 Team 信息。所有调用者(包括平台管理员)只能读取自己具有
85
+ * active membership 的组织。
86
+ *
87
+ * 为避免泄露组织是否存在,非成员访问不存在或无权访问的组织时统一返回未找到。
88
+ *
89
+ *
90
+ * @param {string} params.organizationId - Organization ID.
91
+ * @throws {AgentbaseException}
92
+ * @returns {Promise<Models.SelfHostedOrganization>}
93
+ */
94
+ get(params: {
95
+ organizationId: string;
96
+ }): Promise<Models.SelfHostedOrganization>;
97
+ /**
98
+ * 获取单个组织及其默认 Team 信息。所有调用者(包括平台管理员)只能读取自己具有
99
+ * active membership 的组织。
100
+ *
101
+ * 为避免泄露组织是否存在,非成员访问不存在或无权访问的组织时统一返回未找到。
102
+ *
103
+ *
104
+ * @param {string} organizationId - Organization ID.
105
+ * @throws {AgentbaseException}
106
+ * @returns {Promise<Models.SelfHostedOrganization>}
107
+ * @deprecated Use the object parameter style method for a better developer experience.
108
+ */
109
+ get(organizationId: string): Promise<Models.SelfHostedOrganization>;
110
+ /**
111
+ * 更新组织名称或描述,并同步更新兼容默认 Team 的名称。组织 `owner`、`admin` 或平台管理员可以执行此操作。
112
+ *
113
+ * 权限会在写事务内再次校验,避免成员角色在请求处理期间变化后继续完成更新。
114
+ *
115
+ *
116
+ * @param {string} params.organizationId - Organization ID.
117
+ * @param {string} params.name - Organization name. Max length: 128 chars.
118
+ * @param {string} params.description - Organization description. Max length: 512 chars.
119
+ * @throws {AgentbaseException}
120
+ * @returns {Promise<Models.SelfHostedOrganization>}
121
+ */
122
+ update(params: {
123
+ organizationId: string;
124
+ name: string;
125
+ description?: string;
126
+ }): Promise<Models.SelfHostedOrganization>;
127
+ /**
128
+ * 更新组织名称或描述,并同步更新兼容默认 Team 的名称。组织 `owner`、`admin` 或平台管理员可以执行此操作。
129
+ *
130
+ * 权限会在写事务内再次校验,避免成员角色在请求处理期间变化后继续完成更新。
131
+ *
132
+ *
133
+ * @param {string} organizationId - Organization ID.
134
+ * @param {string} name - Organization name. Max length: 128 chars.
135
+ * @param {string} description - Organization description. Max length: 512 chars.
136
+ * @throws {AgentbaseException}
137
+ * @returns {Promise<Models.SelfHostedOrganization>}
138
+ * @deprecated Use the object parameter style method for a better developer experience.
139
+ */
140
+ update(organizationId: string, name: string, description?: string): Promise<Models.SelfHostedOrganization>;
141
+ /**
142
+ * 删除组织、兼容默认 Team 及相关成员关系。仅组织 `owner` 或平台管理员可以执行。
143
+ *
144
+ * 组织仍关联项目时删除会被拒绝,必须先删除或转移这些项目。删除过程串行化执行并在事务中再次校验权限和关联数据。
145
+ *
146
+ *
147
+ * @param {string} params.organizationId - Organization ID.
148
+ * @throws {AgentbaseException}
149
+ * @returns {Promise<{}>}
150
+ */
151
+ delete(params: {
152
+ organizationId: string;
153
+ }): Promise<{}>;
154
+ /**
155
+ * 删除组织、兼容默认 Team 及相关成员关系。仅组织 `owner` 或平台管理员可以执行。
156
+ *
157
+ * 组织仍关联项目时删除会被拒绝,必须先删除或转移这些项目。删除过程串行化执行并在事务中再次校验权限和关联数据。
158
+ *
159
+ *
160
+ * @param {string} organizationId - Organization ID.
161
+ * @throws {AgentbaseException}
162
+ * @returns {Promise<{}>}
163
+ * @deprecated Use the object parameter style method for a better developer experience.
164
+ */
165
+ delete(organizationId: string): Promise<{}>;
166
+ /**
167
+ * 列出组织审计日志。调用者必须具有与当前 user generation、当前 organization
168
+ * generation 精确匹配的 active membership,且角色为组织 `owner` 或 `admin`。无有效
169
+ * 成员关系的调用者(包括平台管理员)按组织未找到处理,其他 active 角色无权访问。
170
+ *
171
+ * `queries` 支持 `limit` 和 `offset`,`total=false` 时跳过总数计算。返回结果只包含指定组织的事件,并按最新时间优先排序。
172
+ *
173
+ *
174
+ * @param {string} params.organizationId - Organization ID.
175
+ * @param {string[]} params.queries - Array of query strings generated using the Query class. Only limit and offset are supported.
176
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
177
+ * @throws {AgentbaseException}
178
+ * @returns {Promise<Models.LogList>}
179
+ */
180
+ listLogs(params: {
181
+ organizationId: string;
182
+ queries?: string[];
183
+ total?: boolean;
184
+ }): Promise<Models.LogList>;
185
+ /**
186
+ * 列出组织审计日志。调用者必须具有与当前 user generation、当前 organization
187
+ * generation 精确匹配的 active membership,且角色为组织 `owner` 或 `admin`。无有效
188
+ * 成员关系的调用者(包括平台管理员)按组织未找到处理,其他 active 角色无权访问。
189
+ *
190
+ * `queries` 支持 `limit` 和 `offset`,`total=false` 时跳过总数计算。返回结果只包含指定组织的事件,并按最新时间优先排序。
191
+ *
192
+ *
193
+ * @param {string} organizationId - Organization ID.
194
+ * @param {string[]} queries - Array of query strings generated using the Query class. Only limit and offset are supported.
195
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
196
+ * @throws {AgentbaseException}
197
+ * @returns {Promise<Models.LogList>}
198
+ * @deprecated Use the object parameter style method for a better developer experience.
199
+ */
200
+ listLogs(organizationId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
201
+ /**
202
+ * 列出组织成员关系。调用者必须具有与当前 user generation、当前 organization
203
+ * generation 精确匹配的 active membership;组织 `owner`、`admin` 可以查看全部成员
204
+ * 关系,其他 active 成员只能查看自己的记录。无有效成员关系的调用者(包括平台管理员)
205
+ * 按组织未找到处理。
206
+ *
207
+ * 支持成员查询过滤、`search`、分页和可选总数。响应会补充用户名称、邮箱与组织名称;无对应用户记录时保留成员快照中的邮箱。
208
+ *
209
+ *
210
+ * @param {string} params.organizationId - Organization ID.
211
+ * @param {string[]} params.queries - Array of query strings generated using the Query class. You may filter by: userId, userEmail, role, status, invited, joined.
212
+ * @param {string} params.search - Search by member ID or email. Max length: 256 chars.
213
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
214
+ * @throws {AgentbaseException}
215
+ * @returns {Promise<Models.SelfHostedOrgMembershipList>}
216
+ */
217
+ listMemberships(params: {
218
+ organizationId: string;
219
+ queries?: string[];
220
+ search?: string;
221
+ total?: boolean;
222
+ }): Promise<Models.SelfHostedOrgMembershipList>;
223
+ /**
224
+ * 列出组织成员关系。调用者必须具有与当前 user generation、当前 organization
225
+ * generation 精确匹配的 active membership;组织 `owner`、`admin` 可以查看全部成员
226
+ * 关系,其他 active 成员只能查看自己的记录。无有效成员关系的调用者(包括平台管理员)
227
+ * 按组织未找到处理。
228
+ *
229
+ * 支持成员查询过滤、`search`、分页和可选总数。响应会补充用户名称、邮箱与组织名称;无对应用户记录时保留成员快照中的邮箱。
230
+ *
231
+ *
232
+ * @param {string} organizationId - Organization ID.
233
+ * @param {string[]} queries - Array of query strings generated using the Query class. You may filter by: userId, userEmail, role, status, invited, joined.
234
+ * @param {string} search - Search by member ID or email. Max length: 256 chars.
235
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
236
+ * @throws {AgentbaseException}
237
+ * @returns {Promise<Models.SelfHostedOrgMembershipList>}
238
+ * @deprecated Use the object parameter style method for a better developer experience.
239
+ */
240
+ listMemberships(organizationId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.SelfHostedOrgMembershipList>;
241
+ /**
242
+ * 邀请成员加入组织。组织 `owner` 和 `admin` 可以邀请成员,但只有 `owner` 可以授予 `owner` 角色;已验证邮箱且位于平台白名单中的平台管理员也可调用。普通 Project、Account 或 Organization API Key 不能调用组织控制面接口。
243
+ *
244
+ * `role` 支持 `owner`、`admin`、`developer`、`editor`、`analyst`、`billing`;省略时默认为最小协作权限 `developer`。只有组织 `owner` 可以显式授予 `owner` 角色。
245
+ *
246
+ * 已有账号在允许自动确认的场景会直接成为 active 成员且不会发送邀请邮件。其他场景会创建带有效期的 pending 邀请并发送接受链接;达到 `maxMembers` 或已有同邮箱/用户成员关系时请求会被拒绝。
247
+ *
248
+ *
249
+ * @param {string} params.organizationId - Organization ID.
250
+ * @param {string} params.email - Email of the member to invite.
251
+ * @param {OrganizationRole} params.role - Organization role. One of: owner, admin, developer, editor, analyst, billing.
252
+ * @param {string} params.name - Name of the invited member. Max length: 128 chars.
253
+ * @param {string} params.url - URL to redirect after accepting the invitation. Required unless an existing account is added directly.
254
+ * @throws {AgentbaseException}
255
+ * @returns {Promise<Models.SelfHostedOrgMembership>}
256
+ */
257
+ createMembership(params: {
258
+ organizationId: string;
259
+ email: string;
260
+ role?: OrganizationRole;
261
+ name?: string;
262
+ url?: string;
263
+ }): Promise<Models.SelfHostedOrgMembership>;
264
+ /**
265
+ * 邀请成员加入组织。组织 `owner` 和 `admin` 可以邀请成员,但只有 `owner` 可以授予 `owner` 角色;已验证邮箱且位于平台白名单中的平台管理员也可调用。普通 Project、Account 或 Organization API Key 不能调用组织控制面接口。
266
+ *
267
+ * `role` 支持 `owner`、`admin`、`developer`、`editor`、`analyst`、`billing`;省略时默认为最小协作权限 `developer`。只有组织 `owner` 可以显式授予 `owner` 角色。
268
+ *
269
+ * 已有账号在允许自动确认的场景会直接成为 active 成员且不会发送邀请邮件。其他场景会创建带有效期的 pending 邀请并发送接受链接;达到 `maxMembers` 或已有同邮箱/用户成员关系时请求会被拒绝。
270
+ *
271
+ *
272
+ * @param {string} organizationId - Organization ID.
273
+ * @param {string} email - Email of the member to invite.
274
+ * @param {OrganizationRole} role - Organization role. One of: owner, admin, developer, editor, analyst, billing.
275
+ * @param {string} name - Name of the invited member. Max length: 128 chars.
276
+ * @param {string} url - URL to redirect after accepting the invitation. Required unless an existing account is added directly.
277
+ * @throws {AgentbaseException}
278
+ * @returns {Promise<Models.SelfHostedOrgMembership>}
279
+ * @deprecated Use the object parameter style method for a better developer experience.
280
+ */
281
+ createMembership(organizationId: string, email: string, role?: OrganizationRole, name?: string, url?: string): Promise<Models.SelfHostedOrgMembership>;
282
+ /**
283
+ * 获取单个组织成员关系。调用者必须具有与当前 user generation、当前 organization
284
+ * generation 精确匹配的 active membership;成员可以读取自己的记录,组织 `owner`、
285
+ * `admin` 可以读取其他成员记录。无有效成员关系的调用者(包括平台管理员)按组织未找到
286
+ * 处理。
287
+ *
288
+ * 成员记录必须属于 URL 中指定的组织,否则返回成员关系未找到,防止跨组织 ID 混用。
289
+ *
290
+ *
291
+ * @param {string} params.organizationId - Organization ID.
292
+ * @param {string} params.membershipId - Membership ID.
293
+ * @throws {AgentbaseException}
294
+ * @returns {Promise<Models.SelfHostedOrgMembership>}
295
+ */
296
+ getMembership(params: {
297
+ organizationId: string;
298
+ membershipId: string;
299
+ }): Promise<Models.SelfHostedOrgMembership>;
300
+ /**
301
+ * 获取单个组织成员关系。调用者必须具有与当前 user generation、当前 organization
302
+ * generation 精确匹配的 active membership;成员可以读取自己的记录,组织 `owner`、
303
+ * `admin` 可以读取其他成员记录。无有效成员关系的调用者(包括平台管理员)按组织未找到
304
+ * 处理。
305
+ *
306
+ * 成员记录必须属于 URL 中指定的组织,否则返回成员关系未找到,防止跨组织 ID 混用。
307
+ *
308
+ *
309
+ * @param {string} organizationId - Organization ID.
310
+ * @param {string} membershipId - Membership ID.
311
+ * @throws {AgentbaseException}
312
+ * @returns {Promise<Models.SelfHostedOrgMembership>}
313
+ * @deprecated Use the object parameter style method for a better developer experience.
314
+ */
315
+ getMembership(organizationId: string, membershipId: string): Promise<Models.SelfHostedOrgMembership>;
316
+ /**
317
+ * 修改组织成员角色。组织 `owner`、`admin` 或平台管理员可以执行;`admin` 不能授予、降级或管理 `owner`。
318
+ *
319
+ * 系统不允许降级最后一个 active owner。角色更新会同步到兼容 Team 成员关系,并在组织锁和事务内重新校验权限。
320
+ *
321
+ *
322
+ * @param {string} params.organizationId - Organization ID.
323
+ * @param {string} params.membershipId - Membership ID.
324
+ * @param {OrganizationRole} params.role - New role. One of: owner, admin, developer, editor, analyst, billing.
325
+ * @throws {AgentbaseException}
326
+ * @returns {Promise<Models.SelfHostedOrgMembership>}
327
+ */
328
+ updateMembership(params: {
329
+ organizationId: string;
330
+ membershipId: string;
331
+ role: OrganizationRole;
332
+ }): Promise<Models.SelfHostedOrgMembership>;
333
+ /**
334
+ * 修改组织成员角色。组织 `owner`、`admin` 或平台管理员可以执行;`admin` 不能授予、降级或管理 `owner`。
335
+ *
336
+ * 系统不允许降级最后一个 active owner。角色更新会同步到兼容 Team 成员关系,并在组织锁和事务内重新校验权限。
337
+ *
338
+ *
339
+ * @param {string} organizationId - Organization ID.
340
+ * @param {string} membershipId - Membership ID.
341
+ * @param {OrganizationRole} role - New role. One of: owner, admin, developer, editor, analyst, billing.
342
+ * @throws {AgentbaseException}
343
+ * @returns {Promise<Models.SelfHostedOrgMembership>}
344
+ * @deprecated Use the object parameter style method for a better developer experience.
345
+ */
346
+ updateMembership(organizationId: string, membershipId: string, role: OrganizationRole): Promise<Models.SelfHostedOrgMembership>;
347
+ /**
348
+ * 移除组织成员。成员可以移除自己;组织 `owner`、`admin` 和平台管理员可以移除其他成员,但 `admin` 不能移除 `owner`。
349
+ *
350
+ * 最后一个 active owner 不能被移除。删除会同步清理兼容 Team 成员关系,并在组织锁和事务内再次校验权限。
351
+ *
352
+ *
353
+ * @param {string} params.organizationId - Organization ID.
354
+ * @param {string} params.membershipId - Membership ID.
355
+ * @throws {AgentbaseException}
356
+ * @returns {Promise<{}>}
357
+ */
358
+ deleteMembership(params: {
359
+ organizationId: string;
360
+ membershipId: string;
361
+ }): Promise<{}>;
362
+ /**
363
+ * 移除组织成员。成员可以移除自己;组织 `owner`、`admin` 和平台管理员可以移除其他成员,但 `admin` 不能移除 `owner`。
364
+ *
365
+ * 最后一个 active owner 不能被移除。删除会同步清理兼容 Team 成员关系,并在组织锁和事务内再次校验权限。
366
+ *
367
+ *
368
+ * @param {string} organizationId - Organization ID.
369
+ * @param {string} membershipId - Membership ID.
370
+ * @throws {AgentbaseException}
371
+ * @returns {Promise<{}>}
372
+ * @deprecated Use the object parameter style method for a better developer experience.
373
+ */
374
+ deleteMembership(organizationId: string, membershipId: string): Promise<{}>;
375
+ /**
376
+ * 接受组织邀请并将 pending 成员关系更新为 active。调用者必须已登录,邀请中的用户 ID 或邮箱必须与当前账号匹配,且 secret 未过期并验证通过。
377
+ *
378
+ * 接受过程会校验 `maxMembers`,同步兼容 Team 成员关系,并在用户锁、组织锁和事务内执行。重复接受本人已激活的邀请按幂等成功返回。
379
+ *
380
+ *
381
+ * @param {string} params.organizationId - Organization ID.
382
+ * @param {string} params.membershipId - Membership ID.
383
+ * @param {string} params.secret - Secret key.
384
+ * @throws {AgentbaseException}
385
+ * @returns {Promise<Models.SelfHostedOrgMembership>}
386
+ */
387
+ updateMembershipStatus(params: {
388
+ organizationId: string;
389
+ membershipId: string;
390
+ secret: string;
391
+ }): Promise<Models.SelfHostedOrgMembership>;
392
+ /**
393
+ * 接受组织邀请并将 pending 成员关系更新为 active。调用者必须已登录,邀请中的用户 ID 或邮箱必须与当前账号匹配,且 secret 未过期并验证通过。
394
+ *
395
+ * 接受过程会校验 `maxMembers`,同步兼容 Team 成员关系,并在用户锁、组织锁和事务内执行。重复接受本人已激活的邀请按幂等成功返回。
396
+ *
397
+ *
398
+ * @param {string} organizationId - Organization ID.
399
+ * @param {string} membershipId - Membership ID.
400
+ * @param {string} secret - Secret key.
401
+ * @throws {AgentbaseException}
402
+ * @returns {Promise<Models.SelfHostedOrgMembership>}
403
+ * @deprecated Use the object parameter style method for a better developer experience.
404
+ */
405
+ updateMembershipStatus(organizationId: string, membershipId: string, secret: string): Promise<Models.SelfHostedOrgMembership>;
406
+ /**
407
+ * 更新组织最大成员数 `maxMembers`。该接口仅允许已验证邮箱且位于平台白名单中的平台管理员调用;普通组织角色和 API Key 都不能修改配额。
408
+ *
409
+ * 省略 `maxMembers` 时保持当前上限不变;显式传入 `null` 时取消成员上限。非空值必须大于零且不能低于当前 active 与 pending 成员总数。检查和更新在组织锁与事务内完成。
410
+ *
411
+ *
412
+ * @param {string} params.organizationId - Organization ID.
413
+ * @param {number} params.maxMembers - Maximum member count. Null means unlimited. Must be greater than 0 if set.
414
+ * @throws {AgentbaseException}
415
+ * @returns {Promise<Models.SelfHostedOrganization>}
416
+ */
417
+ updateQuota(params: {
418
+ organizationId: string;
419
+ maxMembers?: number;
420
+ }): Promise<Models.SelfHostedOrganization>;
421
+ /**
422
+ * 更新组织最大成员数 `maxMembers`。该接口仅允许已验证邮箱且位于平台白名单中的平台管理员调用;普通组织角色和 API Key 都不能修改配额。
423
+ *
424
+ * 省略 `maxMembers` 时保持当前上限不变;显式传入 `null` 时取消成员上限。非空值必须大于零且不能低于当前 active 与 pending 成员总数。检查和更新在组织锁与事务内完成。
425
+ *
426
+ *
427
+ * @param {string} organizationId - Organization ID.
428
+ * @param {number} maxMembers - Maximum member count. Null means unlimited. Must be greater than 0 if set.
429
+ * @throws {AgentbaseException}
430
+ * @returns {Promise<Models.SelfHostedOrganization>}
431
+ * @deprecated Use the object parameter style method for a better developer experience.
432
+ */
433
+ updateQuota(organizationId: string, maxMembers?: number): Promise<Models.SelfHostedOrganization>;
434
+ /**
435
+ * 获取组织唯一规范默认 Team(`defaultTeamId` 与 `defaultTeamInternalId` 精确匹配)下
436
+ * `deletionStatus` 为空且数据库 Pool 当前可用的活动项目用量汇总;待删除或删除中项目不会进入汇总和项目明细。调用者必须具有与当前 user generation、当前 organization
437
+ * generation 精确匹配的 active membership,且角色为组织 `owner`、`admin`、
438
+ * `analyst` 或 `billing`。无有效成员关系的调用者(包括平台管理员)按组织未找到处理,
439
+ * 其他 active 角色无权访问;普通 API Key 不能调用该组织控制面接口。
440
+ *
441
+ * 接口按活动项目游标分页读取各项目自身的 `stats` 数据。尚未初始化 `stats` collection 的新项目按零用量返回;数据库连接或查询错误不会被忽略。
442
+ *
443
+ * 当权威 pool.registry 已成功读取时,引用不存在或状态为 inactive、disabled、removed 的 Pool 的项目不会进入汇总;Registry 读取失败不等同于空 Registry,此时项目数据库错误仍会返回失败,避免静默返回少算的用量。
444
+ *
445
+ * `range` 支持 `24h`、`30d` 和 `90d`,默认为 `30d`。`freshnessAt` 表示本次响应包含的最新统计更新时间;所有项目均无统计数据时该字段为 `null`。
446
+ *
447
+ *
448
+ * @param {string} params.organizationId - Organization ID.
449
+ * @param {OrganizationUsageRange} params.range - Usage stats time range.
450
+ * @throws {AgentbaseException}
451
+ * @returns {Promise<Models.SelfHostedOrganizationUsage>}
452
+ */
453
+ getUsage(params: {
454
+ organizationId: string;
455
+ range?: OrganizationUsageRange;
456
+ }): Promise<Models.SelfHostedOrganizationUsage>;
457
+ /**
458
+ * 获取组织唯一规范默认 Team(`defaultTeamId` 与 `defaultTeamInternalId` 精确匹配)下
459
+ * `deletionStatus` 为空且数据库 Pool 当前可用的活动项目用量汇总;待删除或删除中项目不会进入汇总和项目明细。调用者必须具有与当前 user generation、当前 organization
460
+ * generation 精确匹配的 active membership,且角色为组织 `owner`、`admin`、
461
+ * `analyst` 或 `billing`。无有效成员关系的调用者(包括平台管理员)按组织未找到处理,
462
+ * 其他 active 角色无权访问;普通 API Key 不能调用该组织控制面接口。
463
+ *
464
+ * 接口按活动项目游标分页读取各项目自身的 `stats` 数据。尚未初始化 `stats` collection 的新项目按零用量返回;数据库连接或查询错误不会被忽略。
465
+ *
466
+ * 当权威 pool.registry 已成功读取时,引用不存在或状态为 inactive、disabled、removed 的 Pool 的项目不会进入汇总;Registry 读取失败不等同于空 Registry,此时项目数据库错误仍会返回失败,避免静默返回少算的用量。
467
+ *
468
+ * `range` 支持 `24h`、`30d` 和 `90d`,默认为 `30d`。`freshnessAt` 表示本次响应包含的最新统计更新时间;所有项目均无统计数据时该字段为 `null`。
469
+ *
470
+ *
471
+ * @param {string} organizationId - Organization ID.
472
+ * @param {OrganizationUsageRange} range - Usage stats time range.
473
+ * @throws {AgentbaseException}
474
+ * @returns {Promise<Models.SelfHostedOrganizationUsage>}
475
+ * @deprecated Use the object parameter style method for a better developer experience.
476
+ */
477
+ getUsage(organizationId: string, range?: OrganizationUsageRange): Promise<Models.SelfHostedOrganizationUsage>;
478
+ /**
479
+ *
480
+ * @param {string} params.organizationId - Organization ID.
481
+ * @throws {AgentbaseException}
482
+ * @returns {Promise<Models.MeterUsageList>}
483
+ */
484
+ getUsageAggregates(params: {
485
+ organizationId: string;
486
+ }): Promise<Models.MeterUsageList>;
487
+ /**
488
+ *
489
+ * @param {string} organizationId - Organization ID.
490
+ * @throws {AgentbaseException}
491
+ * @returns {Promise<Models.MeterUsageList>}
492
+ * @deprecated Use the object parameter style method for a better developer experience.
493
+ */
494
+ getUsageAggregates(organizationId: string): Promise<Models.MeterUsageList>;
495
+ }