@appwrite.io/console 10.0.0 → 11.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.
package/dist/esm/sdk.js CHANGED
@@ -38,6 +38,46 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
38
38
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
39
39
  };
40
40
 
41
+ var _a, _ID_hexTimestamp;
42
+ /**
43
+ * Helper class to generate ID strings for resources.
44
+ */
45
+ class ID {
46
+ /**
47
+ * Uses the provided ID as the ID for the resource.
48
+ *
49
+ * @param {string} id
50
+ * @returns {string}
51
+ */
52
+ static custom(id) {
53
+ return id;
54
+ }
55
+ /**
56
+ * Have Appwrite generate a unique ID for you.
57
+ *
58
+ * @param {number} padding. Default is 7.
59
+ * @returns {string}
60
+ */
61
+ static unique(padding = 7) {
62
+ // Generate a unique ID with padding to have a longer ID
63
+ const baseId = __classPrivateFieldGet(_a, _a, "m", _ID_hexTimestamp).call(_a);
64
+ let randomPadding = '';
65
+ for (let i = 0; i < padding; i++) {
66
+ const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
67
+ randomPadding += randomHexDigit;
68
+ }
69
+ return baseId + randomPadding;
70
+ }
71
+ }
72
+ _a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
73
+ const now = new Date();
74
+ const sec = Math.floor(now.getTime() / 1000);
75
+ const msec = now.getMilliseconds();
76
+ // Convert to hexadecimal
77
+ const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0');
78
+ return hexTimestamp;
79
+ };
80
+
41
81
  const JSONbig$1 = JSONbigModule({ useNativeBigInt: true });
