@appwrite.io/console 15.7.0 → 16.0.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.
@@ -1,5 +1,10 @@
1
1
  import { Client } from '../client';
2
2
  import type { Models } from '../models';
3
+ import { UsageInterval } from '../enums/usage-interval';
4
+ import { UsageEventDimension } from '../enums/usage-event-dimension';
5
+ import { UsageOrderBy } from '../enums/usage-order-by';
6
+ import { UsageOrderDirection } from '../enums/usage-order-direction';
7
+ import { UsageGaugeDimension } from '../enums/usage-gauge-dimension';
3
8
  export declare class Usage {
4
9
  client: Client;
5
10
  constructor(client: Client);
@@ -12,14 +17,14 @@ export declare class Usage {
12
17
  *
13
18
  * `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
19
  *
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.
20
+ * @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. On console: `metrics[]=affiliates.clicks`.
16
21
  * @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 {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, continentCode, city, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion, teamId, resourceId.
22
+ * @param {UsageInterval} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
23
+ * @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.
19
24
  * @param {string} params.startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
20
25
  * @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
21
- * @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
22
- * @param {string} params.orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, returns the most recent / highest-value groups first.
26
+ * @param {UsageOrderBy} params.orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
27
+ * @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
28
  * @param {number} params.limit - Maximum rows to return (1-5000).
24
29
  * @param {number} params.offset - Pagination offset (0-100000).
25
30
  * @throws {AppwriteException}
@@ -28,12 +33,12 @@ export declare class Usage {
28
33
  listEvents(params: {
29
34
  metrics: string[];
30
35
  queries?: string[];
31
- interval?: string;
32
- dimensions?: string[];
36
+ interval?: UsageInterval;
37
+ dimensions?: UsageEventDimension[];
33
38
  startAt?: string;
34
39
  endAt?: string;
35
- orderBy?: string;
36
- orderDir?: string;
40
+ orderBy?: UsageOrderBy;
41
+ orderDir?: UsageOrderDirection;
37
42
  limit?: number;
38
43
  offset?: number;
39
44
  }): Promise<Models.UsageEventList>;
@@ -46,21 +51,21 @@ export declare class Usage {
46
51
  *
47
52
  * `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
53
  *
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.
54
+ * @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. On console: `metrics[]=affiliates.clicks`.
50
55
  * @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 {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, continentCode, city, region, hostname, ip, osName, clientType, clientName, deviceName, sdk, sdkVersion, teamId, resourceId.
56
+ * @param {UsageInterval} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
57
+ * @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.
53
58
  * @param {string} startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
54
59
  * @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
55
- * @param {string} orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
56
- * @param {string} orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, returns the most recent / highest-value groups first.
60
+ * @param {UsageOrderBy} orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
61
+ * @param {UsageOrderDirection} orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, returns the most recent / highest-value groups first.
57
62
  * @param {number} limit - Maximum rows to return (1-5000).
58
63
  * @param {number} offset - Pagination offset (0-100000).
59
64
  * @throws {AppwriteException}
60
65
  * @returns {Promise<Models.UsageEventList>}
61
66
  * @deprecated Use the object parameter style method for a better developer experience.
62
67
  */
63
- listEvents(metrics: string[], queries?: string[], interval?: string, dimensions?: string[], startAt?: string, endAt?: string, orderBy?: string, orderDir?: string, limit?: number, offset?: number): Promise<Models.UsageEventList>;
68
+ listEvents(metrics: string[], queries?: string[], interval?: UsageInterval, dimensions?: UsageEventDimension[], startAt?: string, endAt?: string, orderBy?: UsageOrderBy, orderDir?: UsageOrderDirection, limit?: number, offset?: number): Promise<Models.UsageEventList>;
64
69
  /**
65
70
  * 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
71
  *
@@ -70,16 +75,16 @@ export declare class Usage {
70
75
  * - 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
76
  * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
72
77
  *
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 (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).
78
+ * `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
79
  *
75
80
  * @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.
76
81
  * @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"])`.
77
- * @param {string} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
78
- * @param {string[]} params.dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType, ordinal.
82
+ * @param {UsageInterval} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
83
+ * @param {UsageGaugeDimension[]} params.dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType, ordinal.
79
84
  * @param {string} params.startAt - Range start in ISO 8601. Defaults to endAt - 7d.
80
85
  * @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
81
- * @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time.
82
- * @param {string} 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.
86
+ * @param {UsageOrderBy} params.orderBy - Column to order by. Allowed: time, value. Default time.
87
+ * @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
88
  * @param {number} params.limit - Maximum rows to return (1-5000).
84
89
  * @param {number} params.offset - Pagination offset (0-100000).
85
90
  * @throws {AppwriteException}
@@ -88,12 +93,12 @@ export declare class Usage {
88
93
  listGauges(params: {
89
94
  metrics: string[];
90
95
  queries?: string[];
91
- interval?: string;
92
- dimensions?: string[];
96
+ interval?: UsageInterval;
97
+ dimensions?: UsageGaugeDimension[];
93
98
  startAt?: string;
94
99
  endAt?: string;
95
- orderBy?: string;
96
- orderDir?: string;
100
+ orderBy?: UsageOrderBy;
101
+ orderDir?: UsageOrderDirection;
97
102
  limit?: number;
98
103
  offset?: number;
99
104
  }): Promise<Models.UsageGaugeList>;
@@ -106,21 +111,21 @@ export declare class Usage {
106
111
  * - 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
112
  * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
108
113
  *
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 (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).
114
+ * `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).
110
115
  *
111
116
  * @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
117
  * @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 {string} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
114
- * @param {string[]} dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType, ordinal.
118
+ * @param {UsageInterval} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
119
+ * @param {UsageGaugeDimension[]} dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resourceType, ordinal.
115
120
  * @param {string} startAt - Range start in ISO 8601. Defaults to endAt - 7d.
116
121
  * @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
117
- * @param {string} orderBy - Column to order by. Allowed: time, value. Default time.
118
- * @param {string} 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.
122
+ * @param {UsageOrderBy} orderBy - Column to order by. Allowed: time, value. Default time.
123
+ * @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
124
  * @param {number} limit - Maximum rows to return (1-5000).
120
125
  * @param {number} offset - Pagination offset (0-100000).
121
126
  * @throws {AppwriteException}
122
127
  * @returns {Promise<Models.UsageGaugeList>}
123
128
  * @deprecated Use the object parameter style method for a better developer experience.
124
129
  */
125
- listGauges(metrics: string[], queries?: string[], interval?: string, dimensions?: string[], startAt?: string, endAt?: string, orderBy?: string, orderDir?: string, limit?: number, offset?: number): Promise<Models.UsageGaugeList>;
130
+ listGauges(metrics: string[], queries?: string[], interval?: UsageInterval, dimensions?: UsageGaugeDimension[], startAt?: string, endAt?: string, orderBy?: UsageOrderBy, orderDir?: UsageOrderDirection, limit?: number, offset?: number): Promise<Models.UsageGaugeList>;
126
131
  }
@@ -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 {
@@ -37,6 +36,7 @@ export declare class VectorsDB {
37
36
  * @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
37
  * @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
38
  * @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
+ * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum.
40
40
  * @throws {AppwriteException}
41
41
  * @returns {Promise<Models.Database>}
42
42
  */
@@ -46,6 +46,7 @@ export declare class VectorsDB {
46
46
  enabled?: boolean;
47
47
  specification?: string;
48
48
  replicas?: number;
49
+ syncMode?: string;
49
50
  }): Promise<Models.Database>;
50
51
  /**
51
52
  * Create a new Database.
@@ -56,35 +57,12 @@ export declare class VectorsDB {
56
57
  * @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.
57
58
  * @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
59
  * @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.
60
+ * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum.
59
61
  * @throws {AppwriteException}
60
62
  * @returns {Promise<Models.Database>}
61
63
  * @deprecated Use the object parameter style method for a better developer experience.
62
64
  */
63
- create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number): Promise<Models.Database>;
64
- /**
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.
66
- *
67
- *
68
- * @param {string[]} params.texts - Array of text to generate embeddings.
69
- * @param {EmbeddingModel} params.model - The embedding model to use for generating vector embeddings.
70
- * @throws {AppwriteException}
71
- * @returns {Promise<Models.EmbeddingList>}
72
- */
73
- createTextEmbeddings(params: {
74
- texts: string[];
75
- model?: EmbeddingModel;
76
- }): Promise<Models.EmbeddingList>;
77
- /**
78
- * 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.
79
- *
80
- *
81
- * @param {string[]} texts - Array of text to generate embeddings.
82
- * @param {EmbeddingModel} model - The embedding model to use for generating vector embeddings.
83
- * @throws {AppwriteException}
84
- * @returns {Promise<Models.EmbeddingList>}
85
- * @deprecated Use the object parameter style method for a better developer experience.
86
- */
87
- createTextEmbeddings(texts: string[], model?: EmbeddingModel): Promise<Models.EmbeddingList>;
65
+ create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
88
66
  /**
89
67
  * 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
68
  *
@@ -242,6 +220,7 @@ export declare class VectorsDB {
242
220
  * @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
221
  * @param {string} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize.
244
222
  * @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.
223
+ * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum.
245
224
  * @throws {AppwriteException}
246
225
  * @returns {Promise<Models.Database>}
247
226
  */
@@ -251,6 +230,7 @@ export declare class VectorsDB {
251
230
  enabled?: boolean;
252
231
  specification?: string;
253
232
  replicas?: number;
233
+ syncMode?: string;
254
234
  }): Promise<Models.Database>;
255
235
  /**
256
236
  * Update a database by its unique ID.
@@ -260,11 +240,12 @@ export declare class VectorsDB {
260
240
  * @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.
261
241
  * @param {string} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize.
262
242
  * @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.
243
+ * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum.
263
244
  * @throws {AppwriteException}
264
245
  * @returns {Promise<Models.Database>}
265
246
  * @deprecated Use the object parameter style method for a better developer experience.
266
247
  */
267
- update(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number): Promise<Models.Database>;
248
+ update(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
268
249
  /**
269
250
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
270
251
  *
@@ -115,7 +115,7 @@ export declare class Waf {
115
115
  */
116
116
  updateBypassRule(ruleId: string, resourceType?: string, resourceId?: string, name?: string, description?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleBypass>;
117
117
  /**
118
- * Create a challenge WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
118
+ * Create a challenge WAF rule. Use `difficulty` (1 easiest to 5 hardest) to tune the client-side proof-of-work cost, and `ttl` to control how long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
119
119
  *
120
120
  *
121
121
  * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -127,6 +127,8 @@ export declare class Waf {
127
127
  * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
128
128
  * @param {boolean} params.enabled - Set to false to create the rule in a disabled state.
129
129
  * @param {string} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
130
+ * @param {number} params.difficulty - Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work.
131
+ * @param {number} params.ttl - How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again.
130
132
  * @throws {AppwriteException}
131
133
  * @returns {Promise<Models.WafRuleChallenge>}
132
134
  */
@@ -140,9 +142,11 @@ export declare class Waf {
140
142
  priority?: number;
141
143
  enabled?: boolean;
142
144
  conditions?: string;
145
+ difficulty?: number;
146
+ ttl?: number;
143
147
  }): Promise<Models.WafRuleChallenge>;
144
148
  /**
145
- * Create a challenge WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
149
+ * Create a challenge WAF rule. Use `difficulty` (1 easiest to 5 hardest) to tune the client-side proof-of-work cost, and `ttl` to control how long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
146
150
  *
147
151
  *
148
152
  * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -154,13 +158,15 @@ export declare class Waf {
154
158
  * @param {number} priority - Evaluation priority. Lower numbers run earlier.
155
159
  * @param {boolean} enabled - Set to false to create the rule in a disabled state.
156
160
  * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
161
+ * @param {number} difficulty - Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work.
162
+ * @param {number} ttl - How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again.
157
163
  * @throws {AppwriteException}
158
164
  * @returns {Promise<Models.WafRuleChallenge>}
159
165
  * @deprecated Use the object parameter style method for a better developer experience.
160
166
  */
161
- createChallengeRule(ruleId: string, resourceType: string, name: string, resourceId?: string, description?: string, challengeType?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleChallenge>;
167
+ createChallengeRule(ruleId: string, resourceType: string, name: string, resourceId?: string, description?: string, challengeType?: string, priority?: number, enabled?: boolean, conditions?: string, difficulty?: number, ttl?: number): Promise<Models.WafRuleChallenge>;
162
168
  /**
163
- * Update a challenge WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
169
+ * Update a challenge WAF rule. Use `difficulty` (1 easiest to 5 hardest) to tune the client-side proof-of-work cost, and `ttl` to control how long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
164
170
  *
165
171
  *
166
172
  * @param {string} params.ruleId - Rule ID.
@@ -172,6 +178,8 @@ export declare class Waf {
172
178
  * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
173
179
  * @param {boolean} params.enabled - Set to false to disable the rule.
174
180
  * @param {string} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
181
+ * @param {number} params.difficulty - Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work.
182
+ * @param {number} params.ttl - How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again.
175
183
  * @throws {AppwriteException}
176
184
  * @returns {Promise<Models.WafRuleChallenge>}
177
185
  */
@@ -185,9 +193,11 @@ export declare class Waf {
185
193
  priority?: number;
186
194
  enabled?: boolean;
187
195
  conditions?: string;
196
+ difficulty?: number;
197
+ ttl?: number;
188
198
  }): Promise<Models.WafRuleChallenge>;
189
199
  /**
190
- * Update a challenge WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
200
+ * Update a challenge WAF rule. Use `difficulty` (1 easiest to 5 hardest) to tune the client-side proof-of-work cost, and `ttl` to control how long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
191
201
  *
192
202
  *
193
203
  * @param {string} ruleId - Rule ID.
@@ -199,11 +209,13 @@ export declare class Waf {
199
209
  * @param {number} priority - Evaluation priority. Lower numbers run earlier.
200
210
  * @param {boolean} enabled - Set to false to disable the rule.
201
211
  * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
212
+ * @param {number} difficulty - Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work.
213
+ * @param {number} ttl - How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again.
202
214
  * @throws {AppwriteException}
203
215
  * @returns {Promise<Models.WafRuleChallenge>}
204
216
  * @deprecated Use the object parameter style method for a better developer experience.
205
217
  */
206
- updateChallengeRule(ruleId: string, resourceType?: string, resourceId?: string, name?: string, description?: string, challengeType?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleChallenge>;
218
+ updateChallengeRule(ruleId: string, resourceType?: string, resourceId?: string, name?: string, description?: string, challengeType?: string, priority?: number, enabled?: boolean, conditions?: string, difficulty?: number, ttl?: number): Promise<Models.WafRuleChallenge>;
207
219
  /**
208
220
  * Create a deny WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
209
221
  *
@@ -289,7 +301,7 @@ export declare class Waf {
289
301
  */
290
302
  updateDenyRule(ruleId: string, resourceType?: string, resourceId?: string, name?: string, description?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleDeny>;
291
303
  /**
292
- * Create a rate limit WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
304
+ * Create a rate limit WAF rule. Use `key` to choose the counter: `ip` limits per client IP, while `userId` limits per authenticated user (requests without an authenticated user skip `userId` rules). Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
293
305
  *
294
306
  *
295
307
  * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -299,6 +311,7 @@ export declare class Waf {
299
311
  * @param {number} params.interval - Interval in seconds used for rate limiting.
300
312
  * @param {string} params.resourceId - Resource identifier. Required for functions and sites.
301
313
  * @param {string} params.description - Optional description for the rule.
314
+ * @param {string} params.key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules.
302
315
  * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
303
316
  * @param {boolean} params.enabled - Set to false to create the rule in a disabled state.
304
317
  * @param {string} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -313,12 +326,13 @@ export declare class Waf {
313
326
  interval: number;
314
327
  resourceId?: string;
315
328
  description?: string;
329
+ key?: string;
316
330
  priority?: number;
317
331
  enabled?: boolean;
318
332
  conditions?: string;
319
333
  }): Promise<Models.WafRuleRateLimit>;
320
334
  /**
321
- * Create a rate limit WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
335
+ * Create a rate limit WAF rule. Use `key` to choose the counter: `ip` limits per client IP, while `userId` limits per authenticated user (requests without an authenticated user skip `userId` rules). Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
322
336
  *
323
337
  *
324
338
  * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -328,6 +342,7 @@ export declare class Waf {
328
342
  * @param {number} interval - Interval in seconds used for rate limiting.
329
343
  * @param {string} resourceId - Resource identifier. Required for functions and sites.
330
344
  * @param {string} description - Optional description for the rule.
345
+ * @param {string} key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules.
331
346
  * @param {number} priority - Evaluation priority. Lower numbers run earlier.
332
347
  * @param {boolean} enabled - Set to false to create the rule in a disabled state.
333
348
  * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -335,9 +350,9 @@ export declare class Waf {
335
350
  * @returns {Promise<Models.WafRuleRateLimit>}
336
351
  * @deprecated Use the object parameter style method for a better developer experience.
337
352
  */
338
- createRateLimitRule(ruleId: string, resourceType: string, name: string, limit: number, interval: number, resourceId?: string, description?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleRateLimit>;
353
+ createRateLimitRule(ruleId: string, resourceType: string, name: string, limit: number, interval: number, resourceId?: string, description?: string, key?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleRateLimit>;
339
354
  /**
340
- * Update a rate limit WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
355
+ * Update a rate limit WAF rule. Use `key` to choose the counter: `ip` limits per client IP, while `userId` limits per authenticated user (requests without an authenticated user skip `userId` rules). Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
341
356
  *
342
357
  *
343
358
  * @param {string} params.ruleId - Rule ID.
@@ -347,6 +362,7 @@ export declare class Waf {
347
362
  * @param {string} params.description - Optional description for the rule.
348
363
  * @param {number} params.limit - Maximum number of matching requests allowed in the configured interval.
349
364
  * @param {number} params.interval - Interval in seconds used for rate limiting.
365
+ * @param {string} params.key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules.
350
366
  * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
351
367
  * @param {boolean} params.enabled - Set to false to disable the rule.
352
368
  * @param {string} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -361,12 +377,13 @@ export declare class Waf {
361
377
  description?: string;
362
378
  limit?: number;
363
379
  interval?: number;
380
+ key?: string;
364
381
  priority?: number;
365
382
  enabled?: boolean;
366
383
  conditions?: string;
367
384
  }): Promise<Models.WafRuleRateLimit>;
368
385
  /**
369
- * Update a rate limit WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
386
+ * Update a rate limit WAF rule. Use `key` to choose the counter: `ip` limits per client IP, while `userId` limits per authenticated user (requests without an authenticated user skip `userId` rules). Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
370
387
  *
371
388
  *
372
389
  * @param {string} ruleId - Rule ID.
@@ -376,6 +393,7 @@ export declare class Waf {
376
393
  * @param {string} description - Optional description for the rule.
377
394
  * @param {number} limit - Maximum number of matching requests allowed in the configured interval.
378
395
  * @param {number} interval - Interval in seconds used for rate limiting.
396
+ * @param {string} key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules.
379
397
  * @param {number} priority - Evaluation priority. Lower numbers run earlier.
380
398
  * @param {boolean} enabled - Set to false to disable the rule.
381
399
  * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -383,7 +401,7 @@ export declare class Waf {
383
401
  * @returns {Promise<Models.WafRuleRateLimit>}
384
402
  * @deprecated Use the object parameter style method for a better developer experience.
385
403
  */
386
- updateRateLimitRule(ruleId: string, resourceType?: string, resourceId?: string, name?: string, description?: string, limit?: number, interval?: number, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleRateLimit>;
404
+ updateRateLimitRule(ruleId: string, resourceType?: string, resourceId?: string, name?: string, description?: string, limit?: number, interval?: number, key?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleRateLimit>;
387
405
  /**
388
406
  * Create a redirect WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon.
389
407
  *