@appwrite.io/console 3.0.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 (69) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +470 -83
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +471 -84
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +470 -83
  8. package/docs/examples/databases/list-documents.md +2 -1
  9. package/docs/examples/domains/create-purchase.md +25 -0
  10. package/docs/examples/domains/create-transfer-in.md +18 -0
  11. package/docs/examples/domains/create-transfer-out.md +16 -0
  12. package/docs/examples/domains/get-transfer-status.md +15 -0
  13. package/docs/examples/health/get-console-pausing.md +16 -0
  14. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  15. package/docs/examples/migrations/create-firebase-migration.md +2 -2
  16. package/docs/examples/migrations/create-n-host-migration.md +2 -2
  17. package/docs/examples/migrations/create-supabase-migration.md +2 -2
  18. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  19. package/docs/examples/migrations/get-firebase-report.md +2 -2
  20. package/docs/examples/migrations/get-n-host-report.md +2 -2
  21. package/docs/examples/migrations/get-supabase-report.md +2 -2
  22. package/docs/examples/organizations/get-scopes.md +2 -1
  23. package/docs/examples/projects/update-console-access.md +15 -0
  24. package/docs/examples/projects/update-status.md +16 -0
  25. package/docs/examples/sites/create-deployment.md +2 -2
  26. package/docs/examples/tablesdb/list-rows.md +2 -1
  27. package/package.json +1 -1
  28. package/src/channel.ts +19 -15
  29. package/src/client.ts +7 -2
  30. package/src/enums/appwrite-migration-resource.ts +21 -0
  31. package/src/enums/domain-transfer-status-status.ts +10 -0
  32. package/src/enums/firebase-migration-resource.ts +12 -0
  33. package/src/enums/{resources.ts → n-host-migration-resource.ts} +1 -1
  34. package/src/enums/status.ts +3 -0
  35. package/src/enums/supabase-migration-resource.ts +13 -0
  36. package/src/index.ts +6 -1
  37. package/src/models.ts +124 -3
  38. package/src/query.ts +26 -0
  39. package/src/services/account.ts +2 -2
  40. package/src/services/databases.ts +100 -93
  41. package/src/services/domains.ts +350 -0
  42. package/src/services/health.ts +61 -0
  43. package/src/services/messaging.ts +2 -2
  44. package/src/services/migrations.ts +68 -65
  45. package/src/services/organizations.ts +14 -6
  46. package/src/services/projects.ts +120 -0
  47. package/src/services/sites.ts +13 -16
  48. package/src/services/tables-db.ts +14 -7
  49. package/src/services/teams.ts +4 -4
  50. package/types/channel.d.ts +9 -9
  51. package/types/enums/appwrite-migration-resource.d.ts +21 -0
  52. package/types/enums/domain-transfer-status-status.d.ts +10 -0
  53. package/types/enums/firebase-migration-resource.d.ts +12 -0
  54. package/types/enums/{resources.d.ts → n-host-migration-resource.d.ts} +1 -1
  55. package/types/enums/status.d.ts +3 -0
  56. package/types/enums/supabase-migration-resource.d.ts +13 -0
  57. package/types/index.d.ts +6 -1
  58. package/types/models.d.ts +122 -3
  59. package/types/query.d.ts +22 -0
  60. package/types/services/databases.d.ts +40 -37
  61. package/types/services/domains.d.ts +118 -0
  62. package/types/services/health.d.ts +24 -0
  63. package/types/services/messaging.d.ts +2 -2
  64. package/types/services/migrations.d.ts +36 -33
  65. package/types/services/organizations.d.ts +4 -1
  66. package/types/services/projects.d.ts +46 -0
  67. package/types/services/sites.d.ts +4 -4
  68. package/types/services/tables-db.d.ts +4 -1
  69. package/types/services/teams.d.ts +4 -4
package/dist/cjs/sdk.js CHANGED
@@ -249,12 +249,34 @@ Query.limit = (limit) => new Query("limit", undefined, limit).toString();
249
249
  Query.offset = (offset) => new Query("offset", undefined, offset).toString();
