@appwrite.io/console 15.3.0-rc.1 → 15.4.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.
Files changed (39) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +2524 -2066
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +2524 -2066
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +2524 -2066
  7. package/package.json +4 -4
  8. package/types/enums/database-status.d.ts +12 -1
  9. package/types/enums/database-type.d.ts +4 -1
  10. package/types/enums/o-auth-provider.d.ts +1 -0
  11. package/types/enums/project-key-scopes.d.ts +5 -2
  12. package/types/enums/project-o-auth-provider-id.d.ts +1 -0
  13. package/types/enums/query-suggestion-resource.d.ts +6 -1
  14. package/types/enums/waf-rule-action.d.ts +7 -0
  15. package/types/index.d.ts +3 -5
  16. package/types/models.d.ts +3260 -3404
  17. package/types/services/account.d.ts +133 -4
  18. package/types/services/apps.d.ts +39 -10
  19. package/types/services/backups.d.ts +17 -8
  20. package/types/services/databases.d.ts +0 -70
  21. package/types/services/documents-db.d.ts +75 -2
  22. package/types/services/functions.d.ts +4 -43
  23. package/types/services/locale.d.ts +2 -2
  24. package/types/services/migrations.d.ts +30 -18
  25. package/types/services/mongo.d.ts +13 -4
  26. package/types/services/mysql.d.ts +13 -4
  27. package/types/services/oauth-2.d.ts +119 -15
  28. package/types/services/postgresql.d.ts +13 -4
  29. package/types/services/project.d.ts +29 -1
  30. package/types/services/sites.d.ts +4 -43
  31. package/types/services/storage.d.ts +0 -46
  32. package/types/services/tables-db.d.ts +75 -69
  33. package/types/services/usage.d.ts +10 -10
  34. package/types/services/vectors-db.d.ts +75 -2
  35. package/types/services/waf.d.ts +435 -0
  36. package/types/enums/health-antivirus-status.d.ts +0 -5
  37. package/types/enums/health-check-status.d.ts +0 -4
  38. package/types/enums/health-queue-name.d.ts +0 -16
  39. package/types/services/health.d.ts +0 -483
@@ -1,6 +1,5 @@
1
1
  import { Client } from '../client';
2
2
  import type { Models } from '../models';
3
- import { UsageRange } from '../enums/usage-range';
4
3
  import { RelationshipType } from '../enums/relationship-type';
5
4
  import { RelationMutate } from '../enums/relation-mutate';
6
5
  import { TablesDBIndexType } from '../enums/tables-db-index-type';
@@ -41,6 +40,7 @@ export declare class TablesDB {
41
40
  * @param {string} params.name - Database name. Max length: 128 chars.
42
41
  * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
43
42
  * @param {string} params.specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.
43
+ * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0.
44
44
  * @throws {AppwriteException}
45
45
  * @returns {Promise<Models.Database>}
46
46
  */
@@ -49,6 +49,7 @@ export declare class TablesDB {
49
49
  name: string;
50
50
  enabled?: boolean;
51
51
  specification?: string;
52
+ replicas?: number;
52
53
  }): Promise<Models.Database>;
53
54
  /**
54
55
  * Create a new Database.
@@ -58,11 +59,19 @@ export declare class TablesDB {
58
59
  * @param {string} name - Database name. Max length: 128 chars.
59
60
  * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
60
61
  * @param {string} specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.
62
+ * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0.
61
63
  * @throws {AppwriteException}
62
64
  * @returns {Promise<Models.Database>}
63
65
  * @deprecated Use the object parameter style method for a better developer experience.
64
66
  */
65
- create(databaseId: string, name: string, enabled?: boolean, specification?: string): Promise<Models.Database>;
67
+ create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number): Promise<Models.Database>;
68
+ /**
69
+ * 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.
70
+ *
71
+ * @throws {AppwriteException}
72
+ * @returns {Promise<Models.DedicatedDatabaseSpecificationList>}
73
+ */
74
+ listSpecifications(): Promise<Models.DedicatedDatabaseSpecificationList>;
66
75
  /**
67
76
  * List transactions across all databases.
68
77
  *
@@ -186,25 +195,6 @@ export declare class TablesDB {
186
195
  * @deprecated Use the object parameter style method for a better developer experience.
187
196
  */