42
82
  /**
43
83
  * Helper class to generate query strings.
@@ -578,8 +618,8 @@ class Client {
578
618
  'x-sdk-name': 'Console',
579
619
  'x-sdk-platform': 'console',
580
620
  'x-sdk-language': 'web',
581
- 'x-sdk-version': '10.0.0',
582
- 'X-Appwrite-Response-Format': '1.9.1',
621
+ 'x-sdk-version': '11.0.0',
622
+ 'X-Appwrite-Response-Format': '1.9.2',
583
623
  };
584
624
  this.realtime = {
585
625
  socket: undefined,
@@ -587,11 +627,8 @@ class Client {
587
627
  heartbeat: undefined,
588
628
  url: '',
589
629
  channels: new Set(),
590
- queries: new Set(),
591
630
  subscriptions: new Map(),
592
- slotToSubscriptionId: new Map(),
593
- subscriptionIdToSlot: new Map(),
594
- subscriptionsCounter: 0,
631
+ pendingSubscribes: new Map(),
595
632
  reconnect: true,
596
633
  reconnectAttempts: 0,
597
634
  lastMessage: undefined,
@@ -625,27 +662,15 @@ class Client {
625
662
  }, 20000);
626
663
  },
627
664
  createSocket: () => {
628
- var _a, _b, _c, _d;
665
+ var _a, _b, _c, _d, _e;
629
666
  if (this.realtime.subscriptions.size < 1) {
630
667
  this.realtime.reconnect = false;
631
668
  (_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.close();
632
669
  return;
633
670
  }
634
671
  const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : '');
635
- let queryParams = 'project=' + encodedProject;
636
- this.realtime.channels.forEach(channel => {
637
- queryParams += '&channels[]=' + encodeURIComponent(channel);
638
- });
639
- // Per-subscription queries: channel[slot][]=query so server can route events by subscription
640
- const selectAllQuery = Query.select(['*']).toString();
641
- this.realtime.subscriptions.forEach((sub, slot) => {
642
- const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
643
- sub.channels.forEach(channel => {
644
- queries.forEach(query => {
645
- queryParams += '&' + encodeURIComponent(channel) + '[' + slot + '][]=' + encodeURIComponent(query);
646
- });
647
- });
648
- });
672
+ // URL carries only the project; channels/queries are sent via subscribe message.
673
+ const queryParams = 'project=' + encodedProject;
649
674
  const url = this.config.endpointRealtime + '/realtime?' + queryParams;
650
675
  if (url !== this.realtime.url || // Check if URL is present
651
676
  !this.realtime.socket || // Check if WebSocket has not been created
@@ -681,6 +706,23 @@ class Client {
681
706
  }, timeout);
682
707
  });
683
708
  }
709
+ else if (((_e = this.realtime.socket) === null || _e === void 0 ? void 0 : _e.readyState) === WebSocket.OPEN) {
710
+ this.realtime.sendPendingSubscribes();
711
+ }
712
+ },
713
+ sendPendingSubscribes: () => {
714
+ if (!this.realtime.socket || this.realtime.socket.readyState !== WebSocket.OPEN) {
715
+ return;
716
+ }
717
+ if (this.realtime.pendingSubscribes.size < 1) {
718
+ return;
719
+ }
720
+ const rows = Array.from(this.realtime.pendingSubscribes.values());
721
+ this.realtime.pendingSubscribes.clear();
722
+ this.realtime.socket.send(JSONbig.stringify({
723
+ type: 'subscribe',
724
+ data: rows
725
+ }));
684
726
  },
685
727
  onMessage: (event) => {
686
728
  var _a, _b;
@@ -690,17 +732,6 @@ class Client {
690
732
  switch (message.type) {
691
733
  case 'connected': {
692
734
  const messageData = message.data;
693
- if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
694
- this.realtime.slotToSubscriptionId.clear();
695
- this.realtime.subscriptionIdToSlot.clear();
696
- for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
697
- const slot = Number(slotStr);
698
- if (!isNaN(slot) && typeof subscriptionId === 'string') {
699
- this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
700
- this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
701
- }
702
- }
703
- }
704
735
  let session = this.config.session;
705
736
  if (!session) {
706
737
  const cookie = JSONbig.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
@@ -714,8 +745,22 @@ class Client {
714
745
  }
715
746
  }));
716
747
  }
748
+ this.realtime.subscriptions.forEach((sub, subscriptionId) => {
749
+ var _a;
750
+ this.realtime.pendingSubscribes.set(subscriptionId, {
751
+ subscriptionId,
752
+ channels: sub.channels,
753
+ queries: (_a = sub.queries) !== null && _a !== void 0 ? _a : []
754
+ });
755
+ });
756
+ this.realtime.sendPendingSubscribes();
717
757
  break;
718
758
  }
759
+ case 'response':
760
+ // The SDK generates subscriptionIds client-side and sends them on every
761
+ // subscribe/unsubscribe, so subscribe/unsubscribe acks carry no state
762
+ // the SDK needs to reconcile.
763
+ break;
719
764
  case 'event': {
720
765
  const data = message.data;
721
766
  if (!(data === null || data === void 0 ? void 0 : data.channels))
@@ -723,12 +768,9 @@ class Client {
723
768
  const eventSubIds = data.subscriptions;
724
769
  if (eventSubIds && eventSubIds.length > 0) {
725
770
  for (const subscriptionId of eventSubIds) {
726
- const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
727
- if (slot !== undefined) {
728
- const subscription = this.realtime.subscriptions.get(slot);
729
- if (subscription) {
730
- setTimeout(() => subscription.callback(data));
731
- }
771
+ const subscription = this.realtime.subscriptions.get(subscriptionId);
772
+ if (subscription) {
773
+ setTimeout(() => subscription.callback(data));
732
774
  }
733
775
  }
734
776
  }
@@ -755,29 +797,6 @@ class Client {
755
797
  catch (e) {
756
798
  console.error(e);
757
799
  }
758
- },
759
- cleanUp: (channels, queries) => {
760
- this.realtime.channels.forEach(channel => {
761
- if (channels.includes(channel)) {
762
- let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
763
- return subscription.channels.includes(channel);
764
- });
765
- if (!found) {
766
- this.realtime.channels.delete(channel);
767
- }
768
- }
769
- });
770
- this.realtime.queries.forEach(query => {
771
- if (queries.includes(query)) {
772
- let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
773
- var _a;
774
- return (_a = subscription.queries) === null || _a === void 0 ? void 0 : _a.includes(query);
775
- });
776
- if (!found) {
777
- this.realtime.queries.delete(query);
778
- }
779
- }
780
- });
781
800
  }
782
801
  };
783
802
  }
@@ -1027,17 +1046,41 @@ class Client {
1027
1046
  });
1028
1047
  channelStrings.forEach(channel => this.realtime.channels.add(channel));
1029
1048
  const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map(q => typeof q === 'string' ? q : q.toString());
1030
- queryStrings.forEach(query => this.realtime.queries.add(query));
1031
- const counter = this.realtime.subscriptionsCounter++;
1032
- this.realtime.subscriptions.set(counter, {
1049
+ let subscriptionId = '';
1050
+ const attempts = this.realtime.subscriptions.size + 1;
1051
+ for (let i = 0; i < attempts; i++) {
1052
+ const candidate = ID.unique();
1053
+ if (!this.realtime.subscriptions.has(candidate)) {
1054
+ subscriptionId = candidate;
1055
+ break;
1056
+ }
1057
+ }
1058
+ if (subscriptionId === '') {
1059
+ throw new AppwriteException('Failed to generate unique subscription id');
1060
+ }
1061
+ this.realtime.subscriptions.set(subscriptionId, {
1033
1062
  channels: channelStrings,
1034
1063
  queries: queryStrings,
1035
1064
  callback
1036
1065
  });
1066
+ this.realtime.pendingSubscribes.set(subscriptionId, {
1067
+ subscriptionId,
1068
+ channels: channelStrings,
1069
+ queries: queryStrings
1070
+ });
1037
1071
  this.realtime.connect();
1038
1072
  return () => {
1039
- this.realtime.subscriptions.delete(counter);
1040
- this.realtime.cleanUp(channelStrings, queryStrings);
1073
+ this.realtime.subscriptions.delete(subscriptionId);
1074
+ this.realtime.pendingSubscribes.delete(subscriptionId);
1075
+ const stillUsed = new Set();
1076
+ this.realtime.subscriptions.forEach(sub => {
1077
+ sub.channels.forEach(channel => stillUsed.add(channel));
1078
+ });
1079
+ this.realtime.channels.forEach(channel => {
1080
+ if (!stillUsed.has(channel)) {
1081
+ this.realtime.channels.delete(channel);
1082
+ }
1083
+ });
1041
1084
  this.realtime.connect();
1042
1085
  };
1043
1086
  }
@@ -18585,29 +18628,41 @@ class Project {
18585
18628
  };
18586
18629
  return this.client.call('delete', uri, apiHeaders, payload);
18587
18630
  }
18588
- updateProtocolStatus(paramsOrFirst, ...rest) {
18631
+ updateMembershipPrivacyPolicy(paramsOrFirst, ...rest) {
18589
18632
  let params;
18590
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('protocolId' in paramsOrFirst || 'enabled' in paramsOrFirst))) {
18633
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18591
18634
  params = (paramsOrFirst || {});
18592
18635
  }
18593
18636
  else {
18594
18637
  params = {
18595
- protocolId: paramsOrFirst,
18596
- enabled: rest[0]
18638
+ userId: paramsOrFirst,
18639
+ userEmail: rest[0],
18640
+ userPhone: rest[1],
18641
+ userName: rest[2],
18642
+ userMFA: rest[3]
18597
18643
  };
18598
18644
  }
18599
- const protocolId = params.protocolId;
18600
- const enabled = params.enabled;
18601
- if (typeof protocolId === 'undefined') {
18602
- throw new AppwriteException('Missing required parameter: "protocolId"');
18645
+ const userId = params.userId;
18646
+ const userEmail = params.userEmail;
18647
+ const userPhone = params.userPhone;
18648
+ const userName = params.userName;
18649
+ const userMFA = params.userMFA;
18650
+ const apiPath = '/project/policies/membership-privacy';
18651
+ const payload = {};
18652
+ if (typeof userId !== 'undefined') {
18653
+ payload['userId'] = userId;
18603
18654
  }
18604
- if (typeof enabled === 'undefined') {
18605
- throw new AppwriteException('Missing required parameter: "enabled"');
18655
+ if (typeof userEmail !== 'undefined') {
18656
+ payload['userEmail'] = userEmail;
18606
18657
  }
18607
- const apiPath = '/project/protocols/{protocolId}/status'.replace('{protocolId}', protocolId);
18608
- const payload = {};
18609
- if (typeof enabled !== 'undefined') {
18610
- payload['enabled'] = enabled;
18658
+ if (typeof userPhone !== 'undefined') {
18659
+ payload['userPhone'] = userPhone;
18660
+ }
18661
+ if (typeof userName !== 'undefined') {
18662
+ payload['userName'] = userName;
18663
+ }
18664
+ if (typeof userMFA !== 'undefined') {
18665
+ payload['userMFA'] = userMFA;
18611
18666
  }
18612
18667
  const uri = new URL(this.client.config.endpoint + apiPath);
18613
18668
  const apiHeaders = {
@@ -18615,26 +18670,21 @@ class Project {
18615
18670
  };
18616
18671
  return this.client.call('patch', uri, apiHeaders, payload);
18617
18672
  }
18618
- updateServiceStatus(paramsOrFirst, ...rest) {
18673
+ updatePasswordDictionaryPolicy(paramsOrFirst) {
18619
18674
  let params;
18620
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('serviceId' in paramsOrFirst || 'enabled' in paramsOrFirst))) {
18675
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18621
18676
  params = (paramsOrFirst || {});
18622
18677
  }
18623
18678
  else {
18624
18679
  params = {
18625
- serviceId: paramsOrFirst,
18626
- enabled: rest[0]
18680
+ enabled: paramsOrFirst
18627
18681
  };
18628
18682
  }
18629
- const serviceId = params.serviceId;
18630
18683
  const enabled = params.enabled;
18631
- if (typeof serviceId === 'undefined') {
18632
- throw new AppwriteException('Missing required parameter: "serviceId"');
18633
- }
18634
18684
  if (typeof enabled === 'undefined') {
18635
18685
  throw new AppwriteException('Missing required parameter: "enabled"');
18636
18686
  }
18637
- const apiPath = '/project/services/{serviceId}/status'.replace('{serviceId}', serviceId);
18687
+ const apiPath = '/project/policies/password-dictionary';
18638
18688
  const payload = {};
18639
18689
  if (typeof enabled !== 'undefined') {
18640
18690
  payload['enabled'] = enabled;
@@ -18645,595 +18695,149 @@ class Project {
18645
18695
  };
18646
18696
  return this.client.call('patch', uri, apiHeaders, payload);
18647
18697
  }
18648
- getUsage(paramsOrFirst, ...rest) {
18698
+ updatePasswordHistoryPolicy(paramsOrFirst) {
18649
18699
  let params;
18650
18700
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18651
18701
  params = (paramsOrFirst || {});
18652
18702
  }
18653
18703
  else {
18654
18704
  params = {
18655
- startDate: paramsOrFirst,
18656
- endDate: rest[0],
18657
- period: rest[1]
18705
+ total: paramsOrFirst
18658
18706
  };
18659
18707
  }
18660
- const startDate = params.startDate;
18661
- const endDate = params.endDate;
18662
- const period = params.period;
18663
- if (typeof startDate === 'undefined') {
18664
- throw new AppwriteException('Missing required parameter: "startDate"');
18665
- }
18666
- if (typeof endDate === 'undefined') {
18667
- throw new AppwriteException('Missing required parameter: "endDate"');
18708
+ const total = params.total;
18709
+ if (typeof total === 'undefined') {
18710
+ throw new AppwriteException('Missing required parameter: "total"');
18668
18711
  }
18669
- const apiPath = '/project/usage';
18712
+ const apiPath = '/project/policies/password-history';
18670
18713
  const payload = {};
18671
- if (typeof startDate !== 'undefined') {
18672
- payload['startDate'] = startDate;
18673
- }
18674
- if (typeof endDate !== 'undefined') {
18675
- payload['endDate'] = endDate;
18676
- }
18677
- if (typeof period !== 'undefined') {
18678
- payload['period'] = period;
18714
+ if (typeof total !== 'undefined') {
18715
+ payload['total'] = total;
18679
18716
  }
18680
18717
  const uri = new URL(this.client.config.endpoint + apiPath);
18681
- const apiHeaders = {};
18682
- return this.client.call('get', uri, apiHeaders, payload);
18718
+ const apiHeaders = {
18719
+ 'content-type': 'application/json',
18720
+ };
18721
+ return this.client.call('patch', uri, apiHeaders, payload);
18683
18722
  }
18684
- listVariables(paramsOrFirst, ...rest) {
18723
+ updatePasswordPersonalDataPolicy(paramsOrFirst) {
18685
18724
  let params;
18686
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18725
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18687
18726
  params = (paramsOrFirst || {});
18688
18727
  }
18689
18728
  else {
18690
18729
  params = {
18691
- queries: paramsOrFirst,
18692
- total: rest[0]
18730
+ enabled: paramsOrFirst
18693
18731
  };
18694
18732
  }
18695
- const queries = params.queries;
18696
- const total = params.total;
18697
- const apiPath = '/project/variables';
18698
- const payload = {};
18699
- if (typeof queries !== 'undefined') {
18700
- payload['queries'] = queries;
18733
+ const enabled = params.enabled;
18734
+ if (typeof enabled === 'undefined') {
18735
+ throw new AppwriteException('Missing required parameter: "enabled"');
18701
18736
  }
18702
- if (typeof total !== 'undefined') {
18703
- payload['total'] = total;
18737
+ const apiPath = '/project/policies/password-personal-data';
18738
+ const payload = {};
18739
+ if (typeof enabled !== 'undefined') {
18740
+ payload['enabled'] = enabled;
18704
18741
  }
18705
18742
  const uri = new URL(this.client.config.endpoint + apiPath);
18706
- const apiHeaders = {};
18707
- return this.client.call('get', uri, apiHeaders, payload);
18743
+ const apiHeaders = {
18744
+ 'content-type': 'application/json',
18745
+ };
18746
+ return this.client.call('patch', uri, apiHeaders, payload);
18708
18747
  }
18709
- createVariable(paramsOrFirst, ...rest) {
18748
+ updateSessionAlertPolicy(paramsOrFirst) {
18710
18749
  let params;
18711
18750
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18712
18751
  params = (paramsOrFirst || {});
18713
18752
  }
18714
18753
  else {
18715
18754
  params = {
18716
- variableId: paramsOrFirst,
18717
- key: rest[0],
18718
- value: rest[1],
18719
- secret: rest[2]
18755
+ enabled: paramsOrFirst
18720
18756
  };
18721
18757
  }
18722
- const variableId = params.variableId;
18723
- const key = params.key;
18724
- const value = params.value;
18725
- const secret = params.secret;
18726
- if (typeof variableId === 'undefined') {
18727
- throw new AppwriteException('Missing required parameter: "variableId"');
18728
- }
18729
- if (typeof key === 'undefined') {
18730
- throw new AppwriteException('Missing required parameter: "key"');
18731
- }
18732
- if (typeof value === 'undefined') {
18733
- throw new AppwriteException('Missing required parameter: "value"');
18758
+ const enabled = params.enabled;
18759
+ if (typeof enabled === 'undefined') {
18760
+ throw new AppwriteException('Missing required parameter: "enabled"');
18734
18761
  }
18735
- const apiPath = '/project/variables';
18762
+ const apiPath = '/project/policies/session-alert';
18736
18763
  const payload = {};
18737
- if (typeof variableId !== 'undefined') {
18738
- payload['variableId'] = variableId;
18739
- }
18740
- if (typeof key !== 'undefined') {
18741
- payload['key'] = key;
18742
- }
18743
- if (typeof value !== 'undefined') {
18744
- payload['value'] = value;
18745
- }
18746
- if (typeof secret !== 'undefined') {
18747
- payload['secret'] = secret;
18764
+ if (typeof enabled !== 'undefined') {
18765
+ payload['enabled'] = enabled;
18748
18766
  }
18749
18767
  const uri = new URL(this.client.config.endpoint + apiPath);
18750
18768
  const apiHeaders = {
18751
18769
  'content-type': 'application/json',
18752
18770
  };
18753
- return this.client.call('post', uri, apiHeaders, payload);
18771
+ return this.client.call('patch', uri, apiHeaders, payload);
18754
18772
  }
18755
- getVariable(paramsOrFirst) {
18773
+ updateSessionDurationPolicy(paramsOrFirst) {
18756
18774
  let params;
18757
18775
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18758
18776
  params = (paramsOrFirst || {});
18759
18777
  }
18760
18778
  else {
18761
18779
  params = {
18762
- variableId: paramsOrFirst
18780
+ duration: paramsOrFirst
18763
18781
  };
18764
18782
  }
18765
- const variableId = params.variableId;
18766
- if (typeof variableId === 'undefined') {
18767
- throw new AppwriteException('Missing required parameter: "variableId"');
18783
+ const duration = params.duration;
18784
+ if (typeof duration === 'undefined') {
18785
+ throw new AppwriteException('Missing required parameter: "duration"');
18768
18786
  }
18769
- const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
18787
+ const apiPath = '/project/policies/session-duration';
18770
18788
  const payload = {};
18789
+ if (typeof duration !== 'undefined') {
18790
+ payload['duration'] = duration;
18791
+ }
18771
18792
  const uri = new URL(this.client.config.endpoint + apiPath);
18772
- const apiHeaders = {};
18773
- return this.client.call('get', uri, apiHeaders, payload);
18793
+ const apiHeaders = {
18794
+ 'content-type': 'application/json',
18795
+ };
18796
+ return this.client.call('patch', uri, apiHeaders, payload);
18774
18797
  }
18775
- updateVariable(paramsOrFirst, ...rest) {
18798
+ updateSessionInvalidationPolicy(paramsOrFirst) {
18776
18799
  let params;
18777
18800
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18778
18801
  params = (paramsOrFirst || {});
18779
18802
  }
18780
18803
  else {
18781
18804
  params = {
18782
- variableId: paramsOrFirst,
18783
- key: rest[0],
18784
- value: rest[1],
18785
- secret: rest[2]
18805
+ enabled: paramsOrFirst
18786
18806
  };
18787
18807
  }
18788
- const variableId = params.variableId;
18789
- const key = params.key;
18790
- const value = params.value;
18791
- const secret = params.secret;
18792
- if (typeof variableId === 'undefined') {
18793
- throw new AppwriteException('Missing required parameter: "variableId"');
18808
+ const enabled = params.enabled;
18809
+ if (typeof enabled === 'undefined') {
18810
+ throw new AppwriteException('Missing required parameter: "enabled"');
18794
18811
  }
18795
- const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
18812
+ const apiPath = '/project/policies/session-invalidation';
18796
18813
  const payload = {};
18797
- if (typeof key !== 'undefined') {
18798
- payload['key'] = key;
18799
- }
18800
- if (typeof value !== 'undefined') {
18801
- payload['value'] = value;
18802
- }
18803
- if (typeof secret !== 'undefined') {
18804
- payload['secret'] = secret;
18814
+ if (typeof enabled !== 'undefined') {
18815
+ payload['enabled'] = enabled;
18805
18816
  }
18806
18817
  const uri = new URL(this.client.config.endpoint + apiPath);
18807
18818
  const apiHeaders = {
18808
18819
  'content-type': 'application/json',
18809
18820
  };
18810
- return this.client.call('put', uri, apiHeaders, payload);
18821
+ return this.client.call('patch', uri, apiHeaders, payload);
18811
18822
  }
18812
- deleteVariable(paramsOrFirst) {
18823
+ updateSessionLimitPolicy(paramsOrFirst) {
18813
18824
  let params;
18814
18825
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18815
18826
  params = (paramsOrFirst || {});
18816
18827
  }
18817
18828
  else {
18818
18829
  params = {
18819
- variableId: paramsOrFirst
18830
+ total: paramsOrFirst
18820
18831
  };
18821
18832
  }
18822
- const variableId = params.variableId;
18823
- if (typeof variableId === 'undefined') {
18824
- throw new AppwriteException('Missing required parameter: "variableId"');
18833
+ const total = params.total;
18834
+ if (typeof total === 'undefined') {
18835
+ throw new AppwriteException('Missing required parameter: "total"');
18825
18836
  }
18826
- const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
18837
+ const apiPath = '/project/policies/session-limit';
18827
18838
  const payload = {};
18828
- const uri = new URL(this.client.config.endpoint + apiPath);
18829
- const apiHeaders = {
18830
- 'content-type': 'application/json',
18831
- };
18832
- return this.client.call('delete', uri, apiHeaders, payload);
18833
- }
18834
- }
18835
-
18836
- class Projects {
18837
- constructor(client) {
18838
- this.client = client;
18839
- }
18840
- list(paramsOrFirst, ...rest) {
18841
- let params;
18842
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18843
- params = (paramsOrFirst || {});
18844
- }
18845
- else {
18846
- params = {
18847
- queries: paramsOrFirst,
18848
- search: rest[0],
18849
- total: rest[1]
18850
- };
18851
- }
18852
- const queries = params.queries;
18853
- const search = params.search;
18854
- const total = params.total;
18855
- const apiPath = '/projects';
18856
- const payload = {};
18857
- if (typeof queries !== 'undefined') {
18858
- payload['queries'] = queries;
18859
- }
18860
- if (typeof search !== 'undefined') {
18861
- payload['search'] = search;
18862
- }
18863
- if (typeof total !== 'undefined') {
18864
- payload['total'] = total;
18865
- }
18866
- const uri = new URL(this.client.config.endpoint + apiPath);
18867
- const apiHeaders = {};
18868
- return this.client.call('get', uri, apiHeaders, payload);
18869
- }
18870
- create(paramsOrFirst, ...rest) {
18871
- let params;
18872
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18873
- params = (paramsOrFirst || {});
18874
- }
18875
- else {
18876
- params = {
18877
- projectId: paramsOrFirst,
18878
- name: rest[0],
18879
- teamId: rest[1],
18880
- region: rest[2],
18881
- description: rest[3],
18882
- logo: rest[4],
18883
- url: rest[5],
18884
- legalName: rest[6],
18885
- legalCountry: rest[7],
18886
- legalState: rest[8],
18887
- legalCity: rest[9],
18888
- legalAddress: rest[10],
18889
- legalTaxId: rest[11]
18890
- };
18891
- }
18892
- const projectId = params.projectId;
18893
- const name = params.name;
18894
- const teamId = params.teamId;
18895
- const region = params.region;
18896
- const description = params.description;
18897
- const logo = params.logo;
18898
- const url = params.url;
18899
- const legalName = params.legalName;
18900
- const legalCountry = params.legalCountry;
18901
- const legalState = params.legalState;
18902
- const legalCity = params.legalCity;
18903
- const legalAddress = params.legalAddress;
18904
- const legalTaxId = params.legalTaxId;
18905
- if (typeof projectId === 'undefined') {
18906
- throw new AppwriteException('Missing required parameter: "projectId"');
18907
- }
18908
- if (typeof name === 'undefined') {
18909
- throw new AppwriteException('Missing required parameter: "name"');
18910
- }
18911
- if (typeof teamId === 'undefined') {
18912
- throw new AppwriteException('Missing required parameter: "teamId"');
18913
- }
18914
- const apiPath = '/projects';
18915
- const payload = {};
18916
- if (typeof projectId !== 'undefined') {
18917
- payload['projectId'] = projectId;
18918
- }
18919
- if (typeof name !== 'undefined') {
18920
- payload['name'] = name;
18921
- }
18922
- if (typeof teamId !== 'undefined') {
18923
- payload['teamId'] = teamId;
18924
- }
18925
- if (typeof region !== 'undefined') {
18926
- payload['region'] = region;
18927
- }
18928
- if (typeof description !== 'undefined') {
18929
- payload['description'] = description;
18930
- }
18931
- if (typeof logo !== 'undefined') {
18932
- payload['logo'] = logo;
18933
- }
18934
- if (typeof url !== 'undefined') {
18935
- payload['url'] = url;
18936
- }
18937
- if (typeof legalName !== 'undefined') {
18938
- payload['legalName'] = legalName;
18939
- }
18940
- if (typeof legalCountry !== 'undefined') {
18941
- payload['legalCountry'] = legalCountry;
18942
- }
18943
- if (typeof legalState !== 'undefined') {
18944
- payload['legalState'] = legalState;
18945
- }
18946
- if (typeof legalCity !== 'undefined') {
18947
- payload['legalCity'] = legalCity;
18948
- }
18949
- if (typeof legalAddress !== 'undefined') {
18950
- payload['legalAddress'] = legalAddress;
18951
- }
18952
- if (typeof legalTaxId !== 'undefined') {
18953
- payload['legalTaxId'] = legalTaxId;
18954
- }
18955
- const uri = new URL(this.client.config.endpoint + apiPath);
18956
- const apiHeaders = {
18957
- 'content-type': 'application/json',
18958
- };
18959
- return this.client.call('post', uri, apiHeaders, payload);
18960
- }
18961
- get(paramsOrFirst) {
18962
- let params;
18963
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18964
- params = (paramsOrFirst || {});
18965
- }
18966
- else {
18967
- params = {
18968
- projectId: paramsOrFirst
18969
- };
18970
- }
18971
- const projectId = params.projectId;
18972
- if (typeof projectId === 'undefined') {
18973
- throw new AppwriteException('Missing required parameter: "projectId"');
18974
- }
18975
- const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
18976
- const payload = {};
18977
- const uri = new URL(this.client.config.endpoint + apiPath);
18978
- const apiHeaders = {};
18979
- return this.client.call('get', uri, apiHeaders, payload);
18980
- }
18981
- update(paramsOrFirst, ...rest) {
18982
- let params;
18983
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18984
- params = (paramsOrFirst || {});
18985
- }
18986
- else {
18987
- params = {
18988
- projectId: paramsOrFirst,
18989
- name: rest[0],
18990
- description: rest[1],
18991
- logo: rest[2],
18992
- url: rest[3],
18993
- legalName: rest[4],
18994
- legalCountry: rest[5],
18995
- legalState: rest[6],
18996
- legalCity: rest[7],
18997
- legalAddress: rest[8],
18998
- legalTaxId: rest[9]
18999
- };
19000
- }
19001
- const projectId = params.projectId;
19002
- const name = params.name;
19003
- const description = params.description;
19004
- const logo = params.logo;
19005
- const url = params.url;
19006
- const legalName = params.legalName;
19007
- const legalCountry = params.legalCountry;
19008
- const legalState = params.legalState;
19009
- const legalCity = params.legalCity;
19010
- const legalAddress = params.legalAddress;
19011
- const legalTaxId = params.legalTaxId;
19012
- if (typeof projectId === 'undefined') {
19013
- throw new AppwriteException('Missing required parameter: "projectId"');
19014
- }
19015
- if (typeof name === 'undefined') {
19016
- throw new AppwriteException('Missing required parameter: "name"');
19017
- }
19018
- const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
19019
- const payload = {};
19020
- if (typeof name !== 'undefined') {
19021
- payload['name'] = name;
19022
- }
19023
- if (typeof description !== 'undefined') {
19024
- payload['description'] = description;
19025
- }
19026
- if (typeof logo !== 'undefined') {
19027
- payload['logo'] = logo;
19028
- }
19029
- if (typeof url !== 'undefined') {
19030
- payload['url'] = url;
19031
- }
19032
- if (typeof legalName !== 'undefined') {
19033
- payload['legalName'] = legalName;
19034
- }
19035
- if (typeof legalCountry !== 'undefined') {
19036
- payload['legalCountry'] = legalCountry;
19037
- }
19038
- if (typeof legalState !== 'undefined') {
19039
- payload['legalState'] = legalState;
19040
- }
19041
- if (typeof legalCity !== 'undefined') {
19042
- payload['legalCity'] = legalCity;
19043
- }
19044
- if (typeof legalAddress !== 'undefined') {
19045
- payload['legalAddress'] = legalAddress;
19046
- }
19047
- if (typeof legalTaxId !== 'undefined') {
19048
- payload['legalTaxId'] = legalTaxId;
19049
- }
19050
- const uri = new URL(this.client.config.endpoint + apiPath);
19051
- const apiHeaders = {
19052
- 'content-type': 'application/json',
19053
- };
19054
- return this.client.call('patch', uri, apiHeaders, payload);
19055
- }
19056
- delete(paramsOrFirst) {
19057
- let params;
19058
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19059
- params = (paramsOrFirst || {});
19060
- }
19061
- else {
19062
- params = {
19063
- projectId: paramsOrFirst
19064
- };
19065
- }
19066
- const projectId = params.projectId;
19067
- if (typeof projectId === 'undefined') {
19068
- throw new AppwriteException('Missing required parameter: "projectId"');
19069
- }
19070
- const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
19071
- const payload = {};
19072
- const uri = new URL(this.client.config.endpoint + apiPath);
19073
- const apiHeaders = {
19074
- 'content-type': 'application/json',
19075
- };
19076
- return this.client.call('delete', uri, apiHeaders, payload);
19077
- }
19078
- updateAuthDuration(paramsOrFirst, ...rest) {
19079
- let params;
19080
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19081
- params = (paramsOrFirst || {});
19082
- }
19083
- else {
19084
- params = {
19085
- projectId: paramsOrFirst,
19086
- duration: rest[0]
19087
- };
19088
- }
19089
- const projectId = params.projectId;
19090
- const duration = params.duration;
19091
- if (typeof projectId === 'undefined') {
19092
- throw new AppwriteException('Missing required parameter: "projectId"');
19093
- }
19094
- if (typeof duration === 'undefined') {
19095
- throw new AppwriteException('Missing required parameter: "duration"');
19096
- }
19097
- const apiPath = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);
19098
- const payload = {};
19099
- if (typeof duration !== 'undefined') {
19100
- payload['duration'] = duration;
19101
- }
19102
- const uri = new URL(this.client.config.endpoint + apiPath);
19103
- const apiHeaders = {
19104
- 'content-type': 'application/json',
19105
- };
19106
- return this.client.call('patch', uri, apiHeaders, payload);
19107
- }
19108
- updateAuthLimit(paramsOrFirst, ...rest) {
19109
- let params;
19110
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19111
- params = (paramsOrFirst || {});
19112
- }
19113
- else {
19114
- params = {
19115
- projectId: paramsOrFirst,
19116
- limit: rest[0]
19117
- };
19118
- }
19119
- const projectId = params.projectId;
19120
- const limit = params.limit;
19121
- if (typeof projectId === 'undefined') {
19122
- throw new AppwriteException('Missing required parameter: "projectId"');
19123
- }
19124
- if (typeof limit === 'undefined') {
19125
- throw new AppwriteException('Missing required parameter: "limit"');
19126
- }
19127
- const apiPath = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);
19128
- const payload = {};
19129
- if (typeof limit !== 'undefined') {
19130
- payload['limit'] = limit;
19131
- }
19132
- const uri = new URL(this.client.config.endpoint + apiPath);
19133
- const apiHeaders = {
19134
- 'content-type': 'application/json',
19135
- };
19136
- return this.client.call('patch', uri, apiHeaders, payload);
19137
- }
19138
- updateAuthSessionsLimit(paramsOrFirst, ...rest) {
19139
- let params;
19140
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19141
- params = (paramsOrFirst || {});
19142
- }
19143
- else {
19144
- params = {
19145
- projectId: paramsOrFirst,
19146
- limit: rest[0]
19147
- };
19148
- }
19149
- const projectId = params.projectId;
19150
- const limit = params.limit;
19151
- if (typeof projectId === 'undefined') {
19152
- throw new AppwriteException('Missing required parameter: "projectId"');
19153
- }
19154
- if (typeof limit === 'undefined') {
19155
- throw new AppwriteException('Missing required parameter: "limit"');
19156
- }
19157
- const apiPath = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);
19158
- const payload = {};
19159
- if (typeof limit !== 'undefined') {
19160
- payload['limit'] = limit;
19161
- }
19162
- const uri = new URL(this.client.config.endpoint + apiPath);
19163
- const apiHeaders = {
19164
- 'content-type': 'application/json',
19165
- };
19166
- return this.client.call('patch', uri, apiHeaders, payload);
19167
- }
19168
- updateMembershipsPrivacy(paramsOrFirst, ...rest) {
19169
- let params;
19170
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19171
- params = (paramsOrFirst || {});
19172
- }
19173
- else {
19174
- params = {
19175
- projectId: paramsOrFirst,
19176
- userName: rest[0],
19177
- userEmail: rest[1],
19178
- mfa: rest[2]
19179
- };
19180
- }
19181
- const projectId = params.projectId;
19182
- const userName = params.userName;
19183
- const userEmail = params.userEmail;
19184
- const mfa = params.mfa;
19185
- if (typeof projectId === 'undefined') {
19186
- throw new AppwriteException('Missing required parameter: "projectId"');
19187
- }
19188
- if (typeof userName === 'undefined') {
19189
- throw new AppwriteException('Missing required parameter: "userName"');
19190
- }
19191
- if (typeof userEmail === 'undefined') {
19192
- throw new AppwriteException('Missing required parameter: "userEmail"');
19193
- }
19194
- if (typeof mfa === 'undefined') {
19195
- throw new AppwriteException('Missing required parameter: "mfa"');
19196
- }
19197
- const apiPath = '/projects/{projectId}/auth/memberships-privacy'.replace('{projectId}', projectId);
19198
- const payload = {};
19199
- if (typeof userName !== 'undefined') {
19200
- payload['userName'] = userName;
19201
- }
19202
- if (typeof userEmail !== 'undefined') {
19203
- payload['userEmail'] = userEmail;
19204
- }
19205
- if (typeof mfa !== 'undefined') {
19206
- payload['mfa'] = mfa;
19207
- }
19208
- const uri = new URL(this.client.config.endpoint + apiPath);
19209
- const apiHeaders = {
19210
- 'content-type': 'application/json',
19211
- };
19212
- return this.client.call('patch', uri, apiHeaders, payload);
19213
- }
19214
- updateMockNumbers(paramsOrFirst, ...rest) {
19215
- let params;
19216
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19217
- params = (paramsOrFirst || {});
19218
- }
19219
- else {
19220
- params = {
19221
- projectId: paramsOrFirst,
19222
- numbers: rest[0]
19223
- };
19224
- }
19225
- const projectId = params.projectId;
19226
- const numbers = params.numbers;
19227
- if (typeof projectId === 'undefined') {
19228
- throw new AppwriteException('Missing required parameter: "projectId"');
19229
- }
19230
- if (typeof numbers === 'undefined') {
19231
- throw new AppwriteException('Missing required parameter: "numbers"');
19232
- }
19233
- const apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId);
19234
- const payload = {};
19235
- if (typeof numbers !== 'undefined') {
19236
- payload['numbers'] = numbers;
18839
+ if (typeof total !== 'undefined') {
18840
+ payload['total'] = total;
19237
18841
  }
19238
18842
  const uri = new URL(this.client.config.endpoint + apiPath);
19239
18843
  const apiHeaders = {
@@ -19241,29 +18845,24 @@ class Projects {
19241
18845
  };
19242
18846
  return this.client.call('patch', uri, apiHeaders, payload);
19243
18847
  }
19244
- updateAuthPasswordDictionary(paramsOrFirst, ...rest) {
18848
+ updateUserLimitPolicy(paramsOrFirst) {
19245
18849
  let params;
19246
18850
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19247
18851
  params = (paramsOrFirst || {});
19248
18852
  }
19249
18853
  else {
19250
18854
  params = {
19251
- projectId: paramsOrFirst,
19252
- enabled: rest[0]
18855
+ total: paramsOrFirst
19253
18856
  };
19254
18857
  }
19255
- const projectId = params.projectId;
19256
- const enabled = params.enabled;
19257
- if (typeof projectId === 'undefined') {
19258
- throw new AppwriteException('Missing required parameter: "projectId"');
19259
- }
19260
- if (typeof enabled === 'undefined') {
19261
- throw new AppwriteException('Missing required parameter: "enabled"');
18858
+ const total = params.total;
18859
+ if (typeof total === 'undefined') {
18860
+ throw new AppwriteException('Missing required parameter: "total"');
19262
18861
  }
19263
- const apiPath = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);
18862
+ const apiPath = '/project/policies/user-limit';
19264
18863
  const payload = {};
19265
- if (typeof enabled !== 'undefined') {
19266
- payload['enabled'] = enabled;
18864
+ if (typeof total !== 'undefined') {
18865
+ payload['total'] = total;
19267
18866
  }
19268
18867
  const uri = new URL(this.client.config.endpoint + apiPath);
19269
18868
  const apiHeaders = {
@@ -19271,29 +18870,29 @@ class Projects {
19271
18870
  };
19272
18871
  return this.client.call('patch', uri, apiHeaders, payload);
19273
18872
  }
19274
- updateAuthPasswordHistory(paramsOrFirst, ...rest) {
18873
+ updateProtocol(paramsOrFirst, ...rest) {
19275
18874
  let params;
19276
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18875
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('protocolId' in paramsOrFirst || 'enabled' in paramsOrFirst))) {
19277
18876
  params = (paramsOrFirst || {});
19278
18877
  }
19279
18878
  else {
19280
18879
  params = {
19281
- projectId: paramsOrFirst,
19282
- limit: rest[0]
18880
+ protocolId: paramsOrFirst,
18881
+ enabled: rest[0]
19283
18882
  };
19284
18883
  }
19285
- const projectId = params.projectId;
19286
- const limit = params.limit;
19287
- if (typeof projectId === 'undefined') {
19288
- throw new AppwriteException('Missing required parameter: "projectId"');
18884
+ const protocolId = params.protocolId;
18885
+ const enabled = params.enabled;
18886
+ if (typeof protocolId === 'undefined') {
18887
+ throw new AppwriteException('Missing required parameter: "protocolId"');
19289
18888
  }
19290
- if (typeof limit === 'undefined') {
19291
- throw new AppwriteException('Missing required parameter: "limit"');
18889
+ if (typeof enabled === 'undefined') {
18890
+ throw new AppwriteException('Missing required parameter: "enabled"');
19292
18891
  }
19293
- const apiPath = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);
18892
+ const apiPath = '/project/protocols/{protocolId}'.replace('{protocolId}', protocolId);
19294
18893
  const payload = {};
19295
- if (typeof limit !== 'undefined') {
19296
- payload['limit'] = limit;
18894
+ if (typeof enabled !== 'undefined') {
18895
+ payload['enabled'] = enabled;
19297
18896
  }
19298
18897
  const uri = new URL(this.client.config.endpoint + apiPath);
19299
18898
  const apiHeaders = {
@@ -19301,26 +18900,26 @@ class Projects {
19301
18900
  };
19302
18901
  return this.client.call('patch', uri, apiHeaders, payload);
19303
18902
  }
19304
- updatePersonalDataCheck(paramsOrFirst, ...rest) {
18903
+ updateService(paramsOrFirst, ...rest) {
19305
18904
  let params;
19306
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18905
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('serviceId' in paramsOrFirst || 'enabled' in paramsOrFirst))) {
19307
18906
  params = (paramsOrFirst || {});
19308
18907
  }
19309
18908
  else {
19310
18909
  params = {
19311
- projectId: paramsOrFirst,
18910
+ serviceId: paramsOrFirst,
19312
18911
  enabled: rest[0]
19313
18912
  };
19314
18913
  }
19315
- const projectId = params.projectId;
18914
+ const serviceId = params.serviceId;
19316
18915
  const enabled = params.enabled;
19317
- if (typeof projectId === 'undefined') {
19318
- throw new AppwriteException('Missing required parameter: "projectId"');
18916
+ if (typeof serviceId === 'undefined') {
18917
+ throw new AppwriteException('Missing required parameter: "serviceId"');
19319
18918
  }
19320
18919
  if (typeof enabled === 'undefined') {
19321
18920
  throw new AppwriteException('Missing required parameter: "enabled"');
19322
18921
  }
19323
- const apiPath = '/projects/{projectId}/auth/personal-data'.replace('{projectId}', projectId);
18922
+ const apiPath = '/project/services/{serviceId}'.replace('{serviceId}', serviceId);
19324
18923
  const payload = {};
19325
18924
  if (typeof enabled !== 'undefined') {
19326
18925
  payload['enabled'] = enabled;
@@ -19331,57 +18930,64 @@ class Projects {
19331
18930
  };
19332
18931
  return this.client.call('patch', uri, apiHeaders, payload);
19333
18932
  }
19334
- updateSessionAlerts(paramsOrFirst, ...rest) {
18933
+ updateSMTP(paramsOrFirst, ...rest) {
19335
18934
  let params;
19336
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18935
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19337
18936
  params = (paramsOrFirst || {});
19338
18937
  }
19339
18938
  else {
19340
18939
  params = {
19341
- projectId: paramsOrFirst,
19342
- alerts: rest[0]
18940
+ host: paramsOrFirst,
18941
+ port: rest[0],
18942
+ username: rest[1],
18943
+ password: rest[2],
18944
+ senderEmail: rest[3],
18945
+ senderName: rest[4],
18946
+ replyToEmail: rest[5],
18947
+ replyToName: rest[6],
18948
+ secure: rest[7],
18949
+ enabled: rest[8]
19343
18950
  };
19344
18951
  }
19345
- const projectId = params.projectId;
19346
- const alerts = params.alerts;
19347
- if (typeof projectId === 'undefined') {
19348
- throw new AppwriteException('Missing required parameter: "projectId"');
18952
+ const host = params.host;
18953
+ const port = params.port;
18954
+ const username = params.username;
18955
+ const password = params.password;
18956
+ const senderEmail = params.senderEmail;
18957
+ const senderName = params.senderName;
18958
+ const replyToEmail = params.replyToEmail;
18959
+ const replyToName = params.replyToName;
18960
+ const secure = params.secure;
18961
+ const enabled = params.enabled;
18962
+ const apiPath = '/project/smtp';
18963
+ const payload = {};
18964
+ if (typeof host !== 'undefined') {
18965
+ payload['host'] = host;
19349
18966
  }
19350
- if (typeof alerts === 'undefined') {
19351
- throw new AppwriteException('Missing required parameter: "alerts"');
18967
+ if (typeof port !== 'undefined') {
18968
+ payload['port'] = port;
19352
18969
  }
19353
- const apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId);
19354
- const payload = {};
19355
- if (typeof alerts !== 'undefined') {
19356
- payload['alerts'] = alerts;
18970
+ if (typeof username !== 'undefined') {
18971
+ payload['username'] = username;
19357
18972
  }
19358
- const uri = new URL(this.client.config.endpoint + apiPath);
19359
- const apiHeaders = {
19360
- 'content-type': 'application/json',
19361
- };
19362
- return this.client.call('patch', uri, apiHeaders, payload);
19363
- }
19364
- updateSessionInvalidation(paramsOrFirst, ...rest) {
19365
- let params;
19366
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19367
- params = (paramsOrFirst || {});
18973
+ if (typeof password !== 'undefined') {
18974
+ payload['password'] = password;
19368
18975
  }
19369
- else {
19370
- params = {
19371
- projectId: paramsOrFirst,
19372
- enabled: rest[0]
19373
- };
18976
+ if (typeof senderEmail !== 'undefined') {
18977
+ payload['senderEmail'] = senderEmail;
19374
18978
  }
19375
- const projectId = params.projectId;
19376
- const enabled = params.enabled;
19377
- if (typeof projectId === 'undefined') {
19378
- throw new AppwriteException('Missing required parameter: "projectId"');
18979
+ if (typeof senderName !== 'undefined') {
18980
+ payload['senderName'] = senderName;
19379
18981
  }
19380
- if (typeof enabled === 'undefined') {
19381
- throw new AppwriteException('Missing required parameter: "enabled"');
18982
+ if (typeof replyToEmail !== 'undefined') {
18983
+ payload['replyToEmail'] = replyToEmail;
18984
+ }
18985
+ if (typeof replyToName !== 'undefined') {
18986
+ payload['replyToName'] = replyToName;
18987
+ }
18988
+ if (typeof secure !== 'undefined') {
18989
+ payload['secure'] = secure;
19382
18990
  }
19383
- const apiPath = '/projects/{projectId}/auth/session-invalidation'.replace('{projectId}', projectId);
19384
- const payload = {};
19385
18991
  if (typeof enabled !== 'undefined') {
19386
18992
  payload['enabled'] = enabled;
19387
18993
  }
@@ -19391,324 +18997,331 @@ class Projects {
19391
18997
  };
19392
18998
  return this.client.call('patch', uri, apiHeaders, payload);
19393
18999
  }
19394
- updateAuthStatus(paramsOrFirst, ...rest) {
19000
+ createSMTPTest(paramsOrFirst) {
19395
19001
  let params;
19396
19002
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19397
19003
  params = (paramsOrFirst || {});
19398
19004
  }
19399
19005
  else {
19400
19006
  params = {
19401
- projectId: paramsOrFirst,
19402
- method: rest[0],
19403
- status: rest[1]
19007
+ emails: paramsOrFirst
19404
19008
  };
19405
19009
  }
19406
- const projectId = params.projectId;
19407
- const method = params.method;
19408
- const status = params.status;
19409
- if (typeof projectId === 'undefined') {
19410
- throw new AppwriteException('Missing required parameter: "projectId"');
19411
- }
19412
- if (typeof method === 'undefined') {
19413
- throw new AppwriteException('Missing required parameter: "method"');
19414
- }
19415
- if (typeof status === 'undefined') {
19416
- throw new AppwriteException('Missing required parameter: "status"');
19010
+ const emails = params.emails;
19011
+ if (typeof emails === 'undefined') {
19012
+ throw new AppwriteException('Missing required parameter: "emails"');
19417
19013
  }
19418
- const apiPath = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);
19014
+ const apiPath = '/project/smtp/tests';
19419
19015
  const payload = {};
19420
- if (typeof status !== 'undefined') {
19421
- payload['status'] = status;
19016
+ if (typeof emails !== 'undefined') {
19017
+ payload['emails'] = emails;
19422
19018
  }
19423
19019
  const uri = new URL(this.client.config.endpoint + apiPath);
19424
19020
  const apiHeaders = {
19425
19021
  'content-type': 'application/json',
19426
19022
  };
19427
- return this.client.call('patch', uri, apiHeaders, payload);
19023
+ return this.client.call('post', uri, apiHeaders, payload);
19428
19024
  }
19429
- updateConsoleAccess(paramsOrFirst) {
19025
+ updateEmailTemplate(paramsOrFirst, ...rest) {
19430
19026
  let params;
19431
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19027
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('templateId' in paramsOrFirst || 'locale' in paramsOrFirst || 'subject' in paramsOrFirst || 'message' in paramsOrFirst || 'senderName' in paramsOrFirst || 'senderEmail' in paramsOrFirst || 'replyToEmail' in paramsOrFirst || 'replyToName' in paramsOrFirst))) {
19432
19028
  params = (paramsOrFirst || {});
19433
19029
  }
19434
19030
  else {
19435
19031
  params = {
19436
- projectId: paramsOrFirst
19032
+ templateId: paramsOrFirst,
19033
+ locale: rest[0],
19034
+ subject: rest[1],
19035
+ message: rest[2],
19036
+ senderName: rest[3],
19037
+ senderEmail: rest[4],
19038
+ replyToEmail: rest[5],
19039
+ replyToName: rest[6]
19437
19040
  };
19438
19041
  }
19439
- const projectId = params.projectId;
19440
- if (typeof projectId === 'undefined') {
19441
- throw new AppwriteException('Missing required parameter: "projectId"');
19042
+ const templateId = params.templateId;
19043
+ const locale = params.locale;
19044
+ const subject = params.subject;
19045
+ const message = params.message;
19046
+ const senderName = params.senderName;
19047
+ const senderEmail = params.senderEmail;
19048
+ const replyToEmail = params.replyToEmail;
19049
+ const replyToName = params.replyToName;
19050
+ if (typeof templateId === 'undefined') {
19051
+ throw new AppwriteException('Missing required parameter: "templateId"');
19442
19052
  }
19443
- const apiPath = '/projects/{projectId}/console-access'.replace('{projectId}', projectId);
19053
+ const apiPath = '/project/templates/email';
19444
19054
  const payload = {};
19055
+ if (typeof templateId !== 'undefined') {
19056
+ payload['templateId'] = templateId;
19057
+ }
19058
+ if (typeof locale !== 'undefined') {
19059
+ payload['locale'] = locale;
19060
+ }
19061
+ if (typeof subject !== 'undefined') {
19062
+ payload['subject'] = subject;
19063
+ }
19064
+ if (typeof message !== 'undefined') {
19065
+ payload['message'] = message;
19066
+ }
19067
+ if (typeof senderName !== 'undefined') {
19068
+ payload['senderName'] = senderName;
19069
+ }
19070
+ if (typeof senderEmail !== 'undefined') {
19071
+ payload['senderEmail'] = senderEmail;
19072
+ }
19073
+ if (typeof replyToEmail !== 'undefined') {
19074
+ payload['replyToEmail'] = replyToEmail;
19075
+ }
19076
+ if (typeof replyToName !== 'undefined') {
19077
+ payload['replyToName'] = replyToName;
19078
+ }
19445
19079
  const uri = new URL(this.client.config.endpoint + apiPath);
19446
19080
  const apiHeaders = {
19447
19081
  'content-type': 'application/json',
19448
19082
  };
19449
19083
  return this.client.call('patch', uri, apiHeaders, payload);
19450
19084
  }
19451
- listDevKeys(paramsOrFirst, ...rest) {
19085
+ getEmailTemplate(paramsOrFirst, ...rest) {
19452
19086
  let params;
19453
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19087
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('templateId' in paramsOrFirst || 'locale' in paramsOrFirst))) {
19454
19088
  params = (paramsOrFirst || {});
19455
19089
  }
19456
19090
  else {
19457
19091
  params = {
19458
- projectId: paramsOrFirst,
19459
- queries: rest[0]
19092
+ templateId: paramsOrFirst,
19093
+ locale: rest[0]
19460
19094
  };
19461
19095
  }
19462
- const projectId = params.projectId;
19463
- const queries = params.queries;
19464
- if (typeof projectId === 'undefined') {
19465
- throw new AppwriteException('Missing required parameter: "projectId"');
19096
+ const templateId = params.templateId;
19097
+ const locale = params.locale;
19098
+ if (typeof templateId === 'undefined') {
19099
+ throw new AppwriteException('Missing required parameter: "templateId"');
19466
19100
  }
19467
- const apiPath = '/projects/{projectId}/dev-keys'.replace('{projectId}', projectId);
19101
+ const apiPath = '/project/templates/email/{templateId}'.replace('{templateId}', templateId);
19468
19102
  const payload = {};
19469
- if (typeof queries !== 'undefined') {
19470
- payload['queries'] = queries;
19103
+ if (typeof locale !== 'undefined') {
19104
+ payload['locale'] = locale;
19471
19105
  }
19472
19106
  const uri = new URL(this.client.config.endpoint + apiPath);
19473
19107
  const apiHeaders = {};
19474
19108
  return this.client.call('get', uri, apiHeaders, payload);
19475
19109
  }
19476
- createDevKey(paramsOrFirst, ...rest) {
19110
+ getUsage(paramsOrFirst, ...rest) {
19477
19111
  let params;
19478
19112
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19479
19113
  params = (paramsOrFirst || {});
19480
19114
  }
19481
19115
  else {
19482
19116
  params = {
19483
- projectId: paramsOrFirst,
19484
- name: rest[0],
19485
- expire: rest[1]
19117
+ startDate: paramsOrFirst,
19118
+ endDate: rest[0],
19119
+ period: rest[1]
19486
19120
  };
19487
19121
  }
19488
- const projectId = params.projectId;
19489
- const name = params.name;
19490
- const expire = params.expire;
19491
- if (typeof projectId === 'undefined') {
19492
- throw new AppwriteException('Missing required parameter: "projectId"');
19493
- }
19494
- if (typeof name === 'undefined') {
19495
- throw new AppwriteException('Missing required parameter: "name"');
19122
+ const startDate = params.startDate;
19123
+ const endDate = params.endDate;
19124
+ const period = params.period;
19125
+ if (typeof startDate === 'undefined') {
19126
+ throw new AppwriteException('Missing required parameter: "startDate"');
19496
19127
  }
19497
- if (typeof expire === 'undefined') {
19498
- throw new AppwriteException('Missing required parameter: "expire"');
19128
+ if (typeof endDate === 'undefined') {
19129
+ throw new AppwriteException('Missing required parameter: "endDate"');
19499
19130
  }
19500
- const apiPath = '/projects/{projectId}/dev-keys'.replace('{projectId}', projectId);
19131
+ const apiPath = '/project/usage';
19501
19132
  const payload = {};
19502
- if (typeof name !== 'undefined') {
19503
- payload['name'] = name;
19133
+ if (typeof startDate !== 'undefined') {
19134
+ payload['startDate'] = startDate;
19504
19135
  }
19505
- if (typeof expire !== 'undefined') {
19506
- payload['expire'] = expire;
19136
+ if (typeof endDate !== 'undefined') {
19137
+ payload['endDate'] = endDate;
19138
+ }
19139
+ if (typeof period !== 'undefined') {
19140
+ payload['period'] = period;
19507
19141
  }
19508
19142
  const uri = new URL(this.client.config.endpoint + apiPath);
19509
- const apiHeaders = {
19510
- 'content-type': 'application/json',
19511
- };
19512
- return this.client.call('post', uri, apiHeaders, payload);
19143
+ const apiHeaders = {};
19144
+ return this.client.call('get', uri, apiHeaders, payload);
19513
19145
  }
19514
- getDevKey(paramsOrFirst, ...rest) {
19146
+ listVariables(paramsOrFirst, ...rest) {
19515
19147
  let params;
19516
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19148
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19517
19149
  params = (paramsOrFirst || {});
19518
19150
  }
19519
19151
  else {
19520
19152
  params = {
19521
- projectId: paramsOrFirst,
19522
- keyId: rest[0]
19153
+ queries: paramsOrFirst,
19154
+ total: rest[0]
19523
19155
  };
19524
19156
  }
19525
- const projectId = params.projectId;
19526
- const keyId = params.keyId;
19527
- if (typeof projectId === 'undefined') {
19528
- throw new AppwriteException('Missing required parameter: "projectId"');
19157
+ const queries = params.queries;
19158
+ const total = params.total;
19159
+ const apiPath = '/project/variables';
19160
+ const payload = {};
19161
+ if (typeof queries !== 'undefined') {
19162
+ payload['queries'] = queries;
19529
19163
  }
19530
- if (typeof keyId === 'undefined') {
19531
- throw new AppwriteException('Missing required parameter: "keyId"');
19164
+ if (typeof total !== 'undefined') {
19165
+ payload['total'] = total;
19532
19166
  }
19533
- const apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
19534
- const payload = {};
19535
19167
  const uri = new URL(this.client.config.endpoint + apiPath);
19536
19168
  const apiHeaders = {};
19537
19169
  return this.client.call('get', uri, apiHeaders, payload);
19538
19170
  }
19539
- updateDevKey(paramsOrFirst, ...rest) {
19171
+ createVariable(paramsOrFirst, ...rest) {
19540
19172
  let params;
19541
19173
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19542
19174
  params = (paramsOrFirst || {});
19543
19175
  }
19544
19176
  else {
19545
19177
  params = {
19546
- projectId: paramsOrFirst,
19547
- keyId: rest[0],
19548
- name: rest[1],
19549
- expire: rest[2]
19178
+ variableId: paramsOrFirst,
19179
+ key: rest[0],
19180
+ value: rest[1],
19181
+ secret: rest[2]
19550
19182
  };
19551
19183
  }
19552
- const projectId = params.projectId;
19553
- const keyId = params.keyId;
19554
- const name = params.name;
19555
- const expire = params.expire;
19556
- if (typeof projectId === 'undefined') {
19557
- throw new AppwriteException('Missing required parameter: "projectId"');
19558
- }
19559
- if (typeof keyId === 'undefined') {
19560
- throw new AppwriteException('Missing required parameter: "keyId"');
19184
+ const variableId = params.variableId;
19185
+ const key = params.key;
19186
+ const value = params.value;
19187
+ const secret = params.secret;
19188
+ if (typeof variableId === 'undefined') {
19189
+ throw new AppwriteException('Missing required parameter: "variableId"');
19561
19190
  }
19562
- if (typeof name === 'undefined') {
19563
- throw new AppwriteException('Missing required parameter: "name"');
19191
+ if (typeof key === 'undefined') {
19192
+ throw new AppwriteException('Missing required parameter: "key"');
19564
19193
  }
19565
- if (typeof expire === 'undefined') {
19566
- throw new AppwriteException('Missing required parameter: "expire"');
19194
+ if (typeof value === 'undefined') {
19195
+ throw new AppwriteException('Missing required parameter: "value"');
19567
19196
  }
19568
- const apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
19197
+ const apiPath = '/project/variables';
19569
19198
  const payload = {};
19570
- if (typeof name !== 'undefined') {
19571
- payload['name'] = name;
19199
+ if (typeof variableId !== 'undefined') {
19200
+ payload['variableId'] = variableId;
19572
19201
  }
19573
- if (typeof expire !== 'undefined') {
19574
- payload['expire'] = expire;
19202
+ if (typeof key !== 'undefined') {
19203
+ payload['key'] = key;
19204
+ }
19205
+ if (typeof value !== 'undefined') {
19206
+ payload['value'] = value;
19207
+ }
19208
+ if (typeof secret !== 'undefined') {
19209
+ payload['secret'] = secret;
19575
19210
  }
19576
19211
  const uri = new URL(this.client.config.endpoint + apiPath);
19577
19212
  const apiHeaders = {
19578
19213
  'content-type': 'application/json',
19579
19214
  };
19580
- return this.client.call('put', uri, apiHeaders, payload);
19215
+ return this.client.call('post', uri, apiHeaders, payload);
19581
19216
  }
19582
- deleteDevKey(paramsOrFirst, ...rest) {
19217
+ getVariable(paramsOrFirst) {
19583
19218
  let params;
19584
19219
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19585
19220
  params = (paramsOrFirst || {});
19586
19221
  }
19587
19222
  else {
19588
19223
  params = {
19589
- projectId: paramsOrFirst,
19590
- keyId: rest[0]
19224
+ variableId: paramsOrFirst
19591
19225
  };
19592
19226
  }
19593
- const projectId = params.projectId;
19594
- const keyId = params.keyId;
19595
- if (typeof projectId === 'undefined') {
19596
- throw new AppwriteException('Missing required parameter: "projectId"');
19597
- }
19598
- if (typeof keyId === 'undefined') {
19599
- throw new AppwriteException('Missing required parameter: "keyId"');
19227
+ const variableId = params.variableId;
19228
+ if (typeof variableId === 'undefined') {
19229
+ throw new AppwriteException('Missing required parameter: "variableId"');
19600
19230
  }
19601
- const apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
19231
+ const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
19602
19232
  const payload = {};
19603
19233
  const uri = new URL(this.client.config.endpoint + apiPath);
19604
- const apiHeaders = {
19605
- 'content-type': 'application/json',
19606
- };
19607
- return this.client.call('delete', uri, apiHeaders, payload);
19234
+ const apiHeaders = {};
19235
+ return this.client.call('get', uri, apiHeaders, payload);
19608
19236
  }
19609
- createJWT(paramsOrFirst, ...rest) {
19237
+ updateVariable(paramsOrFirst, ...rest) {
19610
19238
  let params;
19611
19239
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19612
19240
  params = (paramsOrFirst || {});
19613
19241
  }
19614
19242
  else {
19615
19243
  params = {
19616
- projectId: paramsOrFirst,
19617
- scopes: rest[0],
19618
- duration: rest[1]
19244
+ variableId: paramsOrFirst,
19245
+ key: rest[0],
19246
+ value: rest[1],
19247
+ secret: rest[2]
19619
19248
  };
19620
19249
  }
19621
- const projectId = params.projectId;
19622
- const scopes = params.scopes;
19623
- const duration = params.duration;
19624
- if (typeof projectId === 'undefined') {
19625
- throw new AppwriteException('Missing required parameter: "projectId"');
19626
- }
19627
- if (typeof scopes === 'undefined') {
19628
- throw new AppwriteException('Missing required parameter: "scopes"');
19250
+ const variableId = params.variableId;
19251
+ const key = params.key;
19252
+ const value = params.value;
19253
+ const secret = params.secret;
19254
+ if (typeof variableId === 'undefined') {
19255
+ throw new AppwriteException('Missing required parameter: "variableId"');
19629
19256
  }
19630
- const apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId);
19257
+ const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
19631
19258
  const payload = {};
19632
- if (typeof scopes !== 'undefined') {
19633
- payload['scopes'] = scopes;
19259
+ if (typeof key !== 'undefined') {
19260
+ payload['key'] = key;
19634
19261
  }
19635
- if (typeof duration !== 'undefined') {
19636
- payload['duration'] = duration;
19262
+ if (typeof value !== 'undefined') {
19263
+ payload['value'] = value;
19264
+ }
19265
+ if (typeof secret !== 'undefined') {
19266
+ payload['secret'] = secret;
19637
19267
  }
19638
19268
  const uri = new URL(this.client.config.endpoint + apiPath);
19639
19269
  const apiHeaders = {
19640
19270
  'content-type': 'application/json',
19641
19271
  };
19642
- return this.client.call('post', uri, apiHeaders, payload);
19272
+ return this.client.call('put', uri, apiHeaders, payload);
19643
19273
  }
19644
- updateOAuth2(paramsOrFirst, ...rest) {
19274
+ deleteVariable(paramsOrFirst) {
19645
19275
  let params;
19646
19276
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19647
19277
  params = (paramsOrFirst || {});
19648
19278
  }
19649
19279
  else {
19650
19280
  params = {
19651
- projectId: paramsOrFirst,
19652
- provider: rest[0],
19653
- appId: rest[1],
19654
- secret: rest[2],
19655
- enabled: rest[3]
19281
+ variableId: paramsOrFirst
19656
19282
  };
19657
19283
  }
19658
- const projectId = params.projectId;
19659
- const provider = params.provider;
19660
- const appId = params.appId;
19661
- const secret = params.secret;
19662
- const enabled = params.enabled;
19663
- if (typeof projectId === 'undefined') {
19664
- throw new AppwriteException('Missing required parameter: "projectId"');
19665
- }
19666
- if (typeof provider === 'undefined') {
19667
- throw new AppwriteException('Missing required parameter: "provider"');
19284
+ const variableId = params.variableId;
19285
+ if (typeof variableId === 'undefined') {
19286
+ throw new AppwriteException('Missing required parameter: "variableId"');
19668
19287
  }
19669
- const apiPath = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);
19288
+ const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
19670
19289
  const payload = {};
19671
- if (typeof provider !== 'undefined') {
19672
- payload['provider'] = provider;
19673
- }
19674
- if (typeof appId !== 'undefined') {
19675
- payload['appId'] = appId;
19676
- }
19677
- if (typeof secret !== 'undefined') {
19678
- payload['secret'] = secret;
19679
- }
19680
- if (typeof enabled !== 'undefined') {
19681
- payload['enabled'] = enabled;
19682
- }
19683
19290
  const uri = new URL(this.client.config.endpoint + apiPath);
19684
19291
  const apiHeaders = {
19685
19292
  'content-type': 'application/json',
19686
19293
  };
19687
- return this.client.call('patch', uri, apiHeaders, payload);
19294
+ return this.client.call('delete', uri, apiHeaders, payload);
19688
19295
  }
19689
- listSchedules(paramsOrFirst, ...rest) {
19296
+ }
19297
+
19298
+ class Projects {
19299
+ constructor(client) {
19300
+ this.client = client;
19301
+ }
19302
+ list(paramsOrFirst, ...rest) {
19690
19303
  let params;
19691
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19304
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19692
19305
  params = (paramsOrFirst || {});
19693
19306
  }
19694
19307
  else {
19695
19308
  params = {
19696
- projectId: paramsOrFirst,
19697
- queries: rest[0],
19309
+ queries: paramsOrFirst,
19310
+ search: rest[0],
19698
19311
  total: rest[1]
19699
19312
  };
19700
19313
  }
19701
- const projectId = params.projectId;
19702
19314
  const queries = params.queries;
19315
+ const search = params.search;
19703
19316
  const total = params.total;
19704
- if (typeof projectId === 'undefined') {
19705
- throw new AppwriteException('Missing required parameter: "projectId"');
19706
- }
19707
- const apiPath = '/projects/{projectId}/schedules'.replace('{projectId}', projectId);
19317
+ const apiPath = '/projects';
19708
19318
  const payload = {};
19709
19319
  if (typeof queries !== 'undefined') {
19710
19320
  payload['queries'] = queries;
19711
19321
  }
19322
+ if (typeof search !== 'undefined') {
19323
+ payload['search'] = search;
19324
+ }
19712
19325
  if (typeof total !== 'undefined') {
19713
19326
  payload['total'] = total;
19714
19327
  }
@@ -19716,7 +19329,7 @@ class Projects {
19716
19329
  const apiHeaders = {};
19717
19330
  return this.client.call('get', uri, apiHeaders, payload);
19718
19331
  }
19719
- createSchedule(paramsOrFirst, ...rest) {
19332
+ create(paramsOrFirst, ...rest) {
19720
19333
  let params;
19721
19334
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19722
19335
  params = (paramsOrFirst || {});
@@ -19724,47 +19337,82 @@ class Projects {
19724
19337
  else {
19725
19338
  params = {
19726
19339
  projectId: paramsOrFirst,
19727
- resourceType: rest[0],
19728
- resourceId: rest[1],
19729
- schedule: rest[2],
19730
- active: rest[3],
19731
- data: rest[4]
19340
+ name: rest[0],
19341
+ teamId: rest[1],
19342
+ region: rest[2],
19343
+ description: rest[3],
19344
+ logo: rest[4],
19345
+ url: rest[5],
19346
+ legalName: rest[6],
19347
+ legalCountry: rest[7],
19348
+ legalState: rest[8],
19349
+ legalCity: rest[9],
19350
+ legalAddress: rest[10],
19351
+ legalTaxId: rest[11]
19732
19352
  };
19733
19353
  }
19734
19354
  const projectId = params.projectId;
19735
- const resourceType = params.resourceType;
19736
- const resourceId = params.resourceId;
19737
- const schedule = params.schedule;
19738
- const active = params.active;
19739
- const data = params.data;
19355
+ const name = params.name;
19356
+ const teamId = params.teamId;
19357
+ const region = params.region;
19358
+ const description = params.description;
19359
+ const logo = params.logo;
19360
+ const url = params.url;
19361
+ const legalName = params.legalName;
19362
+ const legalCountry = params.legalCountry;
19363
+ const legalState = params.legalState;
19364
+ const legalCity = params.legalCity;
19365
+ const legalAddress = params.legalAddress;
19366
+ const legalTaxId = params.legalTaxId;
19740
19367
  if (typeof projectId === 'undefined') {
19741
19368
  throw new AppwriteException('Missing required parameter: "projectId"');
19742
19369
  }
19743
- if (typeof resourceType === 'undefined') {
19744
- throw new AppwriteException('Missing required parameter: "resourceType"');
19370
+ if (typeof name === 'undefined') {
19371
+ throw new AppwriteException('Missing required parameter: "name"');
19745
19372
  }
19746
- if (typeof resourceId === 'undefined') {
19747
- throw new AppwriteException('Missing required parameter: "resourceId"');
19373
+ if (typeof teamId === 'undefined') {
19374
+ throw new AppwriteException('Missing required parameter: "teamId"');
19375
+ }
19376
+ const apiPath = '/projects';
19377
+ const payload = {};
19378
+ if (typeof projectId !== 'undefined') {
19379
+ payload['projectId'] = projectId;
19380
+ }
19381
+ if (typeof name !== 'undefined') {
19382
+ payload['name'] = name;
19383
+ }
19384
+ if (typeof teamId !== 'undefined') {
19385
+ payload['teamId'] = teamId;
19386
+ }
19387
+ if (typeof region !== 'undefined') {
19388
+ payload['region'] = region;
19389
+ }
19390
+ if (typeof description !== 'undefined') {
19391
+ payload['description'] = description;
19392
+ }
19393
+ if (typeof logo !== 'undefined') {
19394
+ payload['logo'] = logo;
19395
+ }
19396
+ if (typeof url !== 'undefined') {
19397
+ payload['url'] = url;
19748
19398
  }
19749
- if (typeof schedule === 'undefined') {
19750
- throw new AppwriteException('Missing required parameter: "schedule"');
19399
+ if (typeof legalName !== 'undefined') {
19400
+ payload['legalName'] = legalName;
19751
19401
  }
19752
- const apiPath = '/projects/{projectId}/schedules'.replace('{projectId}', projectId);
19753
- const payload = {};
19754
- if (typeof resourceType !== 'undefined') {
19755
- payload['resourceType'] = resourceType;
19402
+ if (typeof legalCountry !== 'undefined') {
19403
+ payload['legalCountry'] = legalCountry;
19756
19404
  }
19757
- if (typeof resourceId !== 'undefined') {
19758
- payload['resourceId'] = resourceId;
19405
+ if (typeof legalState !== 'undefined') {
19406
+ payload['legalState'] = legalState;
19759
19407
  }
19760
- if (typeof schedule !== 'undefined') {
19761
- payload['schedule'] = schedule;
19408
+ if (typeof legalCity !== 'undefined') {
19409
+ payload['legalCity'] = legalCity;
19762
19410
  }
19763
- if (typeof active !== 'undefined') {
19764
- payload['active'] = active;
19411
+ if (typeof legalAddress !== 'undefined') {
19412
+ payload['legalAddress'] = legalAddress;
19765
19413
  }
19766
- if (typeof data !== 'undefined') {
19767
- payload['data'] = data;
19414
+ if (typeof legalTaxId !== 'undefined') {
19415
+ payload['legalTaxId'] = legalTaxId;
19768
19416
  }
19769
19417
  const uri = new URL(this.client.config.endpoint + apiPath);
19770
19418
  const apiHeaders = {
@@ -19772,32 +19420,27 @@ class Projects {
19772
19420
  };
19773
19421
  return this.client.call('post', uri, apiHeaders, payload);
19774
19422
  }
19775
- getSchedule(paramsOrFirst, ...rest) {
19423
+ get(paramsOrFirst) {
19776
19424
  let params;
19777
19425
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19778
19426
  params = (paramsOrFirst || {});
19779
19427
  }
19780
19428
  else {
19781
19429
  params = {
19782
- projectId: paramsOrFirst,
19783
- scheduleId: rest[0]
19430
+ projectId: paramsOrFirst
19784
19431
  };
19785
19432
  }
19786
19433
  const projectId = params.projectId;
19787
- const scheduleId = params.scheduleId;
19788
19434
  if (typeof projectId === 'undefined') {
19789
19435
  throw new AppwriteException('Missing required parameter: "projectId"');
19790
19436
  }
19791
- if (typeof scheduleId === 'undefined') {
19792
- throw new AppwriteException('Missing required parameter: "scheduleId"');
19793
- }
19794
- const apiPath = '/projects/{projectId}/schedules/{scheduleId}'.replace('{projectId}', projectId).replace('{scheduleId}', scheduleId);
19437
+ const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
19795
19438
  const payload = {};
19796
19439
  const uri = new URL(this.client.config.endpoint + apiPath);
19797
19440
  const apiHeaders = {};
19798
19441
  return this.client.call('get', uri, apiHeaders, payload);
19799
19442
  }
19800
- updateSmtp(paramsOrFirst, ...rest) {
19443
+ update(paramsOrFirst, ...rest) {
19801
19444
  let params;
19802
19445
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19803
19446
  params = (paramsOrFirst || {});
@@ -19805,61 +19448,66 @@ class Projects {
19805
19448
  else {
19806
19449
  params = {
19807
19450
  projectId: paramsOrFirst,
19808
- enabled: rest[0],
19809
- senderName: rest[1],
19810
- senderEmail: rest[2],
19811
- replyTo: rest[3],
19812
- host: rest[4],
19813
- port: rest[5],
19814
- username: rest[6],
19815
- password: rest[7],
19816
- secure: rest[8]
19451
+ name: rest[0],
19452
+ description: rest[1],
19453
+ logo: rest[2],
19454
+ url: rest[3],
19455
+ legalName: rest[4],
19456
+ legalCountry: rest[5],
19457
+ legalState: rest[6],
19458
+ legalCity: rest[7],
19459
+ legalAddress: rest[8],
19460
+ legalTaxId: rest[9]
19817
19461
  };
19818
19462
  }
19819
19463
  const projectId = params.projectId;
19820
- const enabled = params.enabled;
19821
- const senderName = params.senderName;
19822
- const senderEmail = params.senderEmail;
19823
- const replyTo = params.replyTo;
19824
- const host = params.host;
19825
- const port = params.port;
19826
- const username = params.username;
19827
- const password = params.password;
19828
- const secure = params.secure;
19464
+ const name = params.name;
19465
+ const description = params.description;
19466
+ const logo = params.logo;
19467
+ const url = params.url;
19468
+ const legalName = params.legalName;
19469
+ const legalCountry = params.legalCountry;
19470
+ const legalState = params.legalState;
19471
+ const legalCity = params.legalCity;
19472
+ const legalAddress = params.legalAddress;
19473
+ const legalTaxId = params.legalTaxId;
19829
19474
  if (typeof projectId === 'undefined') {
19830
19475
  throw new AppwriteException('Missing required parameter: "projectId"');
19831
19476
  }
19832
- if (typeof enabled === 'undefined') {
19833
- throw new AppwriteException('Missing required parameter: "enabled"');
19477
+ if (typeof name === 'undefined') {
19478
+ throw new AppwriteException('Missing required parameter: "name"');
19834
19479
  }
19835
- const apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);
19480
+ const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
19836
19481
  const payload = {};
19837
- if (typeof enabled !== 'undefined') {
19838
- payload['enabled'] = enabled;
19482
+ if (typeof name !== 'undefined') {
19483
+ payload['name'] = name;
19839
19484
  }
19840
- if (typeof senderName !== 'undefined') {
19841
- payload['senderName'] = senderName;
19485
+ if (typeof description !== 'undefined') {
19486
+ payload['description'] = description;
19842
19487
  }
19843
- if (typeof senderEmail !== 'undefined') {
19844
- payload['senderEmail'] = senderEmail;
19488
+ if (typeof logo !== 'undefined') {
19489
+ payload['logo'] = logo;
19845
19490
  }
19846
- if (typeof replyTo !== 'undefined') {
19847
- payload['replyTo'] = replyTo;
19491
+ if (typeof url !== 'undefined') {
19492
+ payload['url'] = url;
19848
19493
  }
19849
- if (typeof host !== 'undefined') {
19850
- payload['host'] = host;
19494
+ if (typeof legalName !== 'undefined') {
19495
+ payload['legalName'] = legalName;
19851
19496
  }
19852
- if (typeof port !== 'undefined') {
19853
- payload['port'] = port;
19497
+ if (typeof legalCountry !== 'undefined') {
19498
+ payload['legalCountry'] = legalCountry;
19854
19499
  }
19855
- if (typeof username !== 'undefined') {
19856
- payload['username'] = username;
19500
+ if (typeof legalState !== 'undefined') {
19501
+ payload['legalState'] = legalState;
19857
19502
  }
19858
- if (typeof password !== 'undefined') {
19859
- payload['password'] = password;
19503
+ if (typeof legalCity !== 'undefined') {
19504
+ payload['legalCity'] = legalCity;
19860
19505
  }
19861
- if (typeof secure !== 'undefined') {
19862
- payload['secure'] = secure;
19506
+ if (typeof legalAddress !== 'undefined') {
19507
+ payload['legalAddress'] = legalAddress;
19508
+ }
19509
+ if (typeof legalTaxId !== 'undefined') {
19510
+ payload['legalTaxId'] = legalTaxId;
19863
19511
  }
19864
19512
  const uri = new URL(this.client.config.endpoint + apiPath);
19865
19513
  const apiHeaders = {
@@ -19867,77 +19515,29 @@ class Projects {
19867
19515
  };
19868
19516
  return this.client.call('patch', uri, apiHeaders, payload);
19869
19517
  }
19870
- updateSMTP(paramsOrFirst, ...rest) {
19518
+ delete(paramsOrFirst) {
19871
19519
  let params;
19872
19520
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19873
19521
  params = (paramsOrFirst || {});
19874
19522
  }
19875
19523
  else {
19876
19524
  params = {
19877
- projectId: paramsOrFirst,
19878
- enabled: rest[0],
19879
- senderName: rest[1],
19880
- senderEmail: rest[2],
19881
- replyTo: rest[3],
19882
- host: rest[4],
19883
- port: rest[5],
19884
- username: rest[6],
19885
- password: rest[7],
19886
- secure: rest[8]
19525
+ projectId: paramsOrFirst
19887
19526
  };
19888
19527
  }
19889
19528
  const projectId = params.projectId;
19890
- const enabled = params.enabled;
19891
- const senderName = params.senderName;
19892
- const senderEmail = params.senderEmail;
19893
- const replyTo = params.replyTo;
19894
- const host = params.host;
19895
- const port = params.port;
19896
- const username = params.username;
19897
- const password = params.password;
19898
- const secure = params.secure;
19899
19529
  if (typeof projectId === 'undefined') {
19900
19530
  throw new AppwriteException('Missing required parameter: "projectId"');
19901
19531
  }
19902
- if (typeof enabled === 'undefined') {
19903
- throw new AppwriteException('Missing required parameter: "enabled"');
19904
- }
19905
- const apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);
19532
+ const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
19906
19533
  const payload = {};
19907
- if (typeof enabled !== 'undefined') {
19908
- payload['enabled'] = enabled;
19909
- }
19910
- if (typeof senderName !== 'undefined') {
19911
- payload['senderName'] = senderName;
19912
- }
19913
- if (typeof senderEmail !== 'undefined') {
19914
- payload['senderEmail'] = senderEmail;
19915
- }
19916
- if (typeof replyTo !== 'undefined') {
19917
- payload['replyTo'] = replyTo;
19918
- }
19919
- if (typeof host !== 'undefined') {
19920
- payload['host'] = host;
19921
- }
19922
- if (typeof port !== 'undefined') {
19923
- payload['port'] = port;
19924
- }
19925
- if (typeof username !== 'undefined') {
19926
- payload['username'] = username;
19927
- }
19928
- if (typeof password !== 'undefined') {
19929
- payload['password'] = password;
19930
- }
19931
- if (typeof secure !== 'undefined') {
19932
- payload['secure'] = secure;
19933
- }
19934
19534
  const uri = new URL(this.client.config.endpoint + apiPath);
19935
19535
  const apiHeaders = {
19936
19536
  'content-type': 'application/json',
19937
19537
  };
19938
- return this.client.call('patch', uri, apiHeaders, payload);
19538
+ return this.client.call('delete', uri, apiHeaders, payload);
19939
19539
  }
19940
- createSmtpTest(paramsOrFirst, ...rest) {
19540
+ updateMockNumbers(paramsOrFirst, ...rest) {
19941
19541
  let params;
19942
19542
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19943
19543
  params = (paramsOrFirst || {});
@@ -19945,78 +19545,29 @@ class Projects {
19945
19545
  else {
19946
19546
  params = {
19947
19547
  projectId: paramsOrFirst,
19948
- emails: rest[0],
19949
- senderName: rest[1],
19950
- senderEmail: rest[2],
19951
- host: rest[3],
19952
- replyTo: rest[4],
19953
- port: rest[5],
19954
- username: rest[6],
19955
- password: rest[7],
19956
- secure: rest[8]
19548
+ numbers: rest[0]
19957
19549
  };
19958
19550
  }
19959
19551
  const projectId = params.projectId;
19960
- const emails = params.emails;
19961
- const senderName = params.senderName;
19962
- const senderEmail = params.senderEmail;
19963
- const host = params.host;
19964
- const replyTo = params.replyTo;
19965
- const port = params.port;
19966
- const username = params.username;
19967
- const password = params.password;
19968
- const secure = params.secure;
19552
+ const numbers = params.numbers;
19969
19553
  if (typeof projectId === 'undefined') {
19970
19554
  throw new AppwriteException('Missing required parameter: "projectId"');
19971
19555
  }
19972
- if (typeof emails === 'undefined') {
19973
- throw new AppwriteException('Missing required parameter: "emails"');
19974
- }
19975
- if (typeof senderName === 'undefined') {
19976
- throw new AppwriteException('Missing required parameter: "senderName"');
19977
- }
19978
- if (typeof senderEmail === 'undefined') {
19979
- throw new AppwriteException('Missing required parameter: "senderEmail"');
19980
- }
19981
- if (typeof host === 'undefined') {
19982
- throw new AppwriteException('Missing required parameter: "host"');
19556
+ if (typeof numbers === 'undefined') {
19557
+ throw new AppwriteException('Missing required parameter: "numbers"');
19983
19558
  }
19984
- const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
19559
+ const apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId);
19985
19560
  const payload = {};
19986
- if (typeof emails !== 'undefined') {
19987
- payload['emails'] = emails;
19988
- }
19989
- if (typeof senderName !== 'undefined') {
19990
- payload['senderName'] = senderName;
19991
- }
19992
- if (typeof senderEmail !== 'undefined') {
19993
- payload['senderEmail'] = senderEmail;
19994
- }
19995
- if (typeof replyTo !== 'undefined') {
19996
- payload['replyTo'] = replyTo;
19997
- }
19998
- if (typeof host !== 'undefined') {
19999
- payload['host'] = host;
20000
- }
20001
- if (typeof port !== 'undefined') {
20002
- payload['port'] = port;
20003
- }
20004
- if (typeof username !== 'undefined') {
20005
- payload['username'] = username;
20006
- }
20007
- if (typeof password !== 'undefined') {
20008
- payload['password'] = password;
20009
- }
20010
- if (typeof secure !== 'undefined') {
20011
- payload['secure'] = secure;
19561
+ if (typeof numbers !== 'undefined') {
19562
+ payload['numbers'] = numbers;
20012
19563
  }
20013
19564
  const uri = new URL(this.client.config.endpoint + apiPath);
20014
19565
  const apiHeaders = {
20015
19566
  'content-type': 'application/json',
20016
19567
  };
20017
- return this.client.call('post', uri, apiHeaders, payload);
19568
+ return this.client.call('patch', uri, apiHeaders, payload);
20018
19569
  }
20019
- createSMTPTest(paramsOrFirst, ...rest) {
19570
+ updateAuthStatus(paramsOrFirst, ...rest) {
20020
19571
  let params;
20021
19572
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20022
19573
  params = (paramsOrFirst || {});
@@ -20024,108 +19575,56 @@ class Projects {
20024
19575
  else {
20025
19576
  params = {
20026
19577
  projectId: paramsOrFirst,
20027
- emails: rest[0],
20028
- senderName: rest[1],
20029
- senderEmail: rest[2],
20030
- host: rest[3],
20031
- replyTo: rest[4],
20032
- port: rest[5],
20033
- username: rest[6],
20034
- password: rest[7],
20035
- secure: rest[8]
19578
+ method: rest[0],
19579
+ status: rest[1]
20036
19580
  };
20037
19581
  }
20038
19582
  const projectId = params.projectId;
20039
- const emails = params.emails;
20040
- const senderName = params.senderName;
20041
- const senderEmail = params.senderEmail;
20042
- const host = params.host;
20043
- const replyTo = params.replyTo;
20044
- const port = params.port;
20045
- const username = params.username;
20046
- const password = params.password;
20047
- const secure = params.secure;
19583
+ const method = params.method;
19584
+ const status = params.status;
20048
19585
  if (typeof projectId === 'undefined') {
20049
19586
  throw new AppwriteException('Missing required parameter: "projectId"');
20050
19587
  }
20051
- if (typeof emails === 'undefined') {
20052
- throw new AppwriteException('Missing required parameter: "emails"');
20053
- }
20054
- if (typeof senderName === 'undefined') {
20055
- throw new AppwriteException('Missing required parameter: "senderName"');
20056
- }
20057
- if (typeof senderEmail === 'undefined') {
20058
- throw new AppwriteException('Missing required parameter: "senderEmail"');
19588
+ if (typeof method === 'undefined') {
19589
+ throw new AppwriteException('Missing required parameter: "method"');
20059
19590
  }
20060
- if (typeof host === 'undefined') {
20061
- throw new AppwriteException('Missing required parameter: "host"');
19591
+ if (typeof status === 'undefined') {
19592
+ throw new AppwriteException('Missing required parameter: "status"');
20062
19593
  }
20063
- const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
19594
+ const apiPath = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);
20064
19595
  const payload = {};
20065
- if (typeof emails !== 'undefined') {
20066
- payload['emails'] = emails;
20067
- }
20068
- if (typeof senderName !== 'undefined') {
20069
- payload['senderName'] = senderName;
20070
- }
20071
- if (typeof senderEmail !== 'undefined') {
20072
- payload['senderEmail'] = senderEmail;
20073
- }
20074
- if (typeof replyTo !== 'undefined') {
20075
- payload['replyTo'] = replyTo;
20076
- }
20077
- if (typeof host !== 'undefined') {
20078
- payload['host'] = host;
20079
- }
20080
- if (typeof port !== 'undefined') {
20081
- payload['port'] = port;
20082
- }
20083
- if (typeof username !== 'undefined') {
20084
- payload['username'] = username;
20085
- }
20086
- if (typeof password !== 'undefined') {
20087
- payload['password'] = password;
20088
- }
20089
- if (typeof secure !== 'undefined') {
20090
- payload['secure'] = secure;
19596
+ if (typeof status !== 'undefined') {
19597
+ payload['status'] = status;
20091
19598
  }
20092
19599
  const uri = new URL(this.client.config.endpoint + apiPath);
20093
19600
  const apiHeaders = {
20094
19601
  'content-type': 'application/json',
20095
19602
  };
20096
- return this.client.call('post', uri, apiHeaders, payload);
19603
+ return this.client.call('patch', uri, apiHeaders, payload);
20097
19604
  }
20098
- updateStatus(paramsOrFirst, ...rest) {
19605
+ updateConsoleAccess(paramsOrFirst) {
20099
19606
  let params;
20100
19607
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20101
19608
  params = (paramsOrFirst || {});
20102
19609
  }
20103
19610
  else {
20104
19611
  params = {
20105
- projectId: paramsOrFirst,
20106
- status: rest[0]
19612
+ projectId: paramsOrFirst
20107
19613
  };
20108
19614
  }
20109
19615
  const projectId = params.projectId;
20110
- const status = params.status;
20111
19616
  if (typeof projectId === 'undefined') {
20112
19617
  throw new AppwriteException('Missing required parameter: "projectId"');
20113
19618
  }
20114
- if (typeof status === 'undefined') {
20115
- throw new AppwriteException('Missing required parameter: "status"');
20116
- }
20117
- const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
19619
+ const apiPath = '/projects/{projectId}/console-access'.replace('{projectId}', projectId);
20118
19620
  const payload = {};
20119
- if (typeof status !== 'undefined') {
20120
- payload['status'] = status;
20121
- }
20122
19621
  const uri = new URL(this.client.config.endpoint + apiPath);
20123
19622
  const apiHeaders = {
20124
19623
  'content-type': 'application/json',
20125
19624
  };
20126
19625
  return this.client.call('patch', uri, apiHeaders, payload);
20127
19626
  }
20128
- updateTeam(paramsOrFirst, ...rest) {
19627
+ listDevKeys(paramsOrFirst, ...rest) {
20129
19628
  let params;
20130
19629
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20131
19630
  params = (paramsOrFirst || {});
@@ -20133,29 +19632,62 @@ class Projects {
20133
19632
  else {
20134
19633
  params = {
20135
19634
  projectId: paramsOrFirst,
20136
- teamId: rest[0]
19635
+ queries: rest[0]
20137
19636
  };
20138
19637
  }
20139
19638
  const projectId = params.projectId;
20140
- const teamId = params.teamId;
19639
+ const queries = params.queries;
20141
19640
  if (typeof projectId === 'undefined') {
20142
19641
  throw new AppwriteException('Missing required parameter: "projectId"');
20143
19642
  }
20144
- if (typeof teamId === 'undefined') {
20145
- throw new AppwriteException('Missing required parameter: "teamId"');
19643
+ const apiPath = '/projects/{projectId}/dev-keys'.replace('{projectId}', projectId);
19644
+ const payload = {};
19645
+ if (typeof queries !== 'undefined') {
19646
+ payload['queries'] = queries;
20146
19647
  }
20147
- const apiPath = '/projects/{projectId}/team'.replace('{projectId}', projectId);
19648
+ const uri = new URL(this.client.config.endpoint + apiPath);
19649
+ const apiHeaders = {};
19650
+ return this.client.call('get', uri, apiHeaders, payload);
19651
+ }
19652
+ createDevKey(paramsOrFirst, ...rest) {
19653
+ let params;
19654
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19655
+ params = (paramsOrFirst || {});
19656
+ }
19657
+ else {
19658
+ params = {
19659
+ projectId: paramsOrFirst,
19660
+ name: rest[0],
19661
+ expire: rest[1]
19662
+ };
19663
+ }
19664
+ const projectId = params.projectId;
19665
+ const name = params.name;
19666
+ const expire = params.expire;
19667
+ if (typeof projectId === 'undefined') {
19668
+ throw new AppwriteException('Missing required parameter: "projectId"');
19669
+ }
19670
+ if (typeof name === 'undefined') {
19671
+ throw new AppwriteException('Missing required parameter: "name"');
19672
+ }
19673
+ if (typeof expire === 'undefined') {
19674
+ throw new AppwriteException('Missing required parameter: "expire"');
19675
+ }
19676
+ const apiPath = '/projects/{projectId}/dev-keys'.replace('{projectId}', projectId);
20148
19677
  const payload = {};
20149
- if (typeof teamId !== 'undefined') {
20150
- payload['teamId'] = teamId;
19678
+ if (typeof name !== 'undefined') {
19679
+ payload['name'] = name;
19680
+ }
19681
+ if (typeof expire !== 'undefined') {
19682
+ payload['expire'] = expire;
20151
19683
  }
20152
19684
  const uri = new URL(this.client.config.endpoint + apiPath);
20153
19685
  const apiHeaders = {
20154
19686
  'content-type': 'application/json',
20155
19687
  };
20156
- return this.client.call('patch', uri, apiHeaders, payload);
19688
+ return this.client.call('post', uri, apiHeaders, payload);
20157
19689
  }
20158
- getEmailTemplate(paramsOrFirst, ...rest) {
19690
+ getDevKey(paramsOrFirst, ...rest) {
20159
19691
  let params;
20160
19692
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20161
19693
  params = (paramsOrFirst || {});
@@ -20163,29 +19695,24 @@ class Projects {
20163
19695
  else {
20164
19696
  params = {
20165
19697
  projectId: paramsOrFirst,
20166
- type: rest[0],
20167
- locale: rest[1]
19698
+ keyId: rest[0]
20168
19699
  };
20169
19700
  }
20170
19701
  const projectId = params.projectId;
20171
- const type = params.type;
20172
- const locale = params.locale;
19702
+ const keyId = params.keyId;
20173
19703
  if (typeof projectId === 'undefined') {
20174
19704
  throw new AppwriteException('Missing required parameter: "projectId"');
20175
19705
  }
20176
- if (typeof type === 'undefined') {
20177
- throw new AppwriteException('Missing required parameter: "type"');
20178
- }
20179
- if (typeof locale === 'undefined') {
20180
- throw new AppwriteException('Missing required parameter: "locale"');
19706
+ if (typeof keyId === 'undefined') {
19707
+ throw new AppwriteException('Missing required parameter: "keyId"');
20181
19708
  }
20182
- const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
19709
+ const apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
20183
19710
  const payload = {};
20184
19711
  const uri = new URL(this.client.config.endpoint + apiPath);
20185
19712
  const apiHeaders = {};
20186
19713
  return this.client.call('get', uri, apiHeaders, payload);
20187
19714
  }
20188
- updateEmailTemplate(paramsOrFirst, ...rest) {
19715
+ updateDevKey(paramsOrFirst, ...rest) {
20189
19716
  let params;
20190
19717
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20191
19718
  params = (paramsOrFirst || {});
@@ -20193,62 +19720,69 @@ class Projects {
20193
19720
  else {
20194
19721
  params = {
20195
19722
  projectId: paramsOrFirst,
20196
- type: rest[0],
20197
- locale: rest[1],
20198
- subject: rest[2],
20199
- message: rest[3],
20200
- senderName: rest[4],
20201
- senderEmail: rest[5],
20202
- replyTo: rest[6]
19723
+ keyId: rest[0],
19724
+ name: rest[1],
19725
+ expire: rest[2]
20203
19726
  };
20204
19727
  }
20205
19728
  const projectId = params.projectId;
20206
- const type = params.type;
20207
- const locale = params.locale;
20208
- const subject = params.subject;
20209
- const message = params.message;
20210
- const senderName = params.senderName;
20211
- const senderEmail = params.senderEmail;
20212
- const replyTo = params.replyTo;
19729
+ const keyId = params.keyId;
19730
+ const name = params.name;
19731
+ const expire = params.expire;
20213
19732
  if (typeof projectId === 'undefined') {
20214
19733
  throw new AppwriteException('Missing required parameter: "projectId"');
20215
19734
  }
20216
- if (typeof type === 'undefined') {
20217
- throw new AppwriteException('Missing required parameter: "type"');
20218
- }
20219
- if (typeof locale === 'undefined') {
20220
- throw new AppwriteException('Missing required parameter: "locale"');
19735
+ if (typeof keyId === 'undefined') {
19736
+ throw new AppwriteException('Missing required parameter: "keyId"');
20221
19737
  }
20222
- if (typeof subject === 'undefined') {
20223
- throw new AppwriteException('Missing required parameter: "subject"');
19738
+ if (typeof name === 'undefined') {
19739
+ throw new AppwriteException('Missing required parameter: "name"');
20224
19740
  }
20225
- if (typeof message === 'undefined') {
20226
- throw new AppwriteException('Missing required parameter: "message"');
19741
+ if (typeof expire === 'undefined') {
19742
+ throw new AppwriteException('Missing required parameter: "expire"');
20227
19743
  }
20228
- const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
19744
+ const apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
20229
19745
  const payload = {};
20230
- if (typeof subject !== 'undefined') {
20231
- payload['subject'] = subject;
19746
+ if (typeof name !== 'undefined') {
19747
+ payload['name'] = name;
20232
19748
  }
20233
- if (typeof message !== 'undefined') {
20234
- payload['message'] = message;
19749
+ if (typeof expire !== 'undefined') {
19750
+ payload['expire'] = expire;
20235
19751
  }
20236
- if (typeof senderName !== 'undefined') {
20237
- payload['senderName'] = senderName;
19752
+ const uri = new URL(this.client.config.endpoint + apiPath);
19753
+ const apiHeaders = {
19754
+ 'content-type': 'application/json',
19755
+ };
19756
+ return this.client.call('put', uri, apiHeaders, payload);
19757
+ }
19758
+ deleteDevKey(paramsOrFirst, ...rest) {
19759
+ let params;
19760
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19761
+ params = (paramsOrFirst || {});
20238
19762
  }
20239
- if (typeof senderEmail !== 'undefined') {
20240
- payload['senderEmail'] = senderEmail;
19763
+ else {
19764
+ params = {
19765
+ projectId: paramsOrFirst,
19766
+ keyId: rest[0]
19767
+ };
19768
+ }
19769
+ const projectId = params.projectId;
19770
+ const keyId = params.keyId;
19771
+ if (typeof projectId === 'undefined') {
19772
+ throw new AppwriteException('Missing required parameter: "projectId"');
20241
19773
  }
20242
- if (typeof replyTo !== 'undefined') {
20243
- payload['replyTo'] = replyTo;
19774
+ if (typeof keyId === 'undefined') {
19775
+ throw new AppwriteException('Missing required parameter: "keyId"');
20244
19776
  }
19777
+ const apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
19778
+ const payload = {};
20245
19779
  const uri = new URL(this.client.config.endpoint + apiPath);
20246
19780
  const apiHeaders = {
20247
19781
  'content-type': 'application/json',
20248
19782
  };
20249
- return this.client.call('patch', uri, apiHeaders, payload);
19783
+ return this.client.call('delete', uri, apiHeaders, payload);
20250
19784
  }
20251
- deleteEmailTemplate(paramsOrFirst, ...rest) {
19785
+ createJWT(paramsOrFirst, ...rest) {
20252
19786
  let params;
20253
19787
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20254
19788
  params = (paramsOrFirst || {});
@@ -20256,31 +19790,34 @@ class Projects {
20256
19790
  else {
20257
19791
  params = {
20258
19792
  projectId: paramsOrFirst,
20259
- type: rest[0],
20260
- locale: rest[1]
19793
+ scopes: rest[0],
19794
+ duration: rest[1]
20261
19795
  };
20262
19796
  }
20263
19797
  const projectId = params.projectId;
20264
- const type = params.type;
20265
- const locale = params.locale;
19798
+ const scopes = params.scopes;
19799
+ const duration = params.duration;
20266
19800
  if (typeof projectId === 'undefined') {
20267
19801
  throw new AppwriteException('Missing required parameter: "projectId"');
20268
19802
  }
20269
- if (typeof type === 'undefined') {
20270
- throw new AppwriteException('Missing required parameter: "type"');
20271
- }
20272
- if (typeof locale === 'undefined') {
20273
- throw new AppwriteException('Missing required parameter: "locale"');
19803
+ if (typeof scopes === 'undefined') {
19804
+ throw new AppwriteException('Missing required parameter: "scopes"');
20274
19805
  }
20275
- const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
19806
+ const apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId);
20276
19807
  const payload = {};
19808
+ if (typeof scopes !== 'undefined') {
19809
+ payload['scopes'] = scopes;
19810
+ }
19811
+ if (typeof duration !== 'undefined') {
19812
+ payload['duration'] = duration;
19813
+ }
20277
19814
  const uri = new URL(this.client.config.endpoint + apiPath);
20278
19815
  const apiHeaders = {
20279
19816
  'content-type': 'application/json',
20280
19817
  };
20281
- return this.client.call('delete', uri, apiHeaders, payload);
19818
+ return this.client.call('post', uri, apiHeaders, payload);
20282
19819
  }
20283
- getSmsTemplate(paramsOrFirst, ...rest) {
19820
+ updateOAuth2(paramsOrFirst, ...rest) {
20284
19821
  let params;
20285
19822
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20286
19823
  params = (paramsOrFirst || {});
@@ -20288,29 +19825,44 @@ class Projects {
20288
19825
  else {
20289
19826
  params = {
20290
19827
  projectId: paramsOrFirst,
20291
- type: rest[0],
20292
- locale: rest[1]
19828
+ provider: rest[0],
19829
+ appId: rest[1],
19830
+ secret: rest[2],
19831
+ enabled: rest[3]
20293
19832
  };
20294
19833
  }
20295
19834
  const projectId = params.projectId;
20296
- const type = params.type;
20297
- const locale = params.locale;
19835
+ const provider = params.provider;
19836
+ const appId = params.appId;
19837
+ const secret = params.secret;
19838
+ const enabled = params.enabled;
20298
19839
  if (typeof projectId === 'undefined') {
20299
19840
  throw new AppwriteException('Missing required parameter: "projectId"');
20300
19841
  }
20301
- if (typeof type === 'undefined') {
20302
- throw new AppwriteException('Missing required parameter: "type"');
20303
- }
20304
- if (typeof locale === 'undefined') {
20305
- throw new AppwriteException('Missing required parameter: "locale"');
19842
+ if (typeof provider === 'undefined') {
19843
+ throw new AppwriteException('Missing required parameter: "provider"');
20306
19844
  }
20307
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
19845
+ const apiPath = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);
20308
19846
  const payload = {};
19847
+ if (typeof provider !== 'undefined') {
19848
+ payload['provider'] = provider;
19849
+ }
19850
+ if (typeof appId !== 'undefined') {
19851
+ payload['appId'] = appId;
19852
+ }
19853
+ if (typeof secret !== 'undefined') {
19854
+ payload['secret'] = secret;
19855
+ }
19856
+ if (typeof enabled !== 'undefined') {
19857
+ payload['enabled'] = enabled;
19858
+ }
20309
19859
  const uri = new URL(this.client.config.endpoint + apiPath);
20310
- const apiHeaders = {};
20311
- return this.client.call('get', uri, apiHeaders, payload);
19860
+ const apiHeaders = {
19861
+ 'content-type': 'application/json',
19862
+ };
19863
+ return this.client.call('patch', uri, apiHeaders, payload);
20312
19864
  }
20313
- getSMSTemplate(paramsOrFirst, ...rest) {
19865
+ listSchedules(paramsOrFirst, ...rest) {
20314
19866
  let params;
20315
19867
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20316
19868
  params = (paramsOrFirst || {});
@@ -20318,29 +19870,29 @@ class Projects {
20318
19870
  else {
20319
19871
  params = {
20320
19872
  projectId: paramsOrFirst,
20321
- type: rest[0],
20322
- locale: rest[1]
19873
+ queries: rest[0],
19874
+ total: rest[1]
20323
19875
  };
20324
19876
  }
20325
19877
  const projectId = params.projectId;
20326
- const type = params.type;
20327
- const locale = params.locale;
19878
+ const queries = params.queries;
19879
+ const total = params.total;
20328
19880
  if (typeof projectId === 'undefined') {
20329
19881
  throw new AppwriteException('Missing required parameter: "projectId"');
20330
19882
  }
20331
- if (typeof type === 'undefined') {
20332
- throw new AppwriteException('Missing required parameter: "type"');
19883
+ const apiPath = '/projects/{projectId}/schedules'.replace('{projectId}', projectId);
19884
+ const payload = {};
19885
+ if (typeof queries !== 'undefined') {
19886
+ payload['queries'] = queries;
20333
19887
  }
20334
- if (typeof locale === 'undefined') {
20335
- throw new AppwriteException('Missing required parameter: "locale"');
19888
+ if (typeof total !== 'undefined') {
19889
+ payload['total'] = total;
20336
19890
  }
20337
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
20338
- const payload = {};
20339
19891
  const uri = new URL(this.client.config.endpoint + apiPath);
20340
19892
  const apiHeaders = {};
20341
19893
  return this.client.call('get', uri, apiHeaders, payload);
20342
19894
  }
20343
- updateSmsTemplate(paramsOrFirst, ...rest) {
19895
+ createSchedule(paramsOrFirst, ...rest) {
20344
19896
  let params;
20345
19897
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20346
19898
  params = (paramsOrFirst || {});
@@ -20348,39 +19900,55 @@ class Projects {
20348
19900
  else {
20349
19901
  params = {
20350
19902
  projectId: paramsOrFirst,
20351
- type: rest[0],
20352
- locale: rest[1],
20353
- message: rest[2]
19903
+ resourceType: rest[0],
19904
+ resourceId: rest[1],
19905
+ schedule: rest[2],
19906
+ active: rest[3],
19907
+ data: rest[4]
20354
19908
  };
20355
19909
  }
20356
19910
  const projectId = params.projectId;
20357
- const type = params.type;
20358
- const locale = params.locale;
20359
- const message = params.message;
19911
+ const resourceType = params.resourceType;
19912
+ const resourceId = params.resourceId;
19913
+ const schedule = params.schedule;
19914
+ const active = params.active;
19915
+ const data = params.data;
20360
19916
  if (typeof projectId === 'undefined') {
20361
19917
  throw new AppwriteException('Missing required parameter: "projectId"');
20362
19918
  }
20363
- if (typeof type === 'undefined') {
20364
- throw new AppwriteException('Missing required parameter: "type"');
19919
+ if (typeof resourceType === 'undefined') {
19920
+ throw new AppwriteException('Missing required parameter: "resourceType"');
19921
+ }
19922
+ if (typeof resourceId === 'undefined') {
19923
+ throw new AppwriteException('Missing required parameter: "resourceId"');
19924
+ }
19925
+ if (typeof schedule === 'undefined') {
19926
+ throw new AppwriteException('Missing required parameter: "schedule"');
19927
+ }
19928
+ const apiPath = '/projects/{projectId}/schedules'.replace('{projectId}', projectId);
19929
+ const payload = {};
19930
+ if (typeof resourceType !== 'undefined') {
19931
+ payload['resourceType'] = resourceType;
19932
+ }
19933
+ if (typeof resourceId !== 'undefined') {
19934
+ payload['resourceId'] = resourceId;
20365
19935
  }
20366
- if (typeof locale === 'undefined') {
20367
- throw new AppwriteException('Missing required parameter: "locale"');
19936
+ if (typeof schedule !== 'undefined') {
19937
+ payload['schedule'] = schedule;
20368
19938
  }
20369
- if (typeof message === 'undefined') {
20370
- throw new AppwriteException('Missing required parameter: "message"');
19939
+ if (typeof active !== 'undefined') {
19940
+ payload['active'] = active;
20371
19941
  }
20372
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
20373
- const payload = {};
20374
- if (typeof message !== 'undefined') {
20375
- payload['message'] = message;
19942
+ if (typeof data !== 'undefined') {
19943
+ payload['data'] = data;
20376
19944
  }
20377
19945
  const uri = new URL(this.client.config.endpoint + apiPath);
20378
19946
  const apiHeaders = {
20379
19947
  'content-type': 'application/json',
20380
19948
  };
20381
- return this.client.call('patch', uri, apiHeaders, payload);
19949
+ return this.client.call('post', uri, apiHeaders, payload);
20382
19950
  }
20383
- updateSMSTemplate(paramsOrFirst, ...rest) {
19951
+ getSchedule(paramsOrFirst, ...rest) {
20384
19952
  let params;
20385
19953
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20386
19954
  params = (paramsOrFirst || {});
@@ -20388,39 +19956,24 @@ class Projects {
20388
19956
  else {
20389
19957
  params = {
20390
19958
  projectId: paramsOrFirst,
20391
- type: rest[0],
20392
- locale: rest[1],
20393
- message: rest[2]
19959
+ scheduleId: rest[0]
20394
19960
  };
20395
19961
  }
20396
19962
  const projectId = params.projectId;
20397
- const type = params.type;
20398
- const locale = params.locale;
20399
- const message = params.message;
19963
+ const scheduleId = params.scheduleId;
20400
19964
  if (typeof projectId === 'undefined') {
20401
19965
  throw new AppwriteException('Missing required parameter: "projectId"');
20402
19966
  }
20403
- if (typeof type === 'undefined') {
20404
- throw new AppwriteException('Missing required parameter: "type"');
20405
- }
20406
- if (typeof locale === 'undefined') {
20407
- throw new AppwriteException('Missing required parameter: "locale"');
20408
- }
20409
- if (typeof message === 'undefined') {
20410
- throw new AppwriteException('Missing required parameter: "message"');
19967
+ if (typeof scheduleId === 'undefined') {
19968
+ throw new AppwriteException('Missing required parameter: "scheduleId"');
20411
19969
  }
20412
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
19970
+ const apiPath = '/projects/{projectId}/schedules/{scheduleId}'.replace('{projectId}', projectId).replace('{scheduleId}', scheduleId);
20413
19971
  const payload = {};
20414
- if (typeof message !== 'undefined') {
20415
- payload['message'] = message;
20416
- }
20417
19972
  const uri = new URL(this.client.config.endpoint + apiPath);
20418
- const apiHeaders = {
20419
- 'content-type': 'application/json',
20420
- };
20421
- return this.client.call('patch', uri, apiHeaders, payload);
19973
+ const apiHeaders = {};
19974
+ return this.client.call('get', uri, apiHeaders, payload);
20422
19975
  }
20423
- deleteSmsTemplate(paramsOrFirst, ...rest) {
19976
+ updateStatus(paramsOrFirst, ...rest) {
20424
19977
  let params;
20425
19978
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20426
19979
  params = (paramsOrFirst || {});
@@ -20428,31 +19981,29 @@ class Projects {
20428
19981
  else {
20429
19982
  params = {
20430
19983
  projectId: paramsOrFirst,
20431
- type: rest[0],
20432
- locale: rest[1]
19984
+ status: rest[0]
20433
19985
  };
20434
19986
  }
20435
19987
  const projectId = params.projectId;
20436
- const type = params.type;
20437
- const locale = params.locale;
19988
+ const status = params.status;
20438
19989
  if (typeof projectId === 'undefined') {
20439
19990
  throw new AppwriteException('Missing required parameter: "projectId"');
20440
19991
  }
20441
- if (typeof type === 'undefined') {
20442
- throw new AppwriteException('Missing required parameter: "type"');
20443
- }
20444
- if (typeof locale === 'undefined') {
20445
- throw new AppwriteException('Missing required parameter: "locale"');
19992
+ if (typeof status === 'undefined') {
19993
+ throw new AppwriteException('Missing required parameter: "status"');
20446
19994
  }
20447
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
19995
+ const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
20448
19996
  const payload = {};
19997
+ if (typeof status !== 'undefined') {
19998
+ payload['status'] = status;
19999
+ }
20449
20000
  const uri = new URL(this.client.config.endpoint + apiPath);
20450
20001
  const apiHeaders = {
20451
20002
  'content-type': 'application/json',
20452
20003
  };
20453
- return this.client.call('delete', uri, apiHeaders, payload);
20004
+ return this.client.call('patch', uri, apiHeaders, payload);
20454
20005
  }
20455
- deleteSMSTemplate(paramsOrFirst, ...rest) {
20006
+ updateTeam(paramsOrFirst, ...rest) {
20456
20007
  let params;
20457
20008
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
20458
20009
  params = (paramsOrFirst || {});
@@ -20460,29 +20011,27 @@ class Projects {
20460
20011
  else {
20461
20012
  params = {
20462
20013
  projectId: paramsOrFirst,
20463
- type: rest[0],
20464
- locale: rest[1]
20014
+ teamId: rest[0]
20465
20015
  };
20466
20016
  }
20467
20017
  const projectId = params.projectId;
20468
- const type = params.type;
20469
- const locale = params.locale;
20018
+ const teamId = params.teamId;
20470
20019
  if (typeof projectId === 'undefined') {
20471
20020
  throw new AppwriteException('Missing required parameter: "projectId"');
20472
20021
  }
20473
- if (typeof type === 'undefined') {
20474
- throw new AppwriteException('Missing required parameter: "type"');
20475
- }
20476
- if (typeof locale === 'undefined') {
20477
- throw new AppwriteException('Missing required parameter: "locale"');
20022
+ if (typeof teamId === 'undefined') {
20023
+ throw new AppwriteException('Missing required parameter: "teamId"');
20478
20024
  }
20479
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
20025
+ const apiPath = '/projects/{projectId}/team'.replace('{projectId}', projectId);
20480
20026
  const payload = {};
20027
+ if (typeof teamId !== 'undefined') {
20028
+ payload['teamId'] = teamId;
20029
+ }
20481
20030
  const uri = new URL(this.client.config.endpoint + apiPath);
20482
20031
  const apiHeaders = {
20483
20032
  'content-type': 'application/json',
20484
20033
  };
20485
- return this.client.call('delete', uri, apiHeaders, payload);
20034
+ return this.client.call('patch', uri, apiHeaders, payload);
20486
20035
  }
20487
20036
  }
20488
20037
 
@@ -29654,17 +29203,13 @@ class Realtime {
29654
29203
  this.TYPE_EVENT = 'event';
29655
29204
  this.TYPE_PONG = 'pong';
29656
29205
  this.TYPE_CONNECTED = 'connected';
29206
+ this.TYPE_RESPONSE = 'response';
29657
29207
  this.DEBOUNCE_MS = 1;
29658
29208
  this.HEARTBEAT_INTERVAL = 20000; // 20 seconds in milliseconds
29659
- // Slot-centric state: Map<slot, { channels: Set<string>, queries: string[], callback: Function }>
29660
29209
  this.activeSubscriptions = new Map();
29661
- // Map slot index -> subscriptionId (from backend)
29662
- this.slotToSubscriptionId = new Map();
29663
- // Inverse map: subscriptionId -> slot index (for O(1) lookup)
29664
- this.subscriptionIdToSlot = new Map();
29210
+ this.pendingSubscribes = new Map();
29665
29211
  this.subCallDepth = 0;
29666
29212
  this.reconnectAttempts = 0;
29667
- this.subscriptionsCounter = 0;
29668
29213
  this.connectionId = 0;
29669
29214
  this.reconnect = true;
29670
29215
  this.onErrorCallbacks = [];
@@ -29701,15 +29246,15 @@ class Realtime {
29701
29246
  }
29702
29247
  startHeartbeat() {
29703
29248
  this.stopHeartbeat();
29704
- this.heartbeatTimer = window.setInterval(() => {
29249
+ this.heartbeatTimer = window === null || window === void 0 ? void 0 : window.setInterval(() => {
29705
29250
  if (this.socket && this.socket.readyState === WebSocket.OPEN) {
29706
- this.socket.send(JSON.stringify({ type: 'ping' }));
29251
+ this.socket.send(JSONbig.stringify({ type: 'ping' }));
29707
29252
  }
29708
29253
  }, this.HEARTBEAT_INTERVAL);
29709
29254
  }
29710
29255
  stopHeartbeat() {
29711
29256
  if (this.heartbeatTimer) {
29712
- window.clearInterval(this.heartbeatTimer);
29257
+ window === null || window === void 0 ? void 0 : window.clearInterval(this.heartbeatTimer);
29713
29258
  this.heartbeatTimer = undefined;
29714
29259
  }
29715
29260
  }
@@ -29724,36 +29269,8 @@ class Realtime {
29724
29269
  if (!projectId) {
29725
29270
  throw new AppwriteException('Missing project ID');
29726
29271
  }
29727
- // Collect all unique channels from all slots
29728
- const allChannels = new Set();
29729
- for (const subscription of this.activeSubscriptions.values()) {
29730
- for (const channel of subscription.channels) {
29731
- allChannels.add(channel);
29732
- }
29733
- }
29734
- let queryParams = `project=${projectId}`;
29735
- for (const channel of allChannels) {
29736
- queryParams += `&channels[]=${encodeURIComponent(channel)}`;
29737
- }
29738
- // Build query string from slots → channels → queries
29739
- // Format: channel[slot][]=query
29740
- // For each slot, repeat its queries under each channel it subscribes to
29741
- // Example: slot 1 → channels [tests, prod], queries [q1, q2]
29742
- // Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
29743
- const selectAllQuery = Query.select(['*']).toString();
29744
- for (const [slot, subscription] of this.activeSubscriptions) {
29745
- // queries is string[] - iterate over each query string
29746
- const queries = subscription.queries.length === 0
29747
- ? [selectAllQuery]
29748
- : subscription.queries;
29749
- // Repeat this slot's queries under each channel it subscribes to
29750
- // Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
29751
- for (const channel of subscription.channels) {
29752
- for (const query of queries) {
29753
- queryParams += `&${encodeURIComponent(channel)}[${slot}][]=${encodeURIComponent(query)}`;
29754
- }
29755
- }
29756
- }
29272
+ // URL carries only the project; channels/queries are sent via the subscribe message.
29273
+ const queryParams = `project=${projectId}`;
29757
29274
  const endpoint = this.client.config.endpointRealtime !== ''
29758
29275
  ? this.client.config.endpointRealtime
29759
29276
  : this.client.config.endpoint || '';
@@ -29787,7 +29304,7 @@ class Realtime {
29787
29304
  return;
29788
29305
  }
29789
29306
  try {
29790
- const message = JSON.parse(event.data);
29307
+ const message = JSONbig.parse(event.data);
29791
29308
  this.handleMessage(message);
29792
29309
  }
29793
29310
  catch (error) {
@@ -29872,6 +29389,67 @@ class Realtime {
29872
29389
  sleep(ms) {
29873
29390
  return new Promise(resolve => setTimeout(resolve, ms));
29874
29391
  }
29392
+ sendUnsubscribeMessage(subscriptionIds) {
29393
+ const ids = subscriptionIds.filter(id => typeof id === 'string' && id.length > 0);
29394
+ if (ids.length === 0) {
29395
+ return;
29396
+ }
29397
+ if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {
29398
+ return;
29399
+ }
29400
+ this.socket.send(JSONbig.stringify({
29401
+ type: 'unsubscribe',
29402
+ data: ids.map(subscriptionId => ({ subscriptionId }))
29403
+ }));
29404
+ }
29405
+ generateUniqueSubscriptionId() {
29406
+ const attempts = this.activeSubscriptions.size + 1;
29407
+ for (let i = 0; i < attempts; i++) {
29408
+ const id = ID.unique();
29409
+ if (!this.activeSubscriptions.has(id)) {
29410
+ return id;
29411
+ }
29412
+ }
29413
+ throw new AppwriteException('Failed to generate unique subscription id');
29414
+ }
29415
+ enqueuePendingSubscribe(subscriptionId) {
29416
+ var _a;
29417
+ const subscription = this.activeSubscriptions.get(subscriptionId);
29418
+ if (!subscription) {
29419
+ return;
29420
+ }
29421
+ this.pendingSubscribes.set(subscriptionId, {
29422
+ subscriptionId,
29423
+ channels: Array.from(subscription.channels),
29424
+ queries: (_a = subscription.queries) !== null && _a !== void 0 ? _a : []
29425
+ });
29426
+ }
29427
+ /**
29428
+ * Close the WebSocket connection and drop all active subscriptions client-side.
29429
+ * Use this instead of calling `unsubscribe()` on every subscription when you want to tear everything down.
29430
+ */
29431
+ disconnect() {
29432
+ return __awaiter(this, void 0, void 0, function* () {
29433
+ this.activeSubscriptions.clear();
29434
+ this.pendingSubscribes.clear();
29435
+ this.reconnect = false;
29436
+ yield this.closeSocket();
29437
+ });
29438
+ }
29439
+ sendPendingSubscribes() {
29440
+ if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {
29441
+ return;
29442
+ }
29443
+ if (this.pendingSubscribes.size < 1) {
29444
+ return;
29445
+ }
29446
+ const rows = Array.from(this.pendingSubscribes.values());
29447
+ this.pendingSubscribes.clear();
29448
+ this.socket.send(JSONbig.stringify({
29449
+ type: 'subscribe',
29450
+ data: rows
29451
+ }));
29452
+ }
29875
29453
  /**
29876
29454
  * Convert a channel value to a string
29877
29455
  *
@@ -29911,38 +29489,86 @@ class Realtime {
29911
29489
  queryStrings.push(typeof q === 'string' ? q : q.toString());
29912
29490
  }
29913
29491
  }
29914
- // Allocate a new slot index
29915
- this.subscriptionsCounter++;
29916
- const slot = this.subscriptionsCounter;
29917
- // Store slot-centric data: channels, queries, and callback belong to the slot
29918
- // queries is stored as string[] (array of query strings)
29919
- // No channel mutation occurs here - channels are derived from slots in createSocket()
29920
- this.activeSubscriptions.set(slot, {
29492
+ const subscriptionId = this.generateUniqueSubscriptionId();
29493
+ this.activeSubscriptions.set(subscriptionId, {
29921
29494
  channels,
29922
29495
  queries: queryStrings,
29923
29496
  callback
29924
29497
  });
29498
+ this.enqueuePendingSubscribe(subscriptionId);
29925
29499
  this.subCallDepth++;
29926
- yield this.sleep(this.DEBOUNCE_MS);
29927
- if (this.subCallDepth === 1) {
29928
- yield this.createSocket();
29500
+ try {
29501
+ yield this.sleep(this.DEBOUNCE_MS);
29502
+ if (this.subCallDepth === 1) {
29503
+ if (!this.socket || this.socket.readyState > WebSocket.OPEN) {
29504
+ yield this.createSocket();
29505
+ }
29506
+ else if (this.socket.readyState === WebSocket.OPEN) {
29507
+ this.sendPendingSubscribes();
29508
+ }
29509
+ }
29510
+ }
29511
+ finally {
29512
+ this.subCallDepth--;
29929
29513
  }
29930
- this.subCallDepth--;
29931
- return {
29932
- close: () => __awaiter(this, void 0, void 0, function* () {
29933
- const subscriptionId = this.slotToSubscriptionId.get(slot);
29934
- this.activeSubscriptions.delete(slot);
29935
- this.slotToSubscriptionId.delete(slot);
29936
- if (subscriptionId) {
29937
- this.subscriptionIdToSlot.delete(subscriptionId);
29514
+ const unsubscribe = () => __awaiter(this, void 0, void 0, function* () {
29515
+ if (!this.activeSubscriptions.has(subscriptionId)) {
29516
+ return;
29517
+ }
29518
+ this.activeSubscriptions.delete(subscriptionId);
29519
+ this.pendingSubscribes.delete(subscriptionId);
29520
+ this.sendUnsubscribeMessage([subscriptionId]);
29521
+ });
29522
+ const update = (changes) => __awaiter(this, void 0, void 0, function* () {
29523
+ const subscription = this.activeSubscriptions.get(subscriptionId);
29524
+ if (!subscription) {
29525
+ return;
29526
+ }
29527
+ if (changes.channels !== undefined) {
29528
+ const nextChannelStrings = changes.channels.map(ch => this.channelToString(ch));
29529
+ subscription.channels = new Set(nextChannelStrings);
29530
+ }
29531
+ if (changes.queries !== undefined) {
29532
+ const nextQueries = [];
29533
+ for (const q of changes.queries) {
29534
+ if (Array.isArray(q)) {
29535
+ for (const inner of q) {
29536
+ nextQueries.push(typeof inner === 'string' ? inner : inner.toString());
29537
+ }
29538
+ }
29539
+ else {
29540
+ nextQueries.push(typeof q === 'string' ? q : q.toString());
29541
+ }
29938
29542
  }
29939
- yield this.createSocket();
29940
- })
29941
- };
29543
+ subscription.queries = nextQueries;
29544
+ }
29545
+ this.enqueuePendingSubscribe(subscriptionId);
29546
+ this.subCallDepth++;
29547
+ try {
29548
+ yield this.sleep(this.DEBOUNCE_MS);
29549
+ if (this.subCallDepth === 1) {
29550
+ if (!this.socket || this.socket.readyState > WebSocket.OPEN) {
29551
+ yield this.createSocket();
29552
+ }
29553
+ else if (this.socket.readyState === WebSocket.OPEN) {
29554
+ this.sendPendingSubscribes();
29555
+ }
29556
+ }
29557
+ }
29558
+ finally {
29559
+ this.subCallDepth--;
29560
+ }
29561
+ });
29562
+ const close = () => __awaiter(this, void 0, void 0, function* () {
29563
+ yield unsubscribe();
29564
+ if (this.activeSubscriptions.size === 0) {
29565
+ this.reconnect = false;
29566
+ yield this.closeSocket();
29567
+ }
29568
+ });
29569
+ return { unsubscribe, update, close };
29942
29570
  });
29943
29571
  }
29944
- // cleanUp is no longer needed - slots are removed directly in subscribe().close()
29945
- // Channels are automatically rebuilt from remaining slots in createSocket()
29946
29572
  handleMessage(message) {
29947
29573
  if (!message.type) {
29948
29574
  return;
@@ -29960,6 +29586,9 @@ class Realtime {
29960
29586
  case this.TYPE_PONG:
29961
29587
  // Handle pong response if needed
29962
29588
  break;
29589
+ case this.TYPE_RESPONSE:
29590
+ this.handleResponseAction(message);
29591
+ break;
29963
29592
  }
29964
29593
  }
29965
29594
  handleResponseConnected(message) {
@@ -29968,23 +29597,10 @@ class Realtime {
29968
29597
  return;
29969
29598
  }
29970
29599
  const messageData = message.data;
29971
- // Store subscription ID mappings from backend
29972
- // Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
29973
- if (messageData.subscriptions) {
29974
- this.slotToSubscriptionId.clear();
29975
- this.subscriptionIdToSlot.clear();
29976
- for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
29977
- const slot = Number(slotStr);
29978
- if (!isNaN(slot)) {
29979
- this.slotToSubscriptionId.set(slot, subscriptionId);
29980
- this.subscriptionIdToSlot.set(subscriptionId, slot);
29981
- }
29982
- }
29983
- }
29984
29600
  let session = this.client.config.session;
29985
29601
  if (!session) {
29986
29602
  try {
29987
- const cookie = JSON.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
29603
+ const cookie = JSONbig.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
29988
29604
  session = cookie === null || cookie === void 0 ? void 0 : cookie[`a_session_${this.client.config.project}`];
29989
29605
  }
29990
29606
  catch (error) {
@@ -29992,13 +29608,17 @@ class Realtime {
29992
29608
  }
29993
29609
  }
29994
29610
  if (session && !messageData.user) {
29995
- (_b = this.socket) === null || _b === void 0 ? void 0 : _b.send(JSON.stringify({
29611
+ (_b = this.socket) === null || _b === void 0 ? void 0 : _b.send(JSONbig.stringify({
29996
29612
  type: 'authentication',
29997
29613
  data: {
29998
29614
  session
29999
29615
  }
30000
29616
  }));
30001
29617
  }
29618
+ for (const subscriptionId of this.activeSubscriptions.keys()) {
29619
+ this.enqueuePendingSubscribe(subscriptionId);
29620
+ }
29621
+ this.sendPendingSubscribes();
30002
29622
  }
30003
29623
  handleResponseError(message) {
30004
29624
  var _a, _b;
@@ -30019,25 +29639,25 @@ class Realtime {
30019
29639
  if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) {
30020
29640
  return;
30021
29641
  }
30022
- // Iterate over all matching subscriptionIds and call callback for each
30023
29642
  for (const subscriptionId of subscriptions) {
30024
- // O(1) lookup using subscriptionId
30025
- const slot = this.subscriptionIdToSlot.get(subscriptionId);
30026
- if (slot !== undefined) {
30027
- const subscription = this.activeSubscriptions.get(slot);
30028
- if (subscription) {
30029
- const response = {
30030
- events,
30031
- channels,
30032
- timestamp,
30033
- payload,
30034
- subscriptions
30035
- };
30036
- subscription.callback(response);
30037
- }
29643
+ const subscription = this.activeSubscriptions.get(subscriptionId);
29644
+ if (!subscription) {
29645
+ continue;
30038
29646
  }
29647
+ subscription.callback({
29648
+ events,
29649
+ channels,
29650
+ timestamp,
29651
+ payload,
29652
+ subscriptions
29653
+ });
30039
29654
  }
30040
29655
  }
29656
+ handleResponseAction(_message) {
29657
+ // The SDK generates subscriptionIds client-side and sends them on every
29658
+ // subscribe/unsubscribe, so subscribe/unsubscribe acks carry no state
29659
+ // the SDK needs to reconcile.
29660
+ }
30041
29661
  }
30042
29662
 
30043
29663
  /**
@@ -30188,46 +29808,6 @@ class Role {
30188
29808
  }
30189
29809
  }
30190
29810
 
30191
- var _a, _ID_hexTimestamp;
30192
- /**
30193
- * Helper class to generate ID strings for resources.
30194
- */
30195
- class ID {
30196
- /**
30197
- * Uses the provided ID as the ID for the resource.
30198
- *
30199
- * @param {string} id
30200
- * @returns {string}
30201
- */
30202
- static custom(id) {
30203
- return id;
30204
- }
30205
- /**
30206
- * Have Appwrite generate a unique ID for you.
30207
- *
30208
- * @param {number} padding. Default is 7.
30209
- * @returns {string}
30210
- */
30211
- static unique(padding = 7) {
30212
- // Generate a unique ID with padding to have a longer ID
30213
- const baseId = __classPrivateFieldGet(_a, _a, "m", _ID_hexTimestamp).call(_a);
30214
- let randomPadding = '';
30215
- for (let i = 0; i < padding; i++) {
30216
- const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
30217
- randomPadding += randomHexDigit;
30218
- }
30219
- return baseId + randomPadding;
30220
- }
30221
- }
30222
- _a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
30223
- const now = new Date();
30224
- const sec = Math.floor(now.getTime() / 1000);
30225
- const msec = now.getMilliseconds();
30226
- // Convert to hexadecimal
30227
- const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0');
30228
- return hexTimestamp;
30229
- };
30230
-
30231
29811
  function normalize(id) {
30232
29812
  if (id === undefined || id === null) {
30233
29813
  throw new Error("Channel ID is required");
@@ -30671,6 +30251,8 @@ var Scopes;
30671
30251
  Scopes["PlatformsRead"] = "platforms.read";
30672
30252
  Scopes["PlatformsWrite"] = "platforms.write";
30673
30253
  Scopes["PoliciesWrite"] = "policies.write";
30254
+ Scopes["TemplatesRead"] = "templates.read";
30255
+ Scopes["TemplatesWrite"] = "templates.write";
30674
30256
  Scopes["PoliciesRead"] = "policies.read";
30675
30257
  Scopes["ArchivesRead"] = "archives.read";
30676
30258
  Scopes["ArchivesWrite"] = "archives.write";
@@ -31555,9 +31137,6 @@ var Runtime;
31555
31137
  Runtime["Pythonml311"] = "python-ml-3.11";
31556
31138
  Runtime["Pythonml312"] = "python-ml-3.12";
31557
31139
  Runtime["Pythonml313"] = "python-ml-3.13";
31558
- Runtime["Deno121"] = "deno-1.21";
31559
- Runtime["Deno124"] = "deno-1.24";
31560
- Runtime["Deno135"] = "deno-1.35";
31561
31140
  Runtime["Deno140"] = "deno-1.40";
31562
31141
  Runtime["Deno146"] = "deno-1.46";
31563
31142
  Runtime["Deno20"] = "deno-2.0";
@@ -31650,9 +31229,6 @@ var Runtimes;
31650
31229
  Runtimes["Pythonml311"] = "python-ml-3.11";
31651
31230
  Runtimes["Pythonml312"] = "python-ml-3.12";
31652
31231
  Runtimes["Pythonml313"] = "python-ml-3.13";
31653
- Runtimes["Deno121"] = "deno-1.21";
31654
- Runtimes["Deno124"] = "deno-1.24";
31655
- Runtimes["Deno135"] = "deno-1.35";
31656
31232
  Runtimes["Deno140"] = "deno-1.40";
31657
31233
  Runtimes["Deno146"] = "deno-1.46";
31658
31234
  Runtimes["Deno20"] = "deno-2.0";
@@ -31897,51 +31473,11 @@ var ServiceId;
31897
31473
  ServiceId["Messaging"] = "messaging";
31898
31474
  })(ServiceId || (ServiceId = {}));
