@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/esm/sdk.js CHANGED
@@ -243,12 +243,34 @@ Query.limit = (limit) => new Query("limit", undefined, limit).toString();
243
243
  Query.offset = (offset) => new Query("offset", undefined, offset).toString();
244
244
  /**
245
245
  * Filter resources where attribute contains the specified value.
246
+ * For string attributes, checks if the string contains the substring.
246
247
  *
248
+ * Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
247
249
  * @param {string} attribute
248
250
  * @param {string | string[]} value
249
251
  * @returns {string}
250
252
  */
251
253
  Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
254
+ /**
255
+ * Filter resources where attribute contains ANY of the specified values.
256
+ * For array and relationship attributes, matches documents where the attribute
257
+ * contains at least one of the given values.
258
+ *
259
+ * @param {string} attribute
260
+ * @param {any[]} value
261
+ * @returns {string}
262
+ */
263
+ Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
264
+ /**
265
+ * Filter resources where attribute contains ALL of the specified values.
266
+ * For array and relationship attributes, matches documents where the attribute
267
+ * contains every one of the given values.
268
+ *
269
+ * @param {string} attribute
270
+ * @param {any[]} value
271
+ * @returns {string}
272
+ */
273
+ Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
252
274
  /**
253
275
  * Filter resources where attribute does not contain the specified value.
254
276
  *
@@ -466,6 +488,8 @@ const JSONbigParser = JSONbigModule({ storeAsString: false });
466
488
  const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });
467
489
  const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
468
490
  const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
491
+ const MAX_INT64 = BigInt('9223372036854775807');
492
+ const MIN_INT64 = BigInt('-9223372036854775808');
469
493
  function isBigNumber(value) {
470
494
  return value !== null
471
495
  && typeof value === 'object'
@@ -482,7 +506,10 @@ function reviver(_key, value) {
482
506
  if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
483
507
  return Number(str);
484
508
  }
485
- return bi;
509
+ if (bi >= MIN_INT64 && bi <= MAX_INT64) {
510
+ return bi;
511
+ }
512
+ return value.toNumber();
486
513
  }
487
514
  return value.toNumber();
488
515
  }
@@ -541,7 +568,7 @@ class Client {
541
568
  'x-sdk-name': 'Console',
542
569
  'x-sdk-platform': 'console',
543
570
  'x-sdk-language': 'web',
544
- 'x-sdk-version': '3.0.0',
571
+ 'x-sdk-version': '4.0.0',
545
572
  'X-Appwrite-Response-Format': '1.8.0',
546
573
  };
547
574
  this.realtime = {
@@ -6234,6 +6261,48 @@ class Databases {
6234
6261
  };
6235
6262
  return this.client.call('post', uri, apiHeaders, payload);
6236
6263
  }
6264
+ updateRelationshipAttribute(paramsOrFirst, ...rest) {
6265
+ let params;
6266
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6267
+ params = (paramsOrFirst || {});
6268
+ }
6269
+ else {
6270
+ params = {
6271
+ databaseId: paramsOrFirst,
6272
+ collectionId: rest[0],
6273
+ key: rest[1],
6274
+ onDelete: rest[2],
6275
+ newKey: rest[3]
6276
+ };
6277
+ }
6278
+ const databaseId = params.databaseId;
6279
+ const collectionId = params.collectionId;
6280
+ const key = params.key;
6281
+ const onDelete = params.onDelete;
6282
+ const newKey = params.newKey;
6283
+ if (typeof databaseId === 'undefined') {
6284
+ throw new AppwriteException('Missing required parameter: "databaseId"');
6285
+ }
6286
+ if (typeof collectionId === 'undefined') {
6287
+ throw new AppwriteException('Missing required parameter: "collectionId"');
6288
+ }
6289
+ if (typeof key === 'undefined') {
6290
+ throw new AppwriteException('Missing required parameter: "key"');
6291
+ }
6292
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
6293
+ const payload = {};
6294
+ if (typeof onDelete !== 'undefined') {
6295
+ payload['onDelete'] = onDelete;
6296
+ }
6297
+ if (typeof newKey !== 'undefined') {
6298
+ payload['newKey'] = newKey;
6299
+ }
6300
+ const uri = new URL(this.client.config.endpoint + apiPath);
6301
+ const apiHeaders = {
6302
+ 'content-type': 'application/json',
6303
+ };
6304
+ return this.client.call('patch', uri, apiHeaders, payload);
6305
+ }
6237
6306
  createStringAttribute(paramsOrFirst, ...rest) {
6238
6307
  let params;
6239
6308
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -6761,48 +6830,6 @@ class Databases {
6761
6830
  };
6762
6831
  return this.client.call('delete', uri, apiHeaders, payload);
6763
6832
  }
6764
- updateRelationshipAttribute(paramsOrFirst, ...rest) {
6765
- let params;
6766
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6767
- params = (paramsOrFirst || {});
6768
- }
6769
- else {
6770
- params = {
6771
- databaseId: paramsOrFirst,
6772
- collectionId: rest[0],
6773
- key: rest[1],
6774
- onDelete: rest[2],
6775
- newKey: rest[3]
6776
- };
6777
- }
6778
- const databaseId = params.databaseId;
6779
- const collectionId = params.collectionId;
6780
- const key = params.key;
6781
- const onDelete = params.onDelete;
6782
- const newKey = params.newKey;
6783
- if (typeof databaseId === 'undefined') {
6784
- throw new AppwriteException('Missing required parameter: "databaseId"');
6785
- }
6786
- if (typeof collectionId === 'undefined') {
6787
- throw new AppwriteException('Missing required parameter: "collectionId"');
6788
- }
6789
- if (typeof key === 'undefined') {
6790
- throw new AppwriteException('Missing required parameter: "key"');
6791
- }
6792
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
6793
- const payload = {};
6794
- if (typeof onDelete !== 'undefined') {
6795
- payload['onDelete'] = onDelete;
6796
- }
6797
- if (typeof newKey !== 'undefined') {
6798
- payload['newKey'] = newKey;
6799
- }
6800
- const uri = new URL(this.client.config.endpoint + apiPath);
6801
- const apiHeaders = {
6802
- 'content-type': 'application/json',
6803
- };
6804
- return this.client.call('patch', uri, apiHeaders, payload);
6805
- }
6806
6833
  listDocuments(paramsOrFirst, ...rest) {
6807
6834
  let params;
6808
6835
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -6814,7 +6841,8 @@ class Databases {
6814
6841
  collectionId: rest[0],
6815
6842
  queries: rest[1],
6816
6843
  transactionId: rest[2],
6817
- total: rest[3]
6844
+ total: rest[3],
6845
+ ttl: rest[4]
6818
6846
  };
6819
6847
  }
6820
6848
  const databaseId = params.databaseId;
@@ -6822,6 +6850,7 @@ class Databases {
6822
6850
  const queries = params.queries;
6823
6851
  const transactionId = params.transactionId;
6824
6852
  const total = params.total;
6853
+ const ttl = params.ttl;
6825
6854
  if (typeof databaseId === 'undefined') {
6826
6855
  throw new AppwriteException('Missing required parameter: "databaseId"');
6827
6856
  }
@@ -6839,6 +6868,9 @@ class Databases {
6839
6868
  if (typeof total !== 'undefined') {
6840
6869
  payload['total'] = total;
6841
6870
  }
6871
+ if (typeof ttl !== 'undefined') {
6872
+ payload['ttl'] = ttl;
6873
+ }
6842
6874
  const uri = new URL(this.client.config.endpoint + apiPath);
6843
6875
  const apiHeaders = {};
6844
6876
  return this.client.call('get', uri, apiHeaders, payload);
@@ -7730,6 +7762,102 @@ class Domains {
7730
7762
  const apiHeaders = {};
7731
7763
  return this.client.call('get', uri, apiHeaders, payload);
7732
7764
  }
7765
+ createPurchase(paramsOrFirst, ...rest) {
7766
+ let params;
7767
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7768
+ params = (paramsOrFirst || {});
7769
+ }
7770
+ else {
7771
+ params = {
7772
+ domain: paramsOrFirst,
7773
+ organizationId: rest[0],
7774
+ firstName: rest[1],
7775
+ lastName: rest[2],
7776
+ email: rest[3],
7777
+ phone: rest[4],
7778
+ billingAddressId: rest[5],
7779
+ paymentMethodId: rest[6],
7780
+ addressLine3: rest[7],
7781
+ companyName: rest[8],
7782
+ periodYears: rest[9]
7783
+ };
7784
+ }
7785
+ const domain = params.domain;
7786
+ const organizationId = params.organizationId;
7787
+ const firstName = params.firstName;
7788
+ const lastName = params.lastName;
7789
+ const email = params.email;
7790
+ const phone = params.phone;
7791
+ const billingAddressId = params.billingAddressId;
7792
+ const paymentMethodId = params.paymentMethodId;
7793
+ const addressLine3 = params.addressLine3;
7794
+ const companyName = params.companyName;
7795
+ const periodYears = params.periodYears;
7796
+ if (typeof domain === 'undefined') {
7797
+ throw new AppwriteException('Missing required parameter: "domain"');
7798
+ }
7799
+ if (typeof organizationId === 'undefined') {
7800
+ throw new AppwriteException('Missing required parameter: "organizationId"');
7801
+ }
7802
+ if (typeof firstName === 'undefined') {
7803
+ throw new AppwriteException('Missing required parameter: "firstName"');
7804
+ }
7805
+ if (typeof lastName === 'undefined') {
7806
+ throw new AppwriteException('Missing required parameter: "lastName"');
7807
+ }
7808
+ if (typeof email === 'undefined') {
7809
+ throw new AppwriteException('Missing required parameter: "email"');
7810
+ }
7811
+ if (typeof phone === 'undefined') {
7812
+ throw new AppwriteException('Missing required parameter: "phone"');
7813
+ }
7814
+ if (typeof billingAddressId === 'undefined') {
7815
+ throw new AppwriteException('Missing required parameter: "billingAddressId"');
7816
+ }
7817
+ if (typeof paymentMethodId === 'undefined') {
7818
+ throw new AppwriteException('Missing required parameter: "paymentMethodId"');
7819
+ }
7820
+ const apiPath = '/domains/purchases';
7821
+ const payload = {};
7822
+ if (typeof domain !== 'undefined') {
7823
+ payload['domain'] = domain;
7824
+ }
7825
+ if (typeof organizationId !== 'undefined') {
7826
+ payload['organizationId'] = organizationId;
7827
+ }
7828
+ if (typeof firstName !== 'undefined') {
7829
+ payload['firstName'] = firstName;
7830
+ }
7831
+ if (typeof lastName !== 'undefined') {
7832
+ payload['lastName'] = lastName;
7833
+ }
7834
+ if (typeof email !== 'undefined') {
7835
+ payload['email'] = email;
7836
+ }
7837
+ if (typeof phone !== 'undefined') {
7838
+ payload['phone'] = phone;
7839
+ }
7840
+ if (typeof billingAddressId !== 'undefined') {
7841
+ payload['billingAddressId'] = billingAddressId;
7842
+ }
7843
+ if (typeof addressLine3 !== 'undefined') {
7844
+ payload['addressLine3'] = addressLine3;
7845
+ }
7846
+ if (typeof companyName !== 'undefined') {
7847
+ payload['companyName'] = companyName;
7848
+ }
7849
+ if (typeof periodYears !== 'undefined') {
7850
+ payload['periodYears'] = periodYears;
7851
+ }
7852
+ if (typeof paymentMethodId !== 'undefined') {
7853
+ payload['paymentMethodId'] = paymentMethodId;
7854
+ }
7855
+ const uri = new URL(this.client.config.endpoint + apiPath);
7856
+ const apiHeaders = {
7857
+ 'content-type': 'application/json',
7858
+ };
7859
+ return this.client.call('post', uri, apiHeaders, payload);
7860
+ }
7733
7861
  listSuggestions(paramsOrFirst, ...rest) {
7734
7862
  let params;
7735
7863
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -7778,6 +7906,88 @@ class Domains {
7778
7906
  const apiHeaders = {};
7779
7907
  return this.client.call('get', uri, apiHeaders, payload);
7780
7908
  }
7909
+ createTransferIn(paramsOrFirst, ...rest) {
7910
+ let params;
7911
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7912
+ params = (paramsOrFirst || {});
7913
+ }
7914
+ else {
7915
+ params = {
7916
+ domain: paramsOrFirst,
7917
+ organizationId: rest[0],
7918
+ authCode: rest[1],
7919
+ paymentMethodId: rest[2]
7920
+ };
7921
+ }
7922
+ const domain = params.domain;
7923
+ const organizationId = params.organizationId;
7924
+ const authCode = params.authCode;
7925
+ const paymentMethodId = params.paymentMethodId;
7926
+ if (typeof domain === 'undefined') {
7927
+ throw new AppwriteException('Missing required parameter: "domain"');
7928
+ }
7929
+ if (typeof organizationId === 'undefined') {
7930
+ throw new AppwriteException('Missing required parameter: "organizationId"');
7931
+ }
7932
+ if (typeof authCode === 'undefined') {
7933
+ throw new AppwriteException('Missing required parameter: "authCode"');
7934
+ }
7935
+ if (typeof paymentMethodId === 'undefined') {
7936
+ throw new AppwriteException('Missing required parameter: "paymentMethodId"');
7937
+ }
7938
+ const apiPath = '/domains/transfers/in';
7939
+ const payload = {};
7940
+ if (typeof domain !== 'undefined') {
7941
+ payload['domain'] = domain;
7942
+ }
7943
+ if (typeof organizationId !== 'undefined') {
7944
+ payload['organizationId'] = organizationId;
7945
+ }
7946
+ if (typeof authCode !== 'undefined') {
7947
+ payload['authCode'] = authCode;
7948
+ }
7949
+ if (typeof paymentMethodId !== 'undefined') {
7950
+ payload['paymentMethodId'] = paymentMethodId;
7951
+ }
7952
+ const uri = new URL(this.client.config.endpoint + apiPath);
7953
+ const apiHeaders = {
7954
+ 'content-type': 'application/json',
7955
+ };
7956
+ return this.client.call('post', uri, apiHeaders, payload);
7957
+ }
7958
+ createTransferOut(paramsOrFirst, ...rest) {
7959
+ let params;
7960
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7961
+ params = (paramsOrFirst || {});
7962
+ }
7963
+ else {
7964
+ params = {
7965
+ domainId: paramsOrFirst,
7966
+ organizationId: rest[0]
7967
+ };
7968
+ }
7969
+ const domainId = params.domainId;
7970
+ const organizationId = params.organizationId;
7971
+ if (typeof domainId === 'undefined') {
7972
+ throw new AppwriteException('Missing required parameter: "domainId"');
7973
+ }
7974
+ if (typeof organizationId === 'undefined') {
7975
+ throw new AppwriteException('Missing required parameter: "organizationId"');
7976
+ }
7977
+ const apiPath = '/domains/transfers/out';
7978
+ const payload = {};
7979
+ if (typeof domainId !== 'undefined') {
7980
+ payload['domainId'] = domainId;
7981
+ }
7982
+ if (typeof organizationId !== 'undefined') {
7983
+ payload['organizationId'] = organizationId;
7984
+ }
7985
+ const uri = new URL(this.client.config.endpoint + apiPath);
7986
+ const apiHeaders = {
7987
+ 'content-type': 'application/json',
7988
+ };
7989
+ return this.client.call('post', uri, apiHeaders, payload);
7990
+ }
7781
7991
  get(paramsOrFirst) {
7782
7992
  let params;
7783
7993
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -9332,6 +9542,26 @@ class Domains {
9332
9542
  };
9333
9543
  return this.client.call('patch', uri, apiHeaders, payload);
9334
9544
  }
9545
+ getTransferStatus(paramsOrFirst) {
9546
+ let params;
9547
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9548
+ params = (paramsOrFirst || {});
9549
+ }
9550
+ else {
9551
+ params = {
9552
+ domainId: paramsOrFirst
9553
+ };
9554
+ }
9555
+ const domainId = params.domainId;
9556
+ if (typeof domainId === 'undefined') {
9557
+ throw new AppwriteException('Missing required parameter: "domainId"');
9558
+ }
9559
+ const apiPath = '/domains/{domainId}/transfers/status'.replace('{domainId}', domainId);
9560
+ const payload = {};
9561
+ const uri = new URL(this.client.config.endpoint + apiPath);
9562
+ const apiHeaders = {};
9563
+ return this.client.call('get', uri, apiHeaders, payload);
9564
+ }
9335
9565
  getZone(paramsOrFirst) {
9336
9566
  let params;
9337
9567
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -10607,6 +10837,31 @@ class Health {
10607
10837
  const apiHeaders = {};
10608
10838
  return this.client.call('get', uri, apiHeaders, payload);
10609
10839
  }
10840
+ getConsolePausing(paramsOrFirst, ...rest) {
10841
+ let params;
10842
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10843
+ params = (paramsOrFirst || {});
10844
+ }
10845
+ else {
10846
+ params = {
10847
+ threshold: paramsOrFirst,
10848
+ inactivityDays: rest[0]
10849
+ };
10850
+ }
10851
+ const threshold = params.threshold;
10852
+ const inactivityDays = params.inactivityDays;
10853
+ const apiPath = '/health/console-pausing';
10854
+ const payload = {};
10855
+ if (typeof threshold !== 'undefined') {
10856
+ payload['threshold'] = threshold;
10857
+ }
10858
+ if (typeof inactivityDays !== 'undefined') {
10859
+ payload['inactivityDays'] = inactivityDays;
10860
+ }
10861
+ const uri = new URL(this.client.config.endpoint + apiPath);
10862
+ const apiHeaders = {};
10863
+ return this.client.call('get', uri, apiHeaders, payload);
10864
+ }
10610
10865
  /**
10611
10866
  * Check the Appwrite database servers are up and connection is successful.
10612
10867
  *
@@ -15836,22 +16091,27 @@ class Organizations {
15836
16091
  const apiHeaders = {};
15837
16092
  return this.client.call('get', uri, apiHeaders, payload);
15838
16093
  }
15839
- getScopes(paramsOrFirst) {
16094
+ getScopes(paramsOrFirst, ...rest) {
15840
16095
  let params;
15841
16096
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
15842
16097
  params = (paramsOrFirst || {});
15843
16098
  }
15844
16099
  else {
15845
16100
  params = {
15846
- organizationId: paramsOrFirst
16101
+ organizationId: paramsOrFirst,
16102
+ projectId: rest[0]
15847
16103
  };
15848
16104
  }
15849
16105
  const organizationId = params.organizationId;
16106
+ const projectId = params.projectId;
15850
16107
  if (typeof organizationId === 'undefined') {
15851
16108
  throw new AppwriteException('Missing required parameter: "organizationId"');
15852
16109
  }
15853
16110
  const apiPath = '/organizations/{organizationId}/roles'.replace('{organizationId}', organizationId);
15854
16111
  const payload = {};
16112
+ if (typeof projectId !== 'undefined') {
16113
+ payload['projectId'] = projectId;
16114
+ }
15855
16115
  const uri = new URL(this.client.config.endpoint + apiPath);
15856
16116
  const apiHeaders = {};
15857
16117
  return this.client.call('get', uri, apiHeaders, payload);
@@ -16849,6 +17109,28 @@ class Projects {
16849
17109
  };
16850
17110
  return this.client.call('patch', uri, apiHeaders, payload);
16851
17111
  }
17112
+ updateConsoleAccess(paramsOrFirst) {
17113
+ let params;
17114
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
17115
+ params = (paramsOrFirst || {});
17116
+ }
17117
+ else {
17118
+ params = {
17119
+ projectId: paramsOrFirst
17120
+ };
17121
+ }
17122
+ const projectId = params.projectId;
17123
+ if (typeof projectId === 'undefined') {
17124
+ throw new AppwriteException('Missing required parameter: "projectId"');
17125
+ }
17126
+ const apiPath = '/projects/{projectId}/console-access'.replace('{projectId}', projectId);
17127
+ const payload = {};
17128
+ const uri = new URL(this.client.config.endpoint + apiPath);
17129
+ const apiHeaders = {
17130
+ 'content-type': 'application/json',
17131
+ };
17132
+ return this.client.call('patch', uri, apiHeaders, payload);
17133
+ }
16852
17134
  listDevKeys(paramsOrFirst, ...rest) {
16853
17135
  let params;
16854
17136
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -17952,6 +18234,36 @@ class Projects {
17952
18234
  };
17953
18235
  return this.client.call('post', uri, apiHeaders, payload);
17954
18236
  }
18237
+ updateStatus(paramsOrFirst, ...rest) {
18238
+ let params;
18239
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18240
+ params = (paramsOrFirst || {});
18241
+ }
18242
+ else {
18243
+ params = {
18244
+ projectId: paramsOrFirst,
18245
+ status: rest[0]
18246
+ };
18247
+ }
18248
+ const projectId = params.projectId;
18249
+ const status = params.status;
18250
+ if (typeof projectId === 'undefined') {
18251
+ throw new AppwriteException('Missing required parameter: "projectId"');
18252
+ }
18253
+ if (typeof status === 'undefined') {
18254
+ throw new AppwriteException('Missing required parameter: "status"');
18255
+ }
18256
+ const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
18257
+ const payload = {};
18258
+ if (typeof status !== 'undefined') {
18259
+ payload['status'] = status;
18260
+ }
18261
+ const uri = new URL(this.client.config.endpoint + apiPath);
18262
+ const apiHeaders = {
18263
+ 'content-type': 'application/json',
18264
+ };
18265
+ return this.client.call('patch', uri, apiHeaders, payload);
18266
+ }
17955
18267
  updateTeam(paramsOrFirst, ...rest) {
17956
18268
  let params;
17957
18269
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -19303,28 +19615,25 @@ class Sites {
19303
19615
  params = {
19304
19616
  siteId: paramsOrFirst,
19305
19617
  code: rest[0],
19306
- activate: rest[1],
19307
- installCommand: rest[2],
19308
- buildCommand: rest[3],
19309
- outputDirectory: rest[4]
19618
+ installCommand: rest[1],
19619
+ buildCommand: rest[2],
19620
+ outputDirectory: rest[3],
19621
+ activate: rest[4]
19310
19622
  };
19311
19623
  onProgress = rest[5];
19312
19624
  }
19313
19625
  const siteId = params.siteId;
19314
19626
  const code = params.code;
19315
- const activate = params.activate;
19316
19627
  const installCommand = params.installCommand;
19317
19628
  const buildCommand = params.buildCommand;
19318
19629
  const outputDirectory = params.outputDirectory;
19630
+ const activate = params.activate;
19319
19631
  if (typeof siteId === 'undefined') {
19320
19632
  throw new AppwriteException('Missing required parameter: "siteId"');
19321
19633
  }
19322
19634
  if (typeof code === 'undefined') {
19323
19635
  throw new AppwriteException('Missing required parameter: "code"');
19324
19636
  }
19325
- if (typeof activate === 'undefined') {
19326
- throw new AppwriteException('Missing required parameter: "activate"');
19327
- }
19328
19637
  const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
19329
19638
  const payload = {};
19330
19639
  if (typeof installCommand !== 'undefined') {
@@ -23155,7 +23464,8 @@ class TablesDB {
23155
23464
  tableId: rest[0],
23156
23465
  queries: rest[1],
23157
23466
  transactionId: rest[2],
23158
- total: rest[3]
23467
+ total: rest[3],
23468
+ ttl: rest[4]
23159
23469
  };
23160
23470
  }
23161
23471
  const databaseId = params.databaseId;
@@ -23163,6 +23473,7 @@ class TablesDB {
23163
23473
  const queries = params.queries;
23164
23474
  const transactionId = params.transactionId;
23165
23475
  const total = params.total;
23476
+ const ttl = params.ttl;
23166
23477
  if (typeof databaseId === 'undefined') {
23167
23478
  throw new AppwriteException('Missing required parameter: "databaseId"');
23168
23479
  }
@@ -23180,6 +23491,9 @@ class TablesDB {
23180
23491
  if (typeof total !== 'undefined') {
23181
23492
  payload['total'] = total;
23182
23493
  }
23494
+ if (typeof ttl !== 'undefined') {
23495
+ payload['ttl'] = ttl;
23496
+ }
23183
23497
  const uri = new URL(this.client.config.endpoint + apiPath);
23184
23498
  const apiHeaders = {};
23185
23499
  return this.client.call('get', uri, apiHeaders, payload);
@@ -26818,8 +27132,14 @@ _a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
26818
27132
  };
26819
27133
 
26820
27134
  function normalize(id) {
26821
- const trimmed = id.trim();
26822
- return trimmed === "" ? "*" : trimmed;
27135
+ if (id === undefined || id === null) {
27136
+ throw new Error("Channel ID is required");
27137
+ }
27138
+ const trimmed = String(id).trim();
27139
+ if (trimmed === "") {
27140
+ throw new Error("Channel ID is required");
27141
+ }
27142
+ return trimmed;
26823
27143
  }
26824
27144
  class Channel {
26825
27145
  constructor(segments) {
@@ -26840,8 +27160,7 @@ class Channel {
26840
27160
  // --- DATABASE ROUTE ---
26841
27161
  // Only available on Channel<Database>
26842
27162
  collection(id) {
26843
- // Default: wildcard collection ID
26844
- return this.next("collections", id !== null && id !== void 0 ? id : "*");
27163
+ return this.next("collections", id);
26845
27164
  }
26846
27165
  // Only available on Channel<Collection>
26847
27166
  document(id) {
@@ -26850,8 +27169,7 @@ class Channel {
26850
27169
  }
26851
27170
  // --- TABLESDB ROUTE ---
26852
27171
  table(id) {
26853
- // Default: wildcard table ID
26854
- return this.next("tables", id !== null && id !== void 0 ? id : "*");
27172
+ return this.next("tables", id);
26855
27173
  }
26856
27174
  row(id) {
26857
27175
  // Default: no row ID segment
@@ -26877,25 +27195,25 @@ class Channel {
26877
27195
  return this.resolve("delete");
26878
27196
  }
26879
27197
  // --- ROOT FACTORIES ---
26880
- static database(id = "*") {
27198
+ static database(id) {
26881
27199
  return new Channel(["databases", normalize(id)]);
26882
27200
  }
26883
- static execution(id = "*") {
27201
+ static execution(id) {
26884
27202
  return new Channel(["executions", normalize(id)]);
26885
27203
  }
26886
- static tablesdb(id = "*") {
27204
+ static tablesdb(id) {
26887
27205
  return new Channel(["tablesdb", normalize(id)]);
26888
27206
  }
26889
- static bucket(id = "*") {
27207
+ static bucket(id) {
26890
27208
  return new Channel(["buckets", normalize(id)]);
26891
27209
  }
26892
- static function(id = "*") {
27210
+ static function(id) {
26893
27211
  return new Channel(["functions", normalize(id)]);
26894
27212
  }
26895
- static team(id = "*") {
27213
+ static team(id) {
26896
27214
  return new Channel(["teams", normalize(id)]);
26897
27215
  }
26898
- static membership(id = "*") {
27216
+ static membership(id) {
26899
27217
  return new Channel(["memberships", normalize(id)]);
26900
27218
  }
26901
27219
  static account() {
@@ -28337,20 +28655,72 @@ var SmtpEncryption;
28337
28655
  SmtpEncryption["Tls"] = "tls";
28338
28656
  })(SmtpEncryption || (SmtpEncryption = {}));
28339
28657
 
28340
- var Resources;
28341
- (function (Resources) {
28342
- Resources["User"] = "user";
28343
- Resources["Database"] = "database";
28344
- Resources["Table"] = "table";
28345
- Resources["Column"] = "column";
28346
- Resources["Index"] = "index";
28347
- Resources["Row"] = "row";
28348
- Resources["Document"] = "document";
28349
- Resources["Attribute"] = "attribute";
28350
- Resources["Collection"] = "collection";
28351
- Resources["Bucket"] = "bucket";
28352
- Resources["File"] = "file";
28353
- })(Resources || (Resources = {}));
28658
+ var AppwriteMigrationResource;
28659
+ (function (AppwriteMigrationResource) {
28660
+ AppwriteMigrationResource["User"] = "user";
28661
+ AppwriteMigrationResource["Team"] = "team";
28662
+ AppwriteMigrationResource["Membership"] = "membership";
28663
+ AppwriteMigrationResource["Database"] = "database";
28664
+ AppwriteMigrationResource["Table"] = "table";
28665
+ AppwriteMigrationResource["Column"] = "column";
28666
+ AppwriteMigrationResource["Index"] = "index";
28667
+ AppwriteMigrationResource["Row"] = "row";
28668
+ AppwriteMigrationResource["Document"] = "document";
28669
+ AppwriteMigrationResource["Attribute"] = "attribute";
28670
+ AppwriteMigrationResource["Collection"] = "collection";
28671
+ AppwriteMigrationResource["Bucket"] = "bucket";
28672
+ AppwriteMigrationResource["File"] = "file";
28673
+ AppwriteMigrationResource["Function"] = "function";
28674
+ AppwriteMigrationResource["Deployment"] = "deployment";
28675
+ AppwriteMigrationResource["Environmentvariable"] = "environment-variable";
28676
+ AppwriteMigrationResource["Site"] = "site";
28677
+ AppwriteMigrationResource["Sitedeployment"] = "site-deployment";
28678
+ AppwriteMigrationResource["Sitevariable"] = "site-variable";
28679
+ })(AppwriteMigrationResource || (AppwriteMigrationResource = {}));
28680
+
28681
+ var FirebaseMigrationResource;
28682
+ (function (FirebaseMigrationResource) {
28683
+ FirebaseMigrationResource["User"] = "user";
28684
+ FirebaseMigrationResource["Database"] = "database";
28685
+ FirebaseMigrationResource["Table"] = "table";
28686
+ FirebaseMigrationResource["Column"] = "column";
28687
+ FirebaseMigrationResource["Row"] = "row";
28688
+ FirebaseMigrationResource["Document"] = "document";
28689
+ FirebaseMigrationResource["Attribute"] = "attribute";
28690
+ FirebaseMigrationResource["Collection"] = "collection";
28691
+ FirebaseMigrationResource["Bucket"] = "bucket";
28692
+ FirebaseMigrationResource["File"] = "file";
28693
+ })(FirebaseMigrationResource || (FirebaseMigrationResource = {}));
28694
+
28695
+ var NHostMigrationResource;
28696
+ (function (NHostMigrationResource) {
28697
+ NHostMigrationResource["User"] = "user";
28698
+ NHostMigrationResource["Database"] = "database";
28699
+ NHostMigrationResource["Table"] = "table";
28700
+ NHostMigrationResource["Column"] = "column";
28701
+ NHostMigrationResource["Index"] = "index";
28702
+ NHostMigrationResource["Row"] = "row";
28703
+ NHostMigrationResource["Document"] = "document";
28704
+ NHostMigrationResource["Attribute"] = "attribute";
28705
+ NHostMigrationResource["Collection"] = "collection";
28706
+ NHostMigrationResource["Bucket"] = "bucket";
28707
+ NHostMigrationResource["File"] = "file";
28708
+ })(NHostMigrationResource || (NHostMigrationResource = {}));
28709
+
28710
+ var SupabaseMigrationResource;
28711
+ (function (SupabaseMigrationResource) {
28712
+ SupabaseMigrationResource["User"] = "user";
28713
+ SupabaseMigrationResource["Database"] = "database";
28714
+ SupabaseMigrationResource["Table"] = "table";
28715
+ SupabaseMigrationResource["Column"] = "column";
28716
+ SupabaseMigrationResource["Index"] = "index";
28717
+ SupabaseMigrationResource["Row"] = "row";
28718
+ SupabaseMigrationResource["Document"] = "document";
28719
+ SupabaseMigrationResource["Attribute"] = "attribute";
28720
+ SupabaseMigrationResource["Collection"] = "collection";
28721
+ SupabaseMigrationResource["Bucket"] = "bucket";
28722
+ SupabaseMigrationResource["File"] = "file";
28723
+ })(SupabaseMigrationResource || (SupabaseMigrationResource = {}));
28354
28724
 
28355
28725
  var ProjectUsageRange;
28356
28726
  (function (ProjectUsageRange) {
@@ -28436,6 +28806,11 @@ var SMTPSecure;
28436
28806
  SMTPSecure["Ssl"] = "ssl";
28437
28807
  })(SMTPSecure || (SMTPSecure = {}));
28438
28808
 
28809
+ var Status;
28810
+ (function (Status) {
28811
+ Status["Active"] = "active";
28812
+ })(Status || (Status = {}));
28813
+
28439
28814
  var EmailTemplateType;
28440
28815
  (function (EmailTemplateType) {
28441
28816
  EmailTemplateType["Verification"] = "verification";
@@ -29023,5 +29398,17 @@ var BillingPlanGroup;
29023
29398
  BillingPlanGroup["Scale"] = "scale";
29024
29399
  })(BillingPlanGroup || (BillingPlanGroup = {}));
29025
29400
 
29026
- export { Account, Activities, Adapter, Api, ApiService, AppwriteException, Assistant, AttributeStatus, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, Browser, BrowserPermission, BuildRuntime, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, CreditCard, DatabaseType, Databases, DeploymentDownloadType, DeploymentStatus, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, ExecutionStatus, ExecutionTrigger, FilterType, Flag, Framework, Frameworks, Functions, Graphql, Health, HealthAntivirusStatus, HealthCheckStatus, ID, ImageFormat, ImageGravity, IndexStatus, IndexType, Locale, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Name, OAuthProvider, Operator, OrderBy, Organizations, PasswordHash, Permission, Platform, PlatformType, Project, ProjectUsageRange, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Query, Realtime, Region, RegistrationType, RelationMutate, RelationshipType, ResourceType, Resources, Role, Runtime, Runtimes, SMTPSecure, Scopes, Sites, SmsTemplateLocale, SmsTemplateType, SmtpEncryption, StatusCode, Storage, TablesDB, Teams, TemplateReferenceType, Theme, Timezone, Tokens, UsageRange, UseCases, Users, VCSDetectionType, VCSReferenceType, Vcs };
29401
+ var DomainTransferStatusStatus;
29402
+ (function (DomainTransferStatusStatus) {
29403
+ DomainTransferStatusStatus["Transferrable"] = "transferrable";
29404
+ DomainTransferStatusStatus["NotTransferrable"] = "not_transferrable";
29405
+ DomainTransferStatusStatus["PendingOwner"] = "pending_owner";
29406
+ DomainTransferStatusStatus["PendingAdmin"] = "pending_admin";
29407
+ DomainTransferStatusStatus["PendingRegistry"] = "pending_registry";
29408
+ DomainTransferStatusStatus["Completed"] = "completed";
29409
+ DomainTransferStatusStatus["Cancelled"] = "cancelled";
29410
+ DomainTransferStatusStatus["ServiceUnavailable"] = "service_unavailable";
29411
+ })(DomainTransferStatusStatus || (DomainTransferStatusStatus = {}));
29412
+
29413
+ export { Account, Activities, Adapter, Api, ApiService, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, Browser, BrowserPermission, BuildRuntime, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, CreditCard, DatabaseType, Databases, DeploymentDownloadType, DeploymentStatus, DomainTransferStatusStatus, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, ExecutionStatus, ExecutionTrigger, FilterType, FirebaseMigrationResource, Flag, Framework, Frameworks, Functions, Graphql, Health, HealthAntivirusStatus, HealthCheckStatus, ID, ImageFormat, ImageGravity, IndexStatus, IndexType, Locale, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, NHostMigrationResource, Name, OAuthProvider, Operator, OrderBy, Organizations, PasswordHash, Permission, Platform, PlatformType, Project, ProjectUsageRange, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Query, Realtime, Region, RegistrationType, RelationMutate, RelationshipType, ResourceType, Role, Runtime, Runtimes, SMTPSecure, Scopes, Sites, SmsTemplateLocale, SmsTemplateType, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, Teams, TemplateReferenceType, Theme, Timezone, Tokens, UsageRange, UseCases, Users, VCSDetectionType, VCSReferenceType, Vcs };
29027
29414
  //# sourceMappingURL=sdk.js.map