188
197
  createOperations(transactionId: string, operations?: object[]): Promise<Models.Transaction>;
189
- /**
190
- * List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
191
- *
192
- * @param {UsageRange} params.range - Date range.
193
- * @throws {AppwriteException}
194
- * @returns {Promise<Models.UsageDatabases>}
195
- */
196
- listUsage(params?: {
197
- range?: UsageRange;
198
- }): Promise<Models.UsageDatabases>;
199
- /**
200
- * List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
201
- *
202
- * @param {UsageRange} range - Date range.
203
- * @throws {AppwriteException}
204
- * @returns {Promise<Models.UsageDatabases>}
205
- * @deprecated Use the object parameter style method for a better developer experience.
206
- */
207
- listUsage(range?: UsageRange): Promise<Models.UsageDatabases>;
208
198
  /**
209
199
  * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
210
200
  *
@@ -230,6 +220,7 @@ export declare class TablesDB {
230
220
  * @param {string} params.databaseId - Database ID.
231
221
  * @param {string} params.name - Database name. Max length: 128 chars.
232
222
  * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
223
+ * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0.
233
224
  * @throws {AppwriteException}
234
225
  * @returns {Promise<Models.Database>}
235
226
  */
@@ -237,6 +228,7 @@ export declare class TablesDB {
237
228
  databaseId: string;
238
229
  name?: string;
239
230
  enabled?: boolean;
231
+ replicas?: number;
240
232
  }): Promise<Models.Database>;
241
233
  /**
242
234
  * Update a database by its unique ID.
@@ -244,11 +236,12 @@ export declare class TablesDB {
244
236
  * @param {string} databaseId - Database ID.
245
237
  * @param {string} name - Database name. Max length: 128 chars.
246
238
  * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
239
+ * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0.
247
240
  * @throws {AppwriteException}
248
241
  * @returns {Promise<Models.Database>}
249
242
  * @deprecated Use the object parameter style method for a better developer experience.
250
243
  */
251
- update(databaseId: string, name?: string, enabled?: boolean): Promise<Models.Database>;
244
+ update(databaseId: string, name?: string, enabled?: boolean, replicas?: number): Promise<Models.Database>;
252
245
  /**
253
246
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
254
247
  *
@@ -268,6 +261,28 @@ export declare class TablesDB {
268
261
  * @deprecated Use the object parameter style method for a better developer experience.
269
262
  */
270
263
  delete(databaseId: string): Promise<{}>;
264
+ /**
265
+ * 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.
266
+ *
267
+ * @param {string} params.databaseId - Database ID.
268
+ * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
269
+ * @throws {AppwriteException}
270
+ * @returns {Promise<Models.DedicatedDatabase>}
271
+ */
272
+ createFailover(params: {
273
+ databaseId: string;
274
+ targetReplicaId?: string;
275
+ }): Promise<Models.DedicatedDatabase>;
276
+ /**
277
+ * 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.
278
+ *
279
+ * @param {string} databaseId - Database ID.
280
+ * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
281
+ * @throws {AppwriteException}
282
+ * @returns {Promise<Models.DedicatedDatabase>}
283
+ * @deprecated Use the object parameter style method for a better developer experience.
284
+ */
285
+ createFailover(databaseId: string, targetReplicaId?: string): Promise<Models.DedicatedDatabase>;
271
286
  /**
272
287
  * List the dedicated migrations for a TablesDB database. A database has at most one in-flight migration.
273
288
  *
@@ -353,6 +368,44 @@ export declare class TablesDB {
353
368
  * @deprecated Use the object parameter style method for a better developer experience.
354
369
  */
355
370
  deleteMigration(databaseId: string, migrationId: string): Promise<{}>;