31899
31475
 
31900
- var ProjectUsageRange;
31901
- (function (ProjectUsageRange) {
31902
- ProjectUsageRange["OneHour"] = "1h";
31903
- ProjectUsageRange["OneDay"] = "1d";
31904
- })(ProjectUsageRange || (ProjectUsageRange = {}));
31905
-
31906
- var Region;
31907
- (function (Region) {
31908
- Region["Fra"] = "fra";
31909
- Region["Nyc"] = "nyc";
31910
- Region["Syd"] = "syd";
31911
- Region["Sfo"] = "sfo";
31912
- Region["Sgp"] = "sgp";
31913
- Region["Tor"] = "tor";
31914
- })(Region || (Region = {}));
31915
-
31916
- var AuthMethod;
31917
- (function (AuthMethod) {
31918
- AuthMethod["Emailpassword"] = "email-password";
31919
- AuthMethod["Magicurl"] = "magic-url";
31920
- AuthMethod["Emailotp"] = "email-otp";
31921
- AuthMethod["Anonymous"] = "anonymous";
31922
- AuthMethod["Invites"] = "invites";
31923
- AuthMethod["Jwt"] = "jwt";
31924
- AuthMethod["Phone"] = "phone";
31925
- })(AuthMethod || (AuthMethod = {}));
31926
-
31927
- var ResourceType;
31928
- (function (ResourceType) {
31929
- ResourceType["Function"] = "function";
31930
- ResourceType["Execution"] = "execution";
31931
- ResourceType["Message"] = "message";
31932
- ResourceType["Backup"] = "backup";
31933
- })(ResourceType || (ResourceType = {}));
31934
-
31935
- var SMTPSecure;
31936
- (function (SMTPSecure) {
31937
- SMTPSecure["Tls"] = "tls";
31938
- SMTPSecure["Ssl"] = "ssl";
31939
- })(SMTPSecure || (SMTPSecure = {}));
31940
-
31941
- var Status;
31942
- (function (Status) {
31943
- Status["Active"] = "active";
31944
- })(Status || (Status = {}));
31476
+ var Secure;
31477
+ (function (Secure) {
31478
+ Secure["Tls"] = "tls";
31479
+ Secure["Ssl"] = "ssl";
31480
+ })(Secure || (Secure = {}));
31945
31481
 
