agentbase-web-sdk 2.6.0-fix1
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 +13833 -0
- package/dist/cjs/sdk.js.map +1 -0
- package/dist/esm/sdk.js +13805 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/iife/sdk.js +17632 -0
- package/package.json +50 -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/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-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/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/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/scope.d.ts +5 -0
- package/types/enums/source-type.d.ts +6 -0
- package/types/enums/status.d.ts +17 -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 +87 -0
- package/types/models.d.ts +2537 -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 +1267 -0
- package/types/services/ai-gateway.d.ts +738 -0
- package/types/services/avatars.d.ts +320 -0
- package/types/services/databases.d.ts +437 -0
- package/types/services/documents-db.d.ts +405 -0
- package/types/services/functions.d.ts +91 -0
- package/types/services/graphql.d.ts +43 -0
- package/types/services/knowledge-bases.d.ts +117 -0
- package/types/services/llm-gateway.d.ts +282 -0
- package/types/services/locale.d.ts +64 -0
- package/types/services/memory.d.ts +1765 -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 +259 -0
- package/types/services/tables-db.d.ts +434 -0
- package/types/services/teams.d.ts +341 -0
- package/types/services/vectors-db.d.ts +297 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
export declare class Teams {
|
|
4
|
+
client: Client;
|
|
5
|
+
constructor(client: Client);
|
|
6
|
+
/**
|
|
7
|
+
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
|
8
|
+
*
|
|
9
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
|
10
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
11
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
12
|
+
* @throws {AgentbaseException}
|
|
13
|
+
* @returns {Promise<Models.TeamList<Preferences>>}
|
|
14
|
+
*/
|
|
15
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params?: {
|
|
16
|
+
queries?: string[];
|
|
17
|
+
search?: string;
|
|
18
|
+
total?: boolean;
|
|
19
|
+
}): Promise<Models.TeamList<Preferences>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
|
22
|
+
*
|
|
23
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
|
24
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
25
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
26
|
+
* @throws {AgentbaseException}
|
|
27
|
+
* @returns {Promise<Models.TeamList<Preferences>>}
|
|
28
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
29
|
+
*/
|
|
30
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string, total?: boolean): Promise<Models.TeamList<Preferences>>;
|
|
31
|
+
/**
|
|
32
|
+
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} params.teamId - Team 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.
|
|
35
|
+
* @param {string} params.name - Team name. Max length: 128 chars.
|
|
36
|
+
* @param {string[]} params.roles - Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions]([HOSTNAME]/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
|
37
|
+
* @throws {AgentbaseException}
|
|
38
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
39
|
+
*/
|
|
40
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
41
|
+
teamId: string;
|
|
42
|
+
name: string;
|
|
43
|
+
roles?: string[];
|
|
44
|
+
}): Promise<Models.Team<Preferences>>;
|
|
45
|
+
/**
|
|
46
|
+
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} teamId - Team 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.
|
|
49
|
+
* @param {string} name - Team name. Max length: 128 chars.
|
|
50
|
+
* @param {string[]} roles - Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions]([HOSTNAME]/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
|
51
|
+
* @throws {AgentbaseException}
|
|
52
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
53
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
54
|
+
*/
|
|
55
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>>;
|
|
56
|
+
/**
|
|
57
|
+
* Get a team by its ID. All team members have read access for this resource.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} params.teamId - Team ID.
|
|
60
|
+
* @throws {AgentbaseException}
|
|
61
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
62
|
+
*/
|
|
63
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
64
|
+
teamId: string;
|
|
65
|
+
}): Promise<Models.Team<Preferences>>;
|
|
66
|
+
/**
|
|
67
|
+
* Get a team by its ID. All team members have read access for this resource.
|
|
68
|
+
*
|
|
69
|
+
* @param {string} teamId - Team ID.
|
|
70
|
+
* @throws {AgentbaseException}
|
|
71
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
72
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
73
|
+
*/
|
|
74
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Models.Team<Preferences>>;
|
|
75
|
+
/**
|
|
76
|
+
* Update the team's name by its unique ID.
|
|
77
|
+
*
|
|
78
|
+
* @param {string} params.teamId - Team ID.
|
|
79
|
+
* @param {string} params.name - New team name. Max length: 128 chars.
|
|
80
|
+
* @throws {AgentbaseException}
|
|
81
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
82
|
+
*/
|
|
83
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
84
|
+
teamId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
}): Promise<Models.Team<Preferences>>;
|
|
87
|
+
/**
|
|
88
|
+
* Update the team's name by its unique ID.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} teamId - Team ID.
|
|
91
|
+
* @param {string} name - New team name. Max length: 128 chars.
|
|
92
|
+
* @throws {AgentbaseException}
|
|
93
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
94
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
95
|
+
*/
|
|
96
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string): Promise<Models.Team<Preferences>>;
|
|
97
|
+
/**
|
|
98
|
+
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
|
99
|
+
*
|
|
100
|
+
* @param {string} params.teamId - Team ID.
|
|
101
|
+
* @throws {AgentbaseException}
|
|
102
|
+
* @returns {Promise<{}>}
|
|
103
|
+
*/
|
|
104
|
+
delete(params: {
|
|
105
|
+
teamId: string;
|
|
106
|
+
}): Promise<{}>;
|
|
107
|
+
/**
|
|
108
|
+
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
|
109
|
+
*
|
|
110
|
+
* @param {string} teamId - Team ID.
|
|
111
|
+
* @throws {AgentbaseException}
|
|
112
|
+
* @returns {Promise<{}>}
|
|
113
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
114
|
+
*/
|
|
115
|
+
delete(teamId: string): Promise<{}>;
|
|
116
|
+
/**
|
|
117
|
+
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
118
|
+
*
|
|
119
|
+
* @param {string} params.teamId - Team ID.
|
|
120
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
|
121
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
122
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
123
|
+
* @throws {AgentbaseException}
|
|
124
|
+
* @returns {Promise<Models.MembershipList>}
|
|
125
|
+
*/
|
|
126
|
+
listMemberships(params: {
|
|
127
|
+
teamId: string;
|
|
128
|
+
queries?: string[];
|
|
129
|
+
search?: string;
|
|
130
|
+
total?: boolean;
|
|
131
|
+
}): Promise<Models.MembershipList>;
|
|
132
|
+
/**
|
|
133
|
+
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
134
|
+
*
|
|
135
|
+
* @param {string} teamId - Team ID.
|
|
136
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
|
137
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
138
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
139
|
+
* @throws {AgentbaseException}
|
|
140
|
+
* @returns {Promise<Models.MembershipList>}
|
|
141
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
142
|
+
*/
|
|
143
|
+
listMemberships(teamId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.MembershipList>;
|
|
144
|
+
/**
|
|
145
|
+
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, AppBase will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
|
146
|
+
*
|
|
147
|
+
* You only need to provide one of a user ID, email, or phone number. AppBase will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
148
|
+
*
|
|
149
|
+
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status]([HOSTNAME]/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
150
|
+
*
|
|
151
|
+
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) AppBase will accept the only redirect URLs under the domains you have added as a platform on the AppBase Console.
|
|
152
|
+
*
|
|
153
|
+
*
|
|
154
|
+
* @param {string} params.teamId - Team ID.
|
|
155
|
+
* @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions]([HOSTNAME]/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long.
|
|
156
|
+
* @param {string} params.email - Email of the new team member.
|
|
157
|
+
* @param {string} params.userId - ID of the user to be added to a team.
|
|
158
|
+
* @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
159
|
+
* @param {string} params.url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
160
|
+
* @param {string} params.name - Name of the new team member. Max length: 128 chars.
|
|
161
|
+
* @throws {AgentbaseException}
|
|
162
|
+
* @returns {Promise<Models.Membership>}
|
|
163
|
+
*/
|
|
164
|
+
createMembership(params: {
|
|
165
|
+
teamId: string;
|
|
166
|
+
roles: string[];
|
|
167
|
+
email?: string;
|
|
168
|
+
userId?: string;
|
|
169
|
+
phone?: string;
|
|
170
|
+
url?: string;
|
|
171
|
+
name?: string;
|
|
172
|
+
}): Promise<Models.Membership>;
|
|
173
|
+
/**
|
|
174
|
+
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, AppBase will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
|
175
|
+
*
|
|
176
|
+
* You only need to provide one of a user ID, email, or phone number. AppBase will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
177
|
+
*
|
|
178
|
+
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status]([HOSTNAME]/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
179
|
+
*
|
|
180
|
+
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) AppBase will accept the only redirect URLs under the domains you have added as a platform on the AppBase Console.
|
|
181
|
+
*
|
|
182
|
+
*
|
|
183
|
+
* @param {string} teamId - Team ID.
|
|
184
|
+
* @param {string[]} roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions]([HOSTNAME]/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long.
|
|
185
|
+
* @param {string} email - Email of the new team member.
|
|
186
|
+
* @param {string} userId - ID of the user to be added to a team.
|
|
187
|
+
* @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
188
|
+
* @param {string} url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
189
|
+
* @param {string} name - Name of the new team member. Max length: 128 chars.
|
|
190
|
+
* @throws {AgentbaseException}
|
|
191
|
+
* @returns {Promise<Models.Membership>}
|
|
192
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
193
|
+
*/
|
|
194
|
+
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
|
|
195
|
+
/**
|
|
196
|
+
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
197
|
+
*
|
|
198
|
+
* @param {string} params.teamId - Team ID.
|
|
199
|
+
* @param {string} params.membershipId - Membership ID.
|
|
200
|
+
* @throws {AgentbaseException}
|
|
201
|
+
* @returns {Promise<Models.Membership>}
|
|
202
|
+
*/
|
|
203
|
+
getMembership(params: {
|
|
204
|
+
teamId: string;
|
|
205
|
+
membershipId: string;
|
|
206
|
+
}): Promise<Models.Membership>;
|
|
207
|
+
/**
|
|
208
|
+
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
209
|
+
*
|
|
210
|
+
* @param {string} teamId - Team ID.
|
|
211
|
+
* @param {string} membershipId - Membership ID.
|
|
212
|
+
* @throws {AgentbaseException}
|
|
213
|
+
* @returns {Promise<Models.Membership>}
|
|
214
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
215
|
+
*/
|
|
216
|
+
getMembership(teamId: string, membershipId: string): Promise<Models.Membership>;
|
|
217
|
+
/**
|
|
218
|
+
* Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions]([HOSTNAME]/docs/permissions).
|
|
219
|
+
*
|
|
220
|
+
*
|
|
221
|
+
* @param {string} params.teamId - Team ID.
|
|
222
|
+
* @param {string} params.membershipId - Membership ID.
|
|
223
|
+
* @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions]([HOSTNAME]/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long.
|
|
224
|
+
* @throws {AgentbaseException}
|
|
225
|
+
* @returns {Promise<Models.Membership>}
|
|
226
|
+
*/
|
|
227
|
+
updateMembership(params: {
|
|
228
|
+
teamId: string;
|
|
229
|
+
membershipId: string;
|
|
230
|
+
roles: string[];
|
|
231
|
+
}): Promise<Models.Membership>;
|
|
232
|
+
/**
|
|
233
|
+
* Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions]([HOSTNAME]/docs/permissions).
|
|
234
|
+
*
|
|
235
|
+
*
|
|
236
|
+
* @param {string} teamId - Team ID.
|
|
237
|
+
* @param {string} membershipId - Membership ID.
|
|
238
|
+
* @param {string[]} roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions]([HOSTNAME]/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long.
|
|
239
|
+
* @throws {AgentbaseException}
|
|
240
|
+
* @returns {Promise<Models.Membership>}
|
|
241
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
242
|
+
*/
|
|
243
|
+
updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
|
|
244
|
+
/**
|
|
245
|
+
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
|
246
|
+
*
|
|
247
|
+
* @param {string} params.teamId - Team ID.
|
|
248
|
+
* @param {string} params.membershipId - Membership ID.
|
|
249
|
+
* @throws {AgentbaseException}
|
|
250
|
+
* @returns {Promise<{}>}
|
|
251
|
+
*/
|
|
252
|
+
deleteMembership(params: {
|
|
253
|
+
teamId: string;
|
|
254
|
+
membershipId: string;
|
|
255
|
+
}): Promise<{}>;
|
|
256
|
+
/**
|
|
257
|
+
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
|
258
|
+
*
|
|
259
|
+
* @param {string} teamId - Team ID.
|
|
260
|
+
* @param {string} membershipId - Membership ID.
|
|
261
|
+
* @throws {AgentbaseException}
|
|
262
|
+
* @returns {Promise<{}>}
|
|
263
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
264
|
+
*/
|
|
265
|
+
deleteMembership(teamId: string, membershipId: string): Promise<{}>;
|
|
266
|
+
/**
|
|
267
|
+
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
|
268
|
+
*
|
|
269
|
+
* If the request is successful, a session for the user is automatically created.
|
|
270
|
+
*
|
|
271
|
+
*
|
|
272
|
+
* @param {string} params.teamId - Team ID.
|
|
273
|
+
* @param {string} params.membershipId - Membership ID.
|
|
274
|
+
* @param {string} params.userId - User ID.
|
|
275
|
+
* @param {string} params.secret - Secret key.
|
|
276
|
+
* @throws {AgentbaseException}
|
|
277
|
+
* @returns {Promise<Models.Membership>}
|
|
278
|
+
*/
|
|
279
|
+
updateMembershipStatus(params: {
|
|
280
|
+
teamId: string;
|
|
281
|
+
membershipId: string;
|
|
282
|
+
userId: string;
|
|
283
|
+
secret: string;
|
|
284
|
+
}): Promise<Models.Membership>;
|
|
285
|
+
/**
|
|
286
|
+
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
|
287
|
+
*
|
|
288
|
+
* If the request is successful, a session for the user is automatically created.
|
|
289
|
+
*
|
|
290
|
+
*
|
|
291
|
+
* @param {string} teamId - Team ID.
|
|
292
|
+
* @param {string} membershipId - Membership ID.
|
|
293
|
+
* @param {string} userId - User ID.
|
|
294
|
+
* @param {string} secret - Secret key.
|
|
295
|
+
* @throws {AgentbaseException}
|
|
296
|
+
* @returns {Promise<Models.Membership>}
|
|
297
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
298
|
+
*/
|
|
299
|
+
updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
|
|
300
|
+
/**
|
|
301
|
+
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences]([HOSTNAME]/docs/references/cloud/client-web/account#getPrefs).
|
|
302
|
+
*
|
|
303
|
+
* @param {string} params.teamId - Team ID.
|
|
304
|
+
* @throws {AgentbaseException}
|
|
305
|
+
* @returns {Promise<Preferences>}
|
|
306
|
+
*/
|
|
307
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
308
|
+
teamId: string;
|
|
309
|
+
}): Promise<Preferences>;
|
|
310
|
+
/**
|
|
311
|
+
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences]([HOSTNAME]/docs/references/cloud/client-web/account#getPrefs).
|
|
312
|
+
*
|
|
313
|
+
* @param {string} teamId - Team ID.
|
|
314
|
+
* @throws {AgentbaseException}
|
|
315
|
+
* @returns {Promise<Preferences>}
|
|
316
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
317
|
+
*/
|
|
318
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Preferences>;
|
|
319
|
+
/**
|
|
320
|
+
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
|
321
|
+
*
|
|
322
|
+
* @param {string} params.teamId - Team ID.
|
|
323
|
+
* @param {object} params.prefs - Prefs key-value JSON object.
|
|
324
|
+
* @throws {AgentbaseException}
|
|
325
|
+
* @returns {Promise<Preferences>}
|
|
326
|
+
*/
|
|
327
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
328
|
+
teamId: string;
|
|
329
|
+
prefs: object;
|
|
330
|
+
}): Promise<Preferences>;
|
|
331
|
+
/**
|
|
332
|
+
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
|
333
|
+
*
|
|
334
|
+
* @param {string} teamId - Team ID.
|
|
335
|
+
* @param {object} prefs - Prefs key-value JSON object.
|
|
336
|
+
* @throws {AgentbaseException}
|
|
337
|
+
* @returns {Promise<Preferences>}
|
|
338
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
339
|
+
*/
|
|
340
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, prefs: object): Promise<Preferences>;
|
|
341
|
+
}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
export declare class VectorsDB {
|
|
4
|
+
client: Client;
|
|
5
|
+
constructor(client: Client);
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries).
|
|
9
|
+
* @throws {AgentbaseException}
|
|
10
|
+
* @returns {Promise<Models.TransactionList>}
|
|
11
|
+
*/
|
|
12
|
+
listTransactions(params?: {
|
|
13
|
+
queries?: string[];
|
|
14
|
+
}): Promise<Models.TransactionList>;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries).
|
|
18
|
+
* @throws {AgentbaseException}
|
|
19
|
+
* @returns {Promise<Models.TransactionList>}
|
|
20
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
21
|
+
*/
|
|
22
|
+
listTransactions(queries?: string[]): Promise<Models.TransactionList>;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param {number} params.ttl - Seconds before the transaction expires.
|
|
26
|
+
* @throws {AgentbaseException}
|
|
27
|
+
* @returns {Promise<Models.Transaction>}
|
|
28
|
+
*/
|
|
29
|
+
createTransaction(params?: {
|
|
30
|
+
ttl?: number;
|
|
31
|
+
}): Promise<Models.Transaction>;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param {number} ttl - Seconds before the transaction expires.
|
|
35
|
+
* @throws {AgentbaseException}
|
|
36
|
+
* @returns {Promise<Models.Transaction>}
|
|
37
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
38
|
+
*/
|
|
39
|
+
createTransaction(ttl?: number): Promise<Models.Transaction>;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
43
|
+
* @throws {AgentbaseException}
|
|
44
|
+
* @returns {Promise<Models.Transaction>}
|
|
45
|
+
*/
|
|
46
|
+
getTransaction(params: {
|
|
47
|
+
transactionId: string;
|
|
48
|
+
}): Promise<Models.Transaction>;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param {string} transactionId - Transaction ID.
|
|
52
|
+
* @throws {AgentbaseException}
|
|
53
|
+
* @returns {Promise<Models.Transaction>}
|
|
54
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
55
|
+
*/
|
|
56
|
+
getTransaction(transactionId: string): Promise<Models.Transaction>;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
60
|
+
* @param {boolean} params.commit - Commit transaction?
|
|
61
|
+
* @param {boolean} params.rollback - Rollback transaction?
|
|
62
|
+
* @throws {AgentbaseException}
|
|
63
|
+
* @returns {Promise<Models.Transaction>}
|
|
64
|
+
*/
|
|
65
|
+
updateTransaction(params: {
|
|
66
|
+
transactionId: string;
|
|
67
|
+
commit?: boolean;
|
|
68
|
+
rollback?: boolean;
|
|
69
|
+
}): Promise<Models.Transaction>;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @param {string} transactionId - Transaction ID.
|
|
73
|
+
* @param {boolean} commit - Commit transaction?
|
|
74
|
+
* @param {boolean} rollback - Rollback transaction?
|
|
75
|
+
* @throws {AgentbaseException}
|
|
76
|
+
* @returns {Promise<Models.Transaction>}
|
|
77
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
78
|
+
*/
|
|
79
|
+
updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise<Models.Transaction>;
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
83
|
+
* @throws {AgentbaseException}
|
|
84
|
+
* @returns {Promise<{}>}
|
|
85
|
+
*/
|
|
86
|
+
deleteTransaction(params: {
|
|
87
|
+
transactionId: string;
|
|
88
|
+
}): Promise<{}>;
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
* @param {string} transactionId - Transaction ID.
|
|
92
|
+
* @throws {AgentbaseException}
|
|
93
|
+
* @returns {Promise<{}>}
|
|
94
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
95
|
+
*/
|
|
96
|
+
deleteTransaction(transactionId: string): Promise<{}>;
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @param {string} params.transactionId - Transaction ID.
|
|
100
|
+
* @param {Models.DocumentsDBTransactionOperation[]} params.operations - Array of staged operations.
|
|
101
|
+
* @throws {AgentbaseException}
|
|
102
|
+
* @returns {Promise<Models.Transaction>}
|
|
103
|
+
*/
|
|
104
|
+
createOperations(params: {
|
|
105
|
+
transactionId: string;
|
|
106
|
+
operations?: Models.DocumentsDBTransactionOperation[];
|
|
107
|
+
}): Promise<Models.Transaction>;
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* @param {string} transactionId - Transaction ID.
|
|
111
|
+
* @param {Models.DocumentsDBTransactionOperation[]} operations - Array of staged operations.
|
|
112
|
+
* @throws {AgentbaseException}
|
|
113
|
+
* @returns {Promise<Models.Transaction>}
|
|
114
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
115
|
+
*/
|
|
116
|
+
createOperations(transactionId: string, operations?: Models.DocumentsDBTransactionOperation[]): Promise<Models.Transaction>;
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* @param {string} params.databaseId - Database ID.
|
|
120
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
121
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
122
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
123
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
124
|
+
* @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
125
|
+
* @throws {AgentbaseException}
|
|
126
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
127
|
+
*/
|
|
128
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
129
|
+
databaseId: string;
|
|
130
|
+
collectionId: string;
|
|
131
|
+
queries?: string[];
|
|
132
|
+
transactionId?: string;
|
|
133
|
+
total?: boolean;
|
|
134
|
+
ttl?: number;
|
|
135
|
+
}): Promise<Models.DocumentList<Document>>;
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param {string} databaseId - Database ID.
|
|
139
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
140
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
141
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
142
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
143
|
+
* @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
144
|
+
* @throws {AgentbaseException}
|
|
145
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
146
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
147
|
+
*/
|
|
148
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise<Models.DocumentList<Document>>;
|
|
149
|
+
/**
|
|
150
|
+
*
|
|
151
|
+
* @param {string} params.databaseId - Database ID.
|
|
152
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
|
|
153
|
+
* @param {string} params.documentId - Document 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.
|
|
154
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} params.data - Document data as JSON object.
|
|
155
|
+
* @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
156
|
+
* @throws {AgentbaseException}
|
|
157
|
+
* @returns {Promise<Document>}
|
|
158
|
+
*/
|
|
159
|
+
createDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
160
|
+
databaseId: string;
|
|
161
|
+
collectionId: string;
|
|
162
|
+
documentId: string;
|
|
163
|
+
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
|
|
164
|
+
permissions?: string[];
|
|
165
|
+
}): Promise<Document>;
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
* @param {string} databaseId - Database ID.
|
|
169
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
|
|
170
|
+
* @param {string} documentId - Document 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.
|
|
171
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data - Document data as JSON object.
|
|
172
|
+
* @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
173
|
+
* @throws {AgentbaseException}
|
|
174
|
+
* @returns {Promise<Document>}
|
|
175
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
176
|
+
*/
|
|
177
|
+
createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @param {string} params.databaseId - Database ID.
|
|
181
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
182
|
+
* @param {string} params.documentId - Document ID.
|
|
183
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
184
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
185
|
+
* @throws {AgentbaseException}
|
|
186
|
+
* @returns {Promise<Document>}
|
|
187
|
+
*/
|
|
188
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
189
|
+
databaseId: string;
|
|
190
|
+
collectionId: string;
|
|
191
|
+
documentId: string;
|
|
192
|
+
queries?: string[];
|
|
193
|
+
transactionId?: string;
|
|
194
|
+
}): Promise<Document>;
|
|
195
|
+
/**
|
|
196
|
+
*
|
|
197
|
+
* @param {string} databaseId - Database ID.
|
|
198
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
199
|
+
* @param {string} documentId - Document ID.
|
|
200
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
201
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
202
|
+
* @throws {AgentbaseException}
|
|
203
|
+
* @returns {Promise<Document>}
|
|
204
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
205
|
+
*/
|
|
206
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise<Document>;
|
|
207
|
+
/**
|
|
208
|
+
*
|
|
209
|
+
* @param {string} params.databaseId - Database ID.
|
|
210
|
+
* @param {string} params.collectionId - Collection ID.
|
|
211
|
+
* @param {string} params.documentId - Document ID.
|
|
212
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} params.data - Document data as JSON object. Include all required fields of the document to be created or updated.
|
|
213
|
+
* @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
214
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
215
|
+
* @throws {AgentbaseException}
|
|
216
|
+
* @returns {Promise<Document>}
|
|
217
|
+
*/
|
|
218
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
219
|
+
databaseId: string;
|
|
220
|
+
collectionId: string;
|
|
221
|
+
documentId: string;
|
|
222
|
+
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
223
|
+
permissions?: string[];
|
|
224
|
+
transactionId?: string;
|
|
225
|
+
}): Promise<Document>;
|
|
226
|
+
/**
|
|
227
|
+
*
|
|
228
|
+
* @param {string} databaseId - Database ID.
|
|
229
|
+
* @param {string} collectionId - Collection ID.
|
|
230
|
+
* @param {string} documentId - Document ID.
|
|
231
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data - Document data as JSON object. Include all required fields of the document to be created or updated.
|
|
232
|
+
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
233
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
234
|
+
* @throws {AgentbaseException}
|
|
235
|
+
* @returns {Promise<Document>}
|
|
236
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
237
|
+
*/
|
|
238
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
|
|
239
|
+
/**
|
|
240
|
+
*
|
|
241
|
+
* @param {string} params.databaseId - Database ID.
|
|
242
|
+
* @param {string} params.collectionId - Collection ID.
|
|
243
|
+
* @param {string} params.documentId - Document ID.
|
|
244
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} params.data - Document data as JSON object. Include only fields and value pairs to be updated.
|
|
245
|
+
* @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
246
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
247
|
+
* @throws {AgentbaseException}
|
|
248
|
+
* @returns {Promise<Document>}
|
|
249
|
+
*/
|
|
250
|
+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
251
|
+
databaseId: string;
|
|
252
|
+
collectionId: string;
|
|
253
|
+
documentId: string;
|
|
254
|
+
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
255
|
+
permissions?: string[];
|
|
256
|
+
transactionId?: string;
|
|
257
|
+
}): Promise<Document>;
|
|
258
|
+
/**
|
|
259
|
+
*
|
|
260
|
+
* @param {string} databaseId - Database ID.
|
|
261
|
+
* @param {string} collectionId - Collection ID.
|
|
262
|
+
* @param {string} documentId - Document ID.
|
|
263
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data - Document data as JSON object. Include only fields and value pairs to be updated.
|
|
264
|
+
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
265
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
266
|
+
* @throws {AgentbaseException}
|
|
267
|
+
* @returns {Promise<Document>}
|
|
268
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
269
|
+
*/
|
|
270
|
+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
|
|
271
|
+
/**
|
|
272
|
+
*
|
|
273
|
+
* @param {string} params.databaseId - Database ID.
|
|
274
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
275
|
+
* @param {string} params.documentId - Document ID.
|
|
276
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
277
|
+
* @throws {AgentbaseException}
|
|
278
|
+
* @returns {Promise<{}>}
|
|
279
|
+
*/
|
|
280
|
+
deleteDocument(params: {
|
|
281
|
+
databaseId: string;
|
|
282
|
+
collectionId: string;
|
|
283
|
+
documentId: string;
|
|
284
|
+
transactionId?: string;
|
|
285
|
+
}): Promise<{}>;
|
|
286
|
+
/**
|
|
287
|
+
*
|
|
288
|
+
* @param {string} databaseId - Database ID.
|
|
289
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
290
|
+
* @param {string} documentId - Document ID.
|
|
291
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
292
|
+
* @throws {AgentbaseException}
|
|
293
|
+
* @returns {Promise<{}>}
|
|
294
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
295
|
+
*/
|
|
296
|
+
deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>;
|
|
297
|
+
}
|