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.
- package/LICENSE +0 -0
- package/README.md +41 -0
- package/dist/cjs/sdk.js +16322 -0
- package/dist/cjs/sdk.js.map +1 -0
- package/dist/esm/sdk.js +16292 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/iife/sdk.js +20121 -0
- package/package.json +54 -0
- package/types/channel.d.ts +79 -0
- package/types/client.d.ts +289 -0
- package/types/enums/authentication-factor.d.ts +6 -0
- package/types/enums/authenticator-type.d.ts +3 -0
- package/types/enums/browser-permission.d.ts +22 -0
- package/types/enums/browser.d.ts +16 -0
- package/types/enums/credit-card.d.ts +19 -0
- package/types/enums/data-api-catalog-data-source-database-type.d.ts +6 -0
- package/types/enums/data-api-catalog-data-source-visibility-source.d.ts +7 -0
- package/types/enums/data-api-catalog-database-availability.d.ts +5 -0
- package/types/enums/data-api-catalog-database-classification.d.ts +4 -0
- package/types/enums/data-api-catalog-database-status.d.ts +4 -0
- package/types/enums/data-api-catalog-database-visibility-source.d.ts +7 -0
- package/types/enums/data-api-filter-logic.d.ts +4 -0
- package/types/enums/data-api-owned-binding-principal-type.d.ts +4 -0
- package/types/enums/data-api-owned-binding-status.d.ts +4 -0
- package/types/enums/distillation-message-role.d.ts +6 -0
- package/types/enums/distillation-mode.d.ts +4 -0
- package/types/enums/distillation-tool-status.d.ts +4 -0
- package/types/enums/execution-method.d.ts +9 -0
- package/types/enums/execution-status.d.ts +7 -0
- package/types/enums/execution-trigger.d.ts +5 -0
- package/types/enums/export-job-mode.d.ts +4 -0
- package/types/enums/export-mode.d.ts +3 -0
- package/types/enums/feedback-type.d.ts +5 -0
- package/types/enums/flag.d.ts +197 -0
- package/types/enums/format.d.ts +4 -0
- package/types/enums/image-format.d.ts +9 -0
- package/types/enums/image-gravity.d.ts +11 -0
- package/types/enums/kind.d.ts +6 -0
- package/types/enums/kinds.d.ts +6 -0
- package/types/enums/knowledge-base-data-source-document-import-result-status.d.ts +5 -0
- package/types/enums/memory-access-mode.d.ts +4 -0
- package/types/enums/memory-batch-operation.d.ts +5 -0
- package/types/enums/memory-bulk-delete-item-status.d.ts +4 -0
- package/types/enums/memory-bulk-delete-response-status.d.ts +4 -0
- package/types/enums/memory-handling-policy.d.ts +5 -0
- package/types/enums/memory-message-role.d.ts +5 -0
- package/types/enums/memory-pipeline-run-result-status.d.ts +4 -0
- package/types/enums/memory-pipeline-run-scenario.d.ts +6 -0
- package/types/enums/memory-pipeline-run-status.d.ts +6 -0
- package/types/enums/memory-record-kind.d.ts +5 -0
- package/types/enums/memory-record-sensitivity.d.ts +5 -0
- package/types/enums/memory-scope.d.ts +7 -0
- package/types/enums/memory-sensitivity.d.ts +6 -0
- package/types/enums/memory-share-subject-type.d.ts +4 -0
- package/types/enums/method.d.ts +9 -0
- package/types/enums/o-auth-provider.d.ts +45 -0
- package/types/enums/organization-project-deletion-deletion-status.d.ts +5 -0
- package/types/enums/organization-role.d.ts +8 -0
- package/types/enums/organization-usage-range.d.ts +5 -0
- package/types/enums/outcome.d.ts +6 -0
- package/types/enums/path-match.d.ts +4 -0
- package/types/enums/profile-extraction-mode.d.ts +4 -0
- package/types/enums/profile-type.d.ts +4 -0
- package/types/enums/project-deletion-restore-status.d.ts +3 -0
- package/types/enums/project-deletion-result-deletion-status.d.ts +5 -0
- package/types/enums/project-deletion-result-status.d.ts +5 -0
- package/types/enums/record-kind.d.ts +5 -0
- package/types/enums/retention-policy.d.ts +3 -0
- package/types/enums/scenario.d.ts +6 -0
- package/types/enums/scene.d.ts +4 -0
- package/types/enums/scope.d.ts +5 -0
- package/types/enums/source-type.d.ts +6 -0
- package/types/enums/status.d.ts +23 -0
- package/types/enums/theme.d.ts +4 -0
- package/types/enums/timezone.d.ts +422 -0
- package/types/enums/transaction-action.d.ts +12 -0
- package/types/enums/validation-status.d.ts +6 -0
- package/types/enums/verification-source.d.ts +5 -0
- package/types/id.d.ts +20 -0
- package/types/index.d.ts +105 -0
- package/types/models.d.ts +3368 -0
- package/types/operator.d.ts +180 -0
- package/types/permission.d.ts +43 -0
- package/types/query.d.ts +442 -0
- package/types/role.d.ts +70 -0
- package/types/service.d.ts +11 -0
- package/types/services/account.d.ts +1350 -0
- package/types/services/agent-runtime.d.ts +370 -0
- package/types/services/ai-gateway.d.ts +888 -0
- package/types/services/avatars.d.ts +320 -0
- package/types/services/data-api.d.ts +257 -0
- package/types/services/databases.d.ts +441 -0
- package/types/services/documents-db.d.ts +409 -0
- package/types/services/functions.d.ts +175 -0
- package/types/services/graphql.d.ts +43 -0
- package/types/services/knowledge-bases.d.ts +304 -0
- package/types/services/llm-gateway.d.ts +289 -0
- package/types/services/locale.d.ts +64 -0
- package/types/services/memory.d.ts +2352 -0
- package/types/services/messaging.d.ts +53 -0
- package/types/services/projects.d.ts +129 -0
- package/types/services/realtime.d.ts +197 -0
- package/types/services/self-hosted-organizations.d.ts +495 -0
- package/types/services/storage.d.ts +265 -0
- package/types/services/tables-db.d.ts +438 -0
- package/types/services/teams.d.ts +341 -0
- package/types/services/vectors-db.d.ts +297 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
import { Status } from '../enums/status';
|
|
4
|
+
export declare class KnowledgeBases {
|
|
5
|
+
client: Client;
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
/**
|
|
8
|
+
* Import the current user's Ant Documents by URL through an authorized Yuque OAuth session. No team data source is required. Document ownership uses `source=yuque:personal` for compatibility.
|
|
9
|
+
*
|
|
10
|
+
* The service resolves the session's current-user credential from encrypted private storage before requesting the Yuque Open API. If the credential is missing, was locally cancelled, was revoked at Yuque, or Yuque returns 401/403, the request fails with `knowledge_base_yuque_oauth_reauth_required` (HTTP 401); authorize again before retrying.
|
|
11
|
+
*
|
|
12
|
+
* URL rules match the team data-source import: only approved Yuque HTTPS hosts and an exact `{group}/{book}/{slug}` path are accepted. The service never fetches the pasted URL directly.
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
16
|
+
* @param {string} params.sessionId - Yuque OAuth session ID from createYuqueOAuthSession.
|
|
17
|
+
* @param {string[]} params.urls - Yuque document URLs to import. Maximum 20 URLs.
|
|
18
|
+
* @param {string} params.idempotencyKey - Optional batch idempotency key prefix.
|
|
19
|
+
* @param {string} params.versionId - Optional DRAFT Version ID. Required for writes when Versioning is ACTIVE.
|
|
20
|
+
* @throws {AgentbaseException}
|
|
21
|
+
* @returns {Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>}
|
|
22
|
+
*/
|
|
23
|
+
createYuqueDocuments(params: {
|
|
24
|
+
knowledgeBaseId: string;
|
|
25
|
+
sessionId: string;
|
|
26
|
+
urls: string[];
|
|
27
|
+
idempotencyKey?: string;
|
|
28
|
+
versionId?: string;
|
|
29
|
+
}): Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>;
|
|
30
|
+
/**
|
|
31
|
+
* Import the current user's Ant Documents by URL through an authorized Yuque OAuth session. No team data source is required. Document ownership uses `source=yuque:personal` for compatibility.
|
|
32
|
+
*
|
|
33
|
+
* The service resolves the session's current-user credential from encrypted private storage before requesting the Yuque Open API. If the credential is missing, was locally cancelled, was revoked at Yuque, or Yuque returns 401/403, the request fails with `knowledge_base_yuque_oauth_reauth_required` (HTTP 401); authorize again before retrying.
|
|
34
|
+
*
|
|
35
|
+
* URL rules match the team data-source import: only approved Yuque HTTPS hosts and an exact `{group}/{book}/{slug}` path are accepted. The service never fetches the pasted URL directly.
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
39
|
+
* @param {string} sessionId - Yuque OAuth session ID from createYuqueOAuthSession.
|
|
40
|
+
* @param {string[]} urls - Yuque document URLs to import. Maximum 20 URLs.
|
|
41
|
+
* @param {string} idempotencyKey - Optional batch idempotency key prefix.
|
|
42
|
+
* @param {string} versionId - Optional DRAFT Version ID. Required for writes when Versioning is ACTIVE.
|
|
43
|
+
* @throws {AgentbaseException}
|
|
44
|
+
* @returns {Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>}
|
|
45
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
46
|
+
*/
|
|
47
|
+
createYuqueDocuments(knowledgeBaseId: string, sessionId: string, urls: string[], idempotencyKey?: string, versionId?: string): Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete the current signed-in user's locally stored Yuque OAuth credential for this project. This endpoint is idempotent and returns `204 No Content` when no credential exists. It removes only the encrypted Agentbase copy; it does not revoke the authorization at Yuque.
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
53
|
+
* @throws {AgentbaseException}
|
|
54
|
+
* @returns {Promise<{}>}
|
|
55
|
+
*/
|
|
56
|
+
deleteYuqueOAuthCredential(params: {
|
|
57
|
+
knowledgeBaseId: string;
|
|
58
|
+
}): Promise<{}>;
|
|
59
|
+
/**
|
|
60
|
+
* Delete the current signed-in user's locally stored Yuque OAuth credential for this project. This endpoint is idempotent and returns `204 No Content` when no credential exists. It removes only the encrypted Agentbase copy; it does not revoke the authorization at Yuque.
|
|
61
|
+
*
|
|
62
|
+
*
|
|
63
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
64
|
+
* @throws {AgentbaseException}
|
|
65
|
+
* @returns {Promise<{}>}
|
|
66
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
67
|
+
*/
|
|
68
|
+
deleteYuqueOAuthCredential(knowledgeBaseId: string): Promise<{}>;
|
|
69
|
+
/**
|
|
70
|
+
* Create a short-lived Yuque OAuth session for the signed-in user's personal document import into a knowledge base.
|
|
71
|
+
*
|
|
72
|
+
* The OAuth Client ID and Client Secret must be configured for a first authorization. If the current user already has an encrypted Yuque credential in this project, the default request returns `authorized=true` and `authorizeUrl=null` without opening OAuth again. Pass optional `force=true` to start a new authorization; the old credential remains usable until the new callback succeeds. The OAuth callback state is single-use: after a callback attempt, create a new session before retrying authorization. After consent, poll `getYuqueOAuthSession` until `authorized` is true, then call `createYuqueDocuments`.
|
|
73
|
+
*
|
|
74
|
+
*
|
|
75
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
76
|
+
* @param {boolean} params.force - Ignore a saved Yuque credential and start a new OAuth authorization.
|
|
77
|
+
* @throws {AgentbaseException}
|
|
78
|
+
* @returns {Promise<{}>}
|
|
79
|
+
*/
|
|
80
|
+
createYuqueOAuthSession(params: {
|
|
81
|
+
knowledgeBaseId: string;
|
|
82
|
+
force?: boolean;
|
|
83
|
+
}): Promise<{}>;
|
|
84
|
+
/**
|
|
85
|
+
* Create a short-lived Yuque OAuth session for the signed-in user's personal document import into a knowledge base.
|
|
86
|
+
*
|
|
87
|
+
* The OAuth Client ID and Client Secret must be configured for a first authorization. If the current user already has an encrypted Yuque credential in this project, the default request returns `authorized=true` and `authorizeUrl=null` without opening OAuth again. Pass optional `force=true` to start a new authorization; the old credential remains usable until the new callback succeeds. The OAuth callback state is single-use: after a callback attempt, create a new session before retrying authorization. After consent, poll `getYuqueOAuthSession` until `authorized` is true, then call `createYuqueDocuments`.
|
|
88
|
+
*
|
|
89
|
+
*
|
|
90
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
91
|
+
* @param {boolean} force - Ignore a saved Yuque credential and start a new OAuth authorization.
|
|
92
|
+
* @throws {AgentbaseException}
|
|
93
|
+
* @returns {Promise<{}>}
|
|
94
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
95
|
+
*/
|
|
96
|
+
createYuqueOAuthSession(knowledgeBaseId: string, force?: boolean): Promise<{}>;
|
|
97
|
+
/**
|
|
98
|
+
* Return the current user's public Yuque OAuth session status (`authorized`, `scope`) without an access token. The first protected poll after a successful OAuth callback persists the token in the private encrypted credential store and removes it from the Redis session.
|
|
99
|
+
*
|
|
100
|
+
*
|
|
101
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
102
|
+
* @param {string} params.sessionId - Yuque OAuth session ID.
|
|
103
|
+
* @throws {AgentbaseException}
|
|
104
|
+
* @returns {Promise<{}>}
|
|
105
|
+
*/
|
|
106
|
+
getYuqueOAuthSession(params: {
|
|
107
|
+
knowledgeBaseId: string;
|
|
108
|
+
sessionId: string;
|
|
109
|
+
}): Promise<{}>;
|
|
110
|
+
/**
|
|
111
|
+
* Return the current user's public Yuque OAuth session status (`authorized`, `scope`) without an access token. The first protected poll after a successful OAuth callback persists the token in the private encrypted credential store and removes it from the Redis session.
|
|
112
|
+
*
|
|
113
|
+
*
|
|
114
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
115
|
+
* @param {string} sessionId - Yuque OAuth session ID.
|
|
116
|
+
* @throws {AgentbaseException}
|
|
117
|
+
* @returns {Promise<{}>}
|
|
118
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
119
|
+
*/
|
|
120
|
+
getYuqueOAuthSession(knowledgeBaseId: string, sessionId: string): Promise<{}>;
|
|
121
|
+
/**
|
|
122
|
+
* 列出当前登录用户在指定知识库中拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
123
|
+
*
|
|
124
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.read`。它只返回当前用户的 `yuque_personal` 资源,供 Console 管理;不会返回其他成员的 OAuth 绑定。响应为 `KnowledgeBaseDataSourceList`,credentials 均已脱敏。
|
|
125
|
+
*
|
|
126
|
+
*
|
|
127
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
128
|
+
* @param {string} params.versionId - Optional Version ID.
|
|
129
|
+
* @throws {AgentbaseException}
|
|
130
|
+
* @returns {Promise<Models.KnowledgeBaseDataSourceList>}
|
|
131
|
+
*/
|
|
132
|
+
listYuquePersonalDataSources(params: {
|
|
133
|
+
knowledgeBaseId: string;
|
|
134
|
+
versionId?: string;
|
|
135
|
+
}): Promise<Models.KnowledgeBaseDataSourceList>;
|
|
136
|
+
/**
|
|
137
|
+
* 列出当前登录用户在指定知识库中拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
138
|
+
*
|
|
139
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.read`。它只返回当前用户的 `yuque_personal` 资源,供 Console 管理;不会返回其他成员的 OAuth 绑定。响应为 `KnowledgeBaseDataSourceList`,credentials 均已脱敏。
|
|
140
|
+
*
|
|
141
|
+
*
|
|
142
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
143
|
+
* @param {string} versionId - Optional Version ID.
|
|
144
|
+
* @throws {AgentbaseException}
|
|
145
|
+
* @returns {Promise<Models.KnowledgeBaseDataSourceList>}
|
|
146
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
147
|
+
*/
|
|
148
|
+
listYuquePersonalDataSources(knowledgeBaseId: string, versionId?: string): Promise<Models.KnowledgeBaseDataSourceList>;
|
|
149
|
+
/**
|
|
150
|
+
* 创建当前登录用户拥有的蚂蚁文档定时数据源(API 类型为 `yuque_personal`)。
|
|
151
|
+
*
|
|
152
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。请求必须包含已授权且与当前 project、知识库和用户匹配的 `sessionId`、数据源 `name` 与 1–20 个 `urls`;可选 `syncSchedule` 为 cron 表达式,`triggerSync` 控制是否立即创建首次异步同步。
|
|
153
|
+
*
|
|
154
|
+
* 服务端从当前用户写入 owner reference,并只在 worker 运行时解析该用户的加密 OAuth credential。请求不能提供 `ownerUserId`、OAuth token、code 或 credentials;响应中的 credentials 也始终脱敏。Version DRAFT 不支持 `syncSchedule`。
|
|
155
|
+
*
|
|
156
|
+
*
|
|
157
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
158
|
+
* @param {string} params.sessionId - Authorized Yuque OAuth session ID.
|
|
159
|
+
* @param {string} params.name - Personal data source name.
|
|
160
|
+
* @param {string[]} params.urls - Personal Yuque document URLs.
|
|
161
|
+
* @param {string} params.versionId - Optional DRAFT Version ID. Required when Versioning is active.
|
|
162
|
+
* @param {string} params.syncSchedule - Optional cron schedule for automatic synchronization.
|
|
163
|
+
* @param {Status} params.status - Data source status.
|
|
164
|
+
* @param {boolean} params.triggerSync - Trigger an initial sync after creation.
|
|
165
|
+
* @throws {AgentbaseException}
|
|
166
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
167
|
+
*/
|
|
168
|
+
createYuquePersonalDataSource(params: {
|
|
169
|
+
knowledgeBaseId: string;
|
|
170
|
+
sessionId: string;
|
|
171
|
+
name: string;
|
|
172
|
+
urls: string[];
|
|
173
|
+
versionId?: string;
|
|
174
|
+
syncSchedule?: string;
|
|
175
|
+
status?: Status;
|
|
176
|
+
triggerSync?: boolean;
|
|
177
|
+
}): Promise<Models.KnowledgeBaseDataSource>;
|
|
178
|
+
/**
|
|
179
|
+
* 创建当前登录用户拥有的蚂蚁文档定时数据源(API 类型为 `yuque_personal`)。
|
|
180
|
+
*
|
|
181
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。请求必须包含已授权且与当前 project、知识库和用户匹配的 `sessionId`、数据源 `name` 与 1–20 个 `urls`;可选 `syncSchedule` 为 cron 表达式,`triggerSync` 控制是否立即创建首次异步同步。
|
|
182
|
+
*
|
|
183
|
+
* 服务端从当前用户写入 owner reference,并只在 worker 运行时解析该用户的加密 OAuth credential。请求不能提供 `ownerUserId`、OAuth token、code 或 credentials;响应中的 credentials 也始终脱敏。Version DRAFT 不支持 `syncSchedule`。
|
|
184
|
+
*
|
|
185
|
+
*
|
|
186
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
187
|
+
* @param {string} sessionId - Authorized Yuque OAuth session ID.
|
|
188
|
+
* @param {string} name - Personal data source name.
|
|
189
|
+
* @param {string[]} urls - Personal Yuque document URLs.
|
|
190
|
+
* @param {string} versionId - Optional DRAFT Version ID. Required when Versioning is active.
|
|
191
|
+
* @param {string} syncSchedule - Optional cron schedule for automatic synchronization.
|
|
192
|
+
* @param {Status} status - Data source status.
|
|
193
|
+
* @param {boolean} triggerSync - Trigger an initial sync after creation.
|
|
194
|
+
* @throws {AgentbaseException}
|
|
195
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
196
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
197
|
+
*/
|
|
198
|
+
createYuquePersonalDataSource(knowledgeBaseId: string, sessionId: string, name: string, urls: string[], versionId?: string, syncSchedule?: string, status?: Status, triggerSync?: boolean): Promise<Models.KnowledgeBaseDataSource>;
|
|
199
|
+
/**
|
|
200
|
+
* 读取当前登录用户拥有的一条蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
201
|
+
*
|
|
202
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.read`。服务端会将 source owner 与当前用户比对;不匹配时拒绝访问,不通过数据源 ID、URL 或 credentials 推断 owner。响应复用 `KnowledgeBaseDataSource`,其中 credentials 均已脱敏。
|
|
203
|
+
*
|
|
204
|
+
*
|
|
205
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
206
|
+
* @param {string} params.dataSourceId - Data source ID.
|
|
207
|
+
* @param {string} params.versionId - Optional Version ID.
|
|
208
|
+
* @throws {AgentbaseException}
|
|
209
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
210
|
+
*/
|
|
211
|
+
getYuquePersonalDataSource(params: {
|
|
212
|
+
knowledgeBaseId: string;
|
|
213
|
+
dataSourceId: string;
|
|
214
|
+
versionId?: string;
|
|
215
|
+
}): Promise<Models.KnowledgeBaseDataSource>;
|
|
216
|
+
/**
|
|
217
|
+
* 读取当前登录用户拥有的一条蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
218
|
+
*
|
|
219
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.read`。服务端会将 source owner 与当前用户比对;不匹配时拒绝访问,不通过数据源 ID、URL 或 credentials 推断 owner。响应复用 `KnowledgeBaseDataSource`,其中 credentials 均已脱敏。
|
|
220
|
+
*
|
|
221
|
+
*
|
|
222
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
223
|
+
* @param {string} dataSourceId - Data source ID.
|
|
224
|
+
* @param {string} versionId - Optional Version ID.
|
|
225
|
+
* @throws {AgentbaseException}
|
|
226
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
227
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
228
|
+
*/
|
|
229
|
+
getYuquePersonalDataSource(knowledgeBaseId: string, dataSourceId: string, versionId?: string): Promise<Models.KnowledgeBaseDataSource>;
|
|
230
|
+
/**
|
|
231
|
+
* 更新当前登录用户拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
232
|
+
*
|
|
233
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。可更新字段为 `name`、`urls`、`syncSchedule` 与 `status`;服务端验证 owner,且不允许修改 OAuth credential 或 owner reference。修改 cron、启停或清除 cron 后会同步创建、更新或移除既有 schedule。Version DRAFT 不支持 `syncSchedule`。
|
|
234
|
+
*
|
|
235
|
+
*
|
|
236
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
237
|
+
* @param {string} params.dataSourceId - Data source ID.
|
|
238
|
+
* @param {string} params.versionId - Optional DRAFT Version ID.
|
|
239
|
+
* @param {string} params.name - Personal data source name.
|
|
240
|
+
* @param {string[]} params.urls - Personal Yuque document URLs.
|
|
241
|
+
* @param {string} params.syncSchedule - Cron schedule for automatic synchronization.
|
|
242
|
+
* @param {Status} params.status - Data source status.
|
|
243
|
+
* @throws {AgentbaseException}
|
|
244
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
245
|
+
*/
|
|
246
|
+
updateYuquePersonalDataSource(params: {
|
|
247
|
+
knowledgeBaseId: string;
|
|
248
|
+
dataSourceId: string;
|
|
249
|
+
versionId?: string;
|
|
250
|
+
name?: string;
|
|
251
|
+
urls?: string[];
|
|
252
|
+
syncSchedule?: string;
|
|
253
|
+
status?: Status;
|
|
254
|
+
}): Promise<Models.KnowledgeBaseDataSource>;
|
|
255
|
+
/**
|
|
256
|
+
* 更新当前登录用户拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
257
|
+
*
|
|
258
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。可更新字段为 `name`、`urls`、`syncSchedule` 与 `status`;服务端验证 owner,且不允许修改 OAuth credential 或 owner reference。修改 cron、启停或清除 cron 后会同步创建、更新或移除既有 schedule。Version DRAFT 不支持 `syncSchedule`。
|
|
259
|
+
*
|
|
260
|
+
*
|
|
261
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
262
|
+
* @param {string} dataSourceId - Data source ID.
|
|
263
|
+
* @param {string} versionId - Optional DRAFT Version ID.
|
|
264
|
+
* @param {string} name - Personal data source name.
|
|
265
|
+
* @param {string[]} urls - Personal Yuque document URLs.
|
|
266
|
+
* @param {string} syncSchedule - Cron schedule for automatic synchronization.
|
|
267
|
+
* @param {Status} status - Data source status.
|
|
268
|
+
* @throws {AgentbaseException}
|
|
269
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
270
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
271
|
+
*/
|
|
272
|
+
updateYuquePersonalDataSource(knowledgeBaseId: string, dataSourceId: string, versionId?: string, name?: string, urls?: string[], syncSchedule?: string, status?: Status): Promise<Models.KnowledgeBaseDataSource>;
|
|
273
|
+
/**
|
|
274
|
+
* 删除当前登录用户拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
275
|
+
*
|
|
276
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。服务端验证 source owner 后删除数据源、同步历史及其定时 schedule;已经由该源导入的知识库文档不会被删除。删除操作不会删除用户的 OAuth credential。
|
|
277
|
+
*
|
|
278
|
+
*
|
|
279
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
280
|
+
* @param {string} params.dataSourceId - Data source ID.
|
|
281
|
+
* @param {string} params.versionId - Optional DRAFT Version ID.
|
|
282
|
+
* @throws {AgentbaseException}
|
|
283
|
+
* @returns {Promise<{}>}
|
|
284
|
+
*/
|
|
285
|
+
deleteYuquePersonalDataSource(params: {
|
|
286
|
+
knowledgeBaseId: string;
|
|
287
|
+
dataSourceId: string;
|
|
288
|
+
versionId?: string;
|
|
289
|
+
}): Promise<{}>;
|
|
290
|
+
/**
|
|
291
|
+
* 删除当前登录用户拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
292
|
+
*
|
|
293
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。服务端验证 source owner 后删除数据源、同步历史及其定时 schedule;已经由该源导入的知识库文档不会被删除。删除操作不会删除用户的 OAuth credential。
|
|
294
|
+
*
|
|
295
|
+
*
|
|
296
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
297
|
+
* @param {string} dataSourceId - Data source ID.
|
|
298
|
+
* @param {string} versionId - Optional DRAFT Version ID.
|
|
299
|
+
* @throws {AgentbaseException}
|
|
300
|
+
* @returns {Promise<{}>}
|
|
301
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
302
|
+
*/
|
|
303
|
+
deleteYuquePersonalDataSource(knowledgeBaseId: string, dataSourceId: string, versionId?: string): Promise<{}>;
|
|
304
|
+
}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { Client, type SseStream } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
export declare class LlmGateway {
|
|
4
|
+
client: Client;
|
|
5
|
+
constructor(client: Client);
|
|
6
|
+
/**
|
|
7
|
+
* Create a chat completion through the LLM Gateway using an OpenAI Chat Completions compatible request. The gateway routes the request by model ID to an active provider, supports optional Server-Sent Events streaming, and records project, model, and Gateway Key usage metrics.
|
|
8
|
+
*
|
|
9
|
+
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @param {string} params.model - Model ID to use for the completion.
|
|
13
|
+
* @param {object[]} params.messages - Provider-native conversation messages. Message fields are forwarded unchanged so text, multimodal, and tool-calling payloads remain supported.
|
|
14
|
+
* @param {number} params.temperature - Sampling temperature (0–2).
|
|
15
|
+
* @param {number} params.maxTokens - Maximum number of tokens to generate.
|
|
16
|
+
* @param {boolean} params.stream - Enable Server-Sent Events (SSE) streaming.
|
|
17
|
+
* @param {object[]} params.tools - OpenAI-compatible tool definitions forwarded to the provider.
|
|
18
|
+
* @param {object|string} params.toolChoice - OpenAI-compatible tool selection policy or forced function selection.
|
|
19
|
+
* @throws {AgentbaseException}
|
|
20
|
+
* @returns {Promise<{}>}
|
|
21
|
+
*/
|
|
22
|
+
createChatCompletion(params: {
|
|
23
|
+
model: string;
|
|
24
|
+
messages: object[];
|
|
25
|
+
temperature?: number;
|
|
26
|
+
maxTokens?: number;
|
|
27
|
+
stream: true;
|
|
28
|
+
tools?: object[];
|
|
29
|
+
toolChoice?: object | 'none' | 'auto' | 'required';
|
|
30
|
+
}): Promise<SseStream>;
|
|
31
|
+
createChatCompletion(params: {
|
|
32
|
+
model: string;
|
|
33
|
+
messages: object[];
|
|
34
|
+
temperature?: number;
|
|
35
|
+
maxTokens?: number;
|
|
36
|
+
stream?: boolean;
|
|
37
|
+
tools?: object[];
|
|
38
|
+
toolChoice?: object | 'none' | 'auto' | 'required';
|
|
39
|
+
}): Promise<{}>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a chat completion through the LLM Gateway using an OpenAI Chat Completions compatible request. The gateway routes the request by model ID to an active provider, supports optional Server-Sent Events streaming, and records project, model, and Gateway Key usage metrics.
|
|
42
|
+
*
|
|
43
|
+
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
44
|
+
*
|
|
45
|
+
*
|
|
46
|
+
* @param {string} model - Model ID to use for the completion.
|
|
47
|
+
* @param {object[]} messages - Provider-native conversation messages. Message fields are forwarded unchanged so text, multimodal, and tool-calling payloads remain supported.
|
|
48
|
+
* @param {number} temperature - Sampling temperature (0–2).
|
|
49
|
+
* @param {number} maxTokens - Maximum number of tokens to generate.
|
|
50
|
+
* @param {boolean} stream - Enable Server-Sent Events (SSE) streaming.
|
|
51
|
+
* @param {object[]} tools - OpenAI-compatible tool definitions forwarded to the provider.
|
|
52
|
+
* @param {object|string} toolChoice - OpenAI-compatible tool selection policy or forced function selection.
|
|
53
|
+
* @throws {AgentbaseException}
|
|
54
|
+
* @returns {Promise<{}>}
|
|
55
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
56
|
+
*/
|
|
57
|
+
createChatCompletion(model: string, messages: object[], temperature: number | undefined, maxTokens: number | undefined, stream: true, tools?: object[], toolChoice?: object | 'none' | 'auto' | 'required'): Promise<SseStream>;
|
|
58
|
+
createChatCompletion(model: string, messages: object[], temperature?: number, maxTokens?: number, stream?: boolean, tools?: object[], toolChoice?: object | 'none' | 'auto' | 'required'): Promise<{}>;
|
|
59
|
+
/**
|
|
60
|
+
* Generate embeddings for one or more input texts through the LLM Gateway. The request is routed by embedding model ID to an active provider and returns an OpenAI-compatible embeddings response with token usage. Streaming is not supported.
|
|
61
|
+
*
|
|
62
|
+
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
63
|
+
*
|
|
64
|
+
*
|
|
65
|
+
* @param {string} params.model - Model ID to use for generating embeddings.
|
|
66
|
+
* @param {string[]} params.input - Array of input texts to embed.
|
|
67
|
+
* @throws {AgentbaseException}
|
|
68
|
+
* @returns {Promise<Models.LlmGatewayEmbeddingResponse>}
|
|
69
|
+
*/
|
|
70
|
+
createEmbeddings(params: {
|
|
71
|
+
model: string;
|
|
72
|
+
input: string[];
|
|
73
|
+
}): Promise<Models.LlmGatewayEmbeddingResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* Generate embeddings for one or more input texts through the LLM Gateway. The request is routed by embedding model ID to an active provider and returns an OpenAI-compatible embeddings response with token usage. Streaming is not supported.
|
|
76
|
+
*
|
|
77
|
+
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
78
|
+
*
|
|
79
|
+
*
|
|
80
|
+
* @param {string} model - Model ID to use for generating embeddings.
|
|
81
|
+
* @param {string[]} input - Array of input texts to embed.
|
|
82
|
+
* @throws {AgentbaseException}
|
|
83
|
+
* @returns {Promise<Models.LlmGatewayEmbeddingResponse>}
|
|
84
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
85
|
+
*/
|
|
86
|
+
createEmbeddings(model: string, input: string[]): Promise<Models.LlmGatewayEmbeddingResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Create a message through the LLM Gateway using an Anthropic Messages compatible request. Anthropic-format requests prefer Anthropic providers during routing, support optional Server-Sent Events streaming, and fall back to the general model route when needed.
|
|
89
|
+
*
|
|
90
|
+
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
91
|
+
*
|
|
92
|
+
*
|
|
93
|
+
* @param {string} params.model - Model ID to use.
|
|
94
|
+
* @param {object[]} params.messages - Provider-native conversation messages. Message fields are forwarded unchanged so text, multimodal, and tool-calling payloads remain supported.
|
|
95
|
+
* @param {number} params.maxTokens - Maximum number of tokens to generate. Defaults to 1024.
|
|
96
|
+
* @param {string} params.system - System prompt. Prepended as a system-role message.
|
|
97
|
+
* @param {number} params.temperature - Sampling temperature (0–1).
|
|
98
|
+
* @param {boolean} params.stream - Enable OpenAI-compatible Server-Sent Events (SSE) streaming.
|
|
99
|
+
* @throws {AgentbaseException}
|
|
100
|
+
* @returns {Promise<{}>}
|
|
101
|
+
*/
|
|
102
|
+
createMessage(params: {
|
|
103
|
+
model: string;
|
|
104
|
+
messages: object[];
|
|
105
|
+
maxTokens: number;
|
|
106
|
+
system?: string;
|
|
107
|
+
temperature?: number;
|
|
108
|
+
stream: true;
|
|
109
|
+
}): Promise<SseStream>;
|
|
110
|
+
createMessage(params: {
|
|
111
|
+
model: string;
|
|
112
|
+
messages: object[];
|
|
113
|
+
maxTokens: number;
|
|
114
|
+
system?: string;
|
|
115
|
+
temperature?: number;
|
|
116
|
+
stream?: boolean;
|
|
117
|
+
}): Promise<{}>;
|
|
118
|
+
/**
|
|
119
|
+
* Create a message through the LLM Gateway using an Anthropic Messages compatible request. Anthropic-format requests prefer Anthropic providers during routing, support optional Server-Sent Events streaming, and fall back to the general model route when needed.
|
|
120
|
+
*
|
|
121
|
+
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
122
|
+
*
|
|
123
|
+
*
|
|
124
|
+
* @param {string} model - Model ID to use.
|
|
125
|
+
* @param {object[]} messages - Provider-native conversation messages. Message fields are forwarded unchanged so text, multimodal, and tool-calling payloads remain supported.
|
|
126
|
+
* @param {number} maxTokens - Maximum number of tokens to generate. Defaults to 1024.
|
|
127
|
+
* @param {string} system - System prompt. Prepended as a system-role message.
|
|
128
|
+
* @param {number} temperature - Sampling temperature (0–1).
|
|
129
|
+
* @param {boolean} stream - Enable OpenAI-compatible Server-Sent Events (SSE) streaming.
|
|
130
|
+
* @throws {AgentbaseException}
|
|
131
|
+
* @returns {Promise<{}>}
|
|
132
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
133
|
+
*/
|
|
134
|
+
createMessage(model: string, messages: object[], maxTokens: number, system: string | undefined, temperature: number | undefined, stream: true): Promise<SseStream>;
|
|
135
|
+
createMessage(model: string, messages: object[], maxTokens: number, system?: string, temperature?: number, stream?: boolean): Promise<{}>;
|
|
136
|
+
/**
|
|
137
|
+
* Get a list of models available through the configured and active LLM Gateway providers. The response deduplicates configured model IDs and includes provider ownership, capabilities, and active status.
|
|
138
|
+
*
|
|
139
|
+
*
|
|
140
|
+
* @throws {AgentbaseException}
|
|
141
|
+
* @returns {Promise<Models.LlmGatewayModelList>}
|
|
142
|
+
*/
|
|
143
|
+
listModels(): Promise<Models.LlmGatewayModelList>;
|
|
144
|
+
/**
|
|
145
|
+
* Get details for a specific model available through the LLM Gateway. The model must be declared by an active provider, either as an exact supported model ID or through a wildcard provider route.
|
|
146
|
+
*
|
|
147
|
+
*
|
|
148
|
+
* @param {string} params.modelId - Model ID.
|
|
149
|
+
* @throws {AgentbaseException}
|
|
150
|
+
* @returns {Promise<Models.LlmGatewayModel>}
|
|
151
|
+
*/
|
|
152
|
+
getModel(params: {
|
|
153
|
+
modelId: string;
|
|
154
|
+
}): Promise<Models.LlmGatewayModel>;
|
|
155
|
+
/**
|
|
156
|
+
* Get details for a specific model available through the LLM Gateway. The model must be declared by an active provider, either as an exact supported model ID or through a wildcard provider route.
|
|
157
|
+
*
|
|
158
|
+
*
|
|
159
|
+
* @param {string} modelId - Model ID.
|
|
160
|
+
* @throws {AgentbaseException}
|
|
161
|
+
* @returns {Promise<Models.LlmGatewayModel>}
|
|
162
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
163
|
+
*/
|
|
164
|
+
getModel(modelId: string): Promise<Models.LlmGatewayModel>;
|
|
165
|
+
/**
|
|
166
|
+
* Rerank documents by relevance to a query through the LLM Gateway. The response returns ranked document indexes, relevance scores, optional document text, and token usage for the rerank request. Streaming is not supported.
|
|
167
|
+
*
|
|
168
|
+
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
169
|
+
*
|
|
170
|
+
* 可选字符串 `instruct` 为原生排序任务说明,最长 65536 UTF-8 字节,拒绝纯空白和非法控制字符。省略或传空字符串时不发送该参数,保持默认行为。支持百炼 DashScope 的 `qwen3.7-text-rerank`、`qwen3-rerank` 和 `qwen3-vl-rerank`;非空值使用原生 `parameters.instruct`,`input.query` 和 `input.documents` 保持原文。不支持的 Provider 或模型返回参数错误,不会静默忽略。说明会计入试用额度预估;不影响原有超时、限流及结果索引校验。
|
|
171
|
+
*
|
|
172
|
+
*
|
|
173
|
+
* @param {string} params.model - Rerank model ID.
|
|
174
|
+
* @param {string} params.query - Query text to rank documents against.
|
|
175
|
+
* @param {string[]} params.documents - Documents to rerank.
|
|
176
|
+
* @param {number} params.topN - Return only the top N results.
|
|
177
|
+
* @param {boolean} params.returnDocuments - Include document text in the response.
|
|
178
|
+
* @param {string} params.instruct - Optional native sorting instruction for supported DashScope rerank models. Empty omits the instruction.
|
|
179
|
+
* @throws {AgentbaseException}
|
|
180
|
+
* @returns {Promise<Models.LlmGatewayRerankResponse>}
|
|
181
|
+
*/
|
|
182
|
+
createRerank(params: {
|
|
183
|
+
model: string;
|
|
184
|
+
query: string;
|
|
185
|
+
documents: string[];
|
|
186
|
+
topN?: number;
|
|
187
|
+
returnDocuments?: boolean;
|
|
188
|
+
instruct?: string;
|
|
189
|
+
}): Promise<Models.LlmGatewayRerankResponse>;
|
|
190
|
+
/**
|
|
191
|
+
* Rerank documents by relevance to a query through the LLM Gateway. The response returns ranked document indexes, relevance scores, optional document text, and token usage for the rerank request. Streaming is not supported.
|
|
192
|
+
*
|
|
193
|
+
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
194
|
+
*
|
|
195
|
+
* 可选字符串 `instruct` 为原生排序任务说明,最长 65536 UTF-8 字节,拒绝纯空白和非法控制字符。省略或传空字符串时不发送该参数,保持默认行为。支持百炼 DashScope 的 `qwen3.7-text-rerank`、`qwen3-rerank` 和 `qwen3-vl-rerank`;非空值使用原生 `parameters.instruct`,`input.query` 和 `input.documents` 保持原文。不支持的 Provider 或模型返回参数错误,不会静默忽略。说明会计入试用额度预估;不影响原有超时、限流及结果索引校验。
|
|
196
|
+
*
|
|
197
|
+
*
|
|
198
|
+
* @param {string} model - Rerank model ID.
|
|
199
|
+
* @param {string} query - Query text to rank documents against.
|
|
200
|
+
* @param {string[]} documents - Documents to rerank.
|
|
201
|
+
* @param {number} topN - Return only the top N results.
|
|
202
|
+
* @param {boolean} returnDocuments - Include document text in the response.
|
|
203
|
+
* @param {string} instruct - Optional native sorting instruction for supported DashScope rerank models. Empty omits the instruction.
|
|
204
|
+
* @throws {AgentbaseException}
|
|
205
|
+
* @returns {Promise<Models.LlmGatewayRerankResponse>}
|
|
206
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
207
|
+
*/
|
|
208
|
+
createRerank(model: string, query: string, documents: string[], topN?: number, returnDocuments?: boolean, instruct?: string): Promise<Models.LlmGatewayRerankResponse>;
|
|
209
|
+
/**
|
|
210
|
+
*
|
|
211
|
+
* @throws {AgentbaseException}
|
|
212
|
+
* @returns {Promise<{}>}
|
|
213
|
+
*/
|
|
214
|
+
listTrialProviderBindings(): Promise<{}>;
|
|
215
|
+
/**
|
|
216
|
+
*
|
|
217
|
+
* @param {string} params.providerId - Platform provider ID.
|
|
218
|
+
* @throws {AgentbaseException}
|
|
219
|
+
* @returns {Promise<{}>}
|
|
220
|
+
*/
|
|
221
|
+
createTrialProviderBinding(params: {
|
|
222
|
+
providerId: string;
|
|
223
|
+
}): Promise<{}>;
|
|
224
|
+
/**
|
|
225
|
+
*
|
|
226
|
+
* @param {string} providerId - Platform provider ID.
|
|
227
|
+
* @throws {AgentbaseException}
|
|
228
|
+
* @returns {Promise<{}>}
|
|
229
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
230
|
+
*/
|
|
231
|
+
createTrialProviderBinding(providerId: string): Promise<{}>;
|
|
232
|
+
/**
|
|
233
|
+
*
|
|
234
|
+
* @param {string} params.bindingId - Trial provider binding ID.
|
|
235
|
+
* @throws {AgentbaseException}
|
|
236
|
+
* @returns {Promise<{}>}
|
|
237
|
+
*/
|
|
238
|
+
getTrialProviderBinding(params: {
|
|
239
|
+
bindingId: string;
|
|
240
|
+
}): Promise<{}>;
|
|
241
|
+
/**
|
|
242
|
+
*
|
|
243
|
+
* @param {string} bindingId - Trial provider binding ID.
|
|
244
|
+
* @throws {AgentbaseException}
|
|
245
|
+
* @returns {Promise<{}>}
|
|
246
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
247
|
+
*/
|
|
248
|
+
getTrialProviderBinding(bindingId: string): Promise<{}>;
|
|
249
|
+
/**
|
|
250
|
+
*
|
|
251
|
+
* @param {string} params.bindingId - Trial provider binding ID.
|
|
252
|
+
* @throws {AgentbaseException}
|
|
253
|
+
* @returns {Promise<{}>}
|
|
254
|
+
*/
|
|
255
|
+
deleteTrialProviderBinding(params: {
|
|
256
|
+
bindingId: string;
|
|
257
|
+
}): Promise<{}>;
|
|
258
|
+
/**
|
|
259
|
+
*
|
|
260
|
+
* @param {string} bindingId - Trial provider binding ID.
|
|
261
|
+
* @throws {AgentbaseException}
|
|
262
|
+
* @returns {Promise<{}>}
|
|
263
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
264
|
+
*/
|
|
265
|
+
deleteTrialProviderBinding(bindingId: string): Promise<{}>;
|
|
266
|
+
/**
|
|
267
|
+
*
|
|
268
|
+
* @param {string} params.bindingId - Trial provider binding ID.
|
|
269
|
+
* @throws {AgentbaseException}
|
|
270
|
+
* @returns {Promise<{}>}
|
|
271
|
+
*/
|
|
272
|
+
createTrialProviderBindingHealthCheck(params: {
|
|
273
|
+
bindingId: string;
|
|
274
|
+
}): Promise<{}>;
|
|
275
|
+
/**
|
|
276
|
+
*
|
|
277
|
+
* @param {string} bindingId - Trial provider binding ID.
|
|
278
|
+
* @throws {AgentbaseException}
|
|
279
|
+
* @returns {Promise<{}>}
|
|
280
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
281
|
+
*/
|
|
282
|
+
createTrialProviderBindingHealthCheck(bindingId: string): Promise<{}>;
|
|
283
|
+
/**
|
|
284
|
+
*
|
|
285
|
+
* @throws {AgentbaseException}
|
|
286
|
+
* @returns {Promise<{}>}
|
|
287
|
+
*/
|
|
288
|
+
listTrialProviders(): Promise<{}>;
|
|
289
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
export declare class Locale {
|
|
4
|
+
client: Client;
|
|
5
|
+
constructor(client: Client);
|
|
6
|
+
/**
|
|
7
|
+
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
|
8
|
+
*
|
|
9
|
+
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
|
10
|
+
*
|
|
11
|
+
* @throws {AgentbaseException}
|
|
12
|
+
* @returns {Promise<Models.Locale>}
|
|
13
|
+
*/
|
|
14
|
+
get(): Promise<Models.Locale>;
|
|
15
|
+
/**
|
|
16
|
+
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
17
|
+
*
|
|
18
|
+
* @throws {AgentbaseException}
|
|
19
|
+
* @returns {Promise<Models.LocaleCodeList>}
|
|
20
|
+
*/
|
|
21
|
+
listCodes(): Promise<Models.LocaleCodeList>;
|
|
22
|
+
/**
|
|
23
|
+
* List of all continents. You can use the locale header to get the data in a supported language.
|
|
24
|
+
*
|
|
25
|
+
* @throws {AgentbaseException}
|
|
26
|
+
* @returns {Promise<Models.ContinentList>}
|
|
27
|
+
*/
|
|
28
|
+
listContinents(): Promise<Models.ContinentList>;
|
|
29
|
+
/**
|
|
30
|
+
* List of all countries. You can use the locale header to get the data in a supported language.
|
|
31
|
+
*
|
|
32
|
+
* @throws {AgentbaseException}
|
|
33
|
+
* @returns {Promise<Models.CountryList>}
|
|
34
|
+
*/
|
|
35
|
+
listCountries(): Promise<Models.CountryList>;
|
|
36
|
+
/**
|
|
37
|
+
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
|
38
|
+
*
|
|
39
|
+
* @throws {AgentbaseException}
|
|
40
|
+
* @returns {Promise<Models.CountryList>}
|
|
41
|
+
*/
|
|
42
|
+
listCountriesEU(): Promise<Models.CountryList>;
|
|
43
|
+
/**
|
|
44
|
+
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
|
45
|
+
*
|
|
46
|
+
* @throws {AgentbaseException}
|
|
47
|
+
* @returns {Promise<Models.PhoneList>}
|
|
48
|
+
*/
|
|
49
|
+
listCountriesPhones(): Promise<Models.PhoneList>;
|
|
50
|
+
/**
|
|
51
|
+
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
|
52
|
+
*
|
|
53
|
+
* @throws {AgentbaseException}
|
|
54
|
+
* @returns {Promise<Models.CurrencyList>}
|
|
55
|
+
*/
|
|
56
|
+
listCurrencies(): Promise<Models.CurrencyList>;
|
|
57
|
+
/**
|
|
58
|
+
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
|
59
|
+
*
|
|
60
|
+
* @throws {AgentbaseException}
|
|
61
|
+
* @returns {Promise<Models.LanguageList>}
|
|
62
|
+
*/
|
|
63
|
+
listLanguages(): Promise<Models.LanguageList>;
|
|
64
|
+
}
|