31946
31482
  var EmailTemplateType;
31947
31483
  (function (EmailTemplateType) {
@@ -32089,148 +31625,45 @@ var EmailTemplateLocale;
32089
31625
  EmailTemplateLocale["Zu"] = "zu";
32090
31626
  })(EmailTemplateLocale || (EmailTemplateLocale = {}));
32091
31627
 
32092
- var SmsTemplateType;
32093
- (function (SmsTemplateType) {
32094
- SmsTemplateType["Verification"] = "verification";
32095
- SmsTemplateType["Login"] = "login";
32096
- SmsTemplateType["Invitation"] = "invitation";
32097
- SmsTemplateType["MfaChallenge"] = "mfaChallenge";
32098
- })(SmsTemplateType || (SmsTemplateType = {}));
31628
+ var ProjectUsageRange;
31629
+ (function (ProjectUsageRange) {
31630
+ ProjectUsageRange["OneHour"] = "1h";
31631
+ ProjectUsageRange["OneDay"] = "1d";
31632
+ })(ProjectUsageRange || (ProjectUsageRange = {}));
31633
+
31634
+ var Region;
31635
+ (function (Region) {
31636
+ Region["Fra"] = "fra";
31637
+ Region["Nyc"] = "nyc";
31638
+ Region["Syd"] = "syd";
31639
+ Region["Sfo"] = "sfo";
31640
+ Region["Sgp"] = "sgp";
31641
+ Region["Tor"] = "tor";
31642
+ })(Region || (Region = {}));
31643
+
31644
+ var AuthMethod;
31645
+ (function (AuthMethod) {
31646
+ AuthMethod["Emailpassword"] = "email-password";
31647
+ AuthMethod["Magicurl"] = "magic-url";
31648
+ AuthMethod["Emailotp"] = "email-otp";
31649
+ AuthMethod["Anonymous"] = "anonymous";
31650
+ AuthMethod["Invites"] = "invites";
31651
+ AuthMethod["Jwt"] = "jwt";
31652
+ AuthMethod["Phone"] = "phone";
31653
+ })(AuthMethod || (AuthMethod = {}));
31654
+
31655
+ var ResourceType;
31656
+ (function (ResourceType) {
31657
+ ResourceType["Function"] = "function";
31658
+ ResourceType["Execution"] = "execution";
31659
+ ResourceType["Message"] = "message";
31660
+ ResourceType["Backup"] = "backup";
31661
+ })(ResourceType || (ResourceType = {}));
32099
31662
 
