agentbase-web-sdk 2.8.0 → 2.10.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/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.8.0",
5
+ "version": "2.10.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": "ae62fff9e9d2c1b81a7040fafaa455cc9a28981039d541cd6e8843c74b172d96"
52
+ "build_manifest_sha256": "cf5a228579f38c6f19462c8a34ad7851d76cf277de4976f947d4c3a5b3314c96"
53
53
  }
54
54
  }
@@ -0,0 +1,9 @@
1
+ export declare enum Method {
2
+ GET = "GET",
3
+ POST = "POST",
4
+ PUT = "PUT",
5
+ PATCH = "PATCH",
6
+ DELETE = "DELETE",
7
+ OPTIONS = "OPTIONS",
8
+ HEAD = "HEAD"
9
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum PathMatch {
2
+ Exact = "exact",
3
+ Regex = "regex"
4
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum Scenario {
2
+ AddMemory = "add_memory",
3
+ Profile = "profile",
4
+ Distillation = "distillation",
5
+ Forgetting = "forgetting"
6
+ }
@@ -13,5 +13,9 @@ export declare enum Status {
13
13
  Succeeded = "succeeded",
14
14
  PartialFailed = "partial_failed",
15
15
  Failed = "failed",
16
- Dead = "dead"
16
+ Dead = "dead",
17
+ Pending = "pending",
18
+ Approved = "approved",
19
+ Rejected = "rejected",
20
+ Superseded = "superseded"
17
21
  }
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.8.x.
4
+ * This SDK is compatible with Appwrite server version 2.10.x.
5
5
  * For older versions, please check
6
6
  * [previous releases](https://github.com/agentbase/agentbase-web-sdk/releases).
7
7
  */
@@ -45,6 +45,8 @@ export { Theme } from './enums/theme';
45
45
  export { Timezone } from './enums/timezone';
46
46
  export { BrowserPermission } from './enums/browser-permission';
47
47
  export { ImageFormat } from './enums/image-format';
48
+ export { PathMatch } from './enums/path-match';
49
+ export { Method } from './enums/method';
48
50
  export { ExecutionMethod } from './enums/execution-method';
49
51
  export { MemoryAccessMode } from './enums/memory-access-mode';
50
52
  export { MemoryScope } from './enums/memory-scope';
@@ -67,6 +69,7 @@ export { ProfileType } from './enums/profile-type';
67
69
  export { ProfileExtractionMode } from './enums/profile-extraction-mode';
68
70
  export { RetentionPolicy } from './enums/retention-policy';
69
71
  export { MemoryShareSubjectType } from './enums/memory-share-subject-type';
72
+ export { Scenario } from './enums/scenario';
70
73
  export { OrganizationRole } from './enums/organization-role';
71
74
  export { OrganizationUsageRange } from './enums/organization-usage-range';
72
75
  export { ImageGravity } from './enums/image-gravity';
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.
@@ -1,15 +1,91 @@
1
1
  import { Client } from '../client';
2
2
  import type { Models } from '../models';
3
+ import { PathMatch } from '../enums/path-match';
4
+ import { Method } from '../enums/method';
3
5
  import { ExecutionMethod } from '../enums/execution-method';
4
6
  export declare class Functions {
5
7
  client: Client;
6
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>;
7
80
  /**
8
81
  * Get a list of all the current user function execution logs. You can use the query params to filter your results.
9
82
  *
10
83
  * @param {string} params.functionId - Function ID.
11
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
12
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.
13
89
  * @throws {AgentbaseException}
14
90
  * @returns {Promise<Models.ExecutionList>}
15
91
  */
@@ -17,6 +93,9 @@ export declare class Functions {
17
93
  functionId: string;
18
94
  queries?: string[];
19
95
  total?: boolean;
96
+ xpath?: string;
97
+ pathMatch?: PathMatch;
98
+ method?: Method;
20
99
  }): Promise<Models.ExecutionList>;
21
100
  /**
22
101
  * Get a list of all the current user function execution logs. You can use the query params to filter your results.
@@ -24,11 +103,14 @@ export declare class Functions {
24
103
  * @param {string} functionId - Function ID.
25
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
26
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.
27
109
  * @throws {AgentbaseException}
28
110
  * @returns {Promise<Models.ExecutionList>}
29
111
  * @deprecated Use the object parameter style method for a better developer experience.
30
112
  */
31
- listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
113
+ listExecutions(functionId: string, queries?: string[], total?: boolean, xpath?: string, pathMatch?: PathMatch, method?: Method): Promise<Models.ExecutionList>;
32
114
  /**
33
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.
34
116
  *