@appwrite.io/console 3.1.0 → 4.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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/sdk.js +345 -86
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +346 -87
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +345 -86
  7. package/docs/examples/databases/list-documents.md +2 -1
  8. package/docs/examples/domains/create-purchase.md +1 -1
  9. package/docs/examples/domains/create-transfer-in.md +18 -0
  10. package/docs/examples/domains/create-transfer-out.md +16 -0
  11. package/docs/examples/domains/get-transfer-status.md +15 -0
  12. package/docs/examples/health/get-console-pausing.md +16 -0
  13. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  14. package/docs/examples/migrations/create-firebase-migration.md +2 -2
  15. package/docs/examples/migrations/create-n-host-migration.md +2 -2
  16. package/docs/examples/migrations/create-supabase-migration.md +2 -2
  17. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  18. package/docs/examples/migrations/get-firebase-report.md +2 -2
  19. package/docs/examples/migrations/get-n-host-report.md +2 -2
  20. package/docs/examples/migrations/get-supabase-report.md +2 -2
  21. package/docs/examples/projects/update-console-access.md +15 -0
  22. package/docs/examples/projects/update-status.md +16 -0
  23. package/docs/examples/sites/create-deployment.md +2 -2
  24. package/docs/examples/tablesdb/list-rows.md +2 -1
  25. package/package.json +1 -1
  26. package/src/channel.ts +19 -15
  27. package/src/client.ts +1 -1
  28. package/src/enums/appwrite-migration-resource.ts +21 -0
  29. package/src/enums/domain-transfer-status-status.ts +10 -0
  30. package/src/enums/firebase-migration-resource.ts +12 -0
  31. package/src/enums/{resources.ts → n-host-migration-resource.ts} +1 -1
  32. package/src/enums/status.ts +3 -0
  33. package/src/enums/supabase-migration-resource.ts +13 -0
  34. package/src/index.ts +6 -1
  35. package/src/models.ts +119 -2
  36. package/src/services/account.ts +2 -2
  37. package/src/services/databases.ts +100 -93
  38. package/src/services/domains.ts +216 -13
  39. package/src/services/health.ts +61 -0
  40. package/src/services/messaging.ts +2 -2
  41. package/src/services/migrations.ts +68 -65
  42. package/src/services/projects.ts +120 -0
  43. package/src/services/sites.ts +13 -16
  44. package/src/services/tables-db.ts +14 -7
  45. package/src/services/teams.ts +4 -4
  46. package/types/channel.d.ts +9 -9
  47. package/types/enums/appwrite-migration-resource.d.ts +21 -0
  48. package/types/enums/domain-transfer-status-status.d.ts +10 -0
  49. package/types/enums/firebase-migration-resource.d.ts +12 -0
  50. package/types/enums/{resources.d.ts → n-host-migration-resource.d.ts} +1 -1
  51. package/types/enums/status.d.ts +3 -0
  52. package/types/enums/supabase-migration-resource.d.ts +13 -0
  53. package/types/index.d.ts +6 -1
  54. package/types/models.d.ts +117 -2
  55. package/types/services/databases.d.ts +40 -37
  56. package/types/services/domains.d.ts +73 -4
  57. package/types/services/health.d.ts +24 -0
  58. package/types/services/messaging.d.ts +2 -2
  59. package/types/services/migrations.d.ts +36 -33
  60. package/types/services/projects.d.ts +46 -0
  61. package/types/services/sites.d.ts +4 -4
  62. package/types/services/tables-db.d.ts +4 -1
  63. package/types/services/teams.d.ts +4 -4
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@3.1.0"></script>
36
+ <script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@4.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': '3.1.0',
577
+ 'x-sdk-version': '4.0.0',
578
578
  'X-Appwrite-Response-Format': '1.8.0',
579
579
  };
580
580
  this.realtime = {
@@ -6267,6 +6267,48 @@ class Databases {
6267
6267
  };
6268
6268
  return this.client.call('post', uri, apiHeaders, payload);
6269
6269
  }
