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/iife/sdk.js
CHANGED
|
@@ -4412,9 +4412,9 @@
|
|
|
4412
4412
|
'x-sdk-name': 'Agentbase',
|
|
4413
4413
|
'x-sdk-platform': 'client',
|
|
4414
4414
|
'x-sdk-language': 'web',
|
|
4415
|
-
'x-sdk-version': '2.
|
|
4415
|
+
'x-sdk-version': '2.9.0',
|
|
4416
4416
|
'X-AppBase-SDK': 'true',
|
|
4417
|
-
'X-Appwrite-Response-Format': '2.
|
|
4417
|
+
'X-Appwrite-Response-Format': '2.9.0',
|
|
4418
4418
|
};
|
|
4419
4419
|
this.realtime = {
|
|
4420
4420
|
socket: undefined,
|
|
@@ -10105,6 +10105,83 @@
|
|
|
10105
10105
|
constructor(client) {
|
|
10106
10106
|
this.client = client;
|
|
10107
10107
|
}
|
|
10108
|
+
listExecutionPaths(paramsOrFirst, ...rest) {
|
|
10109
|
+
let params;
|
|
10110
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10111
|
+
params = (paramsOrFirst || {});
|
|
10112
|
+
}
|
|
10113
|
+
else {
|
|
10114
|
+
params = {
|
|
10115
|
+
functionId: paramsOrFirst,
|
|
10116
|
+
limit: rest[0],
|
|
10117
|
+
offset: rest[1],
|
|
10118
|
+
total: rest[2]
|
|
10119
|
+
};
|
|
10120
|
+
}
|
|
10121
|
+
const functionId = params.functionId;
|
|
10122
|
+
const limit = params.limit;
|
|
10123
|
+
const offset = params.offset;
|
|
10124
|
+
const total = params.total;
|
|
10125
|
+
if (typeof functionId === 'undefined') {
|
|
10126
|
+
throw new AgentbaseException('Missing required parameter: "functionId"');
|
|
10127
|
+
}
|
|
10128
|
+
const apiPath = '/functions/{functionId}/execution-paths'.replace('{functionId}', functionId);
|
|
10129
|
+
const payload = {};
|
|
10130
|
+
if (typeof limit !== 'undefined') {
|
|
10131
|
+
payload['limit'] = limit;
|
|
10132
|
+
}
|
|
10133
|
+
if (typeof offset !== 'undefined') {
|
|
10134
|
+
payload['offset'] = offset;
|
|
10135
|
+
}
|
|
10136
|
+
if (typeof total !== 'undefined') {
|
|
10137
|
+
payload['total'] = total;
|
|
10138
|
+
}
|
|
10139
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10140
|
+
const apiHeaders = {
|
|
10141
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10142
|
+
};
|
|
10143
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
10144
|
+
}
|
|
10145
|
+
listExecutionsByPath(paramsOrFirst, ...rest) {
|
|
10146
|
+
let params;
|
|
10147
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10148
|
+
params = (paramsOrFirst || {});
|
|
10149
|
+
}
|
|
10150
|
+
else {
|
|
10151
|
+
params = {
|
|
10152
|
+
functionId: paramsOrFirst,
|
|
10153
|
+
xpath: rest[0],
|
|
10154
|
+
queries: rest[1],
|
|
10155
|
+
total: rest[2]
|
|
10156
|
+
};
|
|
10157
|
+
}
|
|
10158
|
+
const functionId = params.functionId;
|
|
10159
|
+
const xpath = params.xpath;
|
|
10160
|
+
const queries = params.queries;
|
|
10161
|
+
const total = params.total;
|
|
10162
|
+
if (typeof functionId === 'undefined') {
|
|
10163
|
+
throw new AgentbaseException('Missing required parameter: "functionId"');
|
|
10164
|
+
}
|
|
10165
|
+
if (typeof xpath === 'undefined') {
|
|
10166
|
+
throw new AgentbaseException('Missing required parameter: "xpath"');
|
|
10167
|
+
}
|
|
10168
|
+
const apiPath = '/functions/{functionId}/execution-paths/executions'.replace('{functionId}', functionId);
|
|
10169
|
+
const payload = {};
|
|
10170
|
+
if (typeof xpath !== 'undefined') {
|
|
10171
|
+
payload['path'] = xpath;
|
|
10172
|
+
}
|
|
10173
|
+
if (typeof queries !== 'undefined') {
|
|
10174
|
+
payload['queries'] = queries;
|
|
10175
|
+
}
|
|
10176
|
+
if (typeof total !== 'undefined') {
|
|
10177
|
+
payload['total'] = total;
|
|
10178
|
+
}
|
|
10179
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10180
|
+
const apiHeaders = {
|
|
10181
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10182
|
+
};
|
|
10183
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
10184
|
+
}
|
|
10108
10185
|
listExecutions(paramsOrFirst, ...rest) {
|
|
10109
10186
|
let params;
|
|
10110
10187
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "agentbase-web-sdk",
|
|
3
3
|
"homepage": "https://appbase.local/support",
|
|
4
4
|
"description": "",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.9.0",
|
|
6
6
|
"license": "",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"jsdelivr": "dist/iife/sdk.js",
|
|
50
50
|
"unpkg": "dist/iife/sdk.js",
|
|
51
51
|
"agentbase_provenance": {
|
|
52
|
-
"build_manifest_sha256": "
|
|
52
|
+
"build_manifest_sha256": "39dbfc0e23b3e3fcd04cc79a70bac696fcefadfd49dbd2613fbb9ca8901cf6c8"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agentbase Agentbase SDK
|
|
3
3
|
*
|
|
4
|
-
* This SDK is compatible with Appwrite server version 2.
|
|
4
|
+
* This SDK is compatible with Appwrite server version 2.9.x.
|
|
5
5
|
* For older versions, please check
|
|
6
6
|
* [previous releases](https://github.com/agentbase/agentbase-web-sdk/releases).
|
|
7
7
|
*/
|
package/types/models.d.ts
CHANGED
|
@@ -190,6 +190,19 @@ export declare namespace Models {
|
|
|
190
190
|
*/
|
|
191
191
|
executions: Execution[];
|
|
192
192
|
};
|
|
193
|
+
/**
|
|
194
|
+
* Execution Paths List
|
|
195
|
+
*/
|
|
196
|
+
export type ExecutionPathList = {
|
|
197
|
+
/**
|
|
198
|
+
* Total number of distinct execution paths.
|
|
199
|
+
*/
|
|
200
|
+
total: number;
|
|
201
|
+
/**
|
|
202
|
+
* List of distinct execution paths.
|
|
203
|
+
*/
|
|
204
|
+
paths: string[];
|
|
205
|
+
};
|
|
193
206
|
/**
|
|
194
207
|
* Countries List
|
|
195
208
|
*/
|
|
@@ -363,6 +376,18 @@ export declare namespace Models {
|
|
|
363
376
|
* Document permissions. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
364
377
|
*/
|
|
365
378
|
$permissions: string[];
|
|
379
|
+
/**
|
|
380
|
+
* Moderation disposition: checking, published, quarantined, private_hold. Only present when moderation is active.
|
|
381
|
+
*/
|
|
382
|
+
moderationStatus: string;
|
|
383
|
+
/**
|
|
384
|
+
* ID of the moderation job processing this document. Only present when moderation is active.
|
|
385
|
+
*/
|
|
386
|
+
moderationJobId: string;
|
|
387
|
+
/**
|
|
388
|
+
* Monotonically increasing version of the document content, used by moderation to track which version was reviewed.
|
|
389
|
+
*/
|
|
390
|
+
contentVersion: number;
|
|
366
391
|
};
|
|
367
392
|
export type DefaultDocument = Document & {
|
|
368
393
|
[key: string]: any;
|
|
@@ -2118,6 +2143,10 @@ export declare namespace Models {
|
|
|
2118
2143
|
* Safe projections of the available model sources.
|
|
2119
2144
|
*/
|
|
2120
2145
|
sources?: object[];
|
|
2146
|
+
/**
|
|
2147
|
+
* Resolved per-model metadata (stored provider metadata merged over the built-in preset catalog) when available.
|
|
2148
|
+
*/
|
|
2149
|
+
metadata?: object;
|
|
2121
2150
|
/**
|
|
2122
2151
|
* Current account-model trial quota when a platform trial source is available.
|
|
2123
2152
|
*/
|
|
@@ -129,6 +129,8 @@ export declare class Databases {
|
|
|
129
129
|
/**
|
|
130
130
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
131
131
|
*
|
|
132
|
+
* 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.
|
|
133
|
+
*
|
|
132
134
|
* @param {string} params.databaseId - Database ID.
|
|
133
135
|
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
134
136
|
* @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.
|
|
@@ -150,6 +152,8 @@ export declare class Databases {
|
|
|
150
152
|
/**
|
|
151
153
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
152
154
|
*
|
|
155
|
+
* 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.
|
|
156
|
+
*
|
|
153
157
|
* @param {string} databaseId - Database ID.
|
|
154
158
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
155
159
|
* @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.
|
|
@@ -117,6 +117,8 @@ export declare class DocumentsDB {
|
|
|
117
117
|
/**
|
|
118
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
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
|
+
*
|
|
120
122
|
* @param {string} params.databaseId - Database ID.
|
|
121
123
|
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
122
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.
|
|
@@ -137,6 +139,8 @@ export declare class DocumentsDB {
|
|
|
137
139
|
/**
|
|
138
140
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
139
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
|
+
*
|
|
140
144
|
* @param {string} databaseId - Database ID.
|
|
141
145
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration]([HOSTNAME]/docs/server/databases#databasesCreateCollection).
|
|
142
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.
|
|
@@ -4,6 +4,62 @@ import { ExecutionMethod } from '../enums/execution-method';
|
|
|
4
4
|
export declare class Functions {
|
|
5
5
|
client: Client;
|
|
6
6
|
constructor(client: Client);
|
|
7
|
+
/**
|
|
8
|
+
* Get a paginated list of distinct request paths from the current user function executions.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} params.functionId - Function ID.
|
|
11
|
+
* @param {number} params.limit - Maximum number of execution paths to return.
|
|
12
|
+
* @param {number} params.offset - Number of execution paths to skip.
|
|
13
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0.
|
|
14
|
+
* @throws {AgentbaseException}
|
|
15
|
+
* @returns {Promise<Models.ExecutionPathList>}
|
|
16
|
+
*/
|
|
17
|
+
listExecutionPaths(params: {
|
|
18
|
+
functionId: string;
|
|
19
|
+
limit?: number;
|
|
20
|
+
offset?: number;
|
|
21
|
+
total?: boolean;
|
|
22
|
+
}): Promise<Models.ExecutionPathList>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a paginated list of distinct request paths from the current user function executions.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} functionId - Function ID.
|
|
27
|
+
* @param {number} limit - Maximum number of execution paths to return.
|
|
28
|
+
* @param {number} offset - Number of execution paths to skip.
|
|
29
|
+
* @param {boolean} total - When set to false, the total count returned will be 0.
|
|
30
|
+
* @throws {AgentbaseException}
|
|
31
|
+
* @returns {Promise<Models.ExecutionPathList>}
|
|
32
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
33
|
+
*/
|
|
34
|
+
listExecutionPaths(functionId: string, limit?: number, offset?: number, total?: boolean): Promise<Models.ExecutionPathList>;
|
|
35
|
+
/**
|
|
36
|
+
* Get a paginated list of function executions whose request path exactly matches the given path.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} params.functionId - Function ID.
|
|
39
|
+
* @param {string} params.xpath - Exact execution request path to match.
|
|
40
|
+
* @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.
|
|
41
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
42
|
+
* @throws {AgentbaseException}
|
|
43
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
44
|
+
*/
|
|
45
|
+
listExecutionsByPath(params: {
|
|
46
|
+
functionId: string;
|
|
47
|
+
xpath: string;
|
|
48
|
+
queries?: string[];
|
|
49
|
+
total?: boolean;
|
|
50
|
+
}): Promise<Models.ExecutionList>;
|
|
51
|
+
/**
|
|
52
|
+
* Get a paginated list of function executions whose request path exactly matches the given path.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} functionId - Function ID.
|
|
55
|
+
* @param {string} xpath - Exact execution request path to match.
|
|
56
|
+
* @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.
|
|
57
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
58
|
+
* @throws {AgentbaseException}
|
|
59
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
60
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
61
|
+
*/
|
|
62
|
+
listExecutionsByPath(functionId: string, xpath: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
|
|
7
63
|
/**
|
|
8
64
|
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
|
9
65
|
*
|
|
@@ -165,6 +165,8 @@ export declare class TablesDB {
|
|
|
165
165
|
/**
|
|
166
166
|
* Get a list of all the user's rows in a given table. You can use the query params to filter your results.
|
|
167
167
|
*
|
|
168
|
+
* When Moderation Phase 2 is enabled, unpublished rows (`checking` / `private_hold` / `quarantined`, and similar intermediate dispositions) are hidden from non-creators. The response `total` is corrected approximately: pure pagination subtracts a table-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.
|
|
169
|
+
*
|
|
168
170
|
* @param {string} params.databaseId - Database ID.
|
|
169
171
|
* @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration]([HOSTNAME]/docs/products/databases/tables#create-table).
|
|
170
172
|
* @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.
|
|
@@ -185,6 +187,8 @@ export declare class TablesDB {
|
|
|
185
187
|
/**
|
|
186
188
|
* Get a list of all the user's rows in a given table. You can use the query params to filter your results.
|
|
187
189
|
*
|
|
190
|
+
* When Moderation Phase 2 is enabled, unpublished rows (`checking` / `private_hold` / `quarantined`, and similar intermediate dispositions) are hidden from non-creators. The response `total` is corrected approximately: pure pagination subtracts a table-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.
|
|
191
|
+
*
|
|
188
192
|
* @param {string} databaseId - Database ID.
|
|
189
193
|
* @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration]([HOSTNAME]/docs/products/databases/tables#create-table).
|
|
190
194
|
* @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.
|