@appwrite.io/console 16.0.0 → 17.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.
Files changed (59) hide show
  1. package/README.md +5 -6
  2. package/dist/cjs/package.json +1 -1
  3. package/dist/cjs/sdk.js +8558 -4805
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/package.json +1 -1
  6. package/dist/esm/sdk.js +8559 -4806
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +8558 -4805
  9. package/package.json +59 -50
  10. package/types/client.d.ts +2 -13
  11. package/types/enums/{addon.d.ts → addon-key.d.ts} +1 -1
  12. package/types/enums/authentication-factor.d.ts +2 -1
  13. package/types/enums/billing-plan-group.d.ts +2 -1
  14. package/types/enums/build-runtime.d.ts +4 -1
  15. package/types/enums/cache-database.d.ts +1 -2
  16. package/types/enums/embedding-model.d.ts +1 -3
  17. package/types/enums/execution-resource-type.d.ts +4 -0
  18. package/types/enums/framework.d.ts +1 -0
  19. package/types/enums/id-token-provider.d.ts +4 -0
  20. package/types/enums/image-gravity.d.ts +1 -0
  21. package/types/enums/o-auth-provider.d.ts +5 -0
  22. package/types/enums/organization-key-scopes.d.ts +2 -4
  23. package/types/enums/project-email-template-id.d.ts +2 -1
  24. package/types/enums/project-key-scopes.d.ts +20 -3
  25. package/types/enums/project-o-auth-provider-id.d.ts +5 -0
  26. package/types/enums/project-policy-id.d.ts +2 -0
  27. package/types/enums/query-suggestion-resource.d.ts +2 -3
  28. package/types/enums/runtime.d.ts +4 -1
  29. package/types/enums/usage-event-dimension.d.ts +7 -1
  30. package/types/enums/usage-event-metric.d.ts +55 -0
  31. package/types/enums/usage-gauge-metric.d.ts +50 -0
  32. package/types/index.d.ts +11 -6
  33. package/types/models.d.ts +696 -776
  34. package/types/services/account.d.ts +124 -36
  35. package/types/services/apps.d.ts +6 -6
  36. package/types/services/avatars.d.ts +44 -0
  37. package/types/services/console.d.ts +2 -2
  38. package/types/services/databases.d.ts +8 -8
  39. package/types/services/documents-db.d.ts +13 -7
  40. package/types/services/domains.d.ts +82 -54
  41. package/types/services/functions.d.ts +6 -6
  42. package/types/services/manager.d.ts +14 -14
  43. package/types/services/messaging.d.ts +80 -6
  44. package/types/services/mongo.d.ts +17 -23
  45. package/types/services/mysql.d.ts +17 -23
  46. package/types/services/organization.d.ts +165 -0
  47. package/types/services/organizations.d.ts +24 -24
  48. package/types/services/postgresql.d.ts +17 -23
  49. package/types/services/project.d.ts +218 -51
  50. package/types/services/projects.d.ts +0 -94
  51. package/types/services/sites.d.ts +15 -8
  52. package/types/services/storage.d.ts +2 -2
  53. package/types/services/tables-db.d.ts +37 -12
  54. package/types/services/teams.d.ts +0 -25
  55. package/types/services/usage.d.ts +23 -14
  56. package/types/services/users.d.ts +26 -29
  57. package/types/services/vectors-db.d.ts +15 -9
  58. package/types/services/waf.d.ts +11 -2
  59. package/types/enums/project-usage-range.d.ts +0 -4
