@appwrite.io/console 15.6.0 → 15.8.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.
@@ -2017,7 +2017,7 @@ export declare class Project {
2017
2017
  *
2018
2018
  * Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled.
2019
2019
  *
2020
- * @param {number} params.total - Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit.
2020
+ * @param {number} params.total - Set the password history length per user. Value can be between 1 and 20, or null to disable the limit.
2021
2021
  * @throws {AppwriteException}
2022
2022
  * @returns {Promise<Models.Project>}
2023
2023
  */
@@ -2029,7 +2029,7 @@ export declare class Project {
2029
2029
  *
2030
2030
  * Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled.
2031
2031
  *
2032
- * @param {number} total - Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit.
2032
+ * @param {number} total - Set the password history length per user. Value can be between 1 and 20, or null to disable the limit.
2033
2033
  * @throws {AppwriteException}
2034
2034
  * @returns {Promise<Models.Project>}
2035
2035
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -2107,7 +2107,7 @@ export declare class Project {
2107
2107
  /**
2108
2108
  * Update maximum duration how long sessions created within a project should stay active for.
2109
2109
  *
2110
- * @param {number} params.duration - Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds.
2110
+ * @param {number} params.duration - Maximum session length in seconds. Minium allowed value is 60 seconds, and maximum is 1 year, which is 31536000 seconds.
2111
2111
  * @throws {AppwriteException}
2112
2112
  * @returns {Promise<Models.Project>}
2113
2113
  */
@@ -2117,7 +2117,7 @@ export declare class Project {
2117
2117
  /**
2118
2118
  * Update maximum duration how long sessions created within a project should stay active for.
2119
2119
  *
2120
- * @param {number} duration - Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds.
2120
+ * @param {number} duration - Maximum session length in seconds. Minium allowed value is 60 seconds, and maximum is 1 year, which is 31536000 seconds.
2121
2121
  * @throws {AppwriteException}
2122
2122
  * @returns {Promise<Models.Project>}
2123
2123
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -2145,26 +2145,26 @@ export declare class Project {
2145
2145
  /**
2146
2146
  * Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one.
2147
2147
  *
2148
- * @param {number} params.total - Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit.
2148
+ * @param {number} params.total - Set the maximum number of sessions allowed per user. Value can be between 1 and 100.
2149
2149
  * @throws {AppwriteException}
2150
2150
  * @returns {Promise<Models.Project>}
2151
2151
  */
2152
2152
  updateSessionLimitPolicy(params: {
2153
- total?: number;
2153
+ total: number;
2154
2154
  }): Promise<Models.Project>;
2155
2155
  /**
2156
2156
  * Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one.
2157
2157
  *
2158
- * @param {number} total - Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit.
2158
+ * @param {number} total - Set the maximum number of sessions allowed per user. Value can be between 1 and 100.
2159
2159
  * @throws {AppwriteException}
2160
2160
  * @returns {Promise<Models.Project>}
2161
2161
  * @deprecated Use the object parameter style method for a better developer experience.
2162
2162
  */
2163
- updateSessionLimitPolicy(total?: number): Promise<Models.Project>;
2163
+ updateSessionLimitPolicy(total: number): Promise<Models.Project>;
2164
2164
  /**
2165
2165
  * Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited.
2166
2166
  *
2167
- * @param {number} params.total - Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit.
2167
+ * @param {number} params.total - Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit.
2168
2168
  * @throws {AppwriteException}
2169
2169
  * @returns {Promise<Models.Project>}
2170
2170
  */
@@ -2174,7 +2174,7 @@ export declare class Project {
2174
2174
  /**
2175
2175
  * Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited.
2176
2176
  *
2177
- * @param {number} total - Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit.
2177
+ * @param {number} total - Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit.
2178
2178
  * @throws {AppwriteException}
2179
2179
  * @returns {Promise<Models.Project>}
2180
2180
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -209,6 +209,7 @@ export declare class Storage {
209
209
  * @param {string} params.fileId - File 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.
210
210
  * @param {File} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
211
211
  * @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
212
+ * @param {string} params.folder - Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root.
212
213
  * @throws {AppwriteException}
213
214
  * @returns {Promise<Models.File>}
214
215
  */
@@ -217,6 +218,7 @@ export declare class Storage {
217
218
  fileId: string;
218
219
  file: File;
219
220
  permissions?: string[];
221
+ folder?: string;
220
222
  onProgress?: (progress: UploadProgress) => void;
221
223
  }): Promise<Models.File>;
222
224
  /**
@@ -233,11 +235,12 @@ export declare class Storage {
233
235
  * @param {string} fileId - File 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.
234
236
  * @param {File} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
235
237
  * @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
238
+ * @param {string} folder - Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root.
236
239
  * @throws {AppwriteException}
237
240
  * @returns {Promise<Models.File>}
238
241
  * @deprecated Use the object parameter style method for a better developer experience.
239
242
  */
240
- createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;
243
+ createFile(bucketId: string, fileId: string, file: File, permissions?: string[], folder?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;
241
244
  /**
242
245
  * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
243
246
  *
@@ -41,6 +41,7 @@ export declare class TablesDB {
41
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.
42
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
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
+ * @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.
44
45
  * @throws {AppwriteException}
45
46
  * @returns {Promise<Models.Database>}
46
47
  */
@@ -50,6 +51,7 @@ export declare class TablesDB {
50
51
  enabled?: boolean;
51
52
  specification?: string;
52
53
  replicas?: number;
54
+ syncMode?: string;
53
55
  }): Promise<Models.Database>;
54
56
  /**
55
57
  * Create a new Database.
@@ -60,11 +62,12 @@ export declare class TablesDB {
60
62
  * @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.
61
63
  * @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
64
  * @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.
65
+ * @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.
63
66
  * @throws {AppwriteException}
64
67
  * @returns {Promise<Models.Database>}
65
68
  * @deprecated Use the object parameter style method for a better developer experience.
66
69
  */
67
- create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number): Promise<Models.Database>;
70
+ create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
68
71
  /**
69
72
  * 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
73
  *
@@ -220,7 +223,9 @@ export declare class TablesDB {
220
223
  * @param {string} params.databaseId - Database ID.
221
224
  * @param {string} params.name - Database name. Max length: 128 chars.
222
225
  * @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.
226
+ * @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.
223
227
  * @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.
228
+ * @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.
224
229
  * @throws {AppwriteException}
225
230
  * @returns {Promise<Models.Database>}
226
231
  */
@@ -228,7 +233,9 @@ export declare class TablesDB {
228
233
  databaseId: string;
229
234
  name?: string;
230
235
  enabled?: boolean;
236
+ specification?: string;
231
237
  replicas?: number;
238
+ syncMode?: string;
232
239
  }): Promise<Models.Database>;
233
240
  /**
234
241
  * Update a database by its unique ID.
@@ -236,12 +243,14 @@ export declare class TablesDB {
236
243
  * @param {string} databaseId - Database ID.
237
244
  * @param {string} name - Database name. Max length: 128 chars.
238
245
  * @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.
246
+ * @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.
239
247
  * @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.
248
+ * @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.
240
249
  * @throws {AppwriteException}
241
250
  * @returns {Promise<Models.Database>}
242
251
  * @deprecated Use the object parameter style method for a better developer experience.
243
252
  */
244
- update(databaseId: string, name?: string, enabled?: boolean, replicas?: number): Promise<Models.Database>;
253
+ update(databaseId: string, name?: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
245
254
  /**
246
255
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
247
256
  *
@@ -262,7 +271,7 @@ export declare class TablesDB {
262
271
  */
263
272
  delete(databaseId: string): Promise<{}>;
264
273
  /**
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.
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 by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
266
275
  *
267
276
  * @param {string} params.databaseId - Database ID.
268
277
  * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -274,7 +283,7 @@ export declare class TablesDB {
274
283
  targetReplicaId?: string;
275
284
  }): Promise<Models.DedicatedDatabase>;
276
285
  /**
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.
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 by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
278
287
  *
279
288
  * @param {string} databaseId - Database ID.
280
289
  * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -37,6 +37,7 @@ export declare class VectorsDB {
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
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.
40
+ * @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
41
  * @throws {AppwriteException}
41
42
  * @returns {Promise<Models.Database>}
42
43
  */
@@ -46,6 +47,7 @@ export declare class VectorsDB {
46
47
  enabled?: boolean;
47
48
  specification?: string;
48
49
  replicas?: number;
50
+ syncMode?: string;
49
51
  }): Promise<Models.Database>;
50
52
  /**
51
53
  * Create a new Database.
@@ -56,11 +58,12 @@ export declare class VectorsDB {
56
58
  * @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
59
  * @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
60
  * @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
+ * @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
62
  * @throws {AppwriteException}
60
63
  * @returns {Promise<Models.Database>}
61
64
  * @deprecated Use the object parameter style method for a better developer experience.
62
65
  */
63
- create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number): Promise<Models.Database>;
66
+ create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
64
67
  /**
65
68
  * 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
69
  *
@@ -240,7 +243,9 @@ export declare class VectorsDB {
240
243
  * @param {string} params.databaseId - Database ID.
241
244
  * @param {string} params.name - Database name. Max length: 128 chars.
242
245
  * @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.
246
+ * @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.
243
247
  * @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.
248
+ * @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.
244
249
  * @throws {AppwriteException}
245
250
  * @returns {Promise<Models.Database>}
246
251
  */
@@ -248,7 +253,9 @@ export declare class VectorsDB {
248
253
  databaseId: string;
249
254
  name: string;
250
255
  enabled?: boolean;
256
+ specification?: string;
251
257
  replicas?: number;
258
+ syncMode?: string;
252
259
  }): Promise<Models.Database>;