371
+ /**
372
+ * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
373
+ *
374
+ * @param {string} params.databaseId - Database ID.
375
+ * @throws {AppwriteException}
376
+ * @returns {Promise<Models.DedicatedDatabaseReplicas>}
377
+ */
378
+ getReplicas(params: {
379
+ databaseId: string;
380
+ }): Promise<Models.DedicatedDatabaseReplicas>;
381
+ /**
382
+ * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
383
+ *
384
+ * @param {string} databaseId - Database ID.
385
+ * @throws {AppwriteException}
386
+ * @returns {Promise<Models.DedicatedDatabaseReplicas>}
387
+ * @deprecated Use the object parameter style method for a better developer experience.
388
+ */
389
+ getReplicas(databaseId: string): Promise<Models.DedicatedDatabaseReplicas>;
390
+ /**
391
+ * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
392
+ *
393
+ * @param {string} params.databaseId - Database ID.
394
+ * @throws {AppwriteException}
395
+ * @returns {Promise<Models.DatabaseStatus>}
396
+ */
397
+ getStatus(params: {
398
+ databaseId: string;
399
+ }): Promise<Models.DatabaseStatus>;
400
+ /**
401
+ * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
402
+ *
403
+ * @param {string} databaseId - Database ID.
404
+ * @throws {AppwriteException}
405
+ * @returns {Promise<Models.DatabaseStatus>}
406
+ * @deprecated Use the object parameter style method for a better developer experience.
407
+ */
408
+ getStatus(databaseId: string): Promise<Models.DatabaseStatus>;
356
409
  /**
357
410
  * Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.
358
411
  *
@@ -2424,51 +2477,4 @@ export declare class TablesDB {
2424
2477
  * @deprecated Use the object parameter style method for a better developer experience.
2425
2478
  */
2426
2479
  incrementRowColumn<Row extends Models.Row = Models.DefaultRow>(databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string): Promise<Row>;
2427
- /**
2428
- * Get usage metrics and statistics for a table. Returning the total number of rows. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
2429
- *
2430
- * @param {string} params.databaseId - Database ID.
2431
- * @param {string} params.tableId - Table ID.
2432
- * @param {UsageRange} params.range - Date range.
2433
- * @throws {AppwriteException}
2434
- * @returns {Promise<Models.UsageTable>}
2435
- */
2436
- getTableUsage(params: {
2437
- databaseId: string;
2438
- tableId: string;
2439
- range?: UsageRange;
2440
- }): Promise<Models.UsageTable>;
2441
- /**
2442
- * Get usage metrics and statistics for a table. Returning the total number of rows. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
2443
- *
2444
- * @param {string} databaseId - Database ID.
2445
- * @param {string} tableId - Table ID.
2446
- * @param {UsageRange} range - Date range.
2447
- * @throws {AppwriteException}
2448
- * @returns {Promise<Models.UsageTable>}
2449
- * @deprecated Use the object parameter style method for a better developer experience.
2450
- */
2451
- getTableUsage(databaseId: string, tableId: string, range?: UsageRange): Promise<Models.UsageTable>;
2452
- /**
2453
- * Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
2454
- *
2455
- * @param {string} params.databaseId - Database ID.
2456
- * @param {UsageRange} params.range - Date range.
2457
- * @throws {AppwriteException}
2458
- * @returns {Promise<Models.UsageDatabase>}
2459
- */
2460
- getUsage(params: {
2461
- databaseId: string;
2462
- range?: UsageRange;
2463
- }): Promise<Models.UsageDatabase>;
2464
- /**
2465
- * Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
2466
- *
2467
- * @param {string} databaseId - Database ID.
2468
- * @param {UsageRange} range - Date range.
2469
- * @throws {AppwriteException}
2470
- * @returns {Promise<Models.UsageDatabase>}
2471
- * @deprecated Use the object parameter style method for a better developer experience.
2472
- */
2473
- getUsage(databaseId: string, range?: UsageRange): Promise<Models.UsageDatabase>;
2474
2480
  }