@@ -64,7 +64,7 @@ export declare class VectorsDB {
64
64
  */
65
65
  create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
66
66
  /**
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.
67
+ * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization.
68
68
  *
69
69
  * @throws {AppwriteException}
70
70
  * @returns {Promise<Models.DedicatedDatabaseSpecificationList>}
@@ -416,7 +416,7 @@ export declare class VectorsDB {
416
416
  *
417
417
  * @param {string} params.databaseId - Database ID.
418
418
  * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
419
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
419
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long.
420
420
  * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
421
421
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
422
422
  * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
@@ -436,7 +436,7 @@ export declare class VectorsDB {
436
436
  *
437
437
  * @param {string} databaseId - Database ID.
438
438
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
439
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
439
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long.
440
440
  * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
441
441
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
442
442
  * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
@@ -453,6 +453,7 @@ export declare class VectorsDB {
453
453
  * @param {string} params.documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
454
454
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} params.data - Document data as JSON object.
455
455
  * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
456
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
456
457
  * @throws {AppwriteException}
457
458
  * @returns {Promise<Document>}
458
459
  */
@@ -462,6 +463,7 @@ export declare class VectorsDB {
462
463
  documentId: string;
463
464
  data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
464
465
  permissions?: string[];
466
+ transactionId?: string;
465
467
  }): Promise<Document>;
466
468
  /**
467
469
  * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
@@ -471,17 +473,19 @@ export declare class VectorsDB {
471
473
  * @param {string} documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
472
474
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data - Document data as JSON object.
473
475
  * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
476
+ * @param {string} transactionId - Transaction ID for staging the operation.
474
477
  * @throws {AppwriteException}
475
478
  * @returns {Promise<Document>}
476
479
  * @deprecated Use the object parameter style method for a better developer experience.
477
480
  */
478
- createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
481
+ createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[], transactionId?: string): Promise<Document>;
479
482
  /**
480
483
  * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
481
484
  *
482
485
  * @param {string} params.databaseId - Database ID.
483
486
  * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
484
487
  * @param {object[]} params.documents - Array of documents data as JSON objects.
488
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
485
489
  * @throws {AppwriteException}
486
490
  * @returns {Promise<Models.DocumentList<Document>>}
487
491
  */
@@ -489,6 +493,7 @@ export declare class VectorsDB {
489
493
  databaseId: string;
490
494
  collectionId: string;
491
495
  documents: object[];
496
+ transactionId?: string;
492
497
  }): Promise<Models.DocumentList<Document>>;
493
498
  /**
494
499
  * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
@@ -496,11 +501,12 @@ export declare class VectorsDB {
496
501
  * @param {string} databaseId - Database ID.
497
502
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
498
503
  * @param {object[]} documents - Array of documents data as JSON objects.
504
+ * @param {string} transactionId - Transaction ID for staging the operation.
499
505
  * @throws {AppwriteException}
500
506
  * @returns {Promise<Models.DocumentList<Document>>}
501
507
  * @deprecated Use the object parameter style method for a better developer experience.
502
508
  */
503
- createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
509
+ createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise<Models.DocumentList<Document>>;
504
510
  /**
505
511
  * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
506
512
  *
@@ -596,7 +602,7 @@ export declare class VectorsDB {
596
602
  *
597
603
  * @param {string} params.databaseId - Database ID.
598
604
  * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
599
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
605
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long.
600
606
  * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
601
607
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
602
608
  * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
@@ -617,7 +623,7 @@ export declare class VectorsDB {
617
623
  *
618
624
  * @param {string} databaseId - Database ID.
619
625
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
620
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
626
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long.
621
627
  * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
622
628
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
623
629
  * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
@@ -871,7 +877,7 @@ export declare class VectorsDB {
871
877
  */
872
878
  deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>;
