@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/dist/esm/sdk.js CHANGED
@@ -278,7 +278,7 @@ class Client {
278
278
  'x-sdk-name': 'Console',
279
279
  'x-sdk-platform': 'console',
280
280
  'x-sdk-language': 'web',
281
- 'x-sdk-version': '1.7.0',
281
+ 'x-sdk-version': '1.9.0',
282
282
  'X-Appwrite-Response-Format': '1.7.0',
283
283
  };
284
284
  this.realtime = {
@@ -576,8 +576,10 @@ class Client {
576
576
  let options = {
577
577
  method,
578
578
  headers,
579
- credentials: 'include',
580
579
  };
580
+ if (headers['X-Appwrite-Dev-Key'] === undefined) {
581
+ options.credentials = 'include';
582
+ }
581
583
  if (method === 'GET') {
582
584
  for (const [key, value] of Object.entries(Client.flatten(params))) {
583
585
  url.searchParams.append(key, value);
@@ -611,9 +613,10 @@ class Client {
611
613
  return { uri: url.toString(), options };
612
614
  }
613
615
  chunkedUpload(method, url, headers = {}, originalPayload = {}, onProgress) {
616
+ var _a;
614
617
  return __awaiter(this, void 0, void 0, function* () {
615
- const file = Object.values(originalPayload).find((value) => value instanceof File);
616
- if (!file) {
618
+ const [fileParam, file] = (_a = Object.entries(originalPayload).find(([_, value]) => value instanceof File)) !== null && _a !== void 0 ? _a : [];
619
+ if (!file || !fileParam) {
617
620
  throw new Error('File not found in payload');
618
621
  }
619
622
  if (file.size <= Client.CHUNK_SIZE) {
@@ -628,7 +631,8 @@ class Client {
628
631
  }
629
632
  headers['content-range'] = `bytes ${start}-${end - 1}/${file.size}`;
630
633
  const chunk = file.slice(start, end);
631
- let payload = Object.assign(Object.assign({}, originalPayload), { file: new File([chunk], file.name) });
634
+ let payload = Object.assign({}, originalPayload);
635
+ payload[fileParam] = new File([chunk], file.name);
632
636
  response = yield this.call(method, url, headers, payload);
633
637
  if (onProgress && typeof onProgress === 'function') {
634
638
  onProgress({
@@ -4417,6 +4421,9 @@ class Databases {
4417
4421
  if (typeof collectionId === 'undefined') {
4418
4422
  throw new AppwriteException('Missing required parameter: "collectionId"');
4419
4423
  }
4424
+ if (typeof documents === 'undefined') {
4425
+ throw new AppwriteException('Missing required parameter: "documents"');
4426
+ }
4420
4427
  const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
4421
4428
  const payload = {};
4422
4429
  if (typeof documents !== 'undefined') {
@@ -4515,6 +4522,44 @@ class Databases {
4515
4522
  const apiHeaders = {};
4516
4523
  return this.client.call('get', uri, apiHeaders, payload);
4517
4524
  }
4525
+ /**
4526
+ * 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.
4527
+ *
4528
+ * @param {string} databaseId
4529
+ * @param {string} collectionId
4530
+ * @param {string} documentId
4531
+ * @param {object} data
4532
+ * @param {string[]} permissions
4533
+ * @throws {AppwriteException}
4534
+ * @returns {Promise<Document>}
4535
+ */
4536
+ upsertDocument(databaseId, collectionId, documentId, data, permissions) {
4537
+ if (typeof databaseId === 'undefined') {
4538
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4539
+ }
4540
+ if (typeof collectionId === 'undefined') {
4541
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4542
+ }
4543
+ if (typeof documentId === 'undefined') {
4544
+ throw new AppwriteException('Missing required parameter: "documentId"');
4545
+ }
4546
+ if (typeof data === 'undefined') {
4547
+ throw new AppwriteException('Missing required parameter: "data"');
4548
+ }
4549
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
4550
+ const payload = {};
4551
+ if (typeof data !== 'undefined') {
4552
+ payload['data'] = data;
4553
+ }
4554
+ if (typeof permissions !== 'undefined') {
4555
+ payload['permissions'] = permissions;
4556
+ }
4557
+ const uri = new URL(this.client.config.endpoint + apiPath);
4558
+ const apiHeaders = {
4559
+ 'content-type': 'application/json',
4560
+ };
4561
+ return this.client.call('put', uri, apiHeaders, payload);
4562
+ }
4518
4563
  /**
4519
4564
  * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
4520
4565
  *
@@ -4606,6 +4651,84 @@ class Databases {
4606
4651
  const apiHeaders = {};
4607
4652
  return this.client.call('get', uri, apiHeaders, payload);
4608
4653
  }
4654
+ /**
4655
+ * Decrement a specific attribute of a document by a given value.
4656
+ *
4657
+ * @param {string} databaseId
4658
+ * @param {string} collectionId
4659
+ * @param {string} documentId
4660
+ * @param {string} attribute
4661
+ * @param {number} value
4662
+ * @param {number} min
4663
+ * @throws {AppwriteException}
4664
+ * @returns {Promise<Document>}
4665
+ */
4666
+ decrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, min) {
4667
+ if (typeof databaseId === 'undefined') {
4668
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4669
+ }
4670
+ if (typeof collectionId === 'undefined') {
4671
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4672
+ }
4673
+ if (typeof documentId === 'undefined') {
4674
+ throw new AppwriteException('Missing required parameter: "documentId"');
4675
+ }
4676
+ if (typeof attribute === 'undefined') {
4677
+ throw new AppwriteException('Missing required parameter: "attribute"');
4678
+ }
4679
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
4680
+ const payload = {};
4681
+ if (typeof value !== 'undefined') {
4682
+ payload['value'] = value;
4683
+ }
4684
+ if (typeof min !== 'undefined') {
4685
+ payload['min'] = min;
4686
+ }
4687
+ const uri = new URL(this.client.config.endpoint + apiPath);
4688
+ const apiHeaders = {
4689
+ 'content-type': 'application/json',
4690
+ };
4691
+ return this.client.call('patch', uri, apiHeaders, payload);
4692
+ }
4693
+ /**
4694
+ * Increment a specific attribute of a document by a given value.
4695
+ *
4696
+ * @param {string} databaseId
4697
+ * @param {string} collectionId
4698
+ * @param {string} documentId
4699
+ * @param {string} attribute
4700
+ * @param {number} value
4701
+ * @param {number} max
4702
+ * @throws {AppwriteException}
4703
+ * @returns {Promise<Document>}
4704
+ */
4705
+ incrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, max) {
4706
+ if (typeof databaseId === 'undefined') {
4707
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4708
+ }
4709
+ if (typeof collectionId === 'undefined') {
4710
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4711
+ }
4712
+ if (typeof documentId === 'undefined') {
4713
+ throw new AppwriteException('Missing required parameter: "documentId"');
4714
+ }
4715
+ if (typeof attribute === 'undefined') {
4716
+ throw new AppwriteException('Missing required parameter: "attribute"');
4717
+ }
4718
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
4719
+ const payload = {};
4720
+ if (typeof value !== 'undefined') {
4721
+ payload['value'] = value;
4722
+ }
4723
+ if (typeof max !== 'undefined') {
4724
+ payload['max'] = max;
4725
+ }
4726
+ const uri = new URL(this.client.config.endpoint + apiPath);
4727
+ const apiHeaders = {
4728
+ 'content-type': 'application/json',
4729
+ };
4730
+ return this.client.call('patch', uri, apiHeaders, payload);
4731
+ }
4609
4732
  /**
4610
4733
  * List indexes in the collection.
4611
4734
  *
@@ -6379,14 +6502,10 @@ class Functions {
6379
6502
  * @param {boolean} providerSilentMode
6380
6503
  * @param {string} providerRootDirectory
6381
6504
  * @param {string} specification
6382
- * @param {string} templateRepository
6383
- * @param {string} templateOwner
6384
- * @param {string} templateRootDirectory
6385
- * @param {string} templateVersion
6386
6505
  * @throws {AppwriteException}
6387
6506
  * @returns {Promise<Models.Function>}
6388
6507
  */
6389
- create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification, templateRepository, templateOwner, templateRootDirectory, templateVersion) {
6508
+ create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification) {
6390
6509
  if (typeof functionId === 'undefined') {
6391
6510
  throw new AppwriteException('Missing required parameter: "functionId"');
6392
6511
  }
@@ -6452,18 +6571,6 @@ class Functions {
6452
6571
  if (typeof specification !== 'undefined') {
6453
6572
  payload['specification'] = specification;
6454
6573
  }
6455
- if (typeof templateRepository !== 'undefined') {
6456
- payload['templateRepository'] = templateRepository;
6457
- }
6458
- if (typeof templateOwner !== 'undefined') {
6459
- payload['templateOwner'] = templateOwner;
6460
- }
6461
- if (typeof templateRootDirectory !== 'undefined') {
6462
- payload['templateRootDirectory'] = templateRootDirectory;
6463
- }
6464
- if (typeof templateVersion !== 'undefined') {
6465
- payload['templateVersion'] = templateVersion;
6466
- }
6467
6574
  const uri = new URL(this.client.config.endpoint + apiPath);
6468
6575
  const apiHeaders = {
6469
6576
  'content-type': 'application/json',
@@ -7404,14 +7511,31 @@ class Health {
7404
7511
  return this.client.call('get', uri, apiHeaders, payload);
7405
7512
  }
7406
7513
  /**
7407
- * Get billing aggregation queue
7514
+ * Get billing project aggregation queue
7408
7515
  *
7409
7516
  * @param {number} threshold
7410
7517
  * @throws {AppwriteException}
7411
7518
  * @returns {Promise<Models.HealthQueue>}
7412
7519
  */
7413
- getQueueBillingAggregation(threshold) {
7414
- const apiPath = '/health/queue/billing-aggregation';
7520
+ getQueueBillingProjectAggregation(threshold) {
7521
+ const apiPath = '/health/queue/billing-project-aggregation';
7522
+ const payload = {};
7523
+ if (typeof threshold !== 'undefined') {
7524
+ payload['threshold'] = threshold;
7525
+ }
7526
+ const uri = new URL(this.client.config.endpoint + apiPath);
7527
+ const apiHeaders = {};
7528
+ return this.client.call('get', uri, apiHeaders, payload);
7529
+ }
7530
+ /**
7531
+ * Get billing team aggregation queue
7532
+ *
7533
+ * @param {number} threshold
7534
+ * @throws {AppwriteException}
7535
+ * @returns {Promise<Models.HealthQueue>}
7536
+ */
7537
+ getQueueBillingTeamAggregation(threshold) {
7538
+ const apiPath = '/health/queue/billing-team-aggregation';
7415
7539
  const payload = {};
7416
7540
  if (typeof threshold !== 'undefined') {
7417
7541
  payload['threshold'] = threshold;
@@ -10254,6 +10378,40 @@ class Organizations {
10254
10378
  };
10255
10379
  return this.client.call('post', uri, apiHeaders, payload);
10256
10380
  }
10381
+ /**
10382
+ * Get estimation for creating an organization.
10383
+ *
10384
+ * @param {BillingPlan} billingPlan
10385
+ * @param {string} paymentMethodId
10386
+ * @param {string[]} invites
10387
+ * @param {string} couponId
10388
+ * @throws {AppwriteException}
10389
+ * @returns {Promise<Models.Estimation>}
10390
+ */
10391
+ estimationCreateOrganization(billingPlan, paymentMethodId, invites, couponId) {
10392
+ if (typeof billingPlan === 'undefined') {
10393
+ throw new AppwriteException('Missing required parameter: "billingPlan"');
10394
+ }
10395
+ const apiPath = '/organizations/estimations/create-organization';
10396
+ const payload = {};
10397
+ if (typeof billingPlan !== 'undefined') {
10398
+ payload['billingPlan'] = billingPlan;
10399
+ }
10400
+ if (typeof paymentMethodId !== 'undefined') {
10401
+ payload['paymentMethodId'] = paymentMethodId;
10402
+ }
10403
+ if (typeof invites !== 'undefined') {
10404
+ payload['invites'] = invites;
10405
+ }
10406
+ if (typeof couponId !== 'undefined') {
10407
+ payload['couponId'] = couponId;
10408
+ }
10409
+ const uri = new URL(this.client.config.endpoint + apiPath);
10410
+ const apiHeaders = {
10411
+ 'content-type': 'application/json',
10412
+ };
10413
+ return this.client.call('patch', uri, apiHeaders, payload);
10414
+ }
10257
10415
  /**
10258
10416
  * Delete an organization.
10259
10417
  *
@@ -10506,6 +10664,59 @@ class Organizations {
10506
10664
  const apiHeaders = {};
10507
10665
  return this.client.call('get', uri, apiHeaders, payload);
10508
10666
  }
10667
+ /**
10668
+ * Get estimation for deleting an organization.
10669
+ *
10670
+ * @param {string} organizationId
10671
+ * @throws {AppwriteException}
10672
+ * @returns {Promise<Models.EstimationDeleteOrganization>}
10673
+ */
10674
+ estimationDeleteOrganization(organizationId) {
10675
+ if (typeof organizationId === 'undefined') {
10676
+ throw new AppwriteException('Missing required parameter: "organizationId"');
10677
+ }
10678
+ const apiPath = '/organizations/{organizationId}/estimations/delete-organization'.replace('{organizationId}', organizationId);
10679
+ const payload = {};
10680
+ const uri = new URL(this.client.config.endpoint + apiPath);
10681
+ const apiHeaders = {
10682
+ 'content-type': 'application/json',
10683
+ };
10684
+ return this.client.call('patch', uri, apiHeaders, payload);
10685
+ }
10686
+ /**
10687
+ * Get estimation for updating the organization plan.
10688
+ *
10689
+ * @param {string} organizationId
10690
+ * @param {BillingPlan} billingPlan
10691
+ * @param {string[]} invites
10692
+ * @param {string} couponId
10693
+ * @throws {AppwriteException}
10694
+ * @returns {Promise<Models.EstimationUpdatePlan>}
10695
+ */
10696
+ estimationUpdatePlan(organizationId, billingPlan, invites, couponId) {
10697
+ if (typeof organizationId === 'undefined') {
10698
+ throw new AppwriteException('Missing required parameter: "organizationId"');
10699
+ }
10700
+ if (typeof billingPlan === 'undefined') {
10701
+ throw new AppwriteException('Missing required parameter: "billingPlan"');
10702
+ }
10703
+ const apiPath = '/organizations/{organizationId}/estimations/update-plan'.replace('{organizationId}', organizationId);
10704
+ const payload = {};
10705
+ if (typeof billingPlan !== 'undefined') {
10706
+ payload['billingPlan'] = billingPlan;
10707
+ }
10708
+ if (typeof invites !== 'undefined') {
10709
+ payload['invites'] = invites;
10710
+ }
10711
+ if (typeof couponId !== 'undefined') {
10712
+ payload['couponId'] = couponId;
10713
+ }
10714
+ const uri = new URL(this.client.config.endpoint + apiPath);
10715
+ const apiHeaders = {
10716
+ 'content-type': 'application/json',
10717
+ };
10718
+ return this.client.call('patch', uri, apiHeaders, payload);
10719
+ }
10509
10720
  /**
10510
10721
  * List all invoices for an organization.
10511
10722
  *
@@ -10822,6 +11033,25 @@ class Organizations {
10822
11033
  };
10823
11034
  return this.client.call('patch', uri, apiHeaders, payload);
10824
11035
  }
11036
+ /**
11037
+ * Cancel the downgrade initiated for an organization.
11038
+ *
11039
+ * @param {string} organizationId
11040
+ * @throws {AppwriteException}
11041
+ * @returns {Promise<Models.Organization<Preferences>>}
11042
+ */
11043
+ cancelDowngrade(organizationId) {
11044
+ if (typeof organizationId === 'undefined') {
11045
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11046
+ }
11047
+ const apiPath = '/organizations/{organizationId}/plan/cancel'.replace('{organizationId}', organizationId);
11048
+ const payload = {};
11049
+ const uri = new URL(this.client.config.endpoint + apiPath);
11050
+ const apiHeaders = {
11051
+ 'content-type': 'application/json',
11052
+ };
11053
+ return this.client.call('patch', uri, apiHeaders, payload);
11054
+ }
10825
11055
  /**
10826
11056
  * Get Scopes
10827
11057
  *
@@ -10865,6 +11095,54 @@ class Organizations {
10865
11095
  };
10866
11096
  return this.client.call('patch', uri, apiHeaders, payload);
10867
11097
  }
11098
+ /**
11099
+ * Get the usage data for an organization.
11100
+ *
11101
+ * @param {string} organizationId
11102
+ * @param {string} startDate
11103
+ * @param {string} endDate
11104
+ * @throws {AppwriteException}
11105
+ * @returns {Promise<Models.UsageOrganization>}
11106
+ */
11107
+ getUsage(organizationId, startDate, endDate) {
11108
+ if (typeof organizationId === 'undefined') {
11109
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11110
+ }
11111
+ const apiPath = '/organizations/{organizationId}/usage'.replace('{organizationId}', organizationId);
11112
+ const payload = {};
11113
+ if (typeof startDate !== 'undefined') {
11114
+ payload['startDate'] = startDate;
11115
+ }
11116
+ if (typeof endDate !== 'undefined') {
11117
+ payload['endDate'] = endDate;
11118
+ }
11119
+ const uri = new URL(this.client.config.endpoint + apiPath);
11120
+ const apiHeaders = {};
11121
+ return this.client.call('get', uri, apiHeaders, payload);
11122
+ }
11123
+ /**
11124
+ * Validate payment for team after creation or upgrade.
11125
+ *
11126
+ * @param {string} organizationId
11127
+ * @param {string[]} invites
11128
+ * @throws {AppwriteException}
11129
+ * @returns {Promise<Models.Organization<Preferences>>}
11130
+ */
11131
+ validatePayment(organizationId, invites) {
11132
+ if (typeof organizationId === 'undefined') {
11133
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11134
+ }
11135
+ const apiPath = '/organizations/{organizationId}/validate'.replace('{organizationId}', organizationId);
11136
+ const payload = {};
11137
+ if (typeof invites !== 'undefined') {
11138
+ payload['invites'] = invites;
11139
+ }
11140
+ const uri = new URL(this.client.config.endpoint + apiPath);
11141
+ const apiHeaders = {
11142
+ 'content-type': 'application/json',
11143
+ };
11144
+ return this.client.call('patch', uri, apiHeaders, payload);
11145
+ }
10868
11146
  }
10869
11147
 
10870
11148
  class Project {
@@ -12741,10 +13019,12 @@ class Proxy {
12741
13019
  * @param {string} domain
12742
13020
  * @param {string} url
12743
13021
  * @param {StatusCode} statusCode
13022
+ * @param {string} resourceId
13023
+ * @param {ProxyResourceType} resourceType
12744
13024
  * @throws {AppwriteException}
12745
13025
  * @returns {Promise<Models.ProxyRule>}
12746
13026
  */
12747
- createRedirectRule(domain, url, statusCode) {
13027
+ createRedirectRule(domain, url, statusCode, resourceId, resourceType) {
12748
13028
  if (typeof domain === 'undefined') {
12749
13029
  throw new AppwriteException('Missing required parameter: "domain"');
12750
13030
  }
@@ -12754,6 +13034,12 @@ class Proxy {
12754
13034
  if (typeof statusCode === 'undefined') {
12755
13035
  throw new AppwriteException('Missing required parameter: "statusCode"');
12756
13036
  }
13037
+ if (typeof resourceId === 'undefined') {
13038
+ throw new AppwriteException('Missing required parameter: "resourceId"');
13039
+ }
13040
+ if (typeof resourceType === 'undefined') {
13041
+ throw new AppwriteException('Missing required parameter: "resourceType"');
13042
+ }
12757
13043
  const apiPath = '/proxy/rules/redirect';
12758
13044
  const payload = {};
12759
13045
  if (typeof domain !== 'undefined') {
@@ -12765,6 +13051,12 @@ class Proxy {
12765
13051
  if (typeof statusCode !== 'undefined') {
12766
13052
  payload['statusCode'] = statusCode;
12767
13053
  }
13054
+ if (typeof resourceId !== 'undefined') {
13055
+ payload['resourceId'] = resourceId;
13056
+ }
13057
+ if (typeof resourceType !== 'undefined') {
13058
+ payload['resourceType'] = resourceType;
13059
+ }
12768
13060
  const uri = new URL(this.client.config.endpoint + apiPath);
12769
13061
  const apiHeaders = {
12770
13062
  'content-type': 'application/json',
@@ -14639,7 +14931,7 @@ class Tokens {
14639
14931
  return this.client.call('get', uri, apiHeaders, payload);
14640
14932
  }
14641
14933
  /**
14642
- * Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter.
14934
+ * Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.
14643
14935
  *
14644
14936
  * @param {string} bucketId
14645
14937
  * @param {string} fileId
@@ -16742,6 +17034,7 @@ var Runtime;
16742
17034
  Runtime["Dart31"] = "dart-3.1";
16743
17035
  Runtime["Dart33"] = "dart-3.3";
16744
17036
  Runtime["Dart35"] = "dart-3.5";
17037
+ Runtime["Dart38"] = "dart-3.8";
16745
17038
  Runtime["Dotnet60"] = "dotnet-6.0";
16746
17039
  Runtime["Dotnet70"] = "dotnet-7.0";
16747
17040
  Runtime["Dotnet80"] = "dotnet-8.0";
@@ -16768,6 +17061,7 @@ var Runtime;
16768
17061
  Runtime["Flutter324"] = "flutter-3.24";
16769
17062
  Runtime["Flutter327"] = "flutter-3.27";
16770
17063
  Runtime["Flutter329"] = "flutter-3.29";
17064
+ Runtime["Flutter332"] = "flutter-3.32";
16771
17065
  })(Runtime || (Runtime = {}));
16772
17066
 
16773
17067
  var FunctionUsageRange;
@@ -17205,6 +17499,12 @@ var StatusCode;
17205
17499
  StatusCode["PermanentRedirect308"] = "308";
17206
17500
  })(StatusCode || (StatusCode = {}));
17207
17501
 
17502
+ var ProxyResourceType;
17503
+ (function (ProxyResourceType) {
17504
+ ProxyResourceType["Site"] = "site";
17505
+ ProxyResourceType["Function"] = "function";
17506
+ })(ProxyResourceType || (ProxyResourceType = {}));
17507
+
17208
17508
  var Framework;
17209
17509
  (function (Framework) {
17210
17510
  Framework["Analog"] = "analog";
@@ -17259,6 +17559,7 @@ var BuildRuntime;
17259
17559
  BuildRuntime["Dart31"] = "dart-3.1";
17260
17560
  BuildRuntime["Dart33"] = "dart-3.3";
17261
17561
  BuildRuntime["Dart35"] = "dart-3.5";
17562
+ BuildRuntime["Dart38"] = "dart-3.8";
17262
17563
  BuildRuntime["Dotnet60"] = "dotnet-6.0";
17263
17564
  BuildRuntime["Dotnet70"] = "dotnet-7.0";
17264
17565
  BuildRuntime["Dotnet80"] = "dotnet-8.0";
@@ -17285,6 +17586,7 @@ var BuildRuntime;
17285
17586
  BuildRuntime["Flutter324"] = "flutter-3.24";
17286
17587
  BuildRuntime["Flutter327"] = "flutter-3.27";
17287
17588
  BuildRuntime["Flutter329"] = "flutter-3.29";
17589
+ BuildRuntime["Flutter332"] = "flutter-3.32";
17288
17590
  })(BuildRuntime || (BuildRuntime = {}));
17289
17591
 
17290
17592
  var Adapter;
@@ -17328,6 +17630,7 @@ var ImageFormat;
17328
17630
  ImageFormat["Webp"] = "webp";
17329
17631
  ImageFormat["Heic"] = "heic";
17330
17632
  ImageFormat["Avif"] = "avif";
17633
+ ImageFormat["Gif"] = "gif";
17331
17634
  })(ImageFormat || (ImageFormat = {}));
17332
17635
 
17333
17636
  var StorageUsageRange;
@@ -17372,5 +17675,5 @@ var VCSDetectionType;
17372
17675
  VCSDetectionType["Framework"] = "framework";
17373
17676
  })(VCSDetectionType || (VCSDetectionType = {}));
17374
17677
 
17375
- export { Account, Adapter, Api, ApiService, AppwriteException, Assistant, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, Backups, BillingPlan, Browser, BuildRuntime, Client, Compression, Console, ConsoleResourceType, CreditCard, DatabaseUsageRange, Databases, DeploymentDownloadType, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, Flag, Framework, FunctionUsageRange, Functions, Graphql, Health, ID, ImageFormat, ImageGravity, IndexType, Locale, MessagePriority, Messaging, MessagingProviderType, Migrations, Name, OAuthProvider, Organizations, PasswordHash, Permission, PlatformType, Project, ProjectUsageRange, Projects, Proxy, Query, Region, RelationMutate, RelationshipType, Role, Runtime, SMTPSecure, SiteUsageRange, Sites, SmsTemplateLocale, SmsTemplateType, SmtpEncryption, StatusCode, Storage, StorageUsageRange, Teams, Tokens, UserUsageRange, Users, VCSDeploymentType, VCSDetectionType, Vcs };
17678
+ export { Account, Adapter, Api, ApiService, AppwriteException, Assistant, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, Backups, BillingPlan, Browser, BuildRuntime, Client, Compression, Console, ConsoleResourceType, CreditCard, DatabaseUsageRange, Databases, DeploymentDownloadType, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, Flag, Framework, FunctionUsageRange, Functions, Graphql, Health, ID, ImageFormat, ImageGravity, IndexType, Locale, MessagePriority, Messaging, MessagingProviderType, Migrations, Name, OAuthProvider, Organizations, PasswordHash, Permission, PlatformType, Project, ProjectUsageRange, Projects, Proxy, ProxyResourceType, Query, Region, RelationMutate, RelationshipType, Role, Runtime, SMTPSecure, SiteUsageRange, Sites, SmsTemplateLocale, SmsTemplateType, SmtpEncryption, StatusCode, Storage, StorageUsageRange, Teams, Tokens, UserUsageRange, Users, VCSDeploymentType, VCSDetectionType, Vcs };
17376
17679
  //# sourceMappingURL=sdk.js.map