32100
- var SmsTemplateLocale;
32101
- (function (SmsTemplateLocale) {
32102
- SmsTemplateLocale["Af"] = "af";
32103
- SmsTemplateLocale["Arae"] = "ar-ae";
32104
- SmsTemplateLocale["Arbh"] = "ar-bh";
32105
- SmsTemplateLocale["Ardz"] = "ar-dz";
32106
- SmsTemplateLocale["Areg"] = "ar-eg";
32107
- SmsTemplateLocale["Ariq"] = "ar-iq";
32108
- SmsTemplateLocale["Arjo"] = "ar-jo";
32109
- SmsTemplateLocale["Arkw"] = "ar-kw";
32110
- SmsTemplateLocale["Arlb"] = "ar-lb";
32111
- SmsTemplateLocale["Arly"] = "ar-ly";
32112
- SmsTemplateLocale["Arma"] = "ar-ma";
32113
- SmsTemplateLocale["Arom"] = "ar-om";
32114
- SmsTemplateLocale["Arqa"] = "ar-qa";
32115
- SmsTemplateLocale["Arsa"] = "ar-sa";
32116
- SmsTemplateLocale["Arsy"] = "ar-sy";
32117
- SmsTemplateLocale["Artn"] = "ar-tn";
32118
- SmsTemplateLocale["Arye"] = "ar-ye";
32119
- SmsTemplateLocale["As"] = "as";
32120
- SmsTemplateLocale["Az"] = "az";
32121
- SmsTemplateLocale["Be"] = "be";
32122
- SmsTemplateLocale["Bg"] = "bg";
32123
- SmsTemplateLocale["Bh"] = "bh";
32124
- SmsTemplateLocale["Bn"] = "bn";
32125
- SmsTemplateLocale["Bs"] = "bs";
32126
- SmsTemplateLocale["Ca"] = "ca";
32127
- SmsTemplateLocale["Cs"] = "cs";
32128
- SmsTemplateLocale["Cy"] = "cy";
32129
- SmsTemplateLocale["Da"] = "da";
32130
- SmsTemplateLocale["De"] = "de";
32131
- SmsTemplateLocale["Deat"] = "de-at";
32132
- SmsTemplateLocale["Dech"] = "de-ch";
32133
- SmsTemplateLocale["Deli"] = "de-li";
32134
- SmsTemplateLocale["Delu"] = "de-lu";
32135
- SmsTemplateLocale["El"] = "el";
32136
- SmsTemplateLocale["En"] = "en";
32137
- SmsTemplateLocale["Enau"] = "en-au";
32138
- SmsTemplateLocale["Enbz"] = "en-bz";
32139
- SmsTemplateLocale["Enca"] = "en-ca";
32140
- SmsTemplateLocale["Engb"] = "en-gb";
32141
- SmsTemplateLocale["Enie"] = "en-ie";
32142
- SmsTemplateLocale["Enjm"] = "en-jm";
32143
- SmsTemplateLocale["Ennz"] = "en-nz";
32144
- SmsTemplateLocale["Entt"] = "en-tt";
32145
- SmsTemplateLocale["Enus"] = "en-us";
32146
- SmsTemplateLocale["Enza"] = "en-za";
32147
- SmsTemplateLocale["Eo"] = "eo";
32148
- SmsTemplateLocale["Es"] = "es";
32149
- SmsTemplateLocale["Esar"] = "es-ar";
32150
- SmsTemplateLocale["Esbo"] = "es-bo";
32151
- SmsTemplateLocale["Escl"] = "es-cl";
32152
- SmsTemplateLocale["Esco"] = "es-co";
32153
- SmsTemplateLocale["Escr"] = "es-cr";
32154
- SmsTemplateLocale["Esdo"] = "es-do";
32155
- SmsTemplateLocale["Esec"] = "es-ec";
32156
- SmsTemplateLocale["Esgt"] = "es-gt";
32157
- SmsTemplateLocale["Eshn"] = "es-hn";
32158
- SmsTemplateLocale["Esmx"] = "es-mx";
32159
- SmsTemplateLocale["Esni"] = "es-ni";
32160
- SmsTemplateLocale["Espa"] = "es-pa";
32161
- SmsTemplateLocale["Espe"] = "es-pe";
32162
- SmsTemplateLocale["Espr"] = "es-pr";
32163
- SmsTemplateLocale["Espy"] = "es-py";
32164
- SmsTemplateLocale["Essv"] = "es-sv";
32165
- SmsTemplateLocale["Esuy"] = "es-uy";
32166
- SmsTemplateLocale["Esve"] = "es-ve";
32167
- SmsTemplateLocale["Et"] = "et";
32168
- SmsTemplateLocale["Eu"] = "eu";
32169
- SmsTemplateLocale["Fa"] = "fa";
32170
- SmsTemplateLocale["Fi"] = "fi";
32171
- SmsTemplateLocale["Fo"] = "fo";
32172
- SmsTemplateLocale["Fr"] = "fr";
32173
- SmsTemplateLocale["Frbe"] = "fr-be";
32174
- SmsTemplateLocale["Frca"] = "fr-ca";
32175
- SmsTemplateLocale["Frch"] = "fr-ch";
32176
- SmsTemplateLocale["Frlu"] = "fr-lu";
32177
- SmsTemplateLocale["Ga"] = "ga";
32178
- SmsTemplateLocale["Gd"] = "gd";
32179
- SmsTemplateLocale["He"] = "he";
32180
- SmsTemplateLocale["Hi"] = "hi";
32181
- SmsTemplateLocale["Hr"] = "hr";
32182
- SmsTemplateLocale["Hu"] = "hu";
32183
- SmsTemplateLocale["Id"] = "id";
32184
- SmsTemplateLocale["Is"] = "is";
32185
- SmsTemplateLocale["It"] = "it";
32186
- SmsTemplateLocale["Itch"] = "it-ch";
32187
- SmsTemplateLocale["Ja"] = "ja";
32188
- SmsTemplateLocale["Ji"] = "ji";
32189
- SmsTemplateLocale["Ko"] = "ko";
32190
- SmsTemplateLocale["Ku"] = "ku";
32191
- SmsTemplateLocale["Lt"] = "lt";
32192
- SmsTemplateLocale["Lv"] = "lv";
32193
- SmsTemplateLocale["Mk"] = "mk";
32194
- SmsTemplateLocale["Ml"] = "ml";
32195
- SmsTemplateLocale["Ms"] = "ms";
32196
- SmsTemplateLocale["Mt"] = "mt";
32197
- SmsTemplateLocale["Nb"] = "nb";
32198
- SmsTemplateLocale["Ne"] = "ne";
32199
- SmsTemplateLocale["Nl"] = "nl";
32200
- SmsTemplateLocale["Nlbe"] = "nl-be";
32201
- SmsTemplateLocale["Nn"] = "nn";
32202
- SmsTemplateLocale["No"] = "no";
32203
- SmsTemplateLocale["Pa"] = "pa";
32204
- SmsTemplateLocale["Pl"] = "pl";
32205
- SmsTemplateLocale["Pt"] = "pt";
32206
- SmsTemplateLocale["Ptbr"] = "pt-br";
32207
- SmsTemplateLocale["Rm"] = "rm";
32208
- SmsTemplateLocale["Ro"] = "ro";
32209
- SmsTemplateLocale["Romd"] = "ro-md";
32210
- SmsTemplateLocale["Ru"] = "ru";
32211
- SmsTemplateLocale["Rumd"] = "ru-md";
32212
- SmsTemplateLocale["Sb"] = "sb";
32213
- SmsTemplateLocale["Sk"] = "sk";
32214
- SmsTemplateLocale["Sl"] = "sl";
32215
- SmsTemplateLocale["Sq"] = "sq";
32216
- SmsTemplateLocale["Sr"] = "sr";
32217
- SmsTemplateLocale["Sv"] = "sv";
32218
- SmsTemplateLocale["Svfi"] = "sv-fi";
32219
- SmsTemplateLocale["Th"] = "th";
32220
- SmsTemplateLocale["Tn"] = "tn";
32221
- SmsTemplateLocale["Tr"] = "tr";
32222
- SmsTemplateLocale["Ts"] = "ts";
32223
- SmsTemplateLocale["Ua"] = "ua";
32224
- SmsTemplateLocale["Ur"] = "ur";
32225
- SmsTemplateLocale["Ve"] = "ve";
32226
- SmsTemplateLocale["Vi"] = "vi";
32227
- SmsTemplateLocale["Xh"] = "xh";
32228
- SmsTemplateLocale["Zhcn"] = "zh-cn";
32229
- SmsTemplateLocale["Zhhk"] = "zh-hk";
32230
- SmsTemplateLocale["Zhsg"] = "zh-sg";
32231
- SmsTemplateLocale["Zhtw"] = "zh-tw";
32232
- SmsTemplateLocale["Zu"] = "zu";
32233
- })(SmsTemplateLocale || (SmsTemplateLocale = {}));
31663
+ var Status;
31664
+ (function (Status) {
31665
+ Status["Active"] = "active";
31666
+ })(Status || (Status = {}));
32234
31667
 
