@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/iife/sdk.js CHANGED
@@ -4007,12 +4007,34 @@
4007
4007
  Query.offset = (offset) => new Query("offset", undefined, offset).toString();
4008
4008
  /**
4009
4009
  * Filter resources where attribute contains the specified value.
4010
+ * For string attributes, checks if the string contains the substring.
4010
4011
  *
4012
+ * Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
4011
4013
  * @param {string} attribute
4012
4014
  * @param {string | string[]} value
4013
4015
  * @returns {string}
4014
4016
  */
4015
4017
  Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
4018
+ /**
4019
+ * Filter resources where attribute contains ANY of the specified values.
4020
+ * For array and relationship attributes, matches documents where the attribute
4021
+ * contains at least one of the given values.
4022
+ *
4023
+ * @param {string} attribute
4024
+ * @param {any[]} value
4025
+ * @returns {string}
4026
+ */
4027
+ Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
4028
+ /**
4029
+ * Filter resources where attribute contains ALL of the specified values.
4030
+ * For array and relationship attributes, matches documents where the attribute
4031
+ * contains every one of the given values.
4032
+ *
4033
+ * @param {string} attribute
4034
+ * @param {any[]} value
4035
+ * @returns {string}
4036
+ */
4037
+ Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
4016
4038
  /**
4017
4039
  * Filter resources where attribute does not contain the specified value.
4018
4040
  *
@@ -4230,6 +4252,8 @@
4230
4252
  const JSONbigSerializer = jsonBigint.exports({ useNativeBigInt: true });
4231
4253
  const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
4232
4254
  const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
4255
+ const MAX_INT64 = BigInt('9223372036854775807');
4256
+ const MIN_INT64 = BigInt('-9223372036854775808');
4233
4257
  function isBigNumber(value) {
4234
4258
  return value !== null
4235
4259
  && typeof value === 'object'
@@ -4246,7 +4270,10 @@
4246
4270
  if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
4247
4271
  return Number(str);
4248
4272
  }
4249
- return bi;
4273
+ if (bi >= MIN_INT64 && bi <= MAX_INT64) {
4274
+ return bi;
4275
+ }
4276
+ return value.toNumber();
4250
4277
  }
4251
4278
  return value.toNumber();
4252
4279
  }
@@ -4305,7 +4332,7 @@
4305
4332
  'x-sdk-name': 'Console',
4306
4333
  'x-sdk-platform': 'console',
4307
4334
  'x-sdk-language': 'web',
4308
- 'x-sdk-version': '3.0.0',
4335
+ 'x-sdk-version': '4.0.0',
4309
4336
  'X-Appwrite-Response-Format': '1.8.0',
4310
4337
  };
4311
4338
  this.realtime = {
@@ -9998,6 +10025,48 @@
9998
10025
  };
9999
10026
  return this.client.call('post', uri, apiHeaders, payload);
10000
10027
  }
10028
+ updateRelationshipAttribute(paramsOrFirst, ...rest) {
10029
+ let params;
10030
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10031
+ params = (paramsOrFirst || {});
10032
+ }
10033
+ else {
10034
+ params = {
10035
+ databaseId: paramsOrFirst,
10036
+ collectionId: rest[0],
10037
+ key: rest[1],
10038
+ onDelete: rest[2],
10039
+ newKey: rest[3]
10040
+ };
10041
+ }
10042
+ const databaseId = params.databaseId;
10043
+ const collectionId = params.collectionId;
10044
+ const key = params.key;
10045
+ const onDelete = params.onDelete;
10046
+ const newKey = params.newKey;
10047
+ if (typeof databaseId === 'undefined') {
10048
+ throw new AppwriteException('Missing required parameter: "databaseId"');
10049
+ }
10050
+ if (typeof collectionId === 'undefined') {
10051
+ throw new AppwriteException('Missing required parameter: "collectionId"');
10052
+ }
10053
+ if (typeof key === 'undefined') {
10054
+ throw new AppwriteException('Missing required parameter: "key"');
10055
+ }
10056
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
10057
+ const payload = {};
10058
+ if (typeof onDelete !== 'undefined') {
10059
+ payload['onDelete'] = onDelete;
10060
+ }
10061
+ if (typeof newKey !== 'undefined') {
10062
+ payload['newKey'] = newKey;
10063
+ }
10064
+ const uri = new URL(this.client.config.endpoint + apiPath);
10065
+ const apiHeaders = {
10066
+ 'content-type': 'application/json',
10067
+ };
10068
+ return this.client.call('patch', uri, apiHeaders, payload);
10069
+ }
10001
10070
  createStringAttribute(paramsOrFirst, ...rest) {
10002
10071
  let params;
10003
10072
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -10525,48 +10594,6 @@
10525
10594
  };
10526
10595
  return this.client.call('delete', uri, apiHeaders, payload);
10527
10596
  }
10528
- updateRelationshipAttribute(paramsOrFirst, ...rest) {
10529
- let params;
10530
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10531
- params = (paramsOrFirst || {});
10532
- }
10533
- else {
10534
- params = {
10535
- databaseId: paramsOrFirst,
10536
- collectionId: rest[0],
10537
- key: rest[1],
10538
- onDelete: rest[2],
10539
- newKey: rest[3]
10540
- };
10541
- }
10542
- const databaseId = params.databaseId;
10543
- const collectionId = params.collectionId;
10544
- const key = params.key;
10545
- const onDelete = params.onDelete;
10546
- const newKey = params.newKey;
10547
- if (typeof databaseId === 'undefined') {
10548
- throw new AppwriteException('Missing required parameter: "databaseId"');
10549
- }
10550
- if (typeof collectionId === 'undefined') {
10551
- throw new AppwriteException('Missing required parameter: "collectionId"');
10552
- }
10553
- if (typeof key === 'undefined') {
10554
- throw new AppwriteException('Missing required parameter: "key"');
10555
- }
10556
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
10557
- const payload = {};
10558
- if (typeof onDelete !== 'undefined') {
10559
- payload['onDelete'] = onDelete;
10560
- }
10561
- if (typeof newKey !== 'undefined') {
10562
- payload['newKey'] = newKey;
10563
- }
10564
- const uri = new URL(this.client.config.endpoint + apiPath);
10565
- const apiHeaders = {
10566
- 'content-type': 'application/json',
10567
- };
10568
- return this.client.call('patch', uri, apiHeaders, payload);
10569
- }
10570
10597
  listDocuments(paramsOrFirst, ...rest) {
10571
10598
  let params;
10572
10599
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -10578,7 +10605,8 @@
10578
10605
  collectionId: rest[0],
10579
10606
  queries: rest[1],
10580
10607
  transactionId: rest[2],
10581
- total: rest[3]
10608
+ total: rest[3],
10609
+ ttl: rest[4]
10582
10610
  };
10583
10611
  }
10584
10612
  const databaseId = params.databaseId;
@@ -10586,6 +10614,7 @@
10586
10614
  const queries = params.queries;
10587
10615
  const transactionId = params.transactionId;
10588
10616
  const total = params.total;
10617
+ const ttl = params.ttl;
10589
10618
  if (typeof databaseId === 'undefined') {
10590
10619
  throw new AppwriteException('Missing required parameter: "databaseId"');
10591
10620
  }
@@ -10603,6 +10632,9 @@
10603
10632
  if (typeof total !== 'undefined') {
10604
10633
  payload['total'] = total;
10605
10634
  }
10635
+ if (typeof ttl !== 'undefined') {
10636
+ payload['ttl'] = ttl;
10637
+ }
10606
10638
  const uri = new URL(this.client.config.endpoint + apiPath);
10607
10639
  const apiHeaders = {};
10608
10640
  return this.client.call('get', uri, apiHeaders, payload);
@@ -11494,6 +11526,102 @@
11494
11526
  const apiHeaders = {};
11495
11527
  return this.client.call('get', uri, apiHeaders, payload);
11496
11528
  }
11529
+ createPurchase(paramsOrFirst, ...rest) {
11530
+ let params;
11531
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11532
+ params = (paramsOrFirst || {});
11533
+ }
11534
+ else {
11535
+ params = {
11536
+ domain: paramsOrFirst,
11537
+ organizationId: rest[0],
11538
+ firstName: rest[1],
11539
+ lastName: rest[2],
11540
+ email: rest[3],
11541
+ phone: rest[4],
11542
+ billingAddressId: rest[5],
11543
+ paymentMethodId: rest[6],
11544
+ addressLine3: rest[7],
11545
+ companyName: rest[8],
11546
+ periodYears: rest[9]
11547
+ };
11548
+ }
11549
+ const domain = params.domain;
11550
+ const organizationId = params.organizationId;
11551
+ const firstName = params.firstName;
11552
+ const lastName = params.lastName;
11553
+ const email = params.email;
11554
+ const phone = params.phone;
11555
+ const billingAddressId = params.billingAddressId;
11556
+ const paymentMethodId = params.paymentMethodId;
11557
+ const addressLine3 = params.addressLine3;
11558
+ const companyName = params.companyName;
11559
+ const periodYears = params.periodYears;
11560
+ if (typeof domain === 'undefined') {
11561
+ throw new AppwriteException('Missing required parameter: "domain"');
11562
+ }
11563
+ if (typeof organizationId === 'undefined') {
11564
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11565
+ }
11566
+ if (typeof firstName === 'undefined') {
11567
+ throw new AppwriteException('Missing required parameter: "firstName"');
11568
+ }
11569
+ if (typeof lastName === 'undefined') {
11570
+ throw new AppwriteException('Missing required parameter: "lastName"');
11571
+ }
11572
+ if (typeof email === 'undefined') {
11573
+ throw new AppwriteException('Missing required parameter: "email"');
11574
+ }
11575
+ if (typeof phone === 'undefined') {
11576
+ throw new AppwriteException('Missing required parameter: "phone"');
11577
+ }
11578
+ if (typeof billingAddressId === 'undefined') {
11579
+ throw new AppwriteException('Missing required parameter: "billingAddressId"');
11580
+ }
11581
+ if (typeof paymentMethodId === 'undefined') {
11582
+ throw new AppwriteException('Missing required parameter: "paymentMethodId"');
11583
+ }
11584
+ const apiPath = '/domains/purchases';
11585
+ const payload = {};
11586
+ if (typeof domain !== 'undefined') {
11587
+ payload['domain'] = domain;
11588
+ }
11589
+ if (typeof organizationId !== 'undefined') {
11590
+ payload['organizationId'] = organizationId;
11591
+ }
11592
+ if (typeof firstName !== 'undefined') {
11593
+ payload['firstName'] = firstName;
11594
+ }
11595
+ if (typeof lastName !== 'undefined') {
11596
+ payload['lastName'] = lastName;
11597
+ }
11598
+ if (typeof email !== 'undefined') {
11599
+ payload['email'] = email;
11600
+ }
11601
+ if (typeof phone !== 'undefined') {
11602
+ payload['phone'] = phone;
11603
+ }
11604
+ if (typeof billingAddressId !== 'undefined') {
11605
+ payload['billingAddressId'] = billingAddressId;
11606
+ }
11607
+ if (typeof addressLine3 !== 'undefined') {
11608
+ payload['addressLine3'] = addressLine3;
11609
+ }
11610
+ if (typeof companyName !== 'undefined') {
11611
+ payload['companyName'] = companyName;
11612
+ }
11613
+ if (typeof periodYears !== 'undefined') {
11614
+ payload['periodYears'] = periodYears;
11615
+ }
11616
+ if (typeof paymentMethodId !== 'undefined') {
11617
+ payload['paymentMethodId'] = paymentMethodId;
11618
+ }
11619
+ const uri = new URL(this.client.config.endpoint + apiPath);
11620
+ const apiHeaders = {
11621
+ 'content-type': 'application/json',
11622
+ };
11623
+ return this.client.call('post', uri, apiHeaders, payload);
11624
+ }
11497
11625
  listSuggestions(paramsOrFirst, ...rest) {
11498
11626
  let params;
11499
11627
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -11542,6 +11670,88 @@
11542
11670
  const apiHeaders = {};
11543
11671
  return this.client.call('get', uri, apiHeaders, payload);
11544
11672
  }
11673
+ createTransferIn(paramsOrFirst, ...rest) {
11674
+ let params;
11675
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11676
+ params = (paramsOrFirst || {});
11677
+ }
11678
+ else {
11679
+ params = {
11680
+ domain: paramsOrFirst,
11681
+ organizationId: rest[0],
11682
+ authCode: rest[1],
11683
+ paymentMethodId: rest[2]
11684
+ };
11685
+ }
11686
+ const domain = params.domain;
11687
+ const organizationId = params.organizationId;
11688
+ const authCode = params.authCode;
11689
+ const paymentMethodId = params.paymentMethodId;
11690
+ if (typeof domain === 'undefined') {
11691
+ throw new AppwriteException('Missing required parameter: "domain"');
11692
+ }
11693
+ if (typeof organizationId === 'undefined') {
11694
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11695
+ }
11696
+ if (typeof authCode === 'undefined') {
11697
+ throw new AppwriteException('Missing required parameter: "authCode"');
11698
+ }
11699
+ if (typeof paymentMethodId === 'undefined') {
11700
+ throw new AppwriteException('Missing required parameter: "paymentMethodId"');
11701
+ }
11702
+ const apiPath = '/domains/transfers/in';
11703
+ const payload = {};
11704
+ if (typeof domain !== 'undefined') {
11705
+ payload['domain'] = domain;
11706
+ }
11707
+ if (typeof organizationId !== 'undefined') {
11708
+ payload['organizationId'] = organizationId;
11709
+ }
11710
+ if (typeof authCode !== 'undefined') {
11711
+ payload['authCode'] = authCode;
11712
+ }
11713
+ if (typeof paymentMethodId !== 'undefined') {
11714
+ payload['paymentMethodId'] = paymentMethodId;
11715
+ }
11716
+ const uri = new URL(this.client.config.endpoint + apiPath);
11717
+ const apiHeaders = {
11718
+ 'content-type': 'application/json',
11719
+ };
11720
+ return this.client.call('post', uri, apiHeaders, payload);
11721
+ }
11722
+ createTransferOut(paramsOrFirst, ...rest) {
11723
+ let params;
11724
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11725
+ params = (paramsOrFirst || {});
11726
+ }
11727
+ else {
11728
+ params = {
11729
+ domainId: paramsOrFirst,
11730
+ organizationId: rest[0]
11731
+ };
11732
+ }
11733
+ const domainId = params.domainId;
11734
+ const organizationId = params.organizationId;
11735
+ if (typeof domainId === 'undefined') {
11736
+ throw new AppwriteException('Missing required parameter: "domainId"');
11737
+ }
11738
+ if (typeof organizationId === 'undefined') {
11739
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11740
+ }
11741
+ const apiPath = '/domains/transfers/out';
11742
+ const payload = {};
11743
+ if (typeof domainId !== 'undefined') {
11744
+ payload['domainId'] = domainId;
11745
+ }
11746
+ if (typeof organizationId !== 'undefined') {
11747
+ payload['organizationId'] = organizationId;
11748
+ }
11749
+ const uri = new URL(this.client.config.endpoint + apiPath);
11750
+ const apiHeaders = {
11751
+ 'content-type': 'application/json',
11752
+ };
11753
+ return this.client.call('post', uri, apiHeaders, payload);
11754
+ }
11545
11755
  get(paramsOrFirst) {
11546
11756
  let params;
11547
11757
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -13096,6 +13306,26 @@
13096
13306
  };
13097
13307
  return this.client.call('patch', uri, apiHeaders, payload);
13098
13308
  }
13309
+ getTransferStatus(paramsOrFirst) {
13310
+ let params;
13311
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13312
+ params = (paramsOrFirst || {});
13313
+ }
13314
+ else {
13315
+ params = {
13316
+ domainId: paramsOrFirst
13317
+ };
13318
+ }
13319
+ const domainId = params.domainId;
13320
+ if (typeof domainId === 'undefined') {
13321
+ throw new AppwriteException('Missing required parameter: "domainId"');
13322
+ }
13323
+ const apiPath = '/domains/{domainId}/transfers/status'.replace('{domainId}', domainId);
13324
+ const payload = {};
13325
+ const uri = new URL(this.client.config.endpoint + apiPath);
13326
+ const apiHeaders = {};
13327
+ return this.client.call('get', uri, apiHeaders, payload);
13328
+ }
13099
13329
  getZone(paramsOrFirst) {
13100
13330
  let params;
13101
13331
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -14371,6 +14601,31 @@
14371
14601
  const apiHeaders = {};
14372
14602
  return this.client.call('get', uri, apiHeaders, payload);
14373
14603
  }
14604
+ getConsolePausing(paramsOrFirst, ...rest) {
14605
+ let params;
14606
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14607
+ params = (paramsOrFirst || {});
14608
+ }
14609
+ else {
14610
+ params = {
14611
+ threshold: paramsOrFirst,
14612
+ inactivityDays: rest[0]
14613
+ };
14614
+ }
14615
+ const threshold = params.threshold;
14616
+ const inactivityDays = params.inactivityDays;
14617
+ const apiPath = '/health/console-pausing';
14618
+ const payload = {};
14619
+ if (typeof threshold !== 'undefined') {
14620
+ payload['threshold'] = threshold;
14621
+ }
14622
+ if (typeof inactivityDays !== 'undefined') {
14623
+ payload['inactivityDays'] = inactivityDays;
14624
+ }
14625
+ const uri = new URL(this.client.config.endpoint + apiPath);
14626
+ const apiHeaders = {};
14627
+ return this.client.call('get', uri, apiHeaders, payload);
14628
+ }
14374
14629
  /**
14375
14630
  * Check the Appwrite database servers are up and connection is successful.
14376
14631
  *
@@ -19600,22 +19855,27 @@
19600
19855
  const apiHeaders = {};
19601
19856
  return this.client.call('get', uri, apiHeaders, payload);
19602
19857
  }
19603
- getScopes(paramsOrFirst) {
19858
+ getScopes(paramsOrFirst, ...rest) {
19604
19859
  let params;
19605
19860
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19606
19861
  params = (paramsOrFirst || {});
19607
19862
  }
19608
19863
  else {
19609
19864
  params = {
19610
- organizationId: paramsOrFirst
19865
+ organizationId: paramsOrFirst,
19866
+ projectId: rest[0]
19611
19867
  };
19612
19868
  }
19613
19869
  const organizationId = params.organizationId;
19870
+ const projectId = params.projectId;
19614
19871
  if (typeof organizationId === 'undefined') {
19615
19872
  throw new AppwriteException('Missing required parameter: "organizationId"');
19616
19873
  }
19617
19874
  const apiPath = '/organizations/{organizationId}/roles'.replace('{organizationId}', organizationId);
19618
19875
  const payload = {};
19876
+ if (typeof projectId !== 'undefined') {
19877
+ payload['projectId'] = projectId;
19878
+ }
19619
19879
  const uri = new URL(this.client.config.endpoint + apiPath);
19620
19880
  const apiHeaders = {};
19621
19881
  return this.client.call('get', uri, apiHeaders, payload);
@@ -20613,6 +20873,28 @@
20613
20873
  };
20614
20874
  return this.client.call('patch', uri, apiHeaders, payload);
20615
20875
  }
20876
+ updateConsoleAccess(paramsOrFirst) {
20877
+ let params;
20878
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20879
+ params = (paramsOrFirst || {});
20880
+ }
20881
+ else {
20882
+ params = {
20883
+ projectId: paramsOrFirst
20884
+ };
20885
+ }
20886
+ const projectId = params.projectId;
20887
+ if (typeof projectId === 'undefined') {
20888
+ throw new AppwriteException('Missing required parameter: "projectId"');
20889
+ }
20890
+ const apiPath = '/projects/{projectId}/console-access'.replace('{projectId}', projectId);
20891
+ const payload = {};
20892
+ const uri = new URL(this.client.config.endpoint + apiPath);
20893
+ const apiHeaders = {
20894
+ 'content-type': 'application/json',
20895
+ };
20896
+ return this.client.call('patch', uri, apiHeaders, payload);
20897
+ }
20616
20898
  listDevKeys(paramsOrFirst, ...rest) {
20617
20899
  let params;
20618
20900
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -21716,6 +21998,36 @@
21716
21998
  };
21717
21999
  return this.client.call('post', uri, apiHeaders, payload);
21718
22000
  }
22001
+ updateStatus(paramsOrFirst, ...rest) {
22002
+ let params;
22003
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22004
+ params = (paramsOrFirst || {});
22005
+ }
22006
+ else {
22007
+ params = {
22008
+ projectId: paramsOrFirst,
22009
+ status: rest[0]
22010
+ };
22011
+ }
22012
+ const projectId = params.projectId;
22013
+ const status = params.status;
22014
+ if (typeof projectId === 'undefined') {
22015
+ throw new AppwriteException('Missing required parameter: "projectId"');
22016
+ }
22017
+ if (typeof status === 'undefined') {
22018
+ throw new AppwriteException('Missing required parameter: "status"');
22019
+ }
22020
+ const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
22021
+ const payload = {};
22022
+ if (typeof status !== 'undefined') {
22023
+ payload['status'] = status;
22024
+ }
22025
+ const uri = new URL(this.client.config.endpoint + apiPath);
22026
+ const apiHeaders = {
22027
+ 'content-type': 'application/json',
22028
+ };
22029
+ return this.client.call('patch', uri, apiHeaders, payload);
22030
+ }
21719
22031
  updateTeam(paramsOrFirst, ...rest) {
21720
22032
  let params;
21721
22033
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -23067,28 +23379,25 @@
23067
23379
  params = {
23068
23380
  siteId: paramsOrFirst,
23069
23381
  code: rest[0],
23070
- activate: rest[1],
23071
- installCommand: rest[2],
23072
- buildCommand: rest[3],
23073
- outputDirectory: rest[4]
23382
+ installCommand: rest[1],
23383
+ buildCommand: rest[2],
23384
+ outputDirectory: rest[3],
23385
+ activate: rest[4]
23074
23386
  };
23075
23387
  onProgress = rest[5];
23076
23388
  }
23077
23389
  const siteId = params.siteId;
23078
23390
  const code = params.code;
23079
- const activate = params.activate;
23080
23391
  const installCommand = params.installCommand;
23081
23392
  const buildCommand = params.buildCommand;
23082
23393
  const outputDirectory = params.outputDirectory;
23394
+ const activate = params.activate;
23083
23395
  if (typeof siteId === 'undefined') {
23084
23396
  throw new AppwriteException('Missing required parameter: "siteId"');
23085
23397
  }
23086
23398
  if (typeof code === 'undefined') {
23087
23399
  throw new AppwriteException('Missing required parameter: "code"');
23088
23400
  }
23089
- if (typeof activate === 'undefined') {
23090
- throw new AppwriteException('Missing required parameter: "activate"');
23091
- }
23092
23401
  const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
23093
23402
  const payload = {};
23094
23403
  if (typeof installCommand !== 'undefined') {
@@ -26919,7 +27228,8 @@
26919
27228
  tableId: rest[0],
26920
27229
  queries: rest[1],
26921
27230
  transactionId: rest[2],
26922
- total: rest[3]
27231
+ total: rest[3],
27232
+ ttl: rest[4]
26923
27233
  };
26924
27234
  }
26925
27235
  const databaseId = params.databaseId;
@@ -26927,6 +27237,7 @@
26927
27237
  const queries = params.queries;
26928
27238
  const transactionId = params.transactionId;
26929
27239
  const total = params.total;
27240
+ const ttl = params.ttl;
26930
27241
  if (typeof databaseId === 'undefined') {
26931
27242
  throw new AppwriteException('Missing required parameter: "databaseId"');
26932
27243
  }
@@ -26944,6 +27255,9 @@
26944
27255
  if (typeof total !== 'undefined') {
26945
27256
  payload['total'] = total;
26946
27257
  }
27258
+ if (typeof ttl !== 'undefined') {
27259
+ payload['ttl'] = ttl;
27260
+ }
26947
27261
  const uri = new URL(this.client.config.endpoint + apiPath);
26948
27262
  const apiHeaders = {};
26949
27263
  return this.client.call('get', uri, apiHeaders, payload);
@@ -30582,8 +30896,14 @@
30582
30896
  };
30583
30897
 
30584
30898
  function normalize(id) {
30585
- const trimmed = id.trim();
30586
- return trimmed === "" ? "*" : trimmed;
30899
+ if (id === undefined || id === null) {
30900
+ throw new Error("Channel ID is required");
30901
+ }
30902
+ const trimmed = String(id).trim();
30903
+ if (trimmed === "") {
30904
+ throw new Error("Channel ID is required");
30905
+ }
30906
+ return trimmed;
30587
30907
  }
30588
30908
  class Channel {
30589
30909
  constructor(segments) {
@@ -30604,8 +30924,7 @@
30604
30924
  // --- DATABASE ROUTE ---
30605
30925
  // Only available on Channel<Database>
30606
30926
  collection(id) {
30607
- // Default: wildcard collection ID
30608
- return this.next("collections", id !== null && id !== void 0 ? id : "*");
30927
+ return this.next("collections", id);
30609
30928
  }
30610
30929
  // Only available on Channel<Collection>
30611
30930
  document(id) {
@@ -30614,8 +30933,7 @@
30614
30933
  }
30615
30934
  // --- TABLESDB ROUTE ---
30616
30935
  table(id) {
30617
- // Default: wildcard table ID
30618
- return this.next("tables", id !== null && id !== void 0 ? id : "*");
30936
+ return this.next("tables", id);
30619
30937
  }
30620
30938
  row(id) {
30621
30939
  // Default: no row ID segment
@@ -30641,25 +30959,25 @@
30641
30959
  return this.resolve("delete");
30642
30960
  }
30643
30961
  // --- ROOT FACTORIES ---
30644
- static database(id = "*") {
30962
+ static database(id) {
30645
30963
  return new Channel(["databases", normalize(id)]);
30646
30964
  }
30647
- static execution(id = "*") {
30965
+ static execution(id) {
30648
30966
  return new Channel(["executions", normalize(id)]);
30649
30967
  }
30650
- static tablesdb(id = "*") {
30968
+ static tablesdb(id) {
30651
30969
  return new Channel(["tablesdb", normalize(id)]);
30652
30970
  }
30653
- static bucket(id = "*") {
30971
+ static bucket(id) {
30654
30972
  return new Channel(["buckets", normalize(id)]);
30655
30973
  }
30656
- static function(id = "*") {
30974
+ static function(id) {
30657
30975
  return new Channel(["functions", normalize(id)]);
30658
30976
  }
30659
- static team(id = "*") {
30977
+ static team(id) {
30660
30978
  return new Channel(["teams", normalize(id)]);
30661
30979
  }
30662
- static membership(id = "*") {
30980
+ static membership(id) {
30663
30981
  return new Channel(["memberships", normalize(id)]);
30664
30982
  }
30665
30983
  static account() {
@@ -32101,20 +32419,72 @@
32101
32419
  SmtpEncryption["Tls"] = "tls";
32102
32420
  })(exports.SmtpEncryption || (exports.SmtpEncryption = {}));
32103
32421
 
32104
- exports.Resources = void 0;
32105
- (function (Resources) {
32106
- Resources["User"] = "user";
32107
- Resources["Database"] = "database";
32108
- Resources["Table"] = "table";
32109
- Resources["Column"] = "column";
32110
- Resources["Index"] = "index";
32111
- Resources["Row"] = "row";
32112
- Resources["Document"] = "document";
32113
- Resources["Attribute"] = "attribute";
32114
- Resources["Collection"] = "collection";
32115
- Resources["Bucket"] = "bucket";
32116
- Resources["File"] = "file";
32117
- })(exports.Resources || (exports.Resources = {}));
32422
+ exports.AppwriteMigrationResource = void 0;
32423
+ (function (AppwriteMigrationResource) {
32424
+ AppwriteMigrationResource["User"] = "user";
32425
+ AppwriteMigrationResource["Team"] = "team";
32426
+ AppwriteMigrationResource["Membership"] = "membership";
32427
+ AppwriteMigrationResource["Database"] = "database";
32428
+ AppwriteMigrationResource["Table"] = "table";
32429
+ AppwriteMigrationResource["Column"] = "column";
32430
+ AppwriteMigrationResource["Index"] = "index";
32431
+ AppwriteMigrationResource["Row"] = "row";
32432
+ AppwriteMigrationResource["Document"] = "document";
32433
+ AppwriteMigrationResource["Attribute"] = "attribute";
32434
+ AppwriteMigrationResource["Collection"] = "collection";
32435
+ AppwriteMigrationResource["Bucket"] = "bucket";
32436
+ AppwriteMigrationResource["File"] = "file";
32437
+ AppwriteMigrationResource["Function"] = "function";
32438
+ AppwriteMigrationResource["Deployment"] = "deployment";
32439
+ AppwriteMigrationResource["Environmentvariable"] = "environment-variable";
32440
+ AppwriteMigrationResource["Site"] = "site";
32441
+ AppwriteMigrationResource["Sitedeployment"] = "site-deployment";
32442
+ AppwriteMigrationResource["Sitevariable"] = "site-variable";
32443
+ })(exports.AppwriteMigrationResource || (exports.AppwriteMigrationResource = {}));
32444
+
32445
+ exports.FirebaseMigrationResource = void 0;
32446
+ (function (FirebaseMigrationResource) {
32447
+ FirebaseMigrationResource["User"] = "user";
32448
+ FirebaseMigrationResource["Database"] = "database";
32449
+ FirebaseMigrationResource["Table"] = "table";
32450
+ FirebaseMigrationResource["Column"] = "column";
32451
+ FirebaseMigrationResource["Row"] = "row";
32452
+ FirebaseMigrationResource["Document"] = "document";
32453
+ FirebaseMigrationResource["Attribute"] = "attribute";
32454
+ FirebaseMigrationResource["Collection"] = "collection";
32455
+ FirebaseMigrationResource["Bucket"] = "bucket";
32456
+ FirebaseMigrationResource["File"] = "file";
32457
+ })(exports.FirebaseMigrationResource || (exports.FirebaseMigrationResource = {}));
32458
+
32459
+ exports.NHostMigrationResource = void 0;
32460
+ (function (NHostMigrationResource) {
32461
+ NHostMigrationResource["User"] = "user";
32462
+ NHostMigrationResource["Database"] = "database";
32463
+ NHostMigrationResource["Table"] = "table";
32464
+ NHostMigrationResource["Column"] = "column";
32465
+ NHostMigrationResource["Index"] = "index";
32466
+ NHostMigrationResource["Row"] = "row";
32467
+ NHostMigrationResource["Document"] = "document";
32468
+ NHostMigrationResource["Attribute"] = "attribute";
32469
+ NHostMigrationResource["Collection"] = "collection";
32470
+ NHostMigrationResource["Bucket"] = "bucket";
32471
+ NHostMigrationResource["File"] = "file";
32472
+ })(exports.NHostMigrationResource || (exports.NHostMigrationResource = {}));
32473
+
32474
+ exports.SupabaseMigrationResource = void 0;
32475
+ (function (SupabaseMigrationResource) {
32476
+ SupabaseMigrationResource["User"] = "user";
32477
+ SupabaseMigrationResource["Database"] = "database";
32478
+ SupabaseMigrationResource["Table"] = "table";
32479
+ SupabaseMigrationResource["Column"] = "column";
32480
+ SupabaseMigrationResource["Index"] = "index";
32481
+ SupabaseMigrationResource["Row"] = "row";
32482
+ SupabaseMigrationResource["Document"] = "document";
32483
+ SupabaseMigrationResource["Attribute"] = "attribute";
32484
+ SupabaseMigrationResource["Collection"] = "collection";
32485
+ SupabaseMigrationResource["Bucket"] = "bucket";
32486
+ SupabaseMigrationResource["File"] = "file";
32487
+ })(exports.SupabaseMigrationResource || (exports.SupabaseMigrationResource = {}));
32118
32488
 
32119
32489
  exports.ProjectUsageRange = void 0;
32120
32490
  (function (ProjectUsageRange) {
@@ -32200,6 +32570,11 @@
32200
32570
  SMTPSecure["Ssl"] = "ssl";
32201
32571
  })(exports.SMTPSecure || (exports.SMTPSecure = {}));
32202
32572
 
32573
+ exports.Status = void 0;
32574
+ (function (Status) {
32575
+ Status["Active"] = "active";
32576
+ })(exports.Status || (exports.Status = {}));
32577
+
32203
32578
  exports.EmailTemplateType = void 0;
32204
32579
  (function (EmailTemplateType) {
32205
32580
  EmailTemplateType["Verification"] = "verification";
@@ -32787,6 +33162,18 @@
32787
33162
  BillingPlanGroup["Scale"] = "scale";
32788
33163
  })(exports.BillingPlanGroup || (exports.BillingPlanGroup = {}));
32789
33164
 
33165
+ exports.DomainTransferStatusStatus = void 0;
33166
+ (function (DomainTransferStatusStatus) {
33167
+ DomainTransferStatusStatus["Transferrable"] = "transferrable";
33168
+ DomainTransferStatusStatus["NotTransferrable"] = "not_transferrable";
33169
+ DomainTransferStatusStatus["PendingOwner"] = "pending_owner";
33170
+ DomainTransferStatusStatus["PendingAdmin"] = "pending_admin";
33171
+ DomainTransferStatusStatus["PendingRegistry"] = "pending_registry";
33172
+ DomainTransferStatusStatus["Completed"] = "completed";
33173
+ DomainTransferStatusStatus["Cancelled"] = "cancelled";
33174
+ DomainTransferStatusStatus["ServiceUnavailable"] = "service_unavailable";
33175
+ })(exports.DomainTransferStatusStatus || (exports.DomainTransferStatusStatus = {}));
33176
+
32790
33177
  exports.Account = Account;
32791
33178
  exports.Activities = Activities;
32792
33179
  exports.AppwriteException = AppwriteException;