@@ -13,9 +13,9 @@ export declare class Usage {
13
13
  * `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
14
  *
15
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, region, hostname, ip, osName, clientType, clientName, deviceName. Allowed methods: equal, notEqual, contains, startsWith, endsWith, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
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
17
  * @param {string} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
18
- * @param {string[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resourceType, country, region, hostname, ip, osName, clientType, clientName, deviceName, teamId, resourceId.
18
+ * @param {string[]} 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.
19
19
  * @param {string} params.startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
20
20
  * @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
21
21
  * @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
@@ -47,9 +47,9 @@ export declare class Usage {
47
47
  * `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
48
  *
49
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, region, hostname, ip, osName, clientType, clientName, deviceName. Allowed methods: equal, notEqual, contains, startsWith, endsWith, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
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
51
  * @param {string} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
52
- * @param {string[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resourceType, country, region, hostname, ip, osName, clientType, clientName, deviceName, teamId, resourceId.
52
+ * @param {string[]} 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.
53
53
  * @param {string} startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
54
54
  * @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
55
55
  * @param {string} orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
@@ -68,12 +68,12 @@ export declare class Usage {
68
68
  * - 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".
69
69
  * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
70
70
  *
71
- * `dimensions[]` breaks each point down further. Supported on gauges: `resourceId`, `teamId`, `service`, `resourceType`. `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`). `queries[]` filters the underlying rows using the standard Utopia query syntax — `equal("resourceType", ["bucket"])`, `equal("resourceId", ["abc123"])`, `equal("teamId", ["team_x"])`, `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).
71
+ * `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 (0 is the primary; 1+ are replicas). `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).
72
72
  *
73
73
  * @param {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.
74
- * @param {string[]} params.queries - Up to 10 filter queries in Utopia syntax. Allowed attributes: service, resourceType, resourceId, teamId. Allowed methods: equal, notEqual, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
74
+ * @param {string[]} params.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"])`.
75
75
  * @param {string} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
76
- * @param {string[]} params.dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType.
76
+ * @param {string[]} params.dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType, ordinal.
77
77
  * @param {string} params.startAt - Range start in ISO 8601. Defaults to endAt - 7d.
78
78
  * @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
79
79
  * @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time.
@@ -102,12 +102,12 @@ export declare class Usage {
102
102
  * - 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".
103
103
  * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
104
104
  *
105
- * `dimensions[]` breaks each point down further. Supported on gauges: `resourceId`, `teamId`, `service`, `resourceType`. `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`). `queries[]` filters the underlying rows using the standard Utopia query syntax — `equal("resourceType", ["bucket"])`, `equal("resourceId", ["abc123"])`, `equal("teamId", ["team_x"])`, `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).
105
+ * `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 (0 is the primary; 1+ are replicas). `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).
106
106
  *
107
107
  * @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.
108
- * @param {string[]} queries - Up to 10 filter queries in Utopia syntax. Allowed attributes: service, resourceType, resourceId, teamId. Allowed methods: equal, notEqual, isNull, isNotNull. Example: `queries[]=equal("resourceType", ["bucket"])`.
108
+ * @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"])`.
109
109
  * @param {string} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
110
- * @param {string[]} dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType.
110
+ * @param {string[]} dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType, ordinal.
111
111
  * @param {string} startAt - Range start in ISO 8601. Defaults to endAt - 7d.
112
112
  * @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
113
113
  * @param {string} orderBy - Column to order by. Allowed: time, value. Default time.
@@ -36,6 +36,7 @@ export declare class VectorsDB {
36
36
  * @param {string} params.name - Database name. Max length: 128 chars.
37
37
  * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
38
38
  * @param {string} params.specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.
39
+ * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0.
39
40
  * @throws {AppwriteException}
40
41
  * @returns {Promise<Models.Database>}
41
42
  */
@@ -44,6 +45,7 @@ export declare class VectorsDB {
44
45
  name: string;
45
46
  enabled?: boolean;
46
47
  specification?: string;
48
+ replicas?: number;
47
49
  }): Promise<Models.Database>;
48
50
  /**
49
51
  * Create a new Database.
@@ -53,11 +55,12 @@ export declare class VectorsDB {
53
55
  * @param {string} name - Database name. Max length: 128 chars.
54
56
  * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
55
57
  * @param {string} specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.
58
+ * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0.
56
59
  * @throws {AppwriteException}
57
60
  * @returns {Promise<Models.Database>}
58
61
  * @deprecated Use the object parameter style method for a better developer experience.
59
62
  */
60
- create(databaseId: string, name: string, enabled?: boolean, specification?: string): Promise<Models.Database>;
63
+ create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number): Promise<Models.Database>;
61
64
  /**
62
65
  * 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.
63
66
  *
@@ -82,6 +85,13 @@ export declare class VectorsDB {
82
85
  * @deprecated Use the object parameter style method for a better developer experience.
83
86
  */
84
87
  createTextEmbeddings(texts: string[], model?: EmbeddingModel): Promise<Models.EmbeddingList>;
88
+ /**
89
+ * 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.
90
+ *
91
+ * @throws {AppwriteException}
92
+ * @returns {Promise<Models.DedicatedDatabaseSpecificationList>}
93
+ */
94
+ listSpecifications(): Promise<Models.DedicatedDatabaseSpecificationList>;
85
95
  /**
86
96
  * List transactions across all databases.
87
97
  *
@@ -230,6 +240,7 @@ export declare class VectorsDB {
230
240
  * @param {string} params.databaseId - Database ID.
231
241
  * @param {string} params.name - Database name. Max length: 128 chars.
232
242
  * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
243
+ * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0.
233
244
  * @throws {AppwriteException}
234
245
  * @returns {Promise<Models.Database>}
235
246
  */
@@ -237,6 +248,7 @@ export declare class VectorsDB {
237
248
  databaseId: string;
238
249
  name: string;
239
250
  enabled?: boolean;
251
+ replicas?: number;
240
252
  }): Promise<Models.Database>;
241
253
  /**
242
254
  * Update a database by its unique ID.
@@ -244,11 +256,12 @@ export declare class VectorsDB {
244
256
  * @param {string} databaseId - Database ID.
245
257
  * @param {string} name - Database name. Max length: 128 chars.
246
258
  * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
259
+ * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0.
247
260
  * @throws {AppwriteException}
248
261
  * @returns {Promise<Models.Database>}
249
262
  * @deprecated Use the object parameter style method for a better developer experience.
250
263
  */
251
- update(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database>;
264
+ update(databaseId: string, name: string, enabled?: boolean, replicas?: number): Promise<Models.Database>;
252
265
  /**
253
266
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
254
267
  *
@@ -837,4 +850,64 @@ export declare class VectorsDB {
837
850
  * @deprecated Use the object parameter style method for a better developer experience.
838
851
  */
839
852
  deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>;
853
+ /**
854
+ * 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.
855
+ *
856
+ * @param {string} params.databaseId - Database ID.
857
+ * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
858
+ * @throws {AppwriteException}
859
+ * @returns {Promise<Models.DedicatedDatabase>}
860
+ */
861
+ createFailover(params: {
862
+ databaseId: string;
863
+ targetReplicaId?: string;
864
+ }): Promise<Models.DedicatedDatabase>;
865
+ /**
866
+ * 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.
867
+ *
868
+ * @param {string} databaseId - Database ID.
869
+ * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
870
+ * @throws {AppwriteException}
871
+ * @returns {Promise<Models.DedicatedDatabase>}
872
+ * @deprecated Use the object parameter style method for a better developer experience.
873
+ */
874
+ createFailover(databaseId: string, targetReplicaId?: string): Promise<Models.DedicatedDatabase>;
875
+ /**
876
+ * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
877
+ *
878
+ * @param {string} params.databaseId - Database ID.
879
+ * @throws {AppwriteException}
880
+ * @returns {Promise<Models.DedicatedDatabaseReplicas>}
881
+ */
882
+ getReplicas(params: {
883
+ databaseId: string;
884
+ }): Promise<Models.DedicatedDatabaseReplicas>;
885
+ /**
886
+ * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
887
+ *
888
+ * @param {string} databaseId - Database ID.
889
+ * @throws {AppwriteException}
890
+ * @returns {Promise<Models.DedicatedDatabaseReplicas>}
891
+ * @deprecated Use the object parameter style method for a better developer experience.
892
+ */
893
+ getReplicas(databaseId: string): Promise<Models.DedicatedDatabaseReplicas>;
894
+ /**
895
+ * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
896
+ *
897
+ * @param {string} params.databaseId - Database ID.
898
+ * @throws {AppwriteException}
899
+ * @returns {Promise<Models.DatabaseStatus>}
900
+ */
901
+ getStatus(params: {
902
+ databaseId: string;
903
+ }): Promise<Models.DatabaseStatus>;
904
+ /**
905
+ * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
906
+ *
907
+ * @param {string} databaseId - Database ID.
908
+ * @throws {AppwriteException}
909
+ * @returns {Promise<Models.DatabaseStatus>}
910
+ * @deprecated Use the object parameter style method for a better developer experience.
911
+ */
912
+ getStatus(databaseId: string): Promise<Models.DatabaseStatus>;
840
913
  }