@appwrite.io/console 4.0.0 → 5.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 (39) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +172 -34
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +173 -35
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +172 -34
  8. package/docs/examples/domains/confirm-purchase.md +16 -0
  9. package/docs/examples/domains/confirm-transfer-in.md +16 -0
  10. package/docs/examples/functions/create.md +3 -1
  11. package/docs/examples/functions/update.md +3 -1
  12. package/docs/examples/sites/create.md +4 -1
  13. package/docs/examples/sites/update.md +4 -1
  14. package/package.json +1 -1
  15. package/src/client.ts +5 -1
  16. package/src/enums/appwrite-migration-resource.ts +4 -0
  17. package/src/enums/build-runtime.ts +3 -0
  18. package/src/enums/domain-purchase-payment-status.ts +10 -0
  19. package/src/enums/runtime.ts +3 -0
  20. package/src/enums/runtimes.ts +3 -0
  21. package/src/index.ts +1 -0
  22. package/src/models.ts +90 -5
  23. package/src/services/account.ts +2 -2
  24. package/src/services/domains.ts +126 -0
  25. package/src/services/functions.ts +52 -24
  26. package/src/services/organizations.ts +2 -2
  27. package/src/services/sites.ts +83 -41
  28. package/types/enums/appwrite-migration-resource.d.ts +4 -0
  29. package/types/enums/build-runtime.d.ts +3 -0
  30. package/types/enums/domain-purchase-payment-status.d.ts +10 -0
  31. package/types/enums/runtime.d.ts +3 -0
  32. package/types/enums/runtimes.d.ts +3 -0
  33. package/types/index.d.ts +1 -0
  34. package/types/models.d.ts +90 -5
  35. package/types/services/account.d.ts +2 -2
  36. package/types/services/domains.d.ts +44 -0
  37. package/types/services/functions.d.ts +20 -8
  38. package/types/services/organizations.d.ts +2 -2
  39. package/types/services/sites.d.ts +26 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 5.0.0
4
+
5
+ * Breaking: Functions and Sites now require `specification` parameter and support `deploymentRetention`
6
+ * Breaking: New `buildSpecification` and `runtimeSpecification` parameters for functions
7
+ * Added messaging migration resource types: Provider, Topic, Subscriber, Message
8
+ * Added new build runtimes and runtime versions
9
+ * Added domain purchase and transfer confirmation endpoints
10
+ * Added `DomainPurchasePaymentStatus` enum
11
+
12
+ ## 4.0.0
13
+
14
+ * Breaking: Channel.collection() and Channel.table() now require explicit IDs
15
+ * Added migration resource enums: AppwriteMigrationResource, FirebaseMigrationResource, NHostMigrationResource, SupabaseMigrationResource
16
+ * Added DomainTransferStatusStatus enum
17
+ * Added ttl option to listDocuments and listRows
18
+ * Added new docs/examples across domains, health, migrations, projects, sites
19
+ * Updated docs and examples to reflect new resources and transfers
20
+
3
21
  ## 3.1.0
4
22
 
5
23
  * Add support for `createPurchase` method in `Domains` service