6270
+ updateRelationshipAttribute(paramsOrFirst, ...rest) {
6271
+ let params;
6272
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6273
+ params = (paramsOrFirst || {});
6274
+ }
6275
+ else {
6276
+ params = {
6277
+ databaseId: paramsOrFirst,
6278
+ collectionId: rest[0],
6279
+ key: rest[1],
6280
+ onDelete: rest[2],
6281
+ newKey: rest[3]
6282
+ };
6283
+ }
6284
+ const databaseId = params.databaseId;
6285
+ const collectionId = params.collectionId;
6286
+ const key = params.key;
6287
+ const onDelete = params.onDelete;
6288
+ const newKey = params.newKey;
6289
+ if (typeof databaseId === 'undefined') {
6290
+ throw new AppwriteException('Missing required parameter: "databaseId"');
6291
+ }
6292
+ if (typeof collectionId === 'undefined') {
6293
+ throw new AppwriteException('Missing required parameter: "collectionId"');
6294
+ }
6295
+ if (typeof key === 'undefined') {
6296
+ throw new AppwriteException('Missing required parameter: "key"');
6297
+ }
6298
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
6299
+ const payload = {};
6300
+ if (typeof onDelete !== 'undefined') {
6301
+ payload['onDelete'] = onDelete;
6302
+ }
6303
+ if (typeof newKey !== 'undefined') {
6304
+ payload['newKey'] = newKey;
6305
+ }
6306
+ const uri = new URL(this.client.config.endpoint + apiPath);
6307
+ const apiHeaders = {
6308
+ 'content-type': 'application/json',
6309
+ };
6310
+ return this.client.call('patch', uri, apiHeaders, payload);
6311
+ }
6270
6312
  createStringAttribute(paramsOrFirst, ...rest) {
6271
6313
  let params;
6272
6314
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -6794,48 +6836,6 @@ class Databases {
6794
6836
  };
6795
6837
  return this.client.call('delete', uri, apiHeaders, payload);
6796
6838
  }
6797
- updateRelationshipAttribute(paramsOrFirst, ...rest) {
6798
- let params;
6799
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6800
- params = (paramsOrFirst || {});
6801
- }
6802
- else {
6803
- params = {
6804
- databaseId: paramsOrFirst,
6805
- collectionId: rest[0],
6806
- key: rest[1],
6807
- onDelete: rest[2],
6808
- newKey: rest[3]
6809
- };
6810
- }
6811
- const databaseId = params.databaseId;
6812
- const collectionId = params.collectionId;
6813
- const key = params.key;
6814
- const onDelete = params.onDelete;
6815
- const newKey = params.newKey;
6816
- if (typeof databaseId === 'undefined') {
6817
- throw new AppwriteException('Missing required parameter: "databaseId"');
6818
- }
6819
- if (typeof collectionId === 'undefined') {
6820
- throw new AppwriteException('Missing required parameter: "collectionId"');
6821
- }
6822
- if (typeof key === 'undefined') {
6823
- throw new AppwriteException('Missing required parameter: "key"');
6824
- }
6825
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
6826
- const payload = {};
6827
- if (typeof onDelete !== 'undefined') {
6828
- payload['onDelete'] = onDelete;
6829
- }
6830
- if (typeof newKey !== 'undefined') {
6831
- payload['newKey'] = newKey;
6832
- }
6833
- const uri = new URL(this.client.config.endpoint + apiPath);
6834
- const apiHeaders = {
6835
- 'content-type': 'application/json',
6836
- };
6837
- return this.client.call('patch', uri, apiHeaders, payload);
6838
- }
6839
6839
  listDocuments(paramsOrFirst, ...rest) {
6840
6840
  let params;
6841
6841
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -6847,7 +6847,8 @@ class Databases {
6847
6847
  collectionId: rest[0],
6848
6848
  queries: rest[1],
6849
6849
  transactionId: rest[2],
6850
- total: rest[3]
6850
+ total: rest[3],
6851
+ ttl: rest[4]
6851
6852
  };
6852
6853
  }
6853
6854
  const databaseId = params.databaseId;
