@appwrite.io/console 15.8.0 → 16.1.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 +5 -6
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/sdk.js +8360 -4537
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/sdk.js +8359 -4538
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +8360 -4537
- package/package.json +59 -50
- package/types/client.d.ts +13 -2
- package/types/enums/{addon.d.ts → addon-key.d.ts} +1 -1
- package/types/enums/authentication-factor.d.ts +2 -1
- package/types/enums/build-runtime.d.ts +4 -1
- package/types/enums/embedding-model.d.ts +1 -3
- package/types/enums/execution-resource-type.d.ts +4 -0
- package/types/enums/image-gravity.d.ts +1 -0
- package/types/enums/invalidation-type.d.ts +5 -0
- package/types/enums/o-auth-provider.d.ts +5 -0
- package/types/enums/project-key-scopes.d.ts +20 -3
- package/types/enums/project-o-auth-provider-id.d.ts +5 -0
- package/types/enums/project-policy-id.d.ts +1 -0
- package/types/enums/query-suggestion-resource.d.ts +5 -1
- package/types/enums/runtime.d.ts +4 -1
- package/types/enums/usage-event-dimension.d.ts +27 -0
- package/types/enums/usage-event-metric.d.ts +55 -0
- package/types/enums/usage-gauge-dimension.d.ts +7 -0
- package/types/enums/usage-gauge-metric.d.ts +50 -0
- package/types/enums/usage-interval.d.ts +7 -0
- package/types/enums/usage-order-by.d.ts +4 -0
- package/types/enums/usage-order-direction.d.ts +4 -0
- package/types/index.d.ts +19 -6
- package/types/models.d.ts +764 -313
- package/types/services/account.d.ts +8 -8
- package/types/services/affiliates.d.ts +162 -0
- package/types/services/apps.d.ts +6 -6
- package/types/services/avatars.d.ts +44 -0
- package/types/services/databases.d.ts +8 -8
- package/types/services/documents-db.d.ts +13 -7
- package/types/services/domains.d.ts +82 -54
- package/types/services/embeddings.d.ts +31 -0
- package/types/services/functions.d.ts +6 -6
- package/types/services/mongo.d.ts +17 -23
- package/types/services/mysql.d.ts +17 -23
- package/types/services/organizations.d.ts +5 -5
- package/types/services/postgresql.d.ts +17 -23
- package/types/services/project.d.ts +171 -15
- package/types/services/proxy.d.ts +30 -0
- package/types/services/sites.d.ts +15 -8
- package/types/services/storage.d.ts +6 -6
- package/types/services/tables-db.d.ts +37 -12
- package/types/services/usage.d.ts +52 -38
- package/types/services/users.d.ts +24 -2
- package/types/services/vectors-db.d.ts +15 -34
- package/types/services/waf.d.ts +11 -2
|
@@ -69,7 +69,7 @@ export declare class TablesDB {
|
|
|
69
69
|
*/
|
|
70
70
|
create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
|
|
71
71
|
/**
|
|
72
|
-
* List the dedicated database specifications available on the current plan. Each specification reports its resource limits,
|
|
72
|
+
* List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization.
|
|
73
73
|
*
|
|
74
74
|
* @throws {AppwriteException}
|
|
75
75
|
* @returns {Promise<Models.DedicatedDatabaseSpecificationList>}
|
|
@@ -271,7 +271,7 @@ export declare class TablesDB {
|
|
|
271
271
|
*/
|
|
272
272
|
delete(databaseId: string): Promise<{}>;
|
|
273
273
|
/**
|
|
274
|
-
* Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation
|
|
274
|
+
* Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
|
|
275
275
|
*
|
|
276
276
|
* @param {string} params.databaseId - Database ID.
|
|
277
277
|
* @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
|
|
@@ -283,7 +283,7 @@ export declare class TablesDB {
|
|
|
283
283
|
targetReplicaId?: string;
|
|
284
284
|
}): Promise<Models.DedicatedDatabase>;
|
|
285
285
|
/**
|
|
286
|
-
* Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation
|
|
286
|
+
* Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
|
|
287
287
|
*
|
|
288
288
|
* @param {string} databaseId - Database ID.
|
|
289
289
|
* @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
|
|
@@ -316,23 +316,26 @@ export declare class TablesDB {
|
|
|
316
316
|
*
|
|
317
317
|
* @param {string} params.databaseId - Database ID.
|
|
318
318
|
* @param {string} params.specification - Dedicated compute specification to provision as the migration target (e.g. s-2vcpu-4gb). The migration always targets a dedicated compute, so `serverless` is not accepted.
|
|
319
|
+
* @param {boolean} params.autoCutover - Whether to cut over automatically once the copy is verified. When disabled the migration parks at ready_to_cutover and holds there until the cutover is performed manually.
|
|
319
320
|
* @throws {AppwriteException}
|
|
320
321
|
* @returns {Promise<Models.DatabaseMigration>}
|
|
321
322
|
*/
|
|
322
323
|
createMigration(params: {
|
|
323
324
|
databaseId: string;
|
|
324
325
|
specification: string;
|
|
326
|
+
autoCutover?: boolean;
|
|
325
327
|
}): Promise<Models.DatabaseMigration>;
|
|
326
328
|
/**
|
|
327
329
|
* Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live, with a brief read-only window during cutover.
|
|
328
330
|
*
|
|
329
331
|
* @param {string} databaseId - Database ID.
|
|
330
332
|
* @param {string} specification - Dedicated compute specification to provision as the migration target (e.g. s-2vcpu-4gb). The migration always targets a dedicated compute, so `serverless` is not accepted.
|
|
333
|
+
* @param {boolean} autoCutover - Whether to cut over automatically once the copy is verified. When disabled the migration parks at ready_to_cutover and holds there until the cutover is performed manually.
|
|
331
334
|
* @throws {AppwriteException}
|
|
332
335
|
* @returns {Promise<Models.DatabaseMigration>}
|
|
333
336
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
334
337
|
*/
|
|
335
|
-
createMigration(databaseId: string, specification: string): Promise<Models.DatabaseMigration>;
|
|
338
|
+
createMigration(databaseId: string, specification: string, autoCutover?: boolean): Promise<Models.DatabaseMigration>;
|
|
336
339
|
/**
|
|
337
340
|
* Get a single dedicated migration for a TablesDB database by its ID.
|
|
338
341
|
*
|
|
@@ -377,6 +380,28 @@ export declare class TablesDB {
|
|
|
377
380
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
378
381
|
*/
|
|
379
382
|
deleteMigration(databaseId: string, migrationId: string): Promise<{}>;
|
|
383
|
+
/**
|
|
384
|
+
* Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns, with a brief read-only window. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry.
|
|
385
|
+
*
|
|
386
|
+
* @param {string} params.databaseId - Database ID.
|
|
387
|
+
* @param {string} params.migrationId - Migration ID.
|
|
388
|
+
* @throws {AppwriteException}
|
|
389
|
+
* @returns {Promise<Models.DatabaseMigration>}
|
|
390
|
+
*/
|
|
391
|
+
createCutover(params: {
|
|
392
|
+
databaseId: string;
|
|
393
|
+
migrationId: string;
|
|
394
|
+
}): Promise<Models.DatabaseMigration>;
|
|
395
|
+
/**
|
|
396
|
+
* Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns, with a brief read-only window. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry.
|
|
397
|
+
*
|
|
398
|
+
* @param {string} databaseId - Database ID.
|
|
399
|
+
* @param {string} migrationId - Migration ID.
|
|
400
|
+
* @throws {AppwriteException}
|
|
401
|
+
* @returns {Promise<Models.DatabaseMigration>}
|
|
402
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
403
|
+
*/
|
|
404
|
+
createCutover(databaseId: string, migrationId: string): Promise<Models.DatabaseMigration>;
|
|
380
405
|
/**
|
|
381
406
|
* List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database.
|
|
382
407
|
*
|
|
@@ -480,7 +505,7 @@ export declare class TablesDB {
|
|
|
480
505
|
* @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
481
506
|
* @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
482
507
|
* @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
483
|
-
* @param {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer,
|
|
508
|
+
* @param {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
484
509
|
* @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
485
510
|
* @throws {AppwriteException}
|
|
486
511
|
* @returns {Promise<Models.Table>}
|
|
@@ -504,7 +529,7 @@ export declare class TablesDB {
|
|
|
504
529
|
* @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
505
530
|
* @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
506
531
|
* @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
507
|
-
* @param {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer,
|
|
532
|
+
* @param {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
508
533
|
* @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
509
534
|
* @throws {AppwriteException}
|
|
510
535
|
* @returns {Promise<Models.Table>}
|
|
@@ -1582,11 +1607,11 @@ export declare class TablesDB {
|
|
|
1582
1607
|
* @param {string} params.databaseId - Database ID.
|
|
1583
1608
|
* @param {string} params.tableId - Table ID.
|
|
1584
1609
|
* @param {string} params.relatedTableId - Related Table ID.
|
|
1585
|
-
* @param {RelationshipType} params.type -
|
|
1610
|
+
* @param {RelationshipType} params.type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany.
|
|
1586
1611
|
* @param {boolean} params.twoWay - Is Two Way?
|
|
1587
1612
|
* @param {string} params.key - Column Key.
|
|
1588
1613
|
* @param {string} params.twoWayKey - Two Way Column Key.
|
|
1589
|
-
* @param {RelationMutate} params.onDelete -
|
|
1614
|
+
* @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull.
|
|
1590
1615
|
* @throws {AppwriteException}
|
|
1591
1616
|
* @returns {Promise<Models.ColumnRelationship>}
|
|
1592
1617
|
*/
|
|
@@ -1607,11 +1632,11 @@ export declare class TablesDB {
|
|
|
1607
1632
|
* @param {string} databaseId - Database ID.
|
|
1608
1633
|
* @param {string} tableId - Table ID.
|
|
1609
1634
|
* @param {string} relatedTableId - Related Table ID.
|
|
1610
|
-
* @param {RelationshipType} type -
|
|
1635
|
+
* @param {RelationshipType} type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany.
|
|
1611
1636
|
* @param {boolean} twoWay - Is Two Way?
|
|
1612
1637
|
* @param {string} key - Column Key.
|
|
1613
1638
|
* @param {string} twoWayKey - Two Way Column Key.
|
|
1614
|
-
* @param {RelationMutate} onDelete -
|
|
1639
|
+
* @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull.
|
|
1615
1640
|
* @throws {AppwriteException}
|
|
1616
1641
|
* @returns {Promise<Models.ColumnRelationship>}
|
|
1617
1642
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
@@ -1985,7 +2010,7 @@ export declare class TablesDB {
|
|
|
1985
2010
|
* @param {string} params.databaseId - Database ID.
|
|
1986
2011
|
* @param {string} params.tableId - Table ID.
|
|
1987
2012
|
* @param {string} params.key - Column Key.
|
|
1988
|
-
* @param {RelationMutate} params.onDelete -
|
|
2013
|
+
* @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull.
|
|
1989
2014
|
* @param {string} params.newKey - New Column Key.
|
|
1990
2015
|
* @throws {AppwriteException}
|
|
1991
2016
|
* @returns {Promise<Models.ColumnRelationship>}
|
|
@@ -2004,7 +2029,7 @@ export declare class TablesDB {
|
|
|
2004
2029
|
* @param {string} databaseId - Database ID.
|
|
2005
2030
|
* @param {string} tableId - Table ID.
|
|
2006
2031
|
* @param {string} key - Column Key.
|
|
2007
|
-
* @param {RelationMutate} onDelete -
|
|
2032
|
+
* @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull.
|
|
2008
2033
|
* @param {string} newKey - New Column Key.
|
|
2009
2034
|
* @throws {AppwriteException}
|
|
2010
2035
|
* @returns {Promise<Models.ColumnRelationship>}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { Client } from '../client';
|
|
2
2
|
import type { Models } from '../models';
|
|
3
|
+
import { UsageEventMetric } from '../enums/usage-event-metric';
|
|
4
|
+
import { UsageInterval } from '../enums/usage-interval';
|
|
5
|
+
import { UsageEventDimension } from '../enums/usage-event-dimension';
|
|
6
|
+
import { UsageOrderBy } from '../enums/usage-order-by';
|
|
7
|
+
import { UsageOrderDirection } from '../enums/usage-order-direction';
|
|
8
|
+
import { UsageGaugeMetric } from '../enums/usage-gauge-metric';
|
|
9
|
+
import { UsageGaugeDimension } from '../enums/usage-gauge-dimension';
|
|
3
10
|
export declare class Usage {
|
|
4
11
|
client: Client;
|
|
5
12
|
constructor(client: Client);
|
|
@@ -12,28 +19,28 @@ export declare class Usage {
|
|
|
12
19
|
*
|
|
13
20
|
* `dimensions[]` breaks each point down by one or more attributes (service, path, status, country, …). `queries[]` filters the underlying events using the standard Utopia query syntax — `equal("path", ["/v1/storage/files"])`, `equal("resourceType", ["bucket"])`, `equal("resourceId", ["abc123"])`, `startsWith("path", ["/v1/storage"])`, `equal("status", ["200", "201"])`, `isNotNull("resourceId")`. Supported attributes: see `queries[]` param. Supported methods: `equal`, `notEqual`, `contains`, `startsWith`, `endsWith`, `isNull`, `isNotNull`. Pass multiple metrics to render stacked charts in one round-trip. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N by aggregated value. When `startAt` is omitted, the default window adapts to `interval` (or 7d when interval is omitted).
|
|
14
21
|
*
|
|
15
|
-
* @param {string[]} params.metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=executions` or `metrics[]=executions&metrics[]=executions.compute` for stacked charts.
|
|
16
|
-
* @param {string[]} params.queries - Up to 10 filter queries in Utopia syntax. Allowed attributes: path, method, status, service, resourceType, resourceId, teamId, country, continentCode, city, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion. Allowed methods: equal, notEqual, contains, startsWith, endsWith, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
22
|
+
* @param {(UsageEventMetric | (string & {}))[]} params.metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=executions` or `metrics[]=executions&metrics[]=executions.compute` for stacked charts. On console: `metrics[]=affiliates.clicks`.
|
|
23
|
+
* @param {string[]} params.queries - Up to 10 filter queries in Utopia syntax. Allowed attributes, also published as the `UsageEventDimension` enum: path, method, status, service, resourceType, resourceId, teamId, country, continentCode, city, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion, isp, autonomousSystemNumber, autonomousSystemOrganization, connectionType, connectionUsageType, connectionOrganization. Allowed methods: equal, notEqual, contains, startsWith, endsWith, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
|
|
24
|
+
* @param {UsageInterval} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
|
|
25
|
+
* @param {UsageEventDimension[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resourceType, country, continentCode, city, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion, teamId, resourceId, isp, autonomousSystemNumber, autonomousSystemOrganization, connectionType, connectionUsageType, connectionOrganization.
|
|
19
26
|
* @param {string} params.startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
|
|
20
27
|
* @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {
|
|
28
|
+
* @param {UsageOrderBy} params.orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
|
|
29
|
+
* @param {UsageOrderDirection} params.orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, returns the most recent / highest-value groups first.
|
|
23
30
|
* @param {number} params.limit - Maximum rows to return (1-5000).
|
|
24
31
|
* @param {number} params.offset - Pagination offset (0-100000).
|
|
25
32
|
* @throws {AppwriteException}
|
|
26
33
|
* @returns {Promise<Models.UsageEventList>}
|
|
27
34
|
*/
|
|
28
35
|
listEvents(params: {
|
|
29
|
-
metrics: string[];
|
|
36
|
+
metrics: (UsageEventMetric | (string & {}))[];
|
|
30
37
|
queries?: string[];
|
|
31
|
-
interval?:
|
|
32
|
-
dimensions?:
|
|
38
|
+
interval?: UsageInterval;
|
|
39
|
+
dimensions?: UsageEventDimension[];
|
|
33
40
|
startAt?: string;
|
|
34
41
|
endAt?: string;
|
|
35
|
-
orderBy?:
|
|
36
|
-
orderDir?:
|
|
42
|
+
orderBy?: UsageOrderBy;
|
|
43
|
+
orderDir?: UsageOrderDirection;
|
|
37
44
|
limit?: number;
|
|
38
45
|
offset?: number;
|
|
39
46
|
}): Promise<Models.UsageEventList>;
|
|
@@ -46,21 +53,21 @@ export declare class Usage {
|
|
|
46
53
|
*
|
|
47
54
|
* `dimensions[]` breaks each point down by one or more attributes (service, path, status, country, …). `queries[]` filters the underlying events using the standard Utopia query syntax — `equal("path", ["/v1/storage/files"])`, `equal("resourceType", ["bucket"])`, `equal("resourceId", ["abc123"])`, `startsWith("path", ["/v1/storage"])`, `equal("status", ["200", "201"])`, `isNotNull("resourceId")`. Supported attributes: see `queries[]` param. Supported methods: `equal`, `notEqual`, `contains`, `startsWith`, `endsWith`, `isNull`, `isNotNull`. Pass multiple metrics to render stacked charts in one round-trip. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N by aggregated value. When `startAt` is omitted, the default window adapts to `interval` (or 7d when interval is omitted).
|
|
48
55
|
*
|
|
49
|
-
* @param {string[]} metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=executions` or `metrics[]=executions&metrics[]=executions.compute` for stacked charts.
|
|
50
|
-
* @param {string[]} queries - Up to 10 filter queries in Utopia syntax. Allowed attributes: path, method, status, service, resourceType, resourceId, teamId, country, continentCode, city, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion. Allowed methods: equal, notEqual, contains, startsWith, endsWith, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
|
|
51
|
-
* @param {
|
|
52
|
-
* @param {
|
|
56
|
+
* @param {(UsageEventMetric | (string & {}))[]} metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=executions` or `metrics[]=executions&metrics[]=executions.compute` for stacked charts. On console: `metrics[]=affiliates.clicks`.
|
|
57
|
+
* @param {string[]} queries - Up to 10 filter queries in Utopia syntax. Allowed attributes, also published as the `UsageEventDimension` enum: path, method, status, service, resourceType, resourceId, teamId, country, continentCode, city, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion, isp, autonomousSystemNumber, autonomousSystemOrganization, connectionType, connectionUsageType, connectionOrganization. Allowed methods: equal, notEqual, contains, startsWith, endsWith, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
|
|
58
|
+
* @param {UsageInterval} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
|
|
59
|
+
* @param {UsageEventDimension[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resourceType, country, continentCode, city, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion, teamId, resourceId, isp, autonomousSystemNumber, autonomousSystemOrganization, connectionType, connectionUsageType, connectionOrganization.
|
|
53
60
|
* @param {string} startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
|
|
54
61
|
* @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
|
|
55
|
-
* @param {
|
|
56
|
-
* @param {
|
|
62
|
+
* @param {UsageOrderBy} orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
|
|
63
|
+
* @param {UsageOrderDirection} orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, returns the most recent / highest-value groups first.
|
|
57
64
|
* @param {number} limit - Maximum rows to return (1-5000).
|
|
58
65
|
* @param {number} offset - Pagination offset (0-100000).
|
|
59
66
|
* @throws {AppwriteException}
|
|
60
67
|
* @returns {Promise<Models.UsageEventList>}
|
|
61
68
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
62
69
|
*/
|
|
63
|
-
listEvents(metrics: string[], queries?: string[], interval?:
|
|
70
|
+
listEvents(metrics: (UsageEventMetric | (string & {}))[], queries?: string[], interval?: UsageInterval, dimensions?: UsageEventDimension[], startAt?: string, endAt?: string, orderBy?: UsageOrderBy, orderDir?: UsageOrderDirection, limit?: number, offset?: number): Promise<Models.UsageEventList>;
|
|
64
71
|
/**
|
|
65
72
|
* Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each point carries the latest snapshot in its interval via `argMax(value, time)`. `metrics[]` (1-10) is required; the response always contains one entry per requested metric, each with its own `points[]` time series.
|
|
66
73
|
*
|
|
@@ -70,32 +77,36 @@ export declare class Usage {
|
|
|
70
77
|
* - Omit `interval` for a flat top-N table — `argMax(value, time)` per dimension combination over the whole window, no time axis. Useful for "top 10 resources by current storage".
|
|
71
78
|
* - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
|
|
72
79
|
*
|
|
73
|
-
* `dimensions[]` breaks each point down further. Supported on gauges: `resourceId`, `teamId`, `service`, `resourceType`, `ordinal`. `service` and `resourceType` enable per-service / per-resource-type panels (e.g. storage-by-service: group `files.storage`, `deployments.storage`, `builds.storage`, `databases.storage` by `service`). `ordinal` separates per-node series for multi-node resources such as dedicated databases
|
|
80
|
+
* `dimensions[]` breaks each point down further. Supported on gauges: `resourceId`, `teamId`, `service`, `resourceType`, `ordinal`. `service` and `resourceType` enable per-service / per-resource-type panels (e.g. storage-by-service: group `files.storage`, `deployments.storage`, `builds.storage`, `databases.storage` by `service`). `ordinal` separates per-node series for multi-node resources such as dedicated databases. It is a stable per-node identity, not a role — ordinal 0 is the first member created, and a failover can leave the primary on any ordinal, so read the role from the database's replicas endpoint rather than inferring it here. `queries[]` filters the underlying rows using the standard Utopia query syntax — `equal("resourceType", ["bucket"])`, `equal("resourceId", ["abc123"])`, `equal("teamId", ["team_x"])`, `equal("ordinal", ["0"])`, `isNotNull("teamId")`. Supported attributes: see `queries[]` param. Supported methods: `equal`, `notEqual`, `isNull`, `isNotNull`. Pass multiple metrics to render stacked charts in one round-trip. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N. When `startAt` is omitted, the default window adapts to interval (or 7d when interval is omitted).
|
|
74
81
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @param {string} params.
|
|
78
|
-
* @param {string[]} params.
|
|
82
|
+
* `aggregate` selects how the samples in a bucket are combined: `last` (default) is the latest reading — correct for a snapshot such as storage — while `max` is the highest reading. Use `max` for a sampled level series: peak concurrent realtime connections is `metrics[]=realtime.connections&aggregate=max`, at whatever `interval` the chart needs, since the peak of a set of samples is just the max of their per-bucket maxima. `realtime.connections` is served only here - it is a concurrency level, not a countable event, so `/v1/usage/events` rejects it.
|
|
83
|
+
*
|
|
84
|
+
* @param {(UsageGaugeMetric | (string & {}))[]} params.metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=files.storage` or `metrics[]=files.storage&metrics[]=deployments.storage` for stacked charts.
|
|
85
|
+
* @param {string[]} params.queries - Up to 10 filter queries in Utopia syntax. Allowed attributes, also published as the `UsageGaugeDimension` enum: service, resourceType, resourceId, teamId, ordinal. Allowed methods: equal, notEqual, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
|
|
86
|
+
* @param {UsageInterval} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
|
|
87
|
+
* @param {UsageGaugeDimension[]} params.dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType, ordinal.
|
|
79
88
|
* @param {string} params.startAt - Range start in ISO 8601. Defaults to endAt - 7d.
|
|
80
89
|
* @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
|
|
81
|
-
* @param {
|
|
82
|
-
* @param {
|
|
90
|
+
* @param {UsageOrderBy} params.orderBy - Column to order by. Allowed: time, value. Default time.
|
|
91
|
+
* @param {UsageOrderDirection} params.orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, this returns the most recent groups first. Pass asc for chronological charting.
|
|
83
92
|
* @param {number} params.limit - Maximum rows to return (1-5000).
|
|
84
93
|
* @param {number} params.offset - Pagination offset (0-100000).
|
|
94
|
+
* @param {string} params.aggregate - How to combine the samples in each bucket. `last` (default) returns the latest reading — the right answer for a snapshot such as storage. `max` returns the highest reading, which is what a sampled level series needs: peak concurrent realtime connections is the max of `realtime.connections` over the window.
|
|
85
95
|
* @throws {AppwriteException}
|
|
86
96
|
* @returns {Promise<Models.UsageGaugeList>}
|
|
87
97
|
*/
|
|
88
98
|
listGauges(params: {
|
|
89
|
-
metrics: string[];
|
|
99
|
+
metrics: (UsageGaugeMetric | (string & {}))[];
|
|
90
100
|
queries?: string[];
|
|
91
|
-
interval?:
|
|
92
|
-
dimensions?:
|
|
101
|
+
interval?: UsageInterval;
|
|
102
|
+
dimensions?: UsageGaugeDimension[];
|
|
93
103
|
startAt?: string;
|
|
94
104
|
endAt?: string;
|
|
95
|
-
orderBy?:
|
|
96
|
-
orderDir?:
|
|
105
|
+
orderBy?: UsageOrderBy;
|
|
106
|
+
orderDir?: UsageOrderDirection;
|
|
97
107
|
limit?: number;
|
|
98
108
|
offset?: number;
|
|
109
|
+
aggregate?: string;
|
|
99
110
|
}): Promise<Models.UsageGaugeList>;
|
|
100
111
|
/**
|
|
101
112
|
* Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each point carries the latest snapshot in its interval via `argMax(value, time)`. `metrics[]` (1-10) is required; the response always contains one entry per requested metric, each with its own `points[]` time series.
|
|
@@ -106,21 +117,24 @@ export declare class Usage {
|
|
|
106
117
|
* - Omit `interval` for a flat top-N table — `argMax(value, time)` per dimension combination over the whole window, no time axis. Useful for "top 10 resources by current storage".
|
|
107
118
|
* - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
|
|
108
119
|
*
|
|
109
|
-
* `dimensions[]` breaks each point down further. Supported on gauges: `resourceId`, `teamId`, `service`, `resourceType`, `ordinal`. `service` and `resourceType` enable per-service / per-resource-type panels (e.g. storage-by-service: group `files.storage`, `deployments.storage`, `builds.storage`, `databases.storage` by `service`). `ordinal` separates per-node series for multi-node resources such as dedicated databases
|
|
120
|
+
* `dimensions[]` breaks each point down further. Supported on gauges: `resourceId`, `teamId`, `service`, `resourceType`, `ordinal`. `service` and `resourceType` enable per-service / per-resource-type panels (e.g. storage-by-service: group `files.storage`, `deployments.storage`, `builds.storage`, `databases.storage` by `service`). `ordinal` separates per-node series for multi-node resources such as dedicated databases. It is a stable per-node identity, not a role — ordinal 0 is the first member created, and a failover can leave the primary on any ordinal, so read the role from the database's replicas endpoint rather than inferring it here. `queries[]` filters the underlying rows using the standard Utopia query syntax — `equal("resourceType", ["bucket"])`, `equal("resourceId", ["abc123"])`, `equal("teamId", ["team_x"])`, `equal("ordinal", ["0"])`, `isNotNull("teamId")`. Supported attributes: see `queries[]` param. Supported methods: `equal`, `notEqual`, `isNull`, `isNotNull`. Pass multiple metrics to render stacked charts in one round-trip. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N. When `startAt` is omitted, the default window adapts to interval (or 7d when interval is omitted).
|
|
121
|
+
*
|
|
122
|
+
* `aggregate` selects how the samples in a bucket are combined: `last` (default) is the latest reading — correct for a snapshot such as storage — while `max` is the highest reading. Use `max` for a sampled level series: peak concurrent realtime connections is `metrics[]=realtime.connections&aggregate=max`, at whatever `interval` the chart needs, since the peak of a set of samples is just the max of their per-bucket maxima. `realtime.connections` is served only here - it is a concurrency level, not a countable event, so `/v1/usage/events` rejects it.
|
|
110
123
|
*
|
|
111
|
-
* @param {string[]} metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=files.storage` or `metrics[]=files.storage&metrics[]=deployments.storage` for stacked charts.
|
|
112
|
-
* @param {string[]} queries - Up to 10 filter queries in Utopia syntax. Allowed attributes: service, resourceType, resourceId, teamId, ordinal. Allowed methods: equal, notEqual, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
|
|
113
|
-
* @param {
|
|
114
|
-
* @param {
|
|
124
|
+
* @param {(UsageGaugeMetric | (string & {}))[]} metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=files.storage` or `metrics[]=files.storage&metrics[]=deployments.storage` for stacked charts.
|
|
125
|
+
* @param {string[]} queries - Up to 10 filter queries in Utopia syntax. Allowed attributes, also published as the `UsageGaugeDimension` enum: service, resourceType, resourceId, teamId, ordinal. Allowed methods: equal, notEqual, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
|
|
126
|
+
* @param {UsageInterval} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
|
|
127
|
+
* @param {UsageGaugeDimension[]} dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType, ordinal.
|
|
115
128
|
* @param {string} startAt - Range start in ISO 8601. Defaults to endAt - 7d.
|
|
116
129
|
* @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
|
|
117
|
-
* @param {
|
|
118
|
-
* @param {
|
|
130
|
+
* @param {UsageOrderBy} orderBy - Column to order by. Allowed: time, value. Default time.
|
|
131
|
+
* @param {UsageOrderDirection} orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, this returns the most recent groups first. Pass asc for chronological charting.
|
|
119
132
|
* @param {number} limit - Maximum rows to return (1-5000).
|
|
120
133
|
* @param {number} offset - Pagination offset (0-100000).
|
|
134
|
+
* @param {string} aggregate - How to combine the samples in each bucket. `last` (default) returns the latest reading — the right answer for a snapshot such as storage. `max` returns the highest reading, which is what a sampled level series needs: peak concurrent realtime connections is the max of `realtime.connections` over the window.
|
|
121
135
|
* @throws {AppwriteException}
|
|
122
136
|
* @returns {Promise<Models.UsageGaugeList>}
|
|
123
137
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
124
138
|
*/
|
|
125
|
-
listGauges(metrics: string[], queries?: string[], interval?:
|
|
139
|
+
listGauges(metrics: (UsageGaugeMetric | (string & {}))[], queries?: string[], interval?: UsageInterval, dimensions?: UsageGaugeDimension[], startAt?: string, endAt?: string, orderBy?: UsageOrderBy, orderDir?: UsageOrderDirection, limit?: number, offset?: number, aggregate?: string): Promise<Models.UsageGaugeList>;
|
|
126
140
|
}
|
|
@@ -439,7 +439,7 @@ export declare class Users {
|
|
|
439
439
|
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
440
440
|
*
|
|
441
441
|
* @param {string} params.userId - User ID.
|
|
442
|
-
* @param {string} params.sessionId - Session ID. Use the string 'recent' to use the most recent session
|
|
442
|
+
* @param {string} params.sessionId - Session ID. Use the string 'recent()' to use the most recent session, which is also the default.
|
|
443
443
|
* @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
444
444
|
* @throws {AppwriteException}
|
|
445
445
|
* @returns {Promise<Models.Jwt>}
|
|
@@ -453,7 +453,7 @@ export declare class Users {
|
|
|
453
453
|
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
454
454
|
*
|
|
455
455
|
* @param {string} userId - User ID.
|
|
456
|
-
* @param {string} sessionId - Session ID. Use the string 'recent' to use the most recent session
|
|
456
|
+
* @param {string} sessionId - Session ID. Use the string 'recent()' to use the most recent session, which is also the default.
|
|
457
457
|
* @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
458
458
|
* @throws {AppwriteException}
|
|
459
459
|
* @returns {Promise<Models.Jwt>}
|
|
@@ -629,6 +629,28 @@ export declare class Users {
|
|
|
629
629
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
630
630
|
*/
|
|
631
631
|
deleteMFAAuthenticator(userId: string, type: AuthenticatorType): Promise<{}>;
|
|
632
|
+
/**
|
|
633
|
+
* Get a custom MFA challenge for a user, including the code to be delivered through your own channel.
|
|
634
|
+
*
|
|
635
|
+
* @param {string} params.userId - User ID.
|
|
636
|
+
* @param {string} params.challengeId - ID of the challenge.
|
|
637
|
+
* @throws {AppwriteException}
|
|
638
|
+
* @returns {Promise<Models.MfaChallengeSecret>}
|
|
639
|
+
*/
|
|
640
|
+
getMFAChallenge(params: {
|
|
641
|
+
userId: string;
|
|
642
|
+
challengeId: string;
|
|
643
|
+
}): Promise<Models.MfaChallengeSecret>;
|
|
644
|
+
/**
|
|
645
|
+
* Get a custom MFA challenge for a user, including the code to be delivered through your own channel.
|
|
646
|
+
*
|
|
647
|
+
* @param {string} userId - User ID.
|
|
648
|
+
* @param {string} challengeId - ID of the challenge.
|
|
649
|
+
* @throws {AppwriteException}
|
|
650
|
+
* @returns {Promise<Models.MfaChallengeSecret>}
|
|
651
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
652
|
+
*/
|
|
653
|
+
getMFAChallenge(userId: string, challengeId: string): Promise<Models.MfaChallengeSecret>;
|
|
632
654
|
/**
|
|
633
655
|
* List the factors available on the account to be used as a MFA challange.
|
|
634
656
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Client } from '../client';
|
|
2
2
|
import type { Models } from '../models';
|
|
3
|
-
import { EmbeddingModel } from '../enums/embedding-model';
|
|
4
3
|
import { VectorsDBIndexType } from '../enums/vectors-db-index-type';
|
|
5
4
|
import { OrderBy } from '../enums/order-by';
|
|
6
5
|
export declare class VectorsDB {
|
|
@@ -65,31 +64,7 @@ export declare class VectorsDB {
|
|
|
65
64
|
*/
|
|
66
65
|
create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
|
|
67
66
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @param {string[]} params.texts - Array of text to generate embeddings.
|
|
72
|
-
* @param {EmbeddingModel} params.model - The embedding model to use for generating vector embeddings.
|
|
73
|
-
* @throws {AppwriteException}
|
|
74
|
-
* @returns {Promise<Models.EmbeddingList>}
|
|
75
|
-
*/
|
|
76
|
-
createTextEmbeddings(params: {
|
|
77
|
-
texts: string[];
|
|
78
|
-
model?: EmbeddingModel;
|
|
79
|
-
}): Promise<Models.EmbeddingList>;
|
|
80
|
-
/**
|
|
81
|
-
* Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections.
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* @param {string[]} texts - Array of text to generate embeddings.
|
|
85
|
-
* @param {EmbeddingModel} model - The embedding model to use for generating vector embeddings.
|
|
86
|
-
* @throws {AppwriteException}
|
|
87
|
-
* @returns {Promise<Models.EmbeddingList>}
|
|
88
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
89
|
-
*/
|
|
90
|
-
createTextEmbeddings(texts: string[], model?: EmbeddingModel): Promise<Models.EmbeddingList>;
|
|
91
|
-
/**
|
|
92
|
-
* List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization.
|
|
67
|
+
* List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization.
|
|
93
68
|
*
|
|
94
69
|
* @throws {AppwriteException}
|
|
95
70
|
* @returns {Promise<Models.DedicatedDatabaseSpecificationList>}
|
|
@@ -441,7 +416,7 @@ export declare class VectorsDB {
|
|
|
441
416
|
*
|
|
442
417
|
* @param {string} params.databaseId - Database ID.
|
|
443
418
|
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
444
|
-
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each
|
|
419
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long.
|
|
445
420
|
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
446
421
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
447
422
|
* @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
@@ -461,7 +436,7 @@ export declare class VectorsDB {
|
|
|
461
436
|
*
|
|
462
437
|
* @param {string} databaseId - Database ID.
|
|
463
438
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
464
|
-
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each
|
|
439
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long.
|
|
465
440
|
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
466
441
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
467
442
|
* @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
@@ -478,6 +453,7 @@ export declare class VectorsDB {
|
|
|
478
453
|
* @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.
|
|
479
454
|
* @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.
|
|
480
455
|
* @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
456
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
481
457
|
* @throws {AppwriteException}
|
|
482
458
|
* @returns {Promise<Document>}
|
|
483
459
|
*/
|
|
@@ -487,6 +463,7 @@ export declare class VectorsDB {
|
|
|
487
463
|
documentId: string;
|
|
488
464
|
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
|
|
489
465
|
permissions?: string[];
|
|
466
|
+
transactionId?: string;
|
|
490
467
|
}): Promise<Document>;
|
|
491
468
|
/**
|
|
492
469
|
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
@@ -496,17 +473,19 @@ export declare class VectorsDB {
|
|
|
496
473
|
* @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.
|
|
497
474
|
* @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.
|
|
498
475
|
* @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
476
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
499
477
|
* @throws {AppwriteException}
|
|
500
478
|
* @returns {Promise<Document>}
|
|
501
479
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
502
480
|
*/
|
|
503
|
-
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>;
|
|
481
|
+
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[], transactionId?: string): Promise<Document>;
|
|
504
482
|
/**
|
|
505
483
|
* Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
506
484
|
*
|
|
507
485
|
* @param {string} params.databaseId - Database ID.
|
|
508
486
|
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
|
|
509
487
|
* @param {object[]} params.documents - Array of documents data as JSON objects.
|
|
488
|
+
* @param {string} params.transactionId - Transaction ID for staging the operation.
|
|
510
489
|
* @throws {AppwriteException}
|
|
511
490
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
512
491
|
*/
|
|
@@ -514,6 +493,7 @@ export declare class VectorsDB {
|
|
|
514
493
|
databaseId: string;
|
|
515
494
|
collectionId: string;
|
|
516
495
|
documents: object[];
|
|
496
|
+
transactionId?: string;
|
|
517
497
|
}): Promise<Models.DocumentList<Document>>;
|
|
518
498
|
/**
|
|
519
499
|
* Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
@@ -521,11 +501,12 @@ export declare class VectorsDB {
|
|
|
521
501
|
* @param {string} databaseId - Database ID.
|
|
522
502
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
|
|
523
503
|
* @param {object[]} documents - Array of documents data as JSON objects.
|
|
504
|
+
* @param {string} transactionId - Transaction ID for staging the operation.
|
|
524
505
|
* @throws {AppwriteException}
|
|
525
506
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
526
507
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
527
508
|
*/
|
|
528
|
-
createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
|
|
509
|
+
createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise<Models.DocumentList<Document>>;
|
|
529
510
|
/**
|
|
530
511
|
* Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
|
|
531
512
|
*
|
|
@@ -621,7 +602,7 @@ export declare class VectorsDB {
|
|
|
621
602
|
*
|
|
622
603
|
* @param {string} params.databaseId - Database ID.
|
|
623
604
|
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
624
|
-
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each
|
|
605
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long.
|
|
625
606
|
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
626
607
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
627
608
|
* @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
@@ -642,7 +623,7 @@ export declare class VectorsDB {
|
|
|
642
623
|
*
|
|
643
624
|
* @param {string} databaseId - Database ID.
|
|
644
625
|
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
645
|
-
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each
|
|
626
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long.
|
|
646
627
|
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
647
628
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
648
629
|
* @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
@@ -896,7 +877,7 @@ export declare class VectorsDB {
|
|
|
896
877
|
*/
|
|
897
878
|
deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>;
|
|
898
879
|
/**
|
|
899
|
-
* Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation
|
|
880
|
+
* Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
|
|
900
881
|
*
|
|
901
882
|
* @param {string} params.databaseId - Database ID.
|
|
902
883
|
* @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
|
|
@@ -908,7 +889,7 @@ export declare class VectorsDB {
|
|
|
908
889
|
targetReplicaId?: string;
|
|
909
890
|
}): Promise<Models.DedicatedDatabase>;
|
|
910
891
|
/**
|
|
911
|
-
* Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation
|
|
892
|
+
* Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
|
|
912
893
|
*
|
|
913
894
|
* @param {string} databaseId - Database ID.
|
|
914
895
|
* @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
|