package/README.md CHANGED
@@ -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@4.0.0"></script>
36
+ <script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@5.0.0"></script>
37
37
  ```
38
38
 
39
39
 
package/dist/cjs/sdk.js CHANGED
@@ -574,7 +574,7 @@ class Client {
574
574
  'x-sdk-name': 'Console',
575
575
  'x-sdk-platform': 'console',
576
576
  'x-sdk-language': 'web',
577
- 'x-sdk-version': '4.0.0',
577
+ 'x-sdk-version': '5.0.0',
578
578
  'X-Appwrite-Response-Format': '1.8.0',
579
579
  };
580
580
  this.realtime = {
@@ -1116,6 +1116,9 @@ class Client {
1116
1116
  window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');
1117
1117
  window.localStorage.setItem('cookieFallback', cookieFallback);
1118
1118
  }
1119
+ if (data && typeof data === 'object') {
1120
+ data.toString = () => JSONbig.stringify(data);
1121
+ }
1119
1122
  return data;
1120
1123
  });
1121
1124
  }
@@ -7864,6 +7867,36 @@ class Domains {
7864
7867
  };
7865
7868
  return this.client.call('post', uri, apiHeaders, payload);
7866
7869
  }
7870
+ confirmPurchase(paramsOrFirst, ...rest) {
7871
+ let params;
7872
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7873
+ params = (paramsOrFirst || {});
7874
+ }
7875
+ else {
7876
+ params = {
7877
+ domainId: paramsOrFirst,
7878
+ organizationId: rest[0]
7879
+ };
7880
+ }
7881
+ const domainId = params.domainId;
7882
+ const organizationId = params.organizationId;
7883
+ if (typeof domainId === 'undefined') {
7884
+ throw new AppwriteException('Missing required parameter: "domainId"');
7885
+ }
7886
+ if (typeof organizationId === 'undefined') {
7887
+ throw new AppwriteException('Missing required parameter: "organizationId"');
7888
+ }
7889
+ const apiPath = '/domains/purchases/{domainId}/confirm'.replace('{domainId}', domainId);
7890
+ const payload = {};
7891
+ if (typeof organizationId !== 'undefined') {
7892
+ payload['organizationId'] = organizationId;
7893
+ }
7894
+ const uri = new URL(this.client.config.endpoint + apiPath);
7895
+ const apiHeaders = {
7896
+ 'content-type': 'application/json',
7897
+ };
7898
+ return this.client.call('post', uri, apiHeaders, payload);
7899
+ }
7867
7900
  listSuggestions(paramsOrFirst, ...rest) {
7868
7901
  let params;
7869
7902
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -7961,6 +7994,36 @@ class Domains {
7961
7994
  };
7962
7995
  return this.client.call('post', uri, apiHeaders, payload);
7963
7996
  }
7997
+ confirmTransferIn(paramsOrFirst, ...rest) {
7998
+ let params;
7999
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
8000
+ params = (paramsOrFirst || {});
8001
+ }
8002
+ else {
8003
+ params = {
8004
+ domainId: paramsOrFirst,
8005
+ organizationId: rest[0]
8006
+ };
8007
+ }
8008
+ const domainId = params.domainId;
8009
+ const organizationId = params.organizationId;
8010
+ if (typeof domainId === 'undefined') {
8011
+ throw new AppwriteException('Missing required parameter: "domainId"');
8012
+ }
8013
+ if (typeof organizationId === 'undefined') {
8014
+ throw new AppwriteException('Missing required parameter: "organizationId"');
8015
+ }
8016
+ const apiPath = '/domains/transfers/in/{domainId}/confirm'.replace('{domainId}', domainId);
8017
+ const payload = {};
8018
+ if (typeof organizationId !== 'undefined') {
8019
+ payload['organizationId'] = organizationId;
8020
+ }
8021
+ const uri = new URL(this.client.config.endpoint + apiPath);
8022
+ const apiHeaders = {
8023
+ 'content-type': 'application/json',
8024
+ };
8025
+ return this.client.call('post', uri, apiHeaders, payload);
8026
+ }
7964
8027
  createTransferOut(paramsOrFirst, ...rest) {
7965
8028
  let params;
7966
8029
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -9678,7 +9741,9 @@ class Functions {
9678
9741
  providerBranch: rest[13],
9679
9742
  providerSilentMode: rest[14],
9680
9743
  providerRootDirectory: rest[15],
9681
- specification: rest[16]
9744
+ buildSpecification: rest[16],
9745
+ runtimeSpecification: rest[17],
9746
+ deploymentRetention: rest[18]
9682
9747
  };
9683
9748
  }
9684
9749
  const functionId = params.functionId;
@@ -9698,7 +9763,9 @@ class Functions {
9698
9763
  const providerBranch = params.providerBranch;
9699
9764
  const providerSilentMode = params.providerSilentMode;
9700
9765
  const providerRootDirectory = params.providerRootDirectory;
9701
- const specification = params.specification;
9766
+ const buildSpecification = params.buildSpecification;
9767
+ const runtimeSpecification = params.runtimeSpecification;
9768
+ const deploymentRetention = params.deploymentRetention;
9702
9769
  if (typeof functionId === 'undefined') {
9703
9770
  throw new AppwriteException('Missing required parameter: "functionId"');
9704
9771
  }
@@ -9761,8 +9828,14 @@ class Functions {
9761
9828
  if (typeof providerRootDirectory !== 'undefined') {
9762
9829
  payload['providerRootDirectory'] = providerRootDirectory;
9763
9830
  }
9764
- if (typeof specification !== 'undefined') {
9765
- payload['specification'] = specification;
9831
+ if (typeof buildSpecification !== 'undefined') {
9832
+ payload['buildSpecification'] = buildSpecification;
9833
+ }
9834
+ if (typeof runtimeSpecification !== 'undefined') {
9835
+ payload['runtimeSpecification'] = runtimeSpecification;
9836
+ }
9837
+ if (typeof deploymentRetention !== 'undefined') {
9838
+ payload['deploymentRetention'] = deploymentRetention;
9766
9839
  }
9767
9840
  const uri = new URL(this.client.config.endpoint + apiPath);
9768
9841
  const apiHeaders = {
@@ -9920,7 +9993,9 @@ class Functions {
9920
9993
  providerBranch: rest[13],
9921
9994
  providerSilentMode: rest[14],
9922
9995
  providerRootDirectory: rest[15],
9923
- specification: rest[16]
9996
+ buildSpecification: rest[16],
9997
+ runtimeSpecification: rest[17],
9998
+ deploymentRetention: rest[18]
9924
9999
  };
9925
10000
  }
9926
10001
  const functionId = params.functionId;
@@ -9940,7 +10015,9 @@ class Functions {
9940
10015
  const providerBranch = params.providerBranch;
9941
10016
  const providerSilentMode = params.providerSilentMode;
9942
10017
  const providerRootDirectory = params.providerRootDirectory;
9943
- const specification = params.specification;
10018
+ const buildSpecification = params.buildSpecification;
10019
+ const runtimeSpecification = params.runtimeSpecification;
10020
+ const deploymentRetention = params.deploymentRetention;
9944
10021
  if (typeof functionId === 'undefined') {
9945
10022
  throw new AppwriteException('Missing required parameter: "functionId"');
9946
10023
  }
@@ -9997,8 +10074,14 @@ class Functions {
9997
10074
  if (typeof providerRootDirectory !== 'undefined') {
9998
10075
  payload['providerRootDirectory'] = providerRootDirectory;
9999
10076
  }
10000
- if (typeof specification !== 'undefined') {
10001
- payload['specification'] = specification;
10077
+ if (typeof buildSpecification !== 'undefined') {
10078
+ payload['buildSpecification'] = buildSpecification;
10079
+ }
10080
+ if (typeof runtimeSpecification !== 'undefined') {
10081
+ payload['runtimeSpecification'] = runtimeSpecification;
10082
+ }
10083
+ if (typeof deploymentRetention !== 'undefined') {
10084
+ payload['deploymentRetention'] = deploymentRetention;
10002
10085
  }
10003
10086
  const uri = new URL(this.client.config.endpoint + apiPath);
10004
10087
  const apiHeaders = {
@@ -19186,15 +19269,18 @@ class Sites {
19186
19269
  timeout: rest[5],
19187
19270
  installCommand: rest[6],
19188
19271
  buildCommand: rest[7],
19189
- outputDirectory: rest[8],
19190
- adapter: rest[9],
19191
- installationId: rest[10],
19192
- fallbackFile: rest[11],
19193
- providerRepositoryId: rest[12],
19194
- providerBranch: rest[13],
19195
- providerSilentMode: rest[14],
19196
- providerRootDirectory: rest[15],
19197
- specification: rest[16]
19272
+ startCommand: rest[8],
19273
+ outputDirectory: rest[9],
19274
+ adapter: rest[10],
19275
+ installationId: rest[11],
19276
+ fallbackFile: rest[12],
19277
+ providerRepositoryId: rest[13],
19278
+ providerBranch: rest[14],
19279
+ providerSilentMode: rest[15],
19280
+ providerRootDirectory: rest[16],
19281
+ buildSpecification: rest[17],
19282
+ runtimeSpecification: rest[18],
19283
+ deploymentRetention: rest[19]
19198
19284
  };
19199
19285
  }
19200
19286
  const siteId = params.siteId;
@@ -19206,6 +19292,7 @@ class Sites {
19206
19292
  const timeout = params.timeout;
19207
19293
  const installCommand = params.installCommand;
19208
19294
  const buildCommand = params.buildCommand;
19295
+ const startCommand = params.startCommand;
19209
19296
  const outputDirectory = params.outputDirectory;
19210
19297
  const adapter = params.adapter;
19211
19298
  const installationId = params.installationId;
@@ -19214,7 +19301,9 @@ class Sites {
19214
19301
  const providerBranch = params.providerBranch;
19215
19302
  const providerSilentMode = params.providerSilentMode;
19216
19303
  const providerRootDirectory = params.providerRootDirectory;
19217
- const specification = params.specification;
19304
+ const buildSpecification = params.buildSpecification;
19305
+ const runtimeSpecification = params.runtimeSpecification;
19306
+ const deploymentRetention = params.deploymentRetention;
19218
19307
  if (typeof siteId === 'undefined') {
19219
19308
  throw new AppwriteException('Missing required parameter: "siteId"');
19220
19309
  }
@@ -19253,6 +19342,9 @@ class Sites {
19253
19342
  if (typeof buildCommand !== 'undefined') {
19254
19343
  payload['buildCommand'] = buildCommand;
19255
19344
  }
19345
+ if (typeof startCommand !== 'undefined') {
19346
+ payload['startCommand'] = startCommand;
19347
+ }
19256
19348
  if (typeof outputDirectory !== 'undefined') {
19257
19349
  payload['outputDirectory'] = outputDirectory;
19258
19350
  }
@@ -19280,8 +19372,14 @@ class Sites {
19280
19372
  if (typeof providerRootDirectory !== 'undefined') {
19281
19373
  payload['providerRootDirectory'] = providerRootDirectory;
19282
19374
  }
19283
- if (typeof specification !== 'undefined') {
19284
- payload['specification'] = specification;
19375
+ if (typeof buildSpecification !== 'undefined') {
19376
+ payload['buildSpecification'] = buildSpecification;
19377
+ }
19378
+ if (typeof runtimeSpecification !== 'undefined') {
19379
+ payload['runtimeSpecification'] = runtimeSpecification;
19380
+ }
19381
+ if (typeof deploymentRetention !== 'undefined') {
19382
+ payload['deploymentRetention'] = deploymentRetention;
19285
19383
  }
19286
19384
  const uri = new URL(this.client.config.endpoint + apiPath);
19287
19385
  const apiHeaders = {
@@ -19425,16 +19523,19 @@ class Sites {
19425
19523
  timeout: rest[4],
19426
19524
  installCommand: rest[5],
19427
19525
  buildCommand: rest[6],
19428
- outputDirectory: rest[7],
19429
- buildRuntime: rest[8],
19430
- adapter: rest[9],
19431
- fallbackFile: rest[10],
19432
- installationId: rest[11],
19433
- providerRepositoryId: rest[12],
19434
- providerBranch: rest[13],
19435
- providerSilentMode: rest[14],
19436
- providerRootDirectory: rest[15],
19437
- specification: rest[16]
19526
+ startCommand: rest[7],
19527
+ outputDirectory: rest[8],
19528
+ buildRuntime: rest[9],
19529
+ adapter: rest[10],
19530
+ fallbackFile: rest[11],
19531
+ installationId: rest[12],
19532
+ providerRepositoryId: rest[13],
19533
+ providerBranch: rest[14],
19534
+ providerSilentMode: rest[15],
19535
+ providerRootDirectory: rest[16],
19536
+ buildSpecification: rest[17],
19537
+ runtimeSpecification: rest[18],
19538
+ deploymentRetention: rest[19]
19438
19539
  };
19439
19540
  }
19440
19541
  const siteId = params.siteId;
@@ -19445,6 +19546,7 @@ class Sites {
19445
19546
  const timeout = params.timeout;
19446
19547
  const installCommand = params.installCommand;
19447
19548
  const buildCommand = params.buildCommand;
19549
+ const startCommand = params.startCommand;
19448
19550
  const outputDirectory = params.outputDirectory;
19449
19551
  const buildRuntime = params.buildRuntime;
19450
19552
  const adapter = params.adapter;
@@ -19454,7 +19556,9 @@ class Sites {
19454
19556
  const providerBranch = params.providerBranch;
19455
19557
  const providerSilentMode = params.providerSilentMode;
19456
19558
  const providerRootDirectory = params.providerRootDirectory;
19457
- const specification = params.specification;
19559
+ const buildSpecification = params.buildSpecification;
19560
+ const runtimeSpecification = params.runtimeSpecification;
19561
+ const deploymentRetention = params.deploymentRetention;
19458
19562
  if (typeof siteId === 'undefined') {
19459
19563
  throw new AppwriteException('Missing required parameter: "siteId"');
19460
19564
  }
@@ -19487,6 +19591,9 @@ class Sites {
19487
19591
  if (typeof buildCommand !== 'undefined') {
19488
19592
  payload['buildCommand'] = buildCommand;
19489
19593
  }
19594
+ if (typeof startCommand !== 'undefined') {
19595
+ payload['startCommand'] = startCommand;
19596
+ }
19490
19597
  if (typeof outputDirectory !== 'undefined') {
19491
19598
  payload['outputDirectory'] = outputDirectory;
19492
19599
  }
@@ -19514,8 +19621,14 @@ class Sites {
19514
19621
  if (typeof providerRootDirectory !== 'undefined') {
19515
19622
  payload['providerRootDirectory'] = providerRootDirectory;
19516
19623
  }
19517
- if (typeof specification !== 'undefined') {
19518
- payload['specification'] = specification;
19624
+ if (typeof buildSpecification !== 'undefined') {
19625
+ payload['buildSpecification'] = buildSpecification;
19626
+ }
19627
+ if (typeof runtimeSpecification !== 'undefined') {
19628
+ payload['runtimeSpecification'] = runtimeSpecification;
19629
+ }
19630
+ if (typeof deploymentRetention !== 'undefined') {
19631
+ payload['deploymentRetention'] = deploymentRetention;
19519
19632
  }
19520
19633
  const uri = new URL(this.client.config.endpoint + apiPath);
19521
19634
  const apiHeaders = {
@@ -28440,6 +28553,9 @@ exports.Runtime = void 0;
28440
28553
  Runtime["Pythonml311"] = "python-ml-3.11";
28441
28554
  Runtime["Pythonml312"] = "python-ml-3.12";
28442
28555
  Runtime["Pythonml313"] = "python-ml-3.13";
28556
+ Runtime["Deno121"] = "deno-1.21";
28557
+ Runtime["Deno124"] = "deno-1.24";
28558
+ Runtime["Deno135"] = "deno-1.35";
28443
28559
  Runtime["Deno140"] = "deno-1.40";
28444
28560
  Runtime["Deno146"] = "deno-1.46";
28445
28561
  Runtime["Deno20"] = "deno-2.0";
@@ -28530,6 +28646,9 @@ exports.Runtimes = void 0;
28530
28646
  Runtimes["Pythonml311"] = "python-ml-3.11";
28531
28647
  Runtimes["Pythonml312"] = "python-ml-3.12";
28532
28648
  Runtimes["Pythonml313"] = "python-ml-3.13";
28649
+ Runtimes["Deno121"] = "deno-1.21";
28650
+ Runtimes["Deno124"] = "deno-1.24";
28651
+ Runtimes["Deno135"] = "deno-1.35";
28533
28652
  Runtimes["Deno140"] = "deno-1.40";
28534
28653
  Runtimes["Deno146"] = "deno-1.46";
28535
28654
  Runtimes["Deno20"] = "deno-2.0";
@@ -28679,6 +28798,10 @@ exports.AppwriteMigrationResource = void 0;
28679
28798
  AppwriteMigrationResource["Function"] = "function";
28680
28799
  AppwriteMigrationResource["Deployment"] = "deployment";
28681
28800
  AppwriteMigrationResource["Environmentvariable"] = "environment-variable";
28801
+ AppwriteMigrationResource["Provider"] = "provider";
28802
+ AppwriteMigrationResource["Topic"] = "topic";
28803
+ AppwriteMigrationResource["Subscriber"] = "subscriber";
28804
+ AppwriteMigrationResource["Message"] = "message";
28682
28805
  AppwriteMigrationResource["Site"] = "site";
28683
28806
  AppwriteMigrationResource["Sitedeployment"] = "site-deployment";
28684
28807
  AppwriteMigrationResource["Sitevariable"] = "site-variable";
@@ -29172,6 +29295,9 @@ exports.BuildRuntime = void 0;
29172
29295
  BuildRuntime["Pythonml311"] = "python-ml-3.11";
29173
29296
  BuildRuntime["Pythonml312"] = "python-ml-3.12";
29174
29297
  BuildRuntime["Pythonml313"] = "python-ml-3.13";
29298
+ BuildRuntime["Deno121"] = "deno-1.21";
29299
+ BuildRuntime["Deno124"] = "deno-1.24";
29300
+ BuildRuntime["Deno135"] = "deno-1.35";
29175
29301
  BuildRuntime["Deno140"] = "deno-1.40";
29176
29302
  BuildRuntime["Deno146"] = "deno-1.46";
29177
29303
  BuildRuntime["Deno20"] = "deno-2.0";
@@ -29404,6 +29530,18 @@ exports.BillingPlanGroup = void 0;
29404
29530
  BillingPlanGroup["Scale"] = "scale";
29405
29531
  })(exports.BillingPlanGroup || (exports.BillingPlanGroup = {}));
29406
29532
 
29533
+ exports.DomainPurchasePaymentStatus = void 0;
29534
+ (function (DomainPurchasePaymentStatus) {
29535
+ DomainPurchasePaymentStatus["Pending"] = "pending";
29536
+ DomainPurchasePaymentStatus["PendingConfirmation"] = "pending_confirmation";
29537
+ DomainPurchasePaymentStatus["PendingPaymentProcessing"] = "pending_payment_processing";
29538
+ DomainPurchasePaymentStatus["Authorized"] = "authorized";
29539
+ DomainPurchasePaymentStatus["Captured"] = "captured";
29540
+ DomainPurchasePaymentStatus["Failed"] = "failed";
29541
+ DomainPurchasePaymentStatus["CaptureFailed"] = "capture_failed";
29542
+ DomainPurchasePaymentStatus["RenewalCaptureFailed"] = "renewal_capture_failed";
29543
+ })(exports.DomainPurchasePaymentStatus || (exports.DomainPurchasePaymentStatus = {}));
29544
+
29407
29545
  exports.DomainTransferStatusStatus = void 0;
29408
29546
  (function (DomainTransferStatusStatus) {
29409
29547
  DomainTransferStatusStatus["Transferrable"] = "transferrable";