32235
31668
  var StatusCode;
32236
31669
  (function (StatusCode) {
@@ -32298,9 +31731,6 @@ var BuildRuntime;
32298
31731
  BuildRuntime["Pythonml311"] = "python-ml-3.11";
32299
31732
  BuildRuntime["Pythonml312"] = "python-ml-3.12";
32300
31733
  BuildRuntime["Pythonml313"] = "python-ml-3.13";
32301
- BuildRuntime["Deno121"] = "deno-1.21";
32302
- BuildRuntime["Deno124"] = "deno-1.24";
32303
- BuildRuntime["Deno135"] = "deno-1.35";
32304
31734
  BuildRuntime["Deno140"] = "deno-1.40";
32305
31735
  BuildRuntime["Deno146"] = "deno-1.46";
32306
31736
  BuildRuntime["Deno20"] = "deno-2.0";
@@ -32491,6 +31921,16 @@ var IndexStatus;
32491
31921
  IndexStatus["Failed"] = "failed";
32492
31922
  })(IndexStatus || (IndexStatus = {}));
32493
31923
 
31924
+ var DetectionFrameworkType;
31925
+ (function (DetectionFrameworkType) {
31926
+ DetectionFrameworkType["Framework"] = "framework";
31927
+ })(DetectionFrameworkType || (DetectionFrameworkType = {}));
31928
+
31929
+ var DetectionRuntimeType;
31930
+ (function (DetectionRuntimeType) {
31931
+ DetectionRuntimeType["Runtime"] = "runtime";
31932
+ })(DetectionRuntimeType || (DetectionRuntimeType = {}));
31933
+
32494
31934
  var DeploymentStatus;
