@appwrite.io/console 1.7.0 → 1.9.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 (73) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +330 -27
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +331 -28
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +330 -27
  7. package/docs/examples/databases/decrement-document-attribute.md +18 -0
  8. package/docs/examples/databases/increment-document-attribute.md +18 -0
  9. package/docs/examples/databases/upsert-document.md +17 -0
  10. package/docs/examples/databases/upsert-documents.md +1 -1
  11. package/docs/examples/domains/create-record-a-a-a-a.md +1 -1
  12. package/docs/examples/domains/create-record-a.md +1 -1
  13. package/docs/examples/domains/create-record-alias.md +1 -1
  14. package/docs/examples/domains/create-record-c-a-a.md +1 -1
  15. package/docs/examples/domains/create-record-c-n-a-m-e.md +1 -1
  16. package/docs/examples/domains/create-record-h-t-t-p-s.md +1 -1
  17. package/docs/examples/domains/create-record-m-x.md +1 -1
  18. package/docs/examples/domains/create-record-n-s.md +1 -1
  19. package/docs/examples/domains/create-record-s-r-v.md +1 -1
  20. package/docs/examples/domains/create-record-t-x-t.md +1 -1
  21. package/docs/examples/domains/update-record-a-a-a-a.md +1 -1
  22. package/docs/examples/domains/update-record-a.md +1 -1
  23. package/docs/examples/domains/update-record-alias.md +1 -1
  24. package/docs/examples/domains/update-record-c-a-a.md +1 -1
  25. package/docs/examples/domains/update-record-c-n-a-m-e.md +1 -1
  26. package/docs/examples/domains/update-record-h-t-t-p-s.md +1 -1
  27. package/docs/examples/domains/update-record-m-x.md +1 -1
  28. package/docs/examples/domains/update-record-n-s.md +1 -1
  29. package/docs/examples/domains/update-record-s-r-v.md +1 -1
  30. package/docs/examples/domains/update-record-t-x-t.md +1 -1
  31. package/docs/examples/functions/create.md +1 -5
  32. package/docs/examples/health/{get-queue-stats-usage-dump.md → get-queue-billing-project-aggregation.md} +2 -2
  33. package/docs/examples/health/{get-queue-billing-aggregation.md → get-queue-billing-team-aggregation.md} +1 -1
  34. package/docs/examples/organizations/cancel-downgrade.md +13 -0
  35. package/docs/examples/organizations/estimation-create-organization.md +16 -0
  36. package/docs/examples/organizations/estimation-delete-organization.md +13 -0
  37. package/docs/examples/organizations/estimation-update-plan.md +16 -0
  38. package/docs/examples/organizations/get-usage.md +1 -1
  39. package/docs/examples/organizations/validate-payment.md +14 -0
  40. package/docs/examples/proxy/create-redirect-rule.md +4 -2
  41. package/package.json +1 -1
  42. package/src/client.ts +9 -5
  43. package/src/enums/build-runtime.ts +2 -0
  44. package/src/enums/image-format.ts +1 -0
  45. package/src/enums/proxy-resource-type.ts +4 -0
  46. package/src/enums/runtime.ts +2 -0
  47. package/src/index.ts +1 -0
  48. package/src/models.ts +284 -2
  49. package/src/services/databases.ts +141 -1
  50. package/src/services/functions.ts +1 -17
  51. package/src/services/health.ts +28 -3
  52. package/src/services/organizations.ts +197 -0
  53. package/src/services/proxy.ts +16 -1
  54. package/src/services/tokens.ts +1 -1
  55. package/types/enums/build-runtime.d.ts +3 -1
  56. package/types/enums/image-format.d.ts +2 -1
  57. package/types/enums/proxy-resource-type.d.ts +4 -0
  58. package/types/enums/runtime.d.ts +3 -1
  59. package/types/index.d.ts +1 -0
  60. package/types/models.d.ts +284 -2
  61. package/types/services/databases.d.ts +39 -1
  62. package/types/services/functions.d.ts +1 -5
  63. package/types/services/health.d.ts +10 -2
  64. package/types/services/organizations.d.ts +57 -0
  65. package/types/services/proxy.d.ts +4 -1
  66. package/types/services/tokens.d.ts +1 -1
  67. package/docs/examples/functions/create-build.md +0 -15
  68. package/docs/examples/functions/get-function-usage.md +0 -14
  69. package/docs/examples/functions/update-deployment-build.md +0 -14
  70. package/docs/examples/functions/update-deployment.md +0 -14
  71. package/docs/examples/proxy/create-rule.md +0 -15
  72. package/src/enums/resource-type.ts +0 -4
  73. package/types/enums/resource-type.d.ts +0 -4
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Appwrite Console SDK
2
2
 