250
250
  /**
251
251
  * Filter resources where attribute contains the specified value.
252
+ * For string attributes, checks if the string contains the substring.
252
253
  *
254
+ * Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
253
255
  * @param {string} attribute
254
256
  * @param {string | string[]} value
255
257
  * @returns {string}
256
258
  */
257
259
  Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
260
+ /**
261
+ * Filter resources where attribute contains ANY of the specified values.
262
+ * For array and relationship attributes, matches documents where the attribute
263
+ * contains at least one of the given values.
264
+ *
265
+ * @param {string} attribute
266
+ * @param {any[]} value
267
+ * @returns {string}
268
+ */
269
+ Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
270
+ /**
271
+ * Filter resources where attribute contains ALL of the specified values.
272
+ * For array and relationship attributes, matches documents where the attribute
273
+ * contains every one of the given values.
274
+ *
275
+ * @param {string} attribute
276
+ * @param {any[]} value
277
+ * @returns {string}
278
+ */
279
+ Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
258
280
  /**
259
281
  * Filter resources where attribute does not contain the specified value.
260
282
  *
@@ -472,6 +494,8 @@ const JSONbigParser = JSONbigModule__default["default"]({ storeAsString: false }
472
494
  const JSONbigSerializer = JSONbigModule__default["default"]({ useNativeBigInt: true });
473
495
  const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
474
496
  const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
497
+ const MAX_INT64 = BigInt('9223372036854775807');
498
+ const MIN_INT64 = BigInt('-9223372036854775808');
475
499
  function isBigNumber(value) {
476
500
  return value !== null
477
501
  && typeof value === 'object'
@@ -488,7 +512,10 @@ function reviver(_key, value) {
488
512
  if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
489
513
  return Number(str);
490
514
  }
491
- return bi;
515
+ if (bi >= MIN_INT64 && bi <= MAX_INT64) {
516
+ return bi;
517
+ }
518
+ return value.toNumber();
492
519
  }
493
520
  return value.toNumber();
494
521
  }
@@ -547,7 +574,7 @@ class Client {
547
574
  'x-sdk-name': 'Console',
548
575
  'x-sdk-platform': 'console',
549
576
  'x-sdk-language': 'web',
550
- 'x-sdk-version': '3.0.0',
577
+ 'x-sdk-version': '4.0.0',
551
578
  'X-Appwrite-Response-Format': '1.8.0',
552
579
  };
553
580
  this.realtime = {
@@ -6240,6 +6267,48 @@ class Databases {
6240
6267
  };
6241
6268
  return this.client.call('post', uri, apiHeaders, payload);
6242
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
+ }
6243
6312
  createStringAttribute(paramsOrFirst, ...rest) {
6244
6313
  let params;
6245
6314
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -6767,48 +6836,6 @@ class Databases {
6767
6836
  };
6768
6837
  return this.client.call('delete', uri, apiHeaders, payload);
6769
6838
  }
6770
- updateRelationshipAttribute(paramsOrFirst, ...rest) {
6771
- let params;
6772
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6773
- params = (paramsOrFirst || {});
6774
- }
6775
- else {
6776
- params = {
6777
- databaseId: paramsOrFirst,
6778
- collectionId: rest[0],
6779
- key: rest[1],
6780
- onDelete: rest[2],
6781
- newKey: rest[3]
6782
- };
6783
- }
6784
- const databaseId = params.databaseId;
6785
- const collectionId = params.collectionId;
6786
- const key = params.key;
6787
- const onDelete = params.onDelete;
6788
- const newKey = params.newKey;
6789
- if (typeof databaseId === 'undefined') {
6790
- throw new AppwriteException('Missing required parameter: "databaseId"');
6791
- }
6792
- if (typeof collectionId === 'undefined') {
6793
- throw new AppwriteException('Missing required parameter: "collectionId"');
6794
- }
6795
- if (typeof key === 'undefined') {
6796
- throw new AppwriteException('Missing required parameter: "key"');
6797
- }
6798
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
6799
- const payload = {};
6800
- if (typeof onDelete !== 'undefined') {
6801
- payload['onDelete'] = onDelete;
6802
- }
6803
- if (typeof newKey !== 'undefined') {
6804
- payload['newKey'] = newKey;
6805
- }
6806
- const uri = new URL(this.client.config.endpoint + apiPath);
6807
- const apiHeaders = {
6808
- 'content-type': 'application/json',
6809
- };
6810
- return this.client.call('patch', uri, apiHeaders, payload);
6811
- }
6812
6839
  listDocuments(paramsOrFirst, ...rest) {
6813
6840
  let params;
6814
6841
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -6820,7 +6847,8 @@ class Databases {
6820
6847
  collectionId: rest[0],
6821
6848
  queries: rest[1],
6822
6849
  transactionId: rest[2],
6823
- total: rest[3]
6850
+ total: rest[3],
6851
+ ttl: rest[4]
6824
6852
  };
6825
6853
  }
6826
6854
  const databaseId = params.databaseId;
@@ -6828,6 +6856,7 @@ class Databases {
6828
6856
  const queries = params.queries;
6829
6857
  const transactionId = params.transactionId;
6830
6858
  const total = params.total;
6859
+ const ttl = params.ttl;
6831
6860
  if (typeof databaseId === 'undefined') {
6832
6861
  throw new AppwriteException('Missing required parameter: "databaseId"');
6833
6862
  }
@@ -6845,6 +6874,9 @@ class Databases {
6845
6874
  if (typeof total !== 'undefined') {
6846
6875
  payload['total'] = total;
6847
6876
  }
6877
+ if (typeof ttl !== 'undefined') {
6878
+ payload['ttl'] = ttl;
6879
+ }
6848
6880
  const uri = new URL(this.client.config.endpoint + apiPath);
6849
6881
  const apiHeaders = {};
6850
6882
  return this.client.call('get', uri, apiHeaders, payload);
@@ -7736,6 +7768,102 @@ class Domains {
7736
7768
  const apiHeaders = {};
7737
7769
  return this.client.call('get', uri, apiHeaders, payload);
7738
7770
  }
7771
+ createPurchase(paramsOrFirst, ...rest) {
7772
+ let params;
7773
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7774
+ params = (paramsOrFirst || {});
7775
+ }
7776
+ else {
7777
+ params = {
7778
+ domain: paramsOrFirst,
7779
+ organizationId: rest[0],
7780
+ firstName: rest[1],
7781
+ lastName: rest[2],
7782
+ email: rest[3],
7783
+ phone: rest[4],
7784
+ billingAddressId: rest[5],
7785
+ paymentMethodId: rest[6],
7786
+ addressLine3: rest[7],
7787
+ companyName: rest[8],
7788
+ periodYears: rest[9]
7789
+ };
7790
+ }
7791
+ const domain = params.domain;
7792
+ const organizationId = params.organizationId;
7793
+ const firstName = params.firstName;
7794
+ const lastName = params.lastName;
7795
+ const email = params.email;
7796
+ const phone = params.phone;
7797
+ const billingAddressId = params.billingAddressId;
7798
+ const paymentMethodId = params.paymentMethodId;
7799
+ const addressLine3 = params.addressLine3;
7800
+ const companyName = params.companyName;
7801
+ const periodYears = params.periodYears;
7802
+ if (typeof domain === 'undefined') {
7803
+ throw new AppwriteException('Missing required parameter: "domain"');
7804
+ }
7805
+ if (typeof organizationId === 'undefined') {
7806
+ throw new AppwriteException('Missing required parameter: "organizationId"');
7807
+ }
7808
+ if (typeof firstName === 'undefined') {
7809
+ throw new AppwriteException('Missing required parameter: "firstName"');
7810
+ }
7811
+ if (typeof lastName === 'undefined') {
7812
+ throw new AppwriteException('Missing required parameter: "lastName"');
7813
+ }
7814
+ if (typeof email === 'undefined') {
7815
+ throw new AppwriteException('Missing required parameter: "email"');
7816
+ }
7817
+ if (typeof phone === 'undefined') {
7818
+ throw new AppwriteException('Missing required parameter: "phone"');
7819
+ }
7820
+ if (typeof billingAddressId === 'undefined') {
7821
+ throw new AppwriteException('Missing required parameter: "billingAddressId"');
7822
+ }
7823
+ if (typeof paymentMethodId === 'undefined') {
7824
+ throw new AppwriteException('Missing required parameter: "paymentMethodId"');
7825
+ }
7826
+ const apiPath = '/domains/purchases';
7827
+ const payload = {};
7828
+ if (typeof domain !== 'undefined') {
7829
+ payload['domain'] = domain;
7830
+ }
7831
+ if (typeof organizationId !== 'undefined') {
7832
+ payload['organizationId'] = organizationId;
7833
+ }
7834
+ if (typeof firstName !== 'undefined') {
7835
+ payload['firstName'] = firstName;
7836
+ }
7837
+ if (typeof lastName !== 'undefined') {
7838
+ payload['lastName'] = lastName;
7839
+ }
7840
+ if (typeof email !== 'undefined') {
7841
+ payload['email'] = email;
7842
+ }
7843
+ if (typeof phone !== 'undefined') {
7844
+ payload['phone'] = phone;
7845
+ }
7846
+ if (typeof billingAddressId !== 'undefined') {
7847
+ payload['billingAddressId'] = billingAddressId;
7848
+ }
7849
+ if (typeof addressLine3 !== 'undefined') {
7850
+ payload['addressLine3'] = addressLine3;
7851
+ }
7852
+ if (typeof companyName !== 'undefined') {
7853
+ payload['companyName'] = companyName;
7854
+ }
7855
+ if (typeof periodYears !== 'undefined') {
7856
+ payload['periodYears'] = periodYears;
7857
+ }
7858
+ if (typeof paymentMethodId !== 'undefined') {
7859
+ payload['paymentMethodId'] = paymentMethodId;
7860
+ }
7861
+ const uri = new URL(this.client.config.endpoint + apiPath);
7862
+ const apiHeaders = {
7863
+ 'content-type': 'application/json',
7864
+ };
7865
+ return this.client.call('post', uri, apiHeaders, payload);
7866
+ }
7739
7867
  listSuggestions(paramsOrFirst, ...rest) {
7740
7868
  let params;
7741
7869
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -7784,6 +7912,88 @@ class Domains {
7784
7912
  const apiHeaders = {};
7785
7913
  return this.client.call('get', uri, apiHeaders, payload);
7786
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
+ }
7787
7997
  get(paramsOrFirst) {
7788
7998
  let params;
7789
7999
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -9338,6 +9548,26 @@ class Domains {
9338
9548
  };
9339
9549
  return this.client.call('patch', uri, apiHeaders, payload);
9340
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
+ }
9341
9571
  getZone(paramsOrFirst) {
9342
9572
  let params;
9343
9573
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -10613,6 +10843,31 @@ class Health {
10613
10843
  const apiHeaders = {};
10614
10844
  return this.client.call('get', uri, apiHeaders, payload);
10615
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
+ }
10616
10871
  /**
10617
10872
  * Check the Appwrite database servers are up and connection is successful.
10618
10873
  *
@@ -15842,22 +16097,27 @@ class Organizations {
15842
16097
  const apiHeaders = {};
15843
16098
  return this.client.call('get', uri, apiHeaders, payload);
15844
16099
  }
15845
- getScopes(paramsOrFirst) {
16100
+ getScopes(paramsOrFirst, ...rest) {
15846
16101
  let params;
15847
16102
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
15848
16103
  params = (paramsOrFirst || {});
15849
16104
  }
15850
16105
  else {
15851
16106
  params = {
15852
- organizationId: paramsOrFirst
16107
+ organizationId: paramsOrFirst,
16108
+ projectId: rest[0]
15853
16109
  };
15854
16110
  }
15855
16111
  const organizationId = params.organizationId;
16112
+ const projectId = params.projectId;
15856
16113
  if (typeof organizationId === 'undefined') {
15857
16114
  throw new AppwriteException('Missing required parameter: "organizationId"');
15858
16115
  }
15859
16116
  const apiPath = '/organizations/{organizationId}/roles'.replace('{organizationId}', organizationId);
15860
16117
  const payload = {};
16118
+ if (typeof projectId !== 'undefined') {
16119
+ payload['projectId'] = projectId;
16120
+ }
15861
16121
  const uri = new URL(this.client.config.endpoint + apiPath);
15862
16122
  const apiHeaders = {};
15863
16123
  return this.client.call('get', uri, apiHeaders, payload);
@@ -16855,6 +17115,28 @@ class Projects {
16855
17115
  };
16856
17116
  return this.client.call('patch', uri, apiHeaders, payload);
16857
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
+ }
16858
17140
  listDevKeys(paramsOrFirst, ...rest) {
16859
17141
  let params;
16860
17142
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -17958,6 +18240,36 @@ class Projects {
17958
18240
  };
17959
18241
  return this.client.call('post', uri, apiHeaders, payload);
17960
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
+ }
17961
18273
  updateTeam(paramsOrFirst, ...rest) {
17962
18274
  let params;
17963
18275
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -19309,28 +19621,25 @@ class Sites {
19309
19621
  params = {
19310
19622
  siteId: paramsOrFirst,
19311
19623
  code: rest[0],
19312
- activate: rest[1],
19313
- installCommand: rest[2],
19314
- buildCommand: rest[3],
19315
- outputDirectory: rest[4]
19624
+ installCommand: rest[1],
19625
+ buildCommand: rest[2],
19626
+ outputDirectory: rest[3],
19627
+ activate: rest[4]
19316
19628
  };
19317
19629
  onProgress = rest[5];
19318
19630
  }
19319
19631
  const siteId = params.siteId;
19320
19632
  const code = params.code;
19321
- const activate = params.activate;
19322
19633
  const installCommand = params.installCommand;
19323
19634
  const buildCommand = params.buildCommand;
19324
19635
  const outputDirectory = params.outputDirectory;
19636
+ const activate = params.activate;
19325
19637
  if (typeof siteId === 'undefined') {
19326
19638
  throw new AppwriteException('Missing required parameter: "siteId"');
19327
19639
  }
19328
19640
  if (typeof code === 'undefined') {
19329
19641
  throw new AppwriteException('Missing required parameter: "code"');
19330
19642
  }
19331
- if (typeof activate === 'undefined') {
19332
- throw new AppwriteException('Missing required parameter: "activate"');
19333
- }
19334
19643
  const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
19335
19644
  const payload = {};
19336
19645
  if (typeof installCommand !== 'undefined') {
@@ -23161,7 +23470,8 @@ class TablesDB {
23161
23470
  tableId: rest[0],
23162
23471
  queries: rest[1],
23163
23472
  transactionId: rest[2],
23164
- total: rest[3]
23473
+ total: rest[3],
23474
+ ttl: rest[4]
23165
23475
  };
23166
23476
  }
23167
23477
  const databaseId = params.databaseId;
@@ -23169,6 +23479,7 @@ class TablesDB {
23169
23479
  const queries = params.queries;
23170
23480
  const transactionId = params.transactionId;
23171
23481
  const total = params.total;
23482
+ const ttl = params.ttl;
23172
23483
  if (typeof databaseId === 'undefined') {
23173
23484
  throw new AppwriteException('Missing required parameter: "databaseId"');
23174
23485
  }
@@ -23186,6 +23497,9 @@ class TablesDB {
23186
23497
  if (typeof total !== 'undefined') {
23187
23498
  payload['total'] = total;
23188
23499
  }
23500
+ if (typeof ttl !== 'undefined') {
23501
+ payload['ttl'] = ttl;
23502
+ }
23189
23503
  const uri = new URL(this.client.config.endpoint + apiPath);
23190
23504
  const apiHeaders = {};
23191
23505
  return this.client.call('get', uri, apiHeaders, payload);
@@ -26824,8 +27138,14 @@ _a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
26824
27138
  };
26825
27139
 
26826
27140
  function normalize(id) {
26827
- const trimmed = id.trim();
26828
- 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;
26829
27149
  }
26830
27150
  class Channel {
26831
27151
  constructor(segments) {
@@ -26846,8 +27166,7 @@ class Channel {
26846
27166
  // --- DATABASE ROUTE ---
26847
27167
  // Only available on Channel<Database>
26848
27168
  collection(id) {
26849
- // Default: wildcard collection ID
26850
- return this.next("collections", id !== null && id !== void 0 ? id : "*");
27169
+ return this.next("collections", id);
26851
27170
  }
26852
27171
  // Only available on Channel<Collection>
26853
27172
  document(id) {
@@ -26856,8 +27175,7 @@ class Channel {
26856
27175
  }
26857
27176
  // --- TABLESDB ROUTE ---
26858
27177
  table(id) {
26859
- // Default: wildcard table ID
26860
- return this.next("tables", id !== null && id !== void 0 ? id : "*");
27178
+ return this.next("tables", id);
26861
27179
  }
26862
27180
  row(id) {
26863
27181
  // Default: no row ID segment
@@ -26883,25 +27201,25 @@ class Channel {
26883
27201
  return this.resolve("delete");
26884
27202
  }
26885
27203
  // --- ROOT FACTORIES ---
26886
- static database(id = "*") {
27204
+ static database(id) {
26887
27205
  return new Channel(["databases", normalize(id)]);
26888
27206
  }
26889
- static execution(id = "*") {
27207
+ static execution(id) {
26890
27208
  return new Channel(["executions", normalize(id)]);
26891
27209
  }
26892
- static tablesdb(id = "*") {
27210
+ static tablesdb(id) {
26893
27211
  return new Channel(["tablesdb", normalize(id)]);
26894
27212
  }
26895
- static bucket(id = "*") {
27213
+ static bucket(id) {
26896
27214
  return new Channel(["buckets", normalize(id)]);
26897
27215
  }
26898
- static function(id = "*") {
27216
+ static function(id) {
26899
27217
  return new Channel(["functions", normalize(id)]);
26900
27218
  }
26901
- static team(id = "*") {
27219
+ static team(id) {
26902
27220
  return new Channel(["teams", normalize(id)]);
26903
27221
  }
26904
- static membership(id = "*") {
27222
+ static membership(id) {
26905
27223
  return new Channel(["memberships", normalize(id)]);
26906
27224
  }
26907
27225
  static account() {
@@ -28343,20 +28661,72 @@ exports.SmtpEncryption = void 0;
28343
28661
  SmtpEncryption["Tls"] = "tls";
28344
28662
  })(exports.SmtpEncryption || (exports.SmtpEncryption = {}));
28345
28663
 
28346
- exports.Resources = void 0;
28347
- (function (Resources) {
28348
- Resources["User"] = "user";
28349
- Resources["Database"] = "database";
28350
- Resources["Table"] = "table";
28351
- Resources["Column"] = "column";
28352
- Resources["Index"] = "index";
28353
- Resources["Row"] = "row";
28354
- Resources["Document"] = "document";
28355
- Resources["Attribute"] = "attribute";
28356
- Resources["Collection"] = "collection";
28357
- Resources["Bucket"] = "bucket";
28358
- Resources["File"] = "file";
28359
- })(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 = {}));
28360
28730
 
28361
28731
  exports.ProjectUsageRange = void 0;
28362
28732
  (function (ProjectUsageRange) {
@@ -28442,6 +28812,11 @@ exports.SMTPSecure = void 0;
28442
28812
  SMTPSecure["Ssl"] = "ssl";
28443
28813
  })(exports.SMTPSecure || (exports.SMTPSecure = {}));
28444
28814
 
28815
+ exports.Status = void 0;
28816
+ (function (Status) {
28817
+ Status["Active"] = "active";
28818
+ })(exports.Status || (exports.Status = {}));
28819
+
28445
28820
  exports.EmailTemplateType = void 0;
28446
28821
  (function (EmailTemplateType) {
28447
28822
  EmailTemplateType["Verification"] = "verification";
@@ -29029,6 +29404,18 @@ exports.BillingPlanGroup = void 0;
29029
29404
  BillingPlanGroup["Scale"] = "scale";
29030
29405
  })(exports.BillingPlanGroup || (exports.BillingPlanGroup = {}));
29031
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
+
29032
29419
  exports.Account = Account;
29033
29420
  exports.Activities = Activities;
29034
29421
  exports.AppwriteException = AppwriteException;