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,409 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
export declare class DocumentsDB {
|
|
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
|
+
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
119
|
+
*
|
|
120
|
+
* When Moderation Phase 2 is enabled, unpublished documents (`checking` / `private_hold` / `quarantined`, and similar intermediate dispositions) are hidden from non-creators. The response `total` is corrected approximately: pure pagination subtracts a collection-wide hidden count (clamped so it never exceeds the visible rows on the current page); filtered queries only subtract hidden rows on the current page, so `total` may still over-count when hidden rows fall on other pages. Privileged users and API keys see unfiltered totals.
|
|
121
|
+
*
|
|
122
|
+
* @param {string} params.databaseId - Database ID.
|
|
123
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
124
|
+
* @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.
|
|
125
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
126
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
127
|
+
* @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
128
|
+
* @throws {AgentbaseException}
|
|
129
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
130
|
+
*/
|
|
131
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
132
|
+
databaseId: string;
|
|
133
|
+
collectionId: string;
|
|
134
|
+
queries?: string[];
|
|
135
|
+
transactionId?: string;
|
|
136
|
+
total?: boolean;
|
|
137
|
+
ttl?: number;
|
|
138
|
+
}): Promise<Models.DocumentList<Document>>;
|
|
139
|
+
/**
|
|
140
|
+
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
141
|
+
*
|
|
142
|
+
* When Moderation Phase 2 is enabled, unpublished documents (`checking` / `private_hold` / `quarantined`, and similar intermediate dispositions) are hidden from non-creators. The response `total` is corrected approximately: pure pagination subtracts a collection-wide hidden count (clamped so it never exceeds the visible rows on the current page); filtered queries only subtract hidden rows on the current page, so `total` may still over-count when hidden rows fall on other pages. Privileged users and API keys see unfiltered totals.
|
|
143
|
+
*
|
|
144
|
+
* @param {string} databaseId - Database ID.
|
|
145
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
146
|
+
* @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.
|
|
147
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
148
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
149
|
+
* @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
150
|
+
* @throws {AgentbaseException}
|
|
151
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
152
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
153
|
+
*/
|
|
154
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise<Models.DocumentList<Document>>;
|
|
155
|
+
/**
|
|
156
|
+
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration]([HOSTNAME]/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
157
|
+
*
|
|
158
|
+
* @param {string} params.databaseId - Database ID.
|
|
159
|
+
* @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.
|
|
160
|
+
* @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.
|
|
161
|
+
* @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.
|
|
162
|
+
* @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).
|
|
163
|
+
* @throws {AgentbaseException}
|
|
164
|
+
* @returns {Promise<Document>}
|
|
165
|
+
*/
|
|
166
|
+
createDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
167
|
+
databaseId: string;
|
|
168
|
+
collectionId: string;
|
|
169
|
+
documentId: string;
|
|
170
|
+
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
|
|
171
|
+
permissions?: string[];
|
|
172
|
+
}): Promise<Document>;
|
|
173
|
+
/**
|
|
174
|
+
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration]([HOSTNAME]/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
175
|
+
*
|
|
176
|
+
* @param {string} databaseId - Database ID.
|
|
177
|
+
* @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.
|
|
178
|
+
* @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.
|
|
179
|
+
* @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.
|
|
180
|
+
* @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).
|
|
181
|
+
* @throws {AgentbaseException}
|
|
182
|
+
* @returns {Promise<Document>}
|
|
183
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
184
|
+
*/
|
|
185
|
+
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>;
|
|
186
|
+
/**
|
|
187
|
+
* Create new Documents. Before using this route, you should create a new collection resource using either a [server integration]([HOSTNAME]/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
188
|
+
*
|
|
189
|
+
* @param {string} params.databaseId - Database ID.
|
|
190
|
+
* @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.
|
|
191
|
+
* @throws {AgentbaseException}
|
|
192
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
193
|
+
*/
|
|
194
|
+
createDocuments<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
195
|
+
databaseId: string;
|
|
196
|
+
collectionId: string;
|
|
197
|
+
}): Promise<Models.DocumentList<Document>>;
|
|
198
|
+
/**
|
|
199
|
+
* Create new Documents. Before using this route, you should create a new collection resource using either a [server integration]([HOSTNAME]/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
200
|
+
*
|
|
201
|
+
* @param {string} databaseId - Database ID.
|
|
202
|
+
* @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.
|
|
203
|
+
* @throws {AgentbaseException}
|
|
204
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
205
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
206
|
+
*/
|
|
207
|
+
createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string): Promise<Models.DocumentList<Document>>;
|
|
208
|
+
/**
|
|
209
|
+
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
210
|
+
*
|
|
211
|
+
* @param {string} params.databaseId - Database ID.
|
|
212
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
213
|
+
* @param {string} params.documentId - Document ID.
|
|
214
|
+
* @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.
|
|
215
|
+
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
216
|
+
* @throws {AgentbaseException}
|
|
217
|
+
* @returns {Promise<Document>}
|
|
218
|
+
*/
|
|
219
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
220
|
+
databaseId: string;
|
|
221
|
+
collectionId: string;
|
|
222
|
+
documentId: string;
|
|
223
|
+
queries?: string[];
|
|
224
|
+
transactionId?: string;
|
|
225
|
+
}): Promise<Document>;
|
|
226
|
+
/**
|
|
227
|
+
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
228
|
+
*
|
|
229
|
+
* @param {string} databaseId - Database ID.
|
|
230
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
231
|
+
* @param {string} documentId - Document ID.
|
|
232
|
+
* @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.
|
|
233
|
+
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
234
|
+
* @throws {AgentbaseException}
|
|
235
|
+
* @returns {Promise<Document>}
|
|
236
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
237
|
+
*/
|
|
238
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise<Document>;
|
|
239
|
+
/**
|
|
240
|
+
* Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration]([HOSTNAME]/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
241
|
+
*
|
|
242
|
+
* @param {string} params.databaseId - Database ID.
|
|
243
|
+
* @param {string} params.collectionId - Collection ID.
|
|
244
|
+
* @param {string} params.documentId - Document ID.
|
|
245
|
+
* @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.
|
|
246
|
+
* @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
247
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
248
|
+
* @throws {AgentbaseException}
|
|
249
|
+
* @returns {Promise<Document>}
|
|
250
|
+
*/
|
|
251
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
252
|
+
databaseId: string;
|
|
253
|
+
collectionId: string;
|
|
254
|
+
documentId: string;
|
|
255
|
+
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
256
|
+
permissions?: string[];
|
|
257
|
+
transactionId?: string;
|
|
258
|
+
}): Promise<Document>;
|
|
259
|
+
/**
|
|
260
|
+
* Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration]([HOSTNAME]/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
261
|
+
*
|
|
262
|
+
* @param {string} databaseId - Database ID.
|
|
263
|
+
* @param {string} collectionId - Collection ID.
|
|
264
|
+
* @param {string} documentId - Document ID.
|
|
265
|
+
* @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.
|
|
266
|
+
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
267
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
268
|
+
* @throws {AgentbaseException}
|
|
269
|
+
* @returns {Promise<Document>}
|
|
270
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
271
|
+
*/
|
|
272
|
+
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>;
|
|
273
|
+
/**
|
|
274
|
+
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
275
|
+
*
|
|
276
|
+
* @param {string} params.databaseId - Database ID.
|
|
277
|
+
* @param {string} params.collectionId - Collection ID.
|
|
278
|
+
* @param {string} params.documentId - Document ID.
|
|
279
|
+
* @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.
|
|
280
|
+
* @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
281
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
282
|
+
* @throws {AgentbaseException}
|
|
283
|
+
* @returns {Promise<Document>}
|
|
284
|
+
*/
|
|
285
|
+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
286
|
+
databaseId: string;
|
|
287
|
+
collectionId: string;
|
|
288
|
+
documentId: string;
|
|
289
|
+
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
290
|
+
permissions?: string[];
|
|
291
|
+
transactionId?: string;
|
|
292
|
+
}): Promise<Document>;
|
|
293
|
+
/**
|
|
294
|
+
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
295
|
+
*
|
|
296
|
+
* @param {string} databaseId - Database ID.
|
|
297
|
+
* @param {string} collectionId - Collection ID.
|
|
298
|
+
* @param {string} documentId - Document ID.
|
|
299
|
+
* @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.
|
|
300
|
+
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
301
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
302
|
+
* @throws {AgentbaseException}
|
|
303
|
+
* @returns {Promise<Document>}
|
|
304
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
305
|
+
*/
|
|
306
|
+
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>;
|
|
307
|
+
/**
|
|
308
|
+
* Delete a document by its unique ID.
|
|
309
|
+
*
|
|
310
|
+
* @param {string} params.databaseId - Database ID.
|
|
311
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
312
|
+
* @param {string} params.documentId - Document ID.
|
|
313
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
314
|
+
* @throws {AgentbaseException}
|
|
315
|
+
* @returns {Promise<{}>}
|
|
316
|
+
*/
|
|
317
|
+
deleteDocument(params: {
|
|
318
|
+
databaseId: string;
|
|
319
|
+
collectionId: string;
|
|
320
|
+
documentId: string;
|
|
321
|
+
transactionId?: string;
|
|
322
|
+
}): Promise<{}>;
|
|
323
|
+
/**
|
|
324
|
+
* Delete a document by its unique ID.
|
|
325
|
+
*
|
|
326
|
+
* @param {string} databaseId - Database ID.
|
|
327
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
328
|
+
* @param {string} documentId - Document ID.
|
|
329
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
330
|
+
* @throws {AgentbaseException}
|
|
331
|
+
* @returns {Promise<{}>}
|
|
332
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
333
|
+
*/
|
|
334
|
+
deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>;
|
|
335
|
+
/**
|
|
336
|
+
* Decrement a specific column of a row by a given value.
|
|
337
|
+
*
|
|
338
|
+
* @param {string} params.databaseId - Database ID.
|
|
339
|
+
* @param {string} params.collectionId - Collection ID.
|
|
340
|
+
* @param {string} params.documentId - Document ID.
|
|
341
|
+
* @param {string} params.attribute - Attribute key.
|
|
342
|
+
* @param {number} params.value - Value to decrement the attribute by. The value must be a number.
|
|
343
|
+
* @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
|
344
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
345
|
+
* @throws {AgentbaseException}
|
|
346
|
+
* @returns {Promise<Document>}
|
|
347
|
+
*/
|
|
348
|
+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
349
|
+
databaseId: string;
|
|
350
|
+
collectionId: string;
|
|
351
|
+
documentId: string;
|
|
352
|
+
attribute: string;
|
|
353
|
+
value?: number;
|
|
354
|
+
min?: number;
|
|
355
|
+
transactionId?: string;
|
|
356
|
+
}): Promise<Document>;
|
|
357
|
+
/**
|
|
358
|
+
* Decrement a specific column of a row by a given value.
|
|
359
|
+
*
|
|
360
|
+
* @param {string} databaseId - Database ID.
|
|
361
|
+
* @param {string} collectionId - Collection ID.
|
|
362
|
+
* @param {string} documentId - Document ID.
|
|
363
|
+
* @param {string} attribute - Attribute key.
|
|
364
|
+
* @param {number} value - Value to decrement the attribute by. The value must be a number.
|
|
365
|
+
* @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
|
366
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
367
|
+
* @throws {AgentbaseException}
|
|
368
|
+
* @returns {Promise<Document>}
|
|
369
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
370
|
+
*/
|
|
371
|
+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise<Document>;
|
|
372
|
+
/**
|
|
373
|
+
* Increment a specific column of a row by a given value.
|
|
374
|
+
*
|
|
375
|
+
* @param {string} params.databaseId - Database ID.
|
|
376
|
+
* @param {string} params.collectionId - Collection ID.
|
|
377
|
+
* @param {string} params.documentId - Document ID.
|
|
378
|
+
* @param {string} params.attribute - Attribute key.
|
|
379
|
+
* @param {number} params.value - Value to increment the attribute by. The value must be a number.
|
|
380
|
+
* @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
|
381
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
382
|
+
* @throws {AgentbaseException}
|
|
383
|
+
* @returns {Promise<Document>}
|
|
384
|
+
*/
|
|
385
|
+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
386
|
+
databaseId: string;
|
|
387
|
+
collectionId: string;
|
|
388
|
+
documentId: string;
|
|
389
|
+
attribute: string;
|
|
390
|
+
value?: number;
|
|
391
|
+
max?: number;
|
|
392
|
+
transactionId?: string;
|
|
393
|
+
}): Promise<Document>;
|
|
394
|
+
/**
|
|
395
|
+
* Increment a specific column of a row by a given value.
|
|
396
|
+
*
|
|
397
|
+
* @param {string} databaseId - Database ID.
|
|
398
|
+
* @param {string} collectionId - Collection ID.
|
|
399
|
+
* @param {string} documentId - Document ID.
|
|
400
|
+
* @param {string} attribute - Attribute key.
|
|
401
|
+
* @param {number} value - Value to increment the attribute by. The value must be a number.
|
|
402
|
+
* @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
|
403
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
404
|
+
* @throws {AgentbaseException}
|
|
405
|
+
* @returns {Promise<Document>}
|
|
406
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
407
|
+
*/
|
|
408
|
+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise<Document>;
|
|
409
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
import type { Models } from '../models';
|
|
3
|
+
import { PathMatch } from '../enums/path-match';
|
|
4
|
+
import { Method } from '../enums/method';
|
|
5
|
+
import { ExecutionMethod } from '../enums/execution-method';
|
|
6
|
+
export declare class Functions {
|
|
7
|
+
client: Client;
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
/**
|
|
10
|
+
* Get a paginated list of distinct request paths from the current user function executions.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} params.functionId - Function ID.
|
|
13
|
+
* @param {number} params.limit - Maximum number of execution paths to return.
|
|
14
|
+
* @param {number} params.offset - Number of execution paths to skip.
|
|
15
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0.
|
|
16
|
+
* @param {string} params.xpath - Execution request path or regular expression. Empty means all paths.
|
|
17
|
+
* @param {PathMatch} params.pathMatch - Path matching mode: exact or regex. Regex patterns have no delimiters.
|
|
18
|
+
* @param {Method} params.method - HTTP method to filter. Empty means all methods.
|
|
19
|
+
* @throws {AgentbaseException}
|
|
20
|
+
* @returns {Promise<Models.ExecutionPathList>}
|
|
21
|
+
*/
|
|
22
|
+
listExecutionPaths(params: {
|
|
23
|
+
functionId: string;
|
|
24
|
+
limit?: number;
|
|
25
|
+
offset?: number;
|
|
26
|
+
total?: boolean;
|
|
27
|
+
xpath?: string;
|
|
28
|
+
pathMatch?: PathMatch;
|
|
29
|
+
method?: Method;
|
|
30
|
+
}): Promise<Models.ExecutionPathList>;
|
|
31
|
+
/**
|
|
32
|
+
* Get a paginated list of distinct request paths from the current user function executions.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} functionId - Function ID.
|
|
35
|
+
* @param {number} limit - Maximum number of execution paths to return.
|
|
36
|
+
* @param {number} offset - Number of execution paths to skip.
|
|
37
|
+
* @param {boolean} total - When set to false, the total count returned will be 0.
|
|
38
|
+
* @param {string} xpath - Execution request path or regular expression. Empty means all paths.
|
|
39
|
+
* @param {PathMatch} pathMatch - Path matching mode: exact or regex. Regex patterns have no delimiters.
|
|
40
|
+
* @param {Method} method - HTTP method to filter. Empty means all methods.
|
|
41
|
+
* @throws {AgentbaseException}
|
|
42
|
+
* @returns {Promise<Models.ExecutionPathList>}
|
|
43
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
44
|
+
*/
|
|
45
|
+
listExecutionPaths(functionId: string, limit?: number, offset?: number, total?: boolean, xpath?: string, pathMatch?: PathMatch, method?: Method): Promise<Models.ExecutionPathList>;
|
|
46
|
+
/**
|
|
47
|
+
* Get a paginated list of function executions matching the given request path and optional HTTP method.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} params.functionId - Function ID.
|
|
50
|
+
* @param {string} params.xpath - Execution request path or regular expression to match.
|
|
51
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. Maximum of 100 queries are allowed, each 4096 characters long.
|
|
52
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
53
|
+
* @param {PathMatch} params.pathMatch - Path matching mode: exact or regex. Regex patterns have no delimiters.
|
|
54
|
+
* @param {Method} params.method - HTTP method to filter. Empty means all methods.
|
|
55
|
+
* @throws {AgentbaseException}
|
|
56
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
57
|
+
*/
|
|
58
|
+
listExecutionsByPath(params: {
|
|
59
|
+
functionId: string;
|
|
60
|
+
xpath: string;
|
|
61
|
+
queries?: string[];
|
|
62
|
+
total?: boolean;
|
|
63
|
+
pathMatch?: PathMatch;
|
|
64
|
+
method?: Method;
|
|
65
|
+
}): Promise<Models.ExecutionList>;
|
|
66
|
+
/**
|
|
67
|
+
* Get a paginated list of function executions matching the given request path and optional HTTP method.
|
|
68
|
+
*
|
|
69
|
+
* @param {string} functionId - Function ID.
|
|
70
|
+
* @param {string} xpath - Execution request path or regular expression to match.
|
|
71
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. Maximum of 100 queries are allowed, each 4096 characters long.
|
|
72
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
73
|
+
* @param {PathMatch} pathMatch - Path matching mode: exact or regex. Regex patterns have no delimiters.
|
|
74
|
+
* @param {Method} method - HTTP method to filter. Empty means all methods.
|
|
75
|
+
* @throws {AgentbaseException}
|
|
76
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
77
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
78
|
+
*/
|
|
79
|
+
listExecutionsByPath(functionId: string, xpath: string, queries?: string[], total?: boolean, pathMatch?: PathMatch, method?: Method): Promise<Models.ExecutionList>;
|
|
80
|
+
/**
|
|
81
|
+
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} params.functionId - Function ID.
|
|
84
|
+
* @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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
85
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
86
|
+
* @param {string} params.xpath - Execution request path or regular expression. Empty means all paths.
|
|
87
|
+
* @param {PathMatch} params.pathMatch - Path matching mode: exact or regex. Regex patterns have no delimiters.
|
|
88
|
+
* @param {Method} params.method - HTTP method to filter. Empty means all methods.
|
|
89
|
+
* @throws {AgentbaseException}
|
|
90
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
91
|
+
*/
|
|
92
|
+
listExecutions(params: {
|
|
93
|
+
functionId: string;
|
|
94
|
+
queries?: string[];
|
|
95
|
+
total?: boolean;
|
|
96
|
+
xpath?: string;
|
|
97
|
+
pathMatch?: PathMatch;
|
|
98
|
+
method?: Method;
|
|
99
|
+
}): Promise<Models.ExecutionList>;
|
|
100
|
+
/**
|
|
101
|
+
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
|
102
|
+
*
|
|
103
|
+
* @param {string} functionId - Function ID.
|
|
104
|
+
* @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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
105
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
106
|
+
* @param {string} xpath - Execution request path or regular expression. Empty means all paths.
|
|
107
|
+
* @param {PathMatch} pathMatch - Path matching mode: exact or regex. Regex patterns have no delimiters.
|
|
108
|
+
* @param {Method} method - HTTP method to filter. Empty means all methods.
|
|
109
|
+
* @throws {AgentbaseException}
|
|
110
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
111
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
112
|
+
*/
|
|
113
|
+
listExecutions(functionId: string, queries?: string[], total?: boolean, xpath?: string, pathMatch?: PathMatch, method?: Method): Promise<Models.ExecutionList>;
|
|
114
|
+
/**
|
|
115
|
+
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
|
116
|
+
* The /project/{projectId}/executions alias selects the project from the URL independently of params. The /executions/params namespace accepts GET, POST, PUT, PATCH, DELETE, HEAD and non-preflight OPTIONS, forwarding the raw body, Content-Type, method and business path/query synchronously without injecting metadata fields. Both execution endpoints can return the business response when the function sends X-Function-Response-Passthrough: true; otherwise the Execution model is returned. Async and scheduled executions always return the Execution model.
|
|
117
|
+
*
|
|
118
|
+
* @param {string} params.functionId - Function ID.
|
|
119
|
+
* @param {string} params.body - HTTP body of execution. Default value is empty string.
|
|
120
|
+
* @param {boolean} params.async - Execute code in the background. Default value is false.
|
|
121
|
+
* @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is /
|
|
122
|
+
* @param {ExecutionMethod} params.method - HTTP method of execution. Default value is POST.
|
|
123
|
+
* @param {object} params.headers - HTTP headers of execution. Defaults to empty.
|
|
124
|
+
* @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
|
125
|
+
* @throws {AgentbaseException}
|
|
126
|
+
* @returns {Promise<Models.Execution>}
|
|
127
|
+
*/
|
|
128
|
+
createExecution(params: {
|
|
129
|
+
functionId: string;
|
|
130
|
+
body?: string;
|
|
131
|
+
async?: boolean;
|
|
132
|
+
xpath?: string;
|
|
133
|
+
method?: ExecutionMethod;
|
|
134
|
+
headers?: object;
|
|
135
|
+
scheduledAt?: string;
|
|
136
|
+
}): Promise<Models.Execution>;
|
|
137
|
+
/**
|
|
138
|
+
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
|
139
|
+
* The /project/{projectId}/executions alias selects the project from the URL independently of params. The /executions/params namespace accepts GET, POST, PUT, PATCH, DELETE, HEAD and non-preflight OPTIONS, forwarding the raw body, Content-Type, method and business path/query synchronously without injecting metadata fields. Both execution endpoints can return the business response when the function sends X-Function-Response-Passthrough: true; otherwise the Execution model is returned. Async and scheduled executions always return the Execution model.
|
|
140
|
+
*
|
|
141
|
+
* @param {string} functionId - Function ID.
|
|
142
|
+
* @param {string} body - HTTP body of execution. Default value is empty string.
|
|
143
|
+
* @param {boolean} async - Execute code in the background. Default value is false.
|
|
144
|
+
* @param {string} xpath - HTTP path of execution. Path can include query params. Default value is /
|
|
145
|
+
* @param {ExecutionMethod} method - HTTP method of execution. Default value is POST.
|
|
146
|
+
* @param {object} headers - HTTP headers of execution. Defaults to empty.
|
|
147
|
+
* @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
|
148
|
+
* @throws {AgentbaseException}
|
|
149
|
+
* @returns {Promise<Models.Execution>}
|
|
150
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
151
|
+
*/
|
|
152
|
+
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution>;
|
|
153
|
+
/**
|
|
154
|
+
* Get a function execution log by its unique ID.
|
|
155
|
+
*
|
|
156
|
+
* @param {string} params.functionId - Function ID.
|
|
157
|
+
* @param {string} params.executionId - Execution ID.
|
|
158
|
+
* @throws {AgentbaseException}
|
|
159
|
+
* @returns {Promise<Models.Execution>}
|
|
160
|
+
*/
|
|
161
|
+
getExecution(params: {
|
|
162
|
+
functionId: string;
|
|
163
|
+
executionId: string;
|
|
164
|
+
}): Promise<Models.Execution>;
|
|
165
|
+
/**
|
|
166
|
+
* Get a function execution log by its unique ID.
|
|
167
|
+
*
|
|
168
|
+
* @param {string} functionId - Function ID.
|
|
169
|
+
* @param {string} executionId - Execution ID.
|
|
170
|
+
* @throws {AgentbaseException}
|
|
171
|
+
* @returns {Promise<Models.Execution>}
|
|
172
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
173
|
+
*/
|
|
174
|
+
getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
|
|
175
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Client } from '../client';
|
|
2
|
+
export declare class Graphql {
|
|
3
|
+
client: Client;
|
|
4
|
+
constructor(client: Client);
|
|
5
|
+
/**
|
|
6
|
+
* Execute a GraphQL mutation.
|
|
7
|
+
*
|
|
8
|
+
* @param {object} params.query - The query or queries to execute.
|
|
9
|
+
* @throws {AgentbaseException}
|
|
10
|
+
* @returns {Promise<{}>}
|
|
11
|
+
*/
|
|
12
|
+
query(params: {
|
|
13
|
+
query: object;
|
|
14
|
+
}): Promise<{}>;
|
|
15
|
+
/**
|
|
16
|
+
* Execute a GraphQL mutation.
|
|
17
|
+
*
|
|
18
|
+
* @param {object} query - The query or queries to execute.
|
|
19
|
+
* @throws {AgentbaseException}
|
|
20
|
+
* @returns {Promise<{}>}
|
|
21
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
22
|
+
*/
|
|
23
|
+
query(query: object): Promise<{}>;
|
|
24
|
+
/**
|
|
25
|
+
* Execute a GraphQL mutation.
|
|
26
|
+
*
|
|
27
|
+
* @param {object} params.query - The query or queries to execute.
|
|
28
|
+
* @throws {AgentbaseException}
|
|
29
|
+
* @returns {Promise<{}>}
|
|
30
|
+
*/
|
|
31
|
+
mutation(params: {
|
|
32
|
+
query: object;
|
|
33
|
+
}): Promise<{}>;
|
|
34
|
+
/**
|
|
35
|
+
* Execute a GraphQL mutation.
|
|
36
|
+
*
|
|
37
|
+
* @param {object} query - The query or queries to execute.
|
|
38
|
+
* @throws {AgentbaseException}
|
|
39
|
+
* @returns {Promise<{}>}
|
|
40
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
41
|
+
*/
|
|
42
|
+
mutation(query: object): Promise<{}>;
|
|
43
|
+
}
|