253
260
  /**
254
261
  * Update a database by its unique ID.
@@ -256,12 +263,14 @@ export declare class VectorsDB {
256
263
  * @param {string} databaseId - Database ID.
257
264
  * @param {string} name - Database name. Max length: 128 chars.
258
265
  * @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.
266
+ * @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.
259
267
  * @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.
268
+ * @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.
260
269
  * @throws {AppwriteException}
261
270
  * @returns {Promise<Models.Database>}
262
271
  * @deprecated Use the object parameter style method for a better developer experience.
263
272
  */
264
- update(databaseId: string, name: string, enabled?: boolean, replicas?: number): Promise<Models.Database>;
273
+ update(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
265
274
  /**
266
275
  * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
267
276
  *
@@ -887,7 +896,7 @@ export declare class VectorsDB {
887
896
  */
888
897
  deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>;
889
898
  /**
890
- * 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.
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 by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
891
900
  *
892
901
  * @param {string} params.databaseId - Database ID.
893
902
  * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -899,7 +908,7 @@ export declare class VectorsDB {
899
908
  targetReplicaId?: string;
900
909
  }): Promise<Models.DedicatedDatabase>;
901
910
  /**
902
- * 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.
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 by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
903
912
  *
904
913
  * @param {string} databaseId - Database ID.
905
914
  * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -31,7 +31,7 @@ export declare class Waf {
31
31
  */
32
32
  listRules(queries?: string[], search?: string, total?: boolean): Promise<Models.WafRuleList>;
33
33
  /**
34
- * Create a bypass WAF rule.
34
+ * Create a bypass 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.
35
35
  *
36
36
  *
37
37
  * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -56,7 +56,7 @@ export declare class Waf {
56
56
  conditions?: string;
57
57
  }): Promise<Models.WafRuleBypass>;
58
58
  /**
59
- * Create a bypass WAF rule.
59
+ * Create a bypass 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.
60
60
  *
61
61
  *
62
62
  * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -73,7 +73,7 @@ export declare class Waf {
73
73
  */
74
74
  createBypassRule(ruleId: string, resourceType: string, name: string, resourceId?: string, description?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleBypass>;
75
75
  /**
76
- * Update a bypass WAF rule.
76
+ * Update a bypass 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.
77
77
  *
78
78
  *
79
79
  * @param {string} params.ruleId - Rule ID.
@@ -98,7 +98,7 @@ export declare class Waf {
98
98
  conditions?: string;
99
99
  }): Promise<Models.WafRuleBypass>;
100
100
  /**
101
- * Update a bypass WAF rule.
101
+ * Update a bypass 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.
102
102
  *
103
103
  *
104
104
  * @param {string} ruleId - Rule ID.
@@ -115,7 +115,109 @@ 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 deny WAF rule.
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
+ *
120
+ *
121
+ * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
122
+ * @param {string} params.resourceType - Resource type the rule applies to.
123
+ * @param {string} params.name - Rule name.
124
+ * @param {string} params.resourceId - Resource identifier. Required for functions and sites.
125
+ * @param {string} params.description - Optional description for the rule.
126
+ * @param {string} params.challengeType - Challenge type enforced by the rule.
127
+ * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
128
+ * @param {boolean} params.enabled - Set to false to create the rule in a disabled state.
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.
132
+ * @throws {AppwriteException}
133
+ * @returns {Promise<Models.WafRuleChallenge>}
134
+ */
135
+ createChallengeRule(params: {
136
+ ruleId: string;
137
+ resourceType: string;
138
+ name: string;
139
+ resourceId?: string;
140
+ description?: string;
141
+ challengeType?: string;
142
+ priority?: number;
143
+ enabled?: boolean;
144
+ conditions?: string;
145
+ difficulty?: number;
146
+ ttl?: number;
147
+ }): Promise<Models.WafRuleChallenge>;
148
+ /**
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.
150
+ *
151
+ *
152
+ * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
153
+ * @param {string} resourceType - Resource type the rule applies to.
154
+ * @param {string} name - Rule name.
155
+ * @param {string} resourceId - Resource identifier. Required for functions and sites.
156
+ * @param {string} description - Optional description for the rule.
157
+ * @param {string} challengeType - Challenge type enforced by the rule.
158
+ * @param {number} priority - Evaluation priority. Lower numbers run earlier.
159
+ * @param {boolean} enabled - Set to false to create the rule in a disabled state.
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.
163
+ * @throws {AppwriteException}
164
+ * @returns {Promise<Models.WafRuleChallenge>}
165
+ * @deprecated Use the object parameter style method for a better developer experience.
166
+ */
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>;
168
+ /**
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.
170
+ *
171
+ *
172
+ * @param {string} params.ruleId - Rule ID.
173
+ * @param {string} params.resourceType - Resource type the rule applies to.
174
+ * @param {string} params.resourceId - Resource identifier. Required for functions and sites.
175
+ * @param {string} params.name - Rule name.
176
+ * @param {string} params.description - Optional description for the rule.
177
+ * @param {string} params.challengeType - Challenge type enforced by the rule.
178
+ * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
179
+ * @param {boolean} params.enabled - Set to false to disable the rule.
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.
183
+ * @throws {AppwriteException}
184
+ * @returns {Promise<Models.WafRuleChallenge>}
185
+ */
186
+ updateChallengeRule(params: {
187
+ ruleId: string;
188
+ resourceType?: string;
189
+ resourceId?: string;
190
+ name?: string;
191
+ description?: string;
192
+ challengeType?: string;
193
+ priority?: number;
194
+ enabled?: boolean;
195
+ conditions?: string;
196
+ difficulty?: number;
197
+ ttl?: number;
198
+ }): Promise<Models.WafRuleChallenge>;
199
+ /**
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.
201
+ *
202
+ *
203
+ * @param {string} ruleId - Rule ID.
204
+ * @param {string} resourceType - Resource type the rule applies to.
205
+ * @param {string} resourceId - Resource identifier. Required for functions and sites.
206
+ * @param {string} name - Rule name.
207
+ * @param {string} description - Optional description for the rule.
208
+ * @param {string} challengeType - Challenge type enforced by the rule.
209
+ * @param {number} priority - Evaluation priority. Lower numbers run earlier.
210
+ * @param {boolean} enabled - Set to false to disable the rule.
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.
214
+ * @throws {AppwriteException}
215
+ * @returns {Promise<Models.WafRuleChallenge>}
216
+ * @deprecated Use the object parameter style method for a better developer experience.
217
+ */
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>;
219
+ /**
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.
119
221
  *
120
222
  *
121
223
  * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -140,7 +242,7 @@ export declare class Waf {
140
242
  conditions?: string;
141
243
  }): Promise<Models.WafRuleDeny>;
142
244
  /**
143
- * Create a deny WAF rule.
245
+ * 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.
144
246
  *
145
247
  *
146
248
  * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -157,7 +259,7 @@ export declare class Waf {
157
259
  */
158
260
  createDenyRule(ruleId: string, resourceType: string, name: string, resourceId?: string, description?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleDeny>;
159
261
  /**
160
- * Update a deny WAF rule.
262
+ * Update 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.
161
263
  *
162
264
  *
163
265
  * @param {string} params.ruleId - Rule ID.
@@ -182,7 +284,7 @@ export declare class Waf {
182
284
  conditions?: string;
183
285
  }): Promise<Models.WafRuleDeny>;
184
286
  /**
185
- * Update a deny WAF rule.
287
+ * Update 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.
186
288
  *
187
289
  *
188
290
  * @param {string} ruleId - Rule ID.
@@ -199,7 +301,7 @@ export declare class Waf {
199
301
  */
200
302
  updateDenyRule(ruleId: string, resourceType?: string, resourceId?: string, name?: string, description?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleDeny>;
201
303
  /**
202
- * Create a rate limit WAF rule.
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.
203
305
  *
204
306
  *
205
307
  * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -209,6 +311,7 @@ export declare class Waf {
209
311
  * @param {number} params.interval - Interval in seconds used for rate limiting.
210
312
  * @param {string} params.resourceId - Resource identifier. Required for functions and sites.
211
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.
212
315
  * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
213
316
  * @param {boolean} params.enabled - Set to false to create the rule in a disabled state.
214
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.
@@ -223,12 +326,13 @@ export declare class Waf {
223
326
  interval: number;
224
327
  resourceId?: string;
225
328
  description?: string;
329
+ key?: string;
226
330
  priority?: number;
227
331
  enabled?: boolean;
228
332
  conditions?: string;
229
333
  }): Promise<Models.WafRuleRateLimit>;
230
334
  /**
231
- * Create a rate limit WAF rule.
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.
232
336
  *
233
337
  *
234
338
  * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -238,6 +342,7 @@ export declare class Waf {
238
342
  * @param {number} interval - Interval in seconds used for rate limiting.
239
343
  * @param {string} resourceId - Resource identifier. Required for functions and sites.
240
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.
241
346
  * @param {number} priority - Evaluation priority. Lower numbers run earlier.
242
347
  * @param {boolean} enabled - Set to false to create the rule in a disabled state.
243
348
  * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -245,9 +350,9 @@ export declare class Waf {
245
350
  * @returns {Promise<Models.WafRuleRateLimit>}
246
351
  * @deprecated Use the object parameter style method for a better developer experience.
247
352
  */
248
- 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>;
249
354
  /**
250
- * Update a rate limit WAF rule.
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.
251
356
  *
252
357
  *
253
358
  * @param {string} params.ruleId - Rule ID.
@@ -257,6 +362,7 @@ export declare class Waf {
257
362
  * @param {string} params.description - Optional description for the rule.
258
363
  * @param {number} params.limit - Maximum number of matching requests allowed in the configured interval.
259
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.
260
366
  * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
261
367
  * @param {boolean} params.enabled - Set to false to disable the rule.
262
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.
@@ -271,12 +377,13 @@ export declare class Waf {
271
377
  description?: string;
272
378
  limit?: number;
273
379
  interval?: number;
380
+ key?: string;
274
381
  priority?: number;
275
382
  enabled?: boolean;
276
383
  conditions?: string;
277
384
  }): Promise<Models.WafRuleRateLimit>;
278
385
  /**
279
- * Update a rate limit WAF rule.
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.
280
387
  *
281
388
  *
282
389
  * @param {string} ruleId - Rule ID.
@@ -286,6 +393,7 @@ export declare class Waf {
286
393
  * @param {string} description - Optional description for the rule.
287
394
  * @param {number} limit - Maximum number of matching requests allowed in the configured interval.
288
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.
289
397
  * @param {number} priority - Evaluation priority. Lower numbers run earlier.
290
398
  * @param {boolean} enabled - Set to false to disable the rule.
291
399
  * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -293,9 +401,9 @@ export declare class Waf {
293
401
  * @returns {Promise<Models.WafRuleRateLimit>}
294
402
  * @deprecated Use the object parameter style method for a better developer experience.
295
403
  */
296
- 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>;
297
405
  /**
298
- * Create a redirect WAF rule.
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.
299
407
  *
300
408
  *
301
409
  * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -324,7 +432,7 @@ export declare class Waf {
324
432
  conditions?: string;
325
433
  }): Promise<Models.WafRuleRedirect>;
326
434
  /**
327
- * Create a redirect WAF rule.
435
+ * 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.
328
436
  *
329
437
  *
330
438
  * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -343,7 +451,7 @@ export declare class Waf {
343
451
  */
344
452
  createRedirectRule(ruleId: string, resourceType: string, name: string, location: string, statusCode: number, resourceId?: string, description?: string, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleRedirect>;
345
453
  /**
346
- * Update a redirect WAF rule.
454
+ * Update 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.
347
455
  *
348
456
  *
349
457
  * @param {string} params.ruleId - Rule ID.
@@ -372,7 +480,7 @@ export declare class Waf {
372
480
  conditions?: string;
373
481
  }): Promise<Models.WafRuleRedirect>;
374
482
  /**
375
- * Update a redirect WAF rule.
483
+ * Update 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.
376
484
  *
377
485
  *
378
486
  * @param {string} ruleId - Rule ID.