@@ -6855,6 +6856,7 @@ class Databases {
6855
6856
  const queries = params.queries;
6856
6857
  const transactionId = params.transactionId;
6857
6858
  const total = params.total;
6859
+ const ttl = params.ttl;
6858
6860
  if (typeof databaseId === 'undefined') {
6859
6861
  throw new AppwriteException('Missing required parameter: "databaseId"');
6860
6862
  }
@@ -6872,6 +6874,9 @@ class Databases {
6872
6874
  if (typeof total !== 'undefined') {
6873
6875
  payload['total'] = total;
6874
6876
  }
6877
+ if (typeof ttl !== 'undefined') {
6878
+ payload['ttl'] = ttl;
6879
+ }
6875
6880
  const uri = new URL(this.client.config.endpoint + apiPath);
6876
6881
  const apiHeaders = {};
6877
6882
  return this.client.call('get', uri, apiHeaders, payload);
@@ -7771,7 +7776,7 @@ class Domains {
7771
7776
  else {
7772
7777
  params = {
7773
7778
  domain: paramsOrFirst,
7774
- teamId: rest[0],
7779
+ organizationId: rest[0],
7775
7780
  firstName: rest[1],
7776
7781
  lastName: rest[2],
7777
7782
  email: rest[3],
@@ -7784,7 +7789,7 @@ class Domains {
7784
7789
  };
7785
7790
  }
7786
7791
  const domain = params.domain;
7787
- const teamId = params.teamId;
7792
+ const organizationId = params.organizationId;
7788
7793
  const firstName = params.firstName;
7789
7794
  const lastName = params.lastName;
7790
7795
  const email = params.email;
@@ -7797,8 +7802,8 @@ class Domains {
7797
7802
  if (typeof domain === 'undefined') {
7798
7803
  throw new AppwriteException('Missing required parameter: "domain"');
7799
7804
  }
7800
- if (typeof teamId === 'undefined') {
7801
- throw new AppwriteException('Missing required parameter: "teamId"');
7805
+ if (typeof organizationId === 'undefined') {
7806
+ throw new AppwriteException('Missing required parameter: "organizationId"');
7802
7807
  }
7803
7808
  if (typeof firstName === 'undefined') {
7804
7809
  throw new AppwriteException('Missing required parameter: "firstName"');
@@ -7823,8 +7828,8 @@ class Domains {
7823
7828
  if (typeof domain !== 'undefined') {
7824
7829
  payload['domain'] = domain;
7825
7830
  }
7826
- if (typeof teamId !== 'undefined') {
7827
- payload['teamId'] = teamId;
7831
+ if (typeof organizationId !== 'undefined') {
7832
+ payload['organizationId'] = organizationId;
7828
7833
  }
7829
7834
  if (typeof firstName !== 'undefined') {
7830
7835
  payload['firstName'] = firstName;
@@ -7907,6 +7912,88 @@ class Domains {
7907
7912
  const apiHeaders = {};
7908
7913
  return this.client.call('get', uri, apiHeaders, payload);
7909
7914
  }
7915
+ createTransferIn(paramsOrFirst, ...rest) {
7916
+ let params;
7917
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7918
+ params = (paramsOrFirst || {});
7919
+ }
7920
+ else {
7921
+ params = {
7922
+ domain: paramsOrFirst,
7923
+ organizationId: rest[0],
7924
+ authCode: rest[1],
7925
+ paymentMethodId: rest[2]
7926
+ };
7927
+ }
7928
+ const domain = params.domain;
7929
+ const organizationId = params.organizationId;
7930
+ const authCode = params.authCode;
7931
+ const paymentMethodId = params.paymentMethodId;
7932
+ if (typeof domain === 'undefined') {
7933
+ throw new AppwriteException('Missing required parameter: "domain"');
7934
+ }
7935
+ if (typeof organizationId === 'undefined') {
7936
+ throw new AppwriteException('Missing required parameter: "organizationId"');
7937
+ }
7938
+ if (typeof authCode === 'undefined') {
7939
+ throw new AppwriteException('Missing required parameter: "authCode"');
7940
+ }
7941
+ if (typeof paymentMethodId === 'undefined') {
7942
+ throw new AppwriteException('Missing required parameter: "paymentMethodId"');
7943
+ }
7944
+ const apiPath = '/domains/transfers/in';
7945
+ const payload = {};
7946
+ if (typeof domain !== 'undefined') {
7947
+ payload['domain'] = domain;
7948
+ }
7949
+ if (typeof organizationId !== 'undefined') {
7950
+ payload['organizationId'] = organizationId;
7951
+ }
7952
+ if (typeof authCode !== 'undefined') {
7953
+ payload['authCode'] = authCode;
7954
+ }
7955
+ if (typeof paymentMethodId !== 'undefined') {
7956
+ payload['paymentMethodId'] = paymentMethodId;
7957
+ }
7958
+ const uri = new URL(this.client.config.endpoint + apiPath);
7959
+ const apiHeaders = {
7960
+ 'content-type': 'application/json',
7961
+ };
7962
+ return this.client.call('post', uri, apiHeaders, payload);
7963
+ }
7964
+ createTransferOut(paramsOrFirst, ...rest) {
7965
+ let params;
7966
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7967
+ params = (paramsOrFirst || {});
7968
+ }
7969
+ else {
7970
+ params = {
7971
+ domainId: paramsOrFirst,
7972
+ organizationId: rest[0]
7973
+ };
7974
+ }
7975
+ const domainId = params.domainId;
7976
+ const organizationId = params.organizationId;
7977
+ if (typeof domainId === 'undefined') {
7978
+ throw new AppwriteException('Missing required parameter: "domainId"');
7979
+ }
7980
+ if (typeof organizationId === 'undefined') {
7981
+ throw new AppwriteException('Missing required parameter: "organizationId"');
7982
+ }
7983
+ const apiPath = '/domains/transfers/out';
7984
+ const payload = {};
7985
+ if (typeof domainId !== 'undefined') {
7986
+ payload['domainId'] = domainId;
7987
+ }
7988
+ if (typeof organizationId !== 'undefined') {
7989
+ payload['organizationId'] = organizationId;
7990
+ }
7991
+ const uri = new URL(this.client.config.endpoint + apiPath);
7992
+ const apiHeaders = {
7993
+ 'content-type': 'application/json',
7994
+ };
7995
+ return this.client.call('post', uri, apiHeaders, payload);
7996
+ }
7910
7997
  get(paramsOrFirst) {
7911
7998
  let params;
7912
7999
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -9461,6 +9548,26 @@ class Domains {
9461
9548
  };
9462
9549
  return this.client.call('patch', uri, apiHeaders, payload);
9463
9550
  }
9551
+ getTransferStatus(paramsOrFirst) {
9552
+ let params;
9553
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9554
+ params = (paramsOrFirst || {});
9555
+ }
9556
+ else {
9557
+ params = {
9558
+ domainId: paramsOrFirst
9559
+ };
9560
+ }
9561
+ const domainId = params.domainId;
9562
+ if (typeof domainId === 'undefined') {
9563
+ throw new AppwriteException('Missing required parameter: "domainId"');
9564
+ }
9565
+ const apiPath = '/domains/{domainId}/transfers/status'.replace('{domainId}', domainId);
9566
+ const payload = {};
9567
+ const uri = new URL(this.client.config.endpoint + apiPath);
9568
+ const apiHeaders = {};
9569
+ return this.client.call('get', uri, apiHeaders, payload);
9570
+ }
9464
9571
  getZone(paramsOrFirst) {
9465
9572
  let params;
9466
9573
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -10736,6 +10843,31 @@ class Health {
10736
10843
  const apiHeaders = {};
10737
10844
  return this.client.call('get', uri, apiHeaders, payload);
10738
10845
  }
10846
+ getConsolePausing(paramsOrFirst, ...rest) {
10847
+ let params;
10848
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10849
+ params = (paramsOrFirst || {});
10850
+ }
10851
+ else {
10852
+ params = {
10853
+ threshold: paramsOrFirst,
10854
+ inactivityDays: rest[0]
10855
+ };
10856
+ }
10857
+ const threshold = params.threshold;
10858
+ const inactivityDays = params.inactivityDays;
10859
+ const apiPath = '/health/console-pausing';
10860
+ const payload = {};
10861
+ if (typeof threshold !== 'undefined') {
10862
+ payload['threshold'] = threshold;
10863
+ }
10864
+ if (typeof inactivityDays !== 'undefined') {
10865
+ payload['inactivityDays'] = inactivityDays;
10866
+ }
10867
+ const uri = new URL(this.client.config.endpoint + apiPath);
10868
+ const apiHeaders = {};
10869
+ return this.client.call('get', uri, apiHeaders, payload);
10870
+ }
10739
10871
  /**
10740
10872
  * Check the Appwrite database servers are up and connection is successful.
10741
10873
  *
@@ -16983,6 +17115,28 @@ class Projects {
16983
17115
  };
16984
17116
  return this.client.call('patch', uri, apiHeaders, payload);
16985
17117
  }
17118
+ updateConsoleAccess(paramsOrFirst) {
17119
+ let params;
17120
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
17121
+ params = (paramsOrFirst || {});
17122
+ }
17123
+ else {
17124
+ params = {
17125
+ projectId: paramsOrFirst
17126
+ };
17127
+ }
17128
+ const projectId = params.projectId;
17129
+ if (typeof projectId === 'undefined') {
17130
+ throw new AppwriteException('Missing required parameter: "projectId"');
17131
+ }
17132
+ const apiPath = '/projects/{projectId}/console-access'.replace('{projectId}', projectId);
17133
+ const payload = {};
17134
+ const uri = new URL(this.client.config.endpoint + apiPath);
17135
+ const apiHeaders = {
17136
+ 'content-type': 'application/json',
17137
+ };
17138
+ return this.client.call('patch', uri, apiHeaders, payload);
17139
+ }
16986
17140
  listDevKeys(paramsOrFirst, ...rest) {
16987
17141
  let params;
16988
17142
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -18086,6 +18240,36 @@ class Projects {
18086
18240
  };
18087
18241
  return this.client.call('post', uri, apiHeaders, payload);
18088
18242
  }
18243
+ updateStatus(paramsOrFirst, ...rest) {
18244
+ let params;
18245
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18246
+ params = (paramsOrFirst || {});
18247
+ }
18248
+ else {
18249
+ params = {
18250
+ projectId: paramsOrFirst,
18251
+ status: rest[0]
18252
+ };
18253
+ }
18254
+ const projectId = params.projectId;
18255
+ const status = params.status;
18256
+ if (typeof projectId === 'undefined') {
18257
+ throw new AppwriteException('Missing required parameter: "projectId"');
18258
+ }
18259
+ if (typeof status === 'undefined') {
18260
+ throw new AppwriteException('Missing required parameter: "status"');
18261
+ }
18262
+ const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
18263
+ const payload = {};
18264
+ if (typeof status !== 'undefined') {
18265
+ payload['status'] = status;
18266
+ }
18267
+ const uri = new URL(this.client.config.endpoint + apiPath);
18268
+ const apiHeaders = {
18269
+ 'content-type': 'application/json',
18270
+ };
18271
+ return this.client.call('patch', uri, apiHeaders, payload);
18272
+ }
18089
18273
  updateTeam(paramsOrFirst, ...rest) {
18090
18274
  let params;
18091
18275
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -19437,28 +19621,25 @@ class Sites {
19437
19621
  params = {
19438
19622
  siteId: paramsOrFirst,
19439
19623
  code: rest[0],
19440
- activate: rest[1],
19441
- installCommand: rest[2],
19442
- buildCommand: rest[3],
19443
- outputDirectory: rest[4]
19624
+ installCommand: rest[1],
19625
+ buildCommand: rest[2],
19626
+ outputDirectory: rest[3],
19627
+ activate: rest[4]
19444
19628
  };
19445
19629
  onProgress = rest[5];
19446
19630
  }
19447
19631
  const siteId = params.siteId;
19448
19632
  const code = params.code;
19449
- const activate = params.activate;
19450
19633
  const installCommand = params.installCommand;
19451
19634
  const buildCommand = params.buildCommand;
19452
19635
  const outputDirectory = params.outputDirectory;
19636
+ const activate = params.activate;
19453
19637
  if (typeof siteId === 'undefined') {
19454
19638
  throw new AppwriteException('Missing required parameter: "siteId"');
19455
19639
  }
19456
19640
  if (typeof code === 'undefined') {
19457
19641
  throw new AppwriteException('Missing required parameter: "code"');
19458
19642
  }
19459
- if (typeof activate === 'undefined') {
19460
- throw new AppwriteException('Missing required parameter: "activate"');
19461
- }
19462
19643
  const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
19463
19644
  const payload = {};
19464
19645
  if (typeof installCommand !== 'undefined') {
@@ -23289,7 +23470,8 @@ class TablesDB {
23289
23470
  tableId: rest[0],
23290
23471
  queries: rest[1],
23291
23472
  transactionId: rest[2],
23292
- total: rest[3]
23473
+ total: rest[3],
23474
+ ttl: rest[4]
23293
23475
  };
23294
23476
  }
23295
23477
  const databaseId = params.databaseId;
@@ -23297,6 +23479,7 @@ class TablesDB {
23297
23479
  const queries = params.queries;
23298
23480
  const transactionId = params.transactionId;
23299
23481
  const total = params.total;
23482
+ const ttl = params.ttl;
23300
23483
  if (typeof databaseId === 'undefined') {
23301
23484
  throw new AppwriteException('Missing required parameter: "databaseId"');
23302
23485
  }
@@ -23314,6 +23497,9 @@ class TablesDB {
23314
23497
  if (typeof total !== 'undefined') {
23315
23498
  payload['total'] = total;
23316
23499
  }
23500
+ if (typeof ttl !== 'undefined') {
23501
+ payload['ttl'] = ttl;
23502
+ }
23317
23503
  const uri = new URL(this.client.config.endpoint + apiPath);
23318
23504
  const apiHeaders = {};
23319
23505
  return this.client.call('get', uri, apiHeaders, payload);
@@ -26952,8 +27138,14 @@ _a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
26952
27138
  };
26953
27139
 
26954
27140
  function normalize(id) {
26955
- const trimmed = id.trim();
26956
- return trimmed === "" ? "*" : trimmed;
27141
+ if (id === undefined || id === null) {
27142
+ throw new Error("Channel ID is required");
27143
+ }
27144
+ const trimmed = String(id).trim();
27145
+ if (trimmed === "") {
27146
+ throw new Error("Channel ID is required");
27147
+ }
27148
+ return trimmed;
26957
27149
  }
26958
27150
  class Channel {
26959
27151
  constructor(segments) {
@@ -26974,8 +27166,7 @@ class Channel {
26974
27166
  // --- DATABASE ROUTE ---
26975
27167
  // Only available on Channel<Database>
26976
27168
  collection(id) {
26977
- // Default: wildcard collection ID
26978
- return this.next("collections", id !== null && id !== void 0 ? id : "*");
27169
+ return this.next("collections", id);
26979
27170
  }
26980
27171
  // Only available on Channel<Collection>
26981
27172
  document(id) {
@@ -26984,8 +27175,7 @@ class Channel {
26984
27175
  }
26985
27176
  // --- TABLESDB ROUTE ---
26986
27177
  table(id) {
26987
- // Default: wildcard table ID
26988
- return this.next("tables", id !== null && id !== void 0 ? id : "*");
27178
+ return this.next("tables", id);
26989
27179
  }
26990
27180
  row(id) {
26991
27181
  // Default: no row ID segment
@@ -27011,25 +27201,25 @@ class Channel {
27011
27201
  return this.resolve("delete");
27012
27202
  }
27013
27203
  // --- ROOT FACTORIES ---
27014
- static database(id = "*") {
27204
+ static database(id) {
27015
27205
  return new Channel(["databases", normalize(id)]);
27016
27206
  }
27017
- static execution(id = "*") {
27207
+ static execution(id) {
27018
27208
  return new Channel(["executions", normalize(id)]);
27019
27209
  }
27020
- static tablesdb(id = "*") {
27210
+ static tablesdb(id) {
27021
27211
  return new Channel(["tablesdb", normalize(id)]);
27022
27212
  }
27023
- static bucket(id = "*") {
27213
+ static bucket(id) {
27024
27214
  return new Channel(["buckets", normalize(id)]);
27025
27215
  }
27026
- static function(id = "*") {
27216
+ static function(id) {
27027
27217
  return new Channel(["functions", normalize(id)]);
27028
27218
  }
27029
- static team(id = "*") {
27219
+ static team(id) {
27030
27220
  return new Channel(["teams", normalize(id)]);
27031
27221
  }
27032
- static membership(id = "*") {
27222
+ static membership(id) {
27033
27223
  return new Channel(["memberships", normalize(id)]);
27034
27224
  }
27035
27225
  static account() {
@@ -28471,20 +28661,72 @@ exports.SmtpEncryption = void 0;
28471
28661
  SmtpEncryption["Tls"] = "tls";
28472
28662
  })(exports.SmtpEncryption || (exports.SmtpEncryption = {}));
28473
28663
 
28474
- exports.Resources = void 0;
28475
- (function (Resources) {
28476
- Resources["User"] = "user";
28477
- Resources["Database"] = "database";
28478
- Resources["Table"] = "table";
28479
- Resources["Column"] = "column";
28480
- Resources["Index"] = "index";
28481
- Resources["Row"] = "row";
28482
- Resources["Document"] = "document";
28483
- Resources["Attribute"] = "attribute";
28484
- Resources["Collection"] = "collection";
28485
- Resources["Bucket"] = "bucket";
28486
- Resources["File"] = "file";
28487
- })(exports.Resources || (exports.Resources = {}));
28664
+ exports.AppwriteMigrationResource = void 0;
28665
+ (function (AppwriteMigrationResource) {
28666
+ AppwriteMigrationResource["User"] = "user";
28667
+ AppwriteMigrationResource["Team"] = "team";
28668
+ AppwriteMigrationResource["Membership"] = "membership";
28669
+ AppwriteMigrationResource["Database"] = "database";
28670
+ AppwriteMigrationResource["Table"] = "table";
28671
+ AppwriteMigrationResource["Column"] = "column";
28672
+ AppwriteMigrationResource["Index"] = "index";
28673
+ AppwriteMigrationResource["Row"] = "row";
28674
+ AppwriteMigrationResource["Document"] = "document";
28675
+ AppwriteMigrationResource["Attribute"] = "attribute";
28676
+ AppwriteMigrationResource["Collection"] = "collection";
28677
+ AppwriteMigrationResource["Bucket"] = "bucket";
28678
+ AppwriteMigrationResource["File"] = "file";
28679
+ AppwriteMigrationResource["Function"] = "function";
28680
+ AppwriteMigrationResource["Deployment"] = "deployment";
28681
+ AppwriteMigrationResource["Environmentvariable"] = "environment-variable";
28682
+ AppwriteMigrationResource["Site"] = "site";
28683
+ AppwriteMigrationResource["Sitedeployment"] = "site-deployment";
28684
+ AppwriteMigrationResource["Sitevariable"] = "site-variable";
28685
+ })(exports.AppwriteMigrationResource || (exports.AppwriteMigrationResource = {}));
28686
+
28687
+ exports.FirebaseMigrationResource = void 0;
28688
+ (function (FirebaseMigrationResource) {
28689
+ FirebaseMigrationResource["User"] = "user";
28690
+ FirebaseMigrationResource["Database"] = "database";
28691
+ FirebaseMigrationResource["Table"] = "table";
28692
+ FirebaseMigrationResource["Column"] = "column";
28693
+ FirebaseMigrationResource["Row"] = "row";
28694
+ FirebaseMigrationResource["Document"] = "document";
28695
+ FirebaseMigrationResource["Attribute"] = "attribute";
28696
+ FirebaseMigrationResource["Collection"] = "collection";
28697
+ FirebaseMigrationResource["Bucket"] = "bucket";
28698
+ FirebaseMigrationResource["File"] = "file";
28699
+ })(exports.FirebaseMigrationResource || (exports.FirebaseMigrationResource = {}));
28700
+
28701
+ exports.NHostMigrationResource = void 0;
28702
+ (function (NHostMigrationResource) {
28703
+ NHostMigrationResource["User"] = "user";
28704
+ NHostMigrationResource["Database"] = "database";
28705
+ NHostMigrationResource["Table"] = "table";
28706
+ NHostMigrationResource["Column"] = "column";
28707
+ NHostMigrationResource["Index"] = "index";
28708
+ NHostMigrationResource["Row"] = "row";
28709
+ NHostMigrationResource["Document"] = "document";
28710
+ NHostMigrationResource["Attribute"] = "attribute";
28711
+ NHostMigrationResource["Collection"] = "collection";
28712
+ NHostMigrationResource["Bucket"] = "bucket";
28713
+ NHostMigrationResource["File"] = "file";
28714
+ })(exports.NHostMigrationResource || (exports.NHostMigrationResource = {}));
28715
+
28716
+ exports.SupabaseMigrationResource = void 0;
28717
+ (function (SupabaseMigrationResource) {
28718
+ SupabaseMigrationResource["User"] = "user";
28719
+ SupabaseMigrationResource["Database"] = "database";
28720
+ SupabaseMigrationResource["Table"] = "table";
28721
+ SupabaseMigrationResource["Column"] = "column";
28722
+ SupabaseMigrationResource["Index"] = "index";
28723
+ SupabaseMigrationResource["Row"] = "row";
28724
+ SupabaseMigrationResource["Document"] = "document";
28725
+ SupabaseMigrationResource["Attribute"] = "attribute";
28726
+ SupabaseMigrationResource["Collection"] = "collection";
28727
+ SupabaseMigrationResource["Bucket"] = "bucket";
28728
+ SupabaseMigrationResource["File"] = "file";
28729
+ })(exports.SupabaseMigrationResource || (exports.SupabaseMigrationResource = {}));
28488
28730
 
28489
28731
  exports.ProjectUsageRange = void 0;
28490
28732
  (function (ProjectUsageRange) {
@@ -28570,6 +28812,11 @@ exports.SMTPSecure = void 0;
28570
28812
  SMTPSecure["Ssl"] = "ssl";
28571
28813
  })(exports.SMTPSecure || (exports.SMTPSecure = {}));
28572
28814
 
28815
+ exports.Status = void 0;
28816
+ (function (Status) {
28817
+ Status["Active"] = "active";
28818
+ })(exports.Status || (exports.Status = {}));
28819
+
28573
28820
  exports.EmailTemplateType = void 0;
28574
28821
  (function (EmailTemplateType) {
28575
28822
  EmailTemplateType["Verification"] = "verification";
@@ -29157,6 +29404,18 @@ exports.BillingPlanGroup = void 0;
29157
29404
  BillingPlanGroup["Scale"] = "scale";
29158
29405
  })(exports.BillingPlanGroup || (exports.BillingPlanGroup = {}));
29159
29406
 
29407
+ exports.DomainTransferStatusStatus = void 0;
29408
+ (function (DomainTransferStatusStatus) {
29409
+ DomainTransferStatusStatus["Transferrable"] = "transferrable";
29410
+ DomainTransferStatusStatus["NotTransferrable"] = "not_transferrable";
29411
+ DomainTransferStatusStatus["PendingOwner"] = "pending_owner";
29412
+ DomainTransferStatusStatus["PendingAdmin"] = "pending_admin";
29413
+ DomainTransferStatusStatus["PendingRegistry"] = "pending_registry";
29414
+ DomainTransferStatusStatus["Completed"] = "completed";
29415
+ DomainTransferStatusStatus["Cancelled"] = "cancelled";
29416
+ DomainTransferStatusStatus["ServiceUnavailable"] = "service_unavailable";
29417
+ })(exports.DomainTransferStatusStatus || (exports.DomainTransferStatusStatus = {}));
29418
+
29160
29419
  exports.Account = Account;
29161
29420
  exports.Activities = Activities;
29162
29421
  exports.AppwriteException = AppwriteException;