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