873
879
  /**
874
- * 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.
880
+ * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
875
881
  *
876
882
  * @param {string} params.databaseId - Database ID.
877
883
  * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -883,7 +889,7 @@ export declare class VectorsDB {
883
889
  targetReplicaId?: string;
884
890
  }): Promise<Models.DedicatedDatabase>;
885
891
  /**
886
- * 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.
892
+ * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
887
893
  *
888
894
  * @param {string} databaseId - Database ID.
889
895
  * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -312,6 +312,8 @@ export declare class Waf {
312
312
  * @param {string} params.resourceId - Resource identifier. Required for functions and sites.
313
313
  * @param {string} params.description - Optional description for the rule.
314
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.
315
+ * @param {string} params.strategy - Rate limit strategy. `fixedWindow` counts requests in discrete intervals, `slidingWindow` weights the previous interval for smoother limiting, and `tokenBucket` refills allowance continuously to permit short bursts.
316
+ * @param {number} params.maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Defaults to `limit` when omitted. Ignored by other strategies.
315
317
  * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
316
318
  * @param {boolean} params.enabled - Set to false to create the rule in a disabled state.
317
319
  * @param {string} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -327,6 +329,8 @@ export declare class Waf {
327
329
  resourceId?: string;
328
330
  description?: string;
329
331
  key?: string;
332
+ strategy?: string;
333
+ maxBucketSize?: number;
330
334
  priority?: number;
331
335
  enabled?: boolean;
332
336
  conditions?: string;
@@ -343,6 +347,8 @@ export declare class Waf {
343
347
  * @param {string} resourceId - Resource identifier. Required for functions and sites.
344
348
  * @param {string} description - Optional description for the rule.
345
349
  * @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.
350
+ * @param {string} strategy - Rate limit strategy. `fixedWindow` counts requests in discrete intervals, `slidingWindow` weights the previous interval for smoother limiting, and `tokenBucket` refills allowance continuously to permit short bursts.
351
+ * @param {number} maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Defaults to `limit` when omitted. Ignored by other strategies.
346
352
  * @param {number} priority - Evaluation priority. Lower numbers run earlier.
347
353
  * @param {boolean} enabled - Set to false to create the rule in a disabled state.
348
354
  * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -350,7 +356,7 @@ export declare class Waf {
350
356
  * @returns {Promise<Models.WafRuleRateLimit>}
351
357
  * @deprecated Use the object parameter style method for a better developer experience.
352
358
  */
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>;
359
+ createRateLimitRule(ruleId: string, resourceType: string, name: string, limit: number, interval: number, resourceId?: string, description?: string, key?: string, strategy?: string, maxBucketSize?: number, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleRateLimit>;
354
360
  /**
355
361
  * 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.
356
362
  *
@@ -363,6 +369,7 @@ export declare class Waf {
363
369
  * @param {number} params.limit - Maximum number of matching requests allowed in the configured interval.
364
370
  * @param {number} params.interval - Interval in seconds used for rate limiting.
365
371
  * @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.
372
+ * @param {number} params.maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Ignored by other strategies. The strategy itself cannot be changed after creation.
366
373
  * @param {number} params.priority - Evaluation priority. Lower numbers run earlier.
367
374
  * @param {boolean} params.enabled - Set to false to disable the rule.
368
375
  * @param {string} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -378,6 +385,7 @@ export declare class Waf {
378
385
  limit?: number;
379
386
  interval?: number;
380
387
  key?: string;
388
+ maxBucketSize?: number;
381
389
  priority?: number;
382
390
  enabled?: boolean;
383
391
  conditions?: string;
@@ -394,6 +402,7 @@ export declare class Waf {
394
402
  * @param {number} limit - Maximum number of matching requests allowed in the configured interval.
395
403
  * @param {number} interval - Interval in seconds used for rate limiting.
396
404
  * @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.
405
+ * @param {number} maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Ignored by other strategies. The strategy itself cannot be changed after creation.
397
406
  * @param {number} priority - Evaluation priority. Lower numbers run earlier.
398
407
  * @param {boolean} enabled - Set to false to disable the rule.
399
408
  * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
@@ -401,7 +410,7 @@ export declare class Waf {
401
410
  * @returns {Promise<Models.WafRuleRateLimit>}
402
411
  * @deprecated Use the object parameter style method for a better developer experience.
403
412
  */
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>;
413
+ updateRateLimitRule(ruleId: string, resourceType?: string, resourceId?: string, name?: string, description?: string, limit?: number, interval?: number, key?: string, maxBucketSize?: number, priority?: number, enabled?: boolean, conditions?: string): Promise<Models.WafRuleRateLimit>;
405
414
  /**
406
415
  * 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.
407
416
  *
@@ -1,4 +0,0 @@
1
- export declare enum ProjectUsageRange {
2
- OneHour = "1h",
3
- OneDay = "1d"
4
- }