32495
31935
  (function (DeploymentStatus) {
32496
31936
  DeploymentStatus["Waiting"] = "waiting";
@@ -32589,5 +32029,5 @@ var DomainPurchaseStatus;
32589
32029
  DomainPurchaseStatus["Cancelled"] = "cancelled";
32590
32030
  })(DomainPurchaseStatus || (DomainPurchaseStatus = {}));
32591
32031
 
32592
- export { Account, Activities, Adapter, Addon, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, Browser, BrowserPermission, BuildRuntime, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, CreditCard, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainTransferStatusEnum, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, ExecutionStatus, ExecutionTrigger, FilterType, FirebaseMigrationResource, Flag, Framework, Frameworks, Functions, Graphql, Health, HealthAntivirusStatus, HealthCheckStatus, ID, ImageFormat, ImageGravity, IndexStatus, Locale, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Model, NHostMigrationResource, Name, OAuthProvider, Operator, OrderBy, Organizations, PasswordHash, Permission, Platform, PlatformType, Project, ProjectUsageRange, Projects, ProtocolId, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Query, Realtime, Region, RegistrationType, RelationMutate, RelationshipType, ResourceType, Role, Runtime, Runtimes, SMTPSecure, Scopes, ServiceId, Sites, SmsTemplateLocale, SmsTemplateType, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Theme, Timezone, Tokens, UsageRange, UseCases, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, Webhooks };
32032
+ export { Account, Activities, Adapter, Addon, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, Browser, BrowserPermission, BuildRuntime, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, CreditCard, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainTransferStatusEnum, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, ExecutionStatus, ExecutionTrigger, FilterType, FirebaseMigrationResource, Flag, Framework, Frameworks, Functions, Graphql, Health, HealthAntivirusStatus, HealthCheckStatus, ID, ImageFormat, ImageGravity, IndexStatus, Locale, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Model, NHostMigrationResource, Name, OAuthProvider, Operator, OrderBy, Organizations, PasswordHash, Permission, Platform, PlatformType, Project, ProjectUsageRange, Projects, ProtocolId, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Query, Realtime, Region, RegistrationType, RelationMutate, RelationshipType, ResourceType, Role, Runtime, Runtimes, Scopes, Secure, ServiceId, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Theme, Timezone, Tokens, UsageRange, UseCases, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, Webhooks };
32593
32033
  //# sourceMappingURL=sdk.js.map