3
3
  ![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?style=flat-square)
4
- ![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square)
4
+ ![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
5
5
  [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
6
6
  [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
7
7
  [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
8
8
 
9
- **This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**
9
+ **This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**
10
10
 
11
11
  Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
12
12
 
@@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
33
33
  To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
34
34
 
35
35
  ```html
36
- <script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@1.7.0"></script>
36
+ <script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@1.9.0"></script>
37
37
  ```
38
38
 
39
39
 
package/dist/cjs/sdk.js CHANGED
@@ -280,7 +280,7 @@ class Client {
280
280
  'x-sdk-name': 'Console',
281
281
  'x-sdk-platform': 'console',
282
282
  'x-sdk-language': 'web',
283
- 'x-sdk-version': '1.7.0',
283
+ 'x-sdk-version': '1.9.0',
284
284
  'X-Appwrite-Response-Format': '1.7.0',
285
285
  };
286
286
  this.realtime = {
@@ -578,8 +578,10 @@ class Client {
578
578
  let options = {
579
579
  method,
580
580
  headers,
581
- credentials: 'include',
582
581
  };
582
+ if (headers['X-Appwrite-Dev-Key'] === undefined) {
583
+ options.credentials = 'include';
584
+ }
583
585
  if (method === 'GET') {
584
586
  for (const [key, value] of Object.entries(Client.flatten(params))) {
585
587
  url.searchParams.append(key, value);
@@ -613,9 +615,10 @@ class Client {
613
615
  return { uri: url.toString(), options };
614
616
  }
615
617
  chunkedUpload(method, url, headers = {}, originalPayload = {}, onProgress) {
618
+ var _a;
616
619
  return __awaiter(this, void 0, void 0, function* () {
617
- const file = Object.values(originalPayload).find((value) => value instanceof File);
618
- if (!file) {
620
+ const [fileParam, file] = (_a = Object.entries(originalPayload).find(([_, value]) => value instanceof File)) !== null && _a !== void 0 ? _a : [];
621
+ if (!file || !fileParam) {
619
622
  throw new Error('File not found in payload');
620
623
  }
621
624
  if (file.size <= Client.CHUNK_SIZE) {
@@ -630,7 +633,8 @@ class Client {
630
633
  }
631
634
  headers['content-range'] = `bytes ${start}-${end - 1}/${file.size}`;
632
635
  const chunk = file.slice(start, end);
633
- let payload = Object.assign(Object.assign({}, originalPayload), { file: new File([chunk], file.name) });
636
+ let payload = Object.assign({}, originalPayload);
637
+ payload[fileParam] = new File([chunk], file.name);
634
638
  response = yield this.call(method, url, headers, payload);
635
639
  if (onProgress && typeof onProgress === 'function') {
636
640
  onProgress({
@@ -4419,6 +4423,9 @@ class Databases {
4419
4423
  if (typeof collectionId === 'undefined') {
4420
4424
  throw new AppwriteException('Missing required parameter: "collectionId"');
4421
4425
  }
4426
+ if (typeof documents === 'undefined') {
4427
+ throw new AppwriteException('Missing required parameter: "documents"');
4428
+ }
4422
4429
  const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
4423
4430
  const payload = {};
4424
4431
  if (typeof documents !== 'undefined') {
@@ -4517,6 +4524,44 @@ class Databases {
4517
4524
  const apiHeaders = {};
4518
4525
  return this.client.call('get', uri, apiHeaders, payload);
4519
4526
  }
4527
+ /**
4528
+ * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
4529
+ *
4530
+ * @param {string} databaseId
4531
+ * @param {string} collectionId
4532
+ * @param {string} documentId
4533
+ * @param {object} data
4534
+ * @param {string[]} permissions
4535
+ * @throws {AppwriteException}
4536
+ * @returns {Promise<Document>}
4537
+ */
4538
+ upsertDocument(databaseId, collectionId, documentId, data, permissions) {
4539
+ if (typeof databaseId === 'undefined') {
4540
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4541
+ }
4542
+ if (typeof collectionId === 'undefined') {
4543
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4544
+ }
4545
+ if (typeof documentId === 'undefined') {
4546
+ throw new AppwriteException('Missing required parameter: "documentId"');
4547
+ }
4548
+ if (typeof data === 'undefined') {
4549
+ throw new AppwriteException('Missing required parameter: "data"');
4550
+ }
4551
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
4552
+ const payload = {};
4553
+ if (typeof data !== 'undefined') {
4554
+ payload['data'] = data;
4555
+ }
4556
+ if (typeof permissions !== 'undefined') {
4557
+ payload['permissions'] = permissions;
4558
+ }
4559
+ const uri = new URL(this.client.config.endpoint + apiPath);
4560
+ const apiHeaders = {
4561
+ 'content-type': 'application/json',
4562
+ };
4563
+ return this.client.call('put', uri, apiHeaders, payload);
4564
+ }
4520
4565
  /**
4521
4566
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
4522
4567
  *
@@ -4608,6 +4653,84 @@ class Databases {
4608
4653
  const apiHeaders = {};
4609
4654
  return this.client.call('get', uri, apiHeaders, payload);
4610
4655
  }
4656
+ /**
4657
+ * Decrement a specific attribute of a document by a given value.
4658
+ *
4659
+ * @param {string} databaseId
4660
+ * @param {string} collectionId
4661
+ * @param {string} documentId
4662
+ * @param {string} attribute
4663
+ * @param {number} value
4664
+ * @param {number} min
4665
+ * @throws {AppwriteException}
4666
+ * @returns {Promise<Document>}
4667
+ */
4668
+ decrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, min) {
4669
+ if (typeof databaseId === 'undefined') {
4670
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4671
+ }
4672
+ if (typeof collectionId === 'undefined') {
4673
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4674
+ }
4675
+ if (typeof documentId === 'undefined') {
4676
+ throw new AppwriteException('Missing required parameter: "documentId"');
4677
+ }
4678
+ if (typeof attribute === 'undefined') {
4679
+ throw new AppwriteException('Missing required parameter: "attribute"');
4680
+ }
4681
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
4682
+ const payload = {};
4683
+ if (typeof value !== 'undefined') {
4684
+ payload['value'] = value;
4685
+ }
4686
+ if (typeof min !== 'undefined') {
4687
+ payload['min'] = min;
4688
+ }
4689
+ const uri = new URL(this.client.config.endpoint + apiPath);
4690
+ const apiHeaders = {
4691
+ 'content-type': 'application/json',
4692
+ };
4693
+ return this.client.call('patch', uri, apiHeaders, payload);
4694
+ }
4695
+ /**
4696
+ * Increment a specific attribute of a document by a given value.
4697
+ *
4698
+ * @param {string} databaseId
4699
+ * @param {string} collectionId
4700
+ * @param {string} documentId
4701
+ * @param {string} attribute
4702
+ * @param {number} value
4703
+ * @param {number} max
4704
+ * @throws {AppwriteException}
4705
+ * @returns {Promise<Document>}
4706
+ */
4707
+ incrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, max) {
4708
+ if (typeof databaseId === 'undefined') {
4709
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4710
+ }
4711
+ if (typeof collectionId === 'undefined') {
4712
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4713
+ }
4714
+ if (typeof documentId === 'undefined') {
4715
+ throw new AppwriteException('Missing required parameter: "documentId"');
4716
+ }
4717
+ if (typeof attribute === 'undefined') {
4718
+ throw new AppwriteException('Missing required parameter: "attribute"');
4719
+ }
4720
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
4721
+ const payload = {};
4722
+ if (typeof value !== 'undefined') {
4723
+ payload['value'] = value;
4724
+ }
4725
+ if (typeof max !== 'undefined') {
4726
+ payload['max'] = max;
4727
+ }
4728
+ const uri = new URL(this.client.config.endpoint + apiPath);
4729
+ const apiHeaders = {
4730
+ 'content-type': 'application/json',
4731
+ };
4732
+ return this.client.call('patch', uri, apiHeaders, payload);
4733
+ }
4611
4734
  /**
4612
4735
  * List indexes in the collection.
4613
4736
  *
@@ -6381,14 +6504,10 @@ class Functions {
6381
6504
  * @param {boolean} providerSilentMode
6382
6505
  * @param {string} providerRootDirectory
6383
6506
  * @param {string} specification
6384
- * @param {string} templateRepository
6385
- * @param {string} templateOwner
6386
- * @param {string} templateRootDirectory
6387
- * @param {string} templateVersion
6388
6507
  * @throws {AppwriteException}
6389
6508
  * @returns {Promise<Models.Function>}
6390
6509
  */
6391
- create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification, templateRepository, templateOwner, templateRootDirectory, templateVersion) {
6510
+ create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification) {
6392
6511
  if (typeof functionId === 'undefined') {
6393
6512
  throw new AppwriteException('Missing required parameter: "functionId"');
6394
6513
  }
@@ -6454,18 +6573,6 @@ class Functions {
6454
6573
  if (typeof specification !== 'undefined') {
6455
6574
  payload['specification'] = specification;
6456
6575
  }
6457
- if (typeof templateRepository !== 'undefined') {
6458
- payload['templateRepository'] = templateRepository;
6459
- }
6460
- if (typeof templateOwner !== 'undefined') {
6461
- payload['templateOwner'] = templateOwner;
6462
- }
6463
- if (typeof templateRootDirectory !== 'undefined') {
6464
- payload['templateRootDirectory'] = templateRootDirectory;
6465
- }
6466
- if (typeof templateVersion !== 'undefined') {
6467
- payload['templateVersion'] = templateVersion;
6468
- }
6469
6576
  const uri = new URL(this.client.config.endpoint + apiPath);
6470
6577
  const apiHeaders = {
6471
6578
  'content-type': 'application/json',
@@ -7406,14 +7513,31 @@ class Health {
7406
7513
  return this.client.call('get', uri, apiHeaders, payload);
7407
7514
  }
7408
7515
  /**
7409
- * Get billing aggregation queue
7516
+ * Get billing project aggregation queue
7410
7517
  *
7411
7518
  * @param {number} threshold
7412
7519
  * @throws {AppwriteException}
7413
7520
  * @returns {Promise<Models.HealthQueue>}
7414
7521
  */
7415
- getQueueBillingAggregation(threshold) {
7416
- const apiPath = '/health/queue/billing-aggregation';
7522
+ getQueueBillingProjectAggregation(threshold) {
7523
+ const apiPath = '/health/queue/billing-project-aggregation';
7524
+ const payload = {};
7525
+ if (typeof threshold !== 'undefined') {
7526
+ payload['threshold'] = threshold;
7527
+ }
7528
+ const uri = new URL(this.client.config.endpoint + apiPath);
7529
+ const apiHeaders = {};
7530
+ return this.client.call('get', uri, apiHeaders, payload);
7531
+ }
7532
+ /**
7533
+ * Get billing team aggregation queue
7534
+ *
7535
+ * @param {number} threshold
7536
+ * @throws {AppwriteException}
7537
+ * @returns {Promise<Models.HealthQueue>}
7538
+ */
7539
+ getQueueBillingTeamAggregation(threshold) {
7540
+ const apiPath = '/health/queue/billing-team-aggregation';
7417
7541
  const payload = {};
7418
7542
  if (typeof threshold !== 'undefined') {
7419
7543
  payload['threshold'] = threshold;
@@ -10256,6 +10380,40 @@ class Organizations {
10256
10380
  };
10257
10381
  return this.client.call('post', uri, apiHeaders, payload);
10258
10382
  }
10383
+ /**
10384
+ * Get estimation for creating an organization.
10385
+ *
10386
+ * @param {BillingPlan} billingPlan
10387
+ * @param {string} paymentMethodId
10388
+ * @param {string[]} invites
10389
+ * @param {string} couponId
10390
+ * @throws {AppwriteException}
10391
+ * @returns {Promise<Models.Estimation>}
10392
+ */
10393
+ estimationCreateOrganization(billingPlan, paymentMethodId, invites, couponId) {
10394
+ if (typeof billingPlan === 'undefined') {
10395
+ throw new AppwriteException('Missing required parameter: "billingPlan"');
10396
+ }
10397
+ const apiPath = '/organizations/estimations/create-organization';
10398
+ const payload = {};
10399
+ if (typeof billingPlan !== 'undefined') {
10400
+ payload['billingPlan'] = billingPlan;
10401
+ }
10402
+ if (typeof paymentMethodId !== 'undefined') {
10403
+ payload['paymentMethodId'] = paymentMethodId;
10404
+ }
10405
+ if (typeof invites !== 'undefined') {
10406
+ payload['invites'] = invites;
10407
+ }
10408
+ if (typeof couponId !== 'undefined') {
10409
+ payload['couponId'] = couponId;
10410
+ }
10411
+ const uri = new URL(this.client.config.endpoint + apiPath);
10412
+ const apiHeaders = {
10413
+ 'content-type': 'application/json',
10414
+ };
10415
+ return this.client.call('patch', uri, apiHeaders, payload);
10416
+ }
10259
10417
  /**
10260
10418
  * Delete an organization.
10261
10419
  *
@@ -10508,6 +10666,59 @@ class Organizations {
10508
10666
  const apiHeaders = {};
10509
10667
  return this.client.call('get', uri, apiHeaders, payload);
10510
10668
  }
10669
+ /**
10670
+ * Get estimation for deleting an organization.
10671
+ *
10672
+ * @param {string} organizationId
10673
+ * @throws {AppwriteException}
10674
+ * @returns {Promise<Models.EstimationDeleteOrganization>}
10675
+ */
10676
+ estimationDeleteOrganization(organizationId) {
10677
+ if (typeof organizationId === 'undefined') {
10678
+ throw new AppwriteException('Missing required parameter: "organizationId"');
10679
+ }
10680
+ const apiPath = '/organizations/{organizationId}/estimations/delete-organization'.replace('{organizationId}', organizationId);
10681
+ const payload = {};
10682
+ const uri = new URL(this.client.config.endpoint + apiPath);
10683
+ const apiHeaders = {
10684
+ 'content-type': 'application/json',
10685
+ };
10686
+ return this.client.call('patch', uri, apiHeaders, payload);
10687
+ }
10688
+ /**
10689
+ * Get estimation for updating the organization plan.
10690
+ *
10691
+ * @param {string} organizationId
10692
+ * @param {BillingPlan} billingPlan
10693
+ * @param {string[]} invites
10694
+ * @param {string} couponId
10695
+ * @throws {AppwriteException}
10696
+ * @returns {Promise<Models.EstimationUpdatePlan>}
10697
+ */
10698
+ estimationUpdatePlan(organizationId, billingPlan, invites, couponId) {
10699
+ if (typeof organizationId === 'undefined') {
10700
+ throw new AppwriteException('Missing required parameter: "organizationId"');
10701
+ }
10702
+ if (typeof billingPlan === 'undefined') {
10703
+ throw new AppwriteException('Missing required parameter: "billingPlan"');
10704
+ }
10705
+ const apiPath = '/organizations/{organizationId}/estimations/update-plan'.replace('{organizationId}', organizationId);
10706
+ const payload = {};
10707
+ if (typeof billingPlan !== 'undefined') {
10708
+ payload['billingPlan'] = billingPlan;
10709
+ }
10710
+ if (typeof invites !== 'undefined') {
10711
+ payload['invites'] = invites;
10712
+ }
10713
+ if (typeof couponId !== 'undefined') {
10714
+ payload['couponId'] = couponId;
10715
+ }
10716
+ const uri = new URL(this.client.config.endpoint + apiPath);
10717
+ const apiHeaders = {
10718
+ 'content-type': 'application/json',
10719
+ };
10720
+ return this.client.call('patch', uri, apiHeaders, payload);
10721
+ }
10511
10722
  /**
10512
10723
  * List all invoices for an organization.
10513
10724
  *
@@ -10824,6 +11035,25 @@ class Organizations {
10824
11035
  };
10825
11036
  return this.client.call('patch', uri, apiHeaders, payload);
10826
11037
  }
11038
+ /**
11039
+ * Cancel the downgrade initiated for an organization.
11040
+ *
11041
+ * @param {string} organizationId
11042
+ * @throws {AppwriteException}
11043
+ * @returns {Promise<Models.Organization<Preferences>>}
11044
+ */
11045
+ cancelDowngrade(organizationId) {
11046
+ if (typeof organizationId === 'undefined') {
11047
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11048
+ }
11049
+ const apiPath = '/organizations/{organizationId}/plan/cancel'.replace('{organizationId}', organizationId);
11050
+ const payload = {};
11051
+ const uri = new URL(this.client.config.endpoint + apiPath);
11052
+ const apiHeaders = {
11053
+ 'content-type': 'application/json',
11054
+ };
11055
+ return this.client.call('patch', uri, apiHeaders, payload);
11056
+ }
10827
11057
  /**
10828
11058
  * Get Scopes
10829
11059
  *
@@ -10867,6 +11097,54 @@ class Organizations {
10867
11097
  };
10868
11098
  return this.client.call('patch', uri, apiHeaders, payload);
10869
11099
  }
11100
+ /**
11101
+ * Get the usage data for an organization.
11102
+ *
11103
+ * @param {string} organizationId
11104
+ * @param {string} startDate
11105
+ * @param {string} endDate
11106
+ * @throws {AppwriteException}
11107
+ * @returns {Promise<Models.UsageOrganization>}
11108
+ */
11109
+ getUsage(organizationId, startDate, endDate) {
11110
+ if (typeof organizationId === 'undefined') {
11111
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11112
+ }
11113
+ const apiPath = '/organizations/{organizationId}/usage'.replace('{organizationId}', organizationId);
11114
+ const payload = {};
11115
+ if (typeof startDate !== 'undefined') {
11116
+ payload['startDate'] = startDate;
11117
+ }
11118
+ if (typeof endDate !== 'undefined') {
11119
+ payload['endDate'] = endDate;
11120
+ }
11121
+ const uri = new URL(this.client.config.endpoint + apiPath);
11122
+ const apiHeaders = {};
11123
+ return this.client.call('get', uri, apiHeaders, payload);
11124
+ }
11125
+ /**
11126
+ * Validate payment for team after creation or upgrade.
11127
+ *
11128
+ * @param {string} organizationId
11129
+ * @param {string[]} invites
11130
+ * @throws {AppwriteException}
11131
+ * @returns {Promise<Models.Organization<Preferences>>}
11132
+ */
11133
+ validatePayment(organizationId, invites) {
11134
+ if (typeof organizationId === 'undefined') {
11135
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11136
+ }
11137
+ const apiPath = '/organizations/{organizationId}/validate'.replace('{organizationId}', organizationId);
11138
+ const payload = {};
11139
+ if (typeof invites !== 'undefined') {
11140
+ payload['invites'] = invites;
11141
+ }
11142
+ const uri = new URL(this.client.config.endpoint + apiPath);
11143
+ const apiHeaders = {
11144
+ 'content-type': 'application/json',
11145
+ };
11146
+ return this.client.call('patch', uri, apiHeaders, payload);
11147
+ }
10870
11148
  }
10871
11149
 
10872
11150
  class Project {
@@ -12743,10 +13021,12 @@ class Proxy {
12743
13021
  * @param {string} domain
12744
13022
  * @param {string} url
12745
13023
  * @param {StatusCode} statusCode
13024
+ * @param {string} resourceId
13025
+ * @param {ProxyResourceType} resourceType
12746
13026
  * @throws {AppwriteException}
12747
13027
  * @returns {Promise<Models.ProxyRule>}
12748
13028
  */
12749
- createRedirectRule(domain, url, statusCode) {
13029
+ createRedirectRule(domain, url, statusCode, resourceId, resourceType) {
12750
13030
  if (typeof domain === 'undefined') {
12751
13031
  throw new AppwriteException('Missing required parameter: "domain"');
12752
13032
  }
@@ -12756,6 +13036,12 @@ class Proxy {
12756
13036
  if (typeof statusCode === 'undefined') {
12757
13037
  throw new AppwriteException('Missing required parameter: "statusCode"');
12758
13038
  }
13039
+ if (typeof resourceId === 'undefined') {
13040
+ throw new AppwriteException('Missing required parameter: "resourceId"');
13041
+ }
13042
+ if (typeof resourceType === 'undefined') {
13043
+ throw new AppwriteException('Missing required parameter: "resourceType"');
13044
+ }
12759
13045
  const apiPath = '/proxy/rules/redirect';
12760
13046
  const payload = {};
12761
13047
  if (typeof domain !== 'undefined') {
@@ -12767,6 +13053,12 @@ class Proxy {
12767
13053
  if (typeof statusCode !== 'undefined') {
12768
13054
  payload['statusCode'] = statusCode;
12769
13055
  }
13056
+ if (typeof resourceId !== 'undefined') {
13057
+ payload['resourceId'] = resourceId;
13058
+ }
13059
+ if (typeof resourceType !== 'undefined') {
13060
+ payload['resourceType'] = resourceType;
13061
+ }
12770
13062
  const uri = new URL(this.client.config.endpoint + apiPath);
12771
13063
  const apiHeaders = {
12772
13064
  'content-type': 'application/json',
@@ -14641,7 +14933,7 @@ class Tokens {
14641
14933
  return this.client.call('get', uri, apiHeaders, payload);
14642
14934
  }
14643
14935
  /**
14644
- * Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter.
14936
+ * Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.
14645
14937
  *
14646
14938
  * @param {string} bucketId
14647
14939
  * @param {string} fileId
@@ -16744,6 +17036,7 @@ exports.Runtime = void 0;
16744
17036
  Runtime["Dart31"] = "dart-3.1";
16745
17037
  Runtime["Dart33"] = "dart-3.3";
16746
17038
  Runtime["Dart35"] = "dart-3.5";
17039
+ Runtime["Dart38"] = "dart-3.8";
16747
17040
  Runtime["Dotnet60"] = "dotnet-6.0";
16748
17041
  Runtime["Dotnet70"] = "dotnet-7.0";
16749
17042
  Runtime["Dotnet80"] = "dotnet-8.0";
@@ -16770,6 +17063,7 @@ exports.Runtime = void 0;
16770
17063
  Runtime["Flutter324"] = "flutter-3.24";
16771
17064
  Runtime["Flutter327"] = "flutter-3.27";
16772
17065
  Runtime["Flutter329"] = "flutter-3.29";
17066
+ Runtime["Flutter332"] = "flutter-3.32";
16773
17067
  })(exports.Runtime || (exports.Runtime = {}));
16774
17068
 
16775
17069
  exports.FunctionUsageRange = void 0;
@@ -17207,6 +17501,12 @@ exports.StatusCode = void 0;
17207
17501
  StatusCode["PermanentRedirect308"] = "308";
17208
17502
  })(exports.StatusCode || (exports.StatusCode = {}));
17209
17503
 
17504
+ exports.ProxyResourceType = void 0;
17505
+ (function (ProxyResourceType) {
17506
+ ProxyResourceType["Site"] = "site";
17507
+ ProxyResourceType["Function"] = "function";
17508
+ })(exports.ProxyResourceType || (exports.ProxyResourceType = {}));
17509
+
17210
17510
  exports.Framework = void 0;
17211
17511
  (function (Framework) {
17212
17512
  Framework["Analog"] = "analog";
@@ -17261,6 +17561,7 @@ exports.BuildRuntime = void 0;
17261
17561
  BuildRuntime["Dart31"] = "dart-3.1";
17262
17562
  BuildRuntime["Dart33"] = "dart-3.3";
17263
17563
  BuildRuntime["Dart35"] = "dart-3.5";
17564
+ BuildRuntime["Dart38"] = "dart-3.8";
17264
17565
  BuildRuntime["Dotnet60"] = "dotnet-6.0";
17265
17566
  BuildRuntime["Dotnet70"] = "dotnet-7.0";
17266
17567
  BuildRuntime["Dotnet80"] = "dotnet-8.0";
@@ -17287,6 +17588,7 @@ exports.BuildRuntime = void 0;
17287
17588
  BuildRuntime["Flutter324"] = "flutter-3.24";
17288
17589
  BuildRuntime["Flutter327"] = "flutter-3.27";
17289
17590
  BuildRuntime["Flutter329"] = "flutter-3.29";
17591
+ BuildRuntime["Flutter332"] = "flutter-3.32";
17290
17592
  })(exports.BuildRuntime || (exports.BuildRuntime = {}));
17291
17593
 
17292
17594
  exports.Adapter = void 0;
@@ -17330,6 +17632,7 @@ exports.ImageFormat = void 0;
17330
17632
  ImageFormat["Webp"] = "webp";
17331
17633
  ImageFormat["Heic"] = "heic";
17332
17634
  ImageFormat["Avif"] = "avif";
17635
+ ImageFormat["Gif"] = "gif";
17333
17636
  })(exports.ImageFormat || (exports.ImageFormat = {}));
17334
17637
 
17335
17638
  exports.StorageUsageRange = void 0;