agentbase-web-sdk 2.8.0 → 2.9.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/README.md +2 -2
- package/dist/cjs/sdk.js +79 -2
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +79 -2
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +79 -2
- package/package.json +2 -2
- package/types/index.d.ts +1 -1
- package/types/models.d.ts +29 -0
- package/types/services/databases.d.ts +4 -0
- package/types/services/documents-db.d.ts +4 -0
- package/types/services/functions.d.ts +56 -0
- package/types/services/tables-db.d.ts +4 -0
package/dist/esm/sdk.js
CHANGED
|
@@ -612,9 +612,9 @@ class Client {
|
|
|
612
612
|
'x-sdk-name': 'Agentbase',
|
|
613
613
|
'x-sdk-platform': 'client',
|
|
614
614
|
'x-sdk-language': 'web',
|
|
615
|
-
'x-sdk-version': '2.
|
|
615
|
+
'x-sdk-version': '2.9.0',
|
|
616
616
|
'X-AppBase-SDK': 'true',
|
|
617
|
-
'X-Appwrite-Response-Format': '2.
|
|
617
|
+
'X-Appwrite-Response-Format': '2.9.0',
|
|
618
618
|
};
|
|
619
619
|
this.realtime = {
|
|
620
620
|
socket: undefined,
|
|
@@ -6305,6 +6305,83 @@ class Functions {
|
|
|
6305
6305
|
constructor(client) {
|
|
6306
6306
|
this.client = client;
|
|
6307
6307
|
}
|
|
6308
|
+
listExecutionPaths(paramsOrFirst, ...rest) {
|
|
6309
|
+
let params;
|
|
6310
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
6311
|
+
params = (paramsOrFirst || {});
|
|
6312
|
+
}
|
|
6313
|
+
else {
|
|
6314
|
+
params = {
|
|
6315
|
+
functionId: paramsOrFirst,
|
|
6316
|
+
limit: rest[0],
|
|
6317
|
+
offset: rest[1],
|
|
6318
|
+
total: rest[2]
|
|
6319
|
+
};
|
|
6320
|
+
}
|
|
6321
|
+
const functionId = params.functionId;
|
|
6322
|
+
const limit = params.limit;
|
|
6323
|
+
const offset = params.offset;
|
|
6324
|
+
const total = params.total;
|
|
6325
|
+
if (typeof functionId === 'undefined') {
|
|
6326
|
+
throw new AgentbaseException('Missing required parameter: "functionId"');
|
|
6327
|
+
}
|
|
6328
|
+
const apiPath = '/functions/{functionId}/execution-paths'.replace('{functionId}', functionId);
|
|
6329
|
+
const payload = {};
|
|
6330
|
+
if (typeof limit !== 'undefined') {
|
|
6331
|
+
payload['limit'] = limit;
|
|
6332
|
+
}
|
|
6333
|
+
if (typeof offset !== 'undefined') {
|
|
6334
|
+
payload['offset'] = offset;
|
|
6335
|
+
}
|
|
6336
|
+
if (typeof total !== 'undefined') {
|
|
6337
|
+
payload['total'] = total;
|
|
6338
|
+
}
|
|
6339
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6340
|
+
const apiHeaders = {
|
|
6341
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
6342
|
+
};
|
|
6343
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
6344
|
+
}
|
|
6345
|
+
listExecutionsByPath(paramsOrFirst, ...rest) {
|
|
6346
|
+
let params;
|
|
6347
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
6348
|
+
params = (paramsOrFirst || {});
|
|
6349
|
+
}
|
|
6350
|
+
else {
|
|
6351
|
+
params = {
|
|
6352
|
+
functionId: paramsOrFirst,
|
|
6353
|
+
xpath: rest[0],
|
|
6354
|
+
queries: rest[1],
|
|
6355
|
+
total: rest[2]
|
|
6356
|
+
};
|
|
6357
|
+
}
|
|
6358
|
+
const functionId = params.functionId;
|
|
6359
|
+
const xpath = params.xpath;
|
|
6360
|
+
const queries = params.queries;
|
|
6361
|
+
const total = params.total;
|
|
6362
|
+
if (typeof functionId === 'undefined') {
|
|
6363
|
+
throw new AgentbaseException('Missing required parameter: "functionId"');
|
|
6364
|
+
}
|
|
6365
|
+
if (typeof xpath === 'undefined') {
|
|
6366
|
+
throw new AgentbaseException('Missing required parameter: "xpath"');
|
|
6367
|
+
}
|
|
6368
|
+
const apiPath = '/functions/{functionId}/execution-paths/executions'.replace('{functionId}', functionId);
|
|
6369
|
+
const payload = {};
|
|
6370
|
+
if (typeof xpath !== 'undefined') {
|
|
6371
|
+
payload['path'] = xpath;
|
|
6372
|
+
}
|
|
6373
|
+
if (typeof queries !== 'undefined') {
|
|
6374
|
+
payload['queries'] = queries;
|
|
6375
|
+
}
|
|
6376
|
+
if (typeof total !== 'undefined') {
|
|
6377
|
+
payload['total'] = total;
|
|
6378
|
+
}
|
|
6379
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6380
|
+
const apiHeaders = {
|
|
6381
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
6382
|
+
};
|
|
6383
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
6384
|
+
}
|
|
6308
6385
|
listExecutions(paramsOrFirst, ...rest) {
|
|
6309
6386
|
let params;
|
|
6310
6387
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|