@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/iife/sdk.js CHANGED
@@ -39,6 +39,46 @@
39
39
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
40
40
  };
41
41
 
42
+ var _a, _ID_hexTimestamp;
43
+ /**
44
+ * Helper class to generate ID strings for resources.
45
+ */
46
+ class ID {
47
+ /**
48
+ * Uses the provided ID as the ID for the resource.
49
+ *
50
+ * @param {string} id
51
+ * @returns {string}
52
+ */
53
+ static custom(id) {
54
+ return id;
55
+ }
56
+ /**
57
+ * Have Appwrite generate a unique ID for you.
58
+ *
59
+ * @param {number} padding. Default is 7.
60
+ * @returns {string}
61
+ */
62
+ static unique(padding = 7) {
63
+ // Generate a unique ID with padding to have a longer ID
64
+ const baseId = __classPrivateFieldGet(_a, _a, "m", _ID_hexTimestamp).call(_a);
65
+ let randomPadding = '';
66
+ for (let i = 0; i < padding; i++) {
67
+ const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
68
+ randomPadding += randomHexDigit;
69
+ }
70
+ return baseId + randomPadding;
71
+ }
72
+ }
73
+ _a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
74
+ const now = new Date();
75
+ const sec = Math.floor(now.getTime() / 1000);
76
+ const msec = now.getMilliseconds();
77
+ // Convert to hexadecimal
78
+ const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0');
79
+ return hexTimestamp;
80
+ };
81
+
42
82
  function getDefaultExportFromCjs (x) {
43
83
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
44
84
  }
@@ -4378,8 +4418,8 @@
4378
4418
  'x-sdk-name': 'Console',
4379
4419
  'x-sdk-platform': 'console',
4380
4420
  'x-sdk-language': 'web',
4381
- 'x-sdk-version': '10.0.0',
4382
- 'X-Appwrite-Response-Format': '1.9.1',
4421
+ 'x-sdk-version': '11.0.0',
4422
+ 'X-Appwrite-Response-Format': '1.9.2',
4383
4423
  };
4384
4424
  this.realtime = {
4385
4425
  socket: undefined,
@@ -4387,11 +4427,8 @@
4387
4427
  heartbeat: undefined,
4388
4428
  url: '',
4389
4429
  channels: new Set(),
4390
- queries: new Set(),
4391
4430
  subscriptions: new Map(),
4392
- slotToSubscriptionId: new Map(),
4393
- subscriptionIdToSlot: new Map(),
4394
- subscriptionsCounter: 0,
4431
+ pendingSubscribes: new Map(),
4395
4432
  reconnect: true,
4396
4433
  reconnectAttempts: 0,
4397
4434
  lastMessage: undefined,
@@ -4425,27 +4462,15 @@
4425
4462
  }, 20000);
4426
4463
  },
4427
4464
  createSocket: () => {
4428
- var _a, _b, _c, _d;
4465
+ var _a, _b, _c, _d, _e;
4429
4466
  if (this.realtime.subscriptions.size < 1) {
4430
4467
  this.realtime.reconnect = false;
4431
4468
  (_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.close();
4432
4469
  return;
4433
4470
  }
4434
4471
  const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : '');
4435
- let queryParams = 'project=' + encodedProject;
4436
- this.realtime.channels.forEach(channel => {
4437
- queryParams += '&channels[]=' + encodeURIComponent(channel);
4438
- });
4439
- // Per-subscription queries: channel[slot][]=query so server can route events by subscription
4440
- const selectAllQuery = Query.select(['*']).toString();
4441
- this.realtime.subscriptions.forEach((sub, slot) => {
4442
- const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
4443
- sub.channels.forEach(channel => {
4444
- queries.forEach(query => {
4445
- queryParams += '&' + encodeURIComponent(channel) + '[' + slot + '][]=' + encodeURIComponent(query);
4446
- });
4447
- });
4448
- });
4472
+ // URL carries only the project; channels/queries are sent via subscribe message.
4473
+ const queryParams = 'project=' + encodedProject;
4449
4474
  const url = this.config.endpointRealtime + '/realtime?' + queryParams;
4450
4475
  if (url !== this.realtime.url || // Check if URL is present
4451
4476
  !this.realtime.socket || // Check if WebSocket has not been created
@@ -4481,6 +4506,23 @@
4481
4506
  }, timeout);
4482
4507
  });
4483
4508
  }
4509
+ else if (((_e = this.realtime.socket) === null || _e === void 0 ? void 0 : _e.readyState) === WebSocket.OPEN) {
4510
+ this.realtime.sendPendingSubscribes();
4511
+ }
4512
+ },
4513
+ sendPendingSubscribes: () => {
4514
+ if (!this.realtime.socket || this.realtime.socket.readyState !== WebSocket.OPEN) {
4515
+ return;
4516
+ }
4517
+ if (this.realtime.pendingSubscribes.size < 1) {
4518
+ return;
4519
+ }
4520
+ const rows = Array.from(this.realtime.pendingSubscribes.values());
4521
+ this.realtime.pendingSubscribes.clear();
4522
+ this.realtime.socket.send(JSONbig.stringify({
4523
+ type: 'subscribe',
4524
+ data: rows
4525
+ }));
4484
4526
  },
4485
4527
  onMessage: (event) => {
4486
4528
  var _a, _b;
@@ -4490,17 +4532,6 @@
4490
4532
  switch (message.type) {
4491
4533
  case 'connected': {
4492
4534
  const messageData = message.data;
4493
- if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
4494
- this.realtime.slotToSubscriptionId.clear();
4495
- this.realtime.subscriptionIdToSlot.clear();
4496
- for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
4497
- const slot = Number(slotStr);
4498
- if (!isNaN(slot) && typeof subscriptionId === 'string') {
4499
- this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
4500
- this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
4501
- }
4502
- }
4503
- }
4504
4535
  let session = this.config.session;
4505
4536
  if (!session) {
4506
4537
  const cookie = JSONbig.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
@@ -4514,8 +4545,22 @@
4514
4545
  }
4515
4546
  }));
4516
4547
  }
4548
+ this.realtime.subscriptions.forEach((sub, subscriptionId) => {
4549
+ var _a;
4550
+ this.realtime.pendingSubscribes.set(subscriptionId, {
4551
+ subscriptionId,
4552
+ channels: sub.channels,
4553
+ queries: (_a = sub.queries) !== null && _a !== void 0 ? _a : []
4554
+ });
4555
+ });
4556
+ this.realtime.sendPendingSubscribes();
4517
4557
  break;
4518
4558
  }
4559
+ case 'response':
4560
+ // The SDK generates subscriptionIds client-side and sends them on every
4561
+ // subscribe/unsubscribe, so subscribe/unsubscribe acks carry no state
4562
+ // the SDK needs to reconcile.
4563
+ break;
4519
4564
  case 'event': {
4520
4565
  const data = message.data;
4521
4566
  if (!(data === null || data === void 0 ? void 0 : data.channels))
@@ -4523,12 +4568,9 @@
4523
4568
  const eventSubIds = data.subscriptions;
4524
4569
  if (eventSubIds && eventSubIds.length > 0) {
4525
4570
  for (const subscriptionId of eventSubIds) {
4526
- const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
4527
- if (slot !== undefined) {
4528
- const subscription = this.realtime.subscriptions.get(slot);
4529
- if (subscription) {
4530
- setTimeout(() => subscription.callback(data));
4531
- }
4571
+ const subscription = this.realtime.subscriptions.get(subscriptionId);
4572
+ if (subscription) {
4573
+ setTimeout(() => subscription.callback(data));
4532
4574
  }
4533
4575
  }
4534
4576
  }
@@ -4555,29 +4597,6 @@
4555
4597
  catch (e) {
4556
4598
  console.error(e);
4557
4599
  }
4558
- },
4559
- cleanUp: (channels, queries) => {
4560
- this.realtime.channels.forEach(channel => {
4561
- if (channels.includes(channel)) {
4562
- let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
4563
- return subscription.channels.includes(channel);
4564
- });
4565
- if (!found) {
4566
- this.realtime.channels.delete(channel);
4567
- }
4568
- }
4569
- });
4570
- this.realtime.queries.forEach(query => {
4571
- if (queries.includes(query)) {
4572
- let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
4573
- var _a;
4574
- return (_a = subscription.queries) === null || _a === void 0 ? void 0 : _a.includes(query);
4575
- });
4576
- if (!found) {
4577
- this.realtime.queries.delete(query);
4578
- }
4579
- }
4580
- });
4581
4600
  }
4582
4601
  };
4583
4602
  }
@@ -4827,17 +4846,41 @@
4827
4846
  });
4828
4847
  channelStrings.forEach(channel => this.realtime.channels.add(channel));
4829
4848
  const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map(q => typeof q === 'string' ? q : q.toString());
4830
- queryStrings.forEach(query => this.realtime.queries.add(query));
4831
- const counter = this.realtime.subscriptionsCounter++;
4832
- this.realtime.subscriptions.set(counter, {
4849
+ let subscriptionId = '';
4850
+ const attempts = this.realtime.subscriptions.size + 1;
4851
+ for (let i = 0; i < attempts; i++) {
4852
+ const candidate = ID.unique();
4853
+ if (!this.realtime.subscriptions.has(candidate)) {
4854
+ subscriptionId = candidate;
4855
+ break;
4856
+ }
4857
+ }
4858
+ if (subscriptionId === '') {
4859
+ throw new AppwriteException('Failed to generate unique subscription id');
4860
+ }
4861
+ this.realtime.subscriptions.set(subscriptionId, {
4833
4862
  channels: channelStrings,
4834
4863
  queries: queryStrings,
4835
4864
  callback
4836
4865
  });
4866
+ this.realtime.pendingSubscribes.set(subscriptionId, {
4867
+ subscriptionId,
4868
+ channels: channelStrings,
4869
+ queries: queryStrings
4870
+ });
4837
4871
  this.realtime.connect();
4838
4872
  return () => {
4839
- this.realtime.subscriptions.delete(counter);
4840
- this.realtime.cleanUp(channelStrings, queryStrings);
4873
+ this.realtime.subscriptions.delete(subscriptionId);
4874
+ this.realtime.pendingSubscribes.delete(subscriptionId);
4875
+ const stillUsed = new Set();
4876
+ this.realtime.subscriptions.forEach(sub => {
4877
+ sub.channels.forEach(channel => stillUsed.add(channel));
4878
+ });
4879
+ this.realtime.channels.forEach(channel => {
4880
+ if (!stillUsed.has(channel)) {
4881
+ this.realtime.channels.delete(channel);
4882
+ }
4883
+ });
4841
4884
  this.realtime.connect();
4842
4885
  };
4843
4886
  }
@@ -22385,7 +22428,249 @@
22385
22428
  };
22386
22429
  return this.client.call('delete', uri, apiHeaders, payload);
22387
22430
  }
22388
- updateProtocolStatus(paramsOrFirst, ...rest) {
22431
+ updateMembershipPrivacyPolicy(paramsOrFirst, ...rest) {
22432
+ let params;
22433
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22434
+ params = (paramsOrFirst || {});
22435
+ }
22436
+ else {
22437
+ params = {
22438
+ userId: paramsOrFirst,
22439
+ userEmail: rest[0],
22440
+ userPhone: rest[1],
22441
+ userName: rest[2],
22442
+ userMFA: rest[3]
22443
+ };
22444
+ }
22445
+ const userId = params.userId;
22446
+ const userEmail = params.userEmail;
22447
+ const userPhone = params.userPhone;
22448
+ const userName = params.userName;
22449
+ const userMFA = params.userMFA;
22450
+ const apiPath = '/project/policies/membership-privacy';
22451
+ const payload = {};
22452
+ if (typeof userId !== 'undefined') {
22453
+ payload['userId'] = userId;
22454
+ }
22455
+ if (typeof userEmail !== 'undefined') {
22456
+ payload['userEmail'] = userEmail;
22457
+ }
22458
+ if (typeof userPhone !== 'undefined') {
22459
+ payload['userPhone'] = userPhone;
22460
+ }
22461
+ if (typeof userName !== 'undefined') {
22462
+ payload['userName'] = userName;
22463
+ }
22464
+ if (typeof userMFA !== 'undefined') {
22465
+ payload['userMFA'] = userMFA;
22466
+ }
22467
+ const uri = new URL(this.client.config.endpoint + apiPath);
22468
+ const apiHeaders = {
22469
+ 'content-type': 'application/json',
22470
+ };
22471
+ return this.client.call('patch', uri, apiHeaders, payload);
22472
+ }
22473
+ updatePasswordDictionaryPolicy(paramsOrFirst) {
22474
+ let params;
22475
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22476
+ params = (paramsOrFirst || {});
22477
+ }
22478
+ else {
22479
+ params = {
22480
+ enabled: paramsOrFirst
22481
+ };
22482
+ }
22483
+ const enabled = params.enabled;
22484
+ if (typeof enabled === 'undefined') {
22485
+ throw new AppwriteException('Missing required parameter: "enabled"');
22486
+ }
22487
+ const apiPath = '/project/policies/password-dictionary';
22488
+ const payload = {};
22489
+ if (typeof enabled !== 'undefined') {
22490
+ payload['enabled'] = enabled;
22491
+ }
22492
+ const uri = new URL(this.client.config.endpoint + apiPath);
22493
+ const apiHeaders = {
22494
+ 'content-type': 'application/json',
22495
+ };
22496
+ return this.client.call('patch', uri, apiHeaders, payload);
22497
+ }
22498
+ updatePasswordHistoryPolicy(paramsOrFirst) {
22499
+ let params;
22500
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22501
+ params = (paramsOrFirst || {});
22502
+ }
22503
+ else {
22504
+ params = {
22505
+ total: paramsOrFirst
22506
+ };
22507
+ }
22508
+ const total = params.total;
22509
+ if (typeof total === 'undefined') {
22510
+ throw new AppwriteException('Missing required parameter: "total"');
22511
+ }
22512
+ const apiPath = '/project/policies/password-history';
22513
+ const payload = {};
22514
+ if (typeof total !== 'undefined') {
22515
+ payload['total'] = total;
22516
+ }
22517
+ const uri = new URL(this.client.config.endpoint + apiPath);
22518
+ const apiHeaders = {
22519
+ 'content-type': 'application/json',
22520
+ };
22521
+ return this.client.call('patch', uri, apiHeaders, payload);
22522
+ }
22523
+ updatePasswordPersonalDataPolicy(paramsOrFirst) {
22524
+ let params;
22525
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22526
+ params = (paramsOrFirst || {});
22527
+ }
22528
+ else {
22529
+ params = {
22530
+ enabled: paramsOrFirst
22531
+ };
22532
+ }
22533
+ const enabled = params.enabled;
22534
+ if (typeof enabled === 'undefined') {
22535
+ throw new AppwriteException('Missing required parameter: "enabled"');
22536
+ }
22537
+ const apiPath = '/project/policies/password-personal-data';
22538
+ const payload = {};
22539
+ if (typeof enabled !== 'undefined') {
22540
+ payload['enabled'] = enabled;
22541
+ }
22542
+ const uri = new URL(this.client.config.endpoint + apiPath);
22543
+ const apiHeaders = {
22544
+ 'content-type': 'application/json',
22545
+ };
22546
+ return this.client.call('patch', uri, apiHeaders, payload);
22547
+ }
22548
+ updateSessionAlertPolicy(paramsOrFirst) {
22549
+ let params;
22550
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22551
+ params = (paramsOrFirst || {});
22552
+ }
22553
+ else {
22554
+ params = {
22555
+ enabled: paramsOrFirst
22556
+ };
22557
+ }
22558
+ const enabled = params.enabled;
22559
+ if (typeof enabled === 'undefined') {
22560
+ throw new AppwriteException('Missing required parameter: "enabled"');
22561
+ }
22562
+ const apiPath = '/project/policies/session-alert';
22563
+ const payload = {};
22564
+ if (typeof enabled !== 'undefined') {
22565
+ payload['enabled'] = enabled;
22566
+ }
22567
+ const uri = new URL(this.client.config.endpoint + apiPath);
22568
+ const apiHeaders = {
22569
+ 'content-type': 'application/json',
22570
+ };
22571
+ return this.client.call('patch', uri, apiHeaders, payload);
22572
+ }
22573
+ updateSessionDurationPolicy(paramsOrFirst) {
22574
+ let params;
22575
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22576
+ params = (paramsOrFirst || {});
22577
+ }
22578
+ else {
22579
+ params = {
22580
+ duration: paramsOrFirst
22581
+ };
22582
+ }
22583
+ const duration = params.duration;
22584
+ if (typeof duration === 'undefined') {
22585
+ throw new AppwriteException('Missing required parameter: "duration"');
22586
+ }
22587
+ const apiPath = '/project/policies/session-duration';
22588
+ const payload = {};
22589
+ if (typeof duration !== 'undefined') {
22590
+ payload['duration'] = duration;
22591
+ }
22592
+ const uri = new URL(this.client.config.endpoint + apiPath);
22593
+ const apiHeaders = {
22594
+ 'content-type': 'application/json',
22595
+ };
22596
+ return this.client.call('patch', uri, apiHeaders, payload);
22597
+ }
22598
+ updateSessionInvalidationPolicy(paramsOrFirst) {
22599
+ let params;
22600
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22601
+ params = (paramsOrFirst || {});
22602
+ }
22603
+ else {
22604
+ params = {
22605
+ enabled: paramsOrFirst
22606
+ };
22607
+ }
22608
+ const enabled = params.enabled;
22609
+ if (typeof enabled === 'undefined') {
22610
+ throw new AppwriteException('Missing required parameter: "enabled"');
22611
+ }
22612
+ const apiPath = '/project/policies/session-invalidation';
22613
+ const payload = {};
22614
+ if (typeof enabled !== 'undefined') {
22615
+ payload['enabled'] = enabled;
22616
+ }
22617
+ const uri = new URL(this.client.config.endpoint + apiPath);
22618
+ const apiHeaders = {
22619
+ 'content-type': 'application/json',
22620
+ };
22621
+ return this.client.call('patch', uri, apiHeaders, payload);
22622
+ }
22623
+ updateSessionLimitPolicy(paramsOrFirst) {
22624
+ let params;
22625
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22626
+ params = (paramsOrFirst || {});
22627
+ }
22628
+ else {
22629
+ params = {
22630
+ total: paramsOrFirst
22631
+ };
22632
+ }
22633
+ const total = params.total;
22634
+ if (typeof total === 'undefined') {
22635
+ throw new AppwriteException('Missing required parameter: "total"');
22636
+ }
22637
+ const apiPath = '/project/policies/session-limit';
22638
+ const payload = {};
22639
+ if (typeof total !== 'undefined') {
22640
+ payload['total'] = total;
22641
+ }
22642
+ const uri = new URL(this.client.config.endpoint + apiPath);
22643
+ const apiHeaders = {
22644
+ 'content-type': 'application/json',
22645
+ };
22646
+ return this.client.call('patch', uri, apiHeaders, payload);
22647
+ }
22648
+ updateUserLimitPolicy(paramsOrFirst) {
22649
+ let params;
22650
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22651
+ params = (paramsOrFirst || {});
22652
+ }
22653
+ else {
22654
+ params = {
22655
+ total: paramsOrFirst
22656
+ };
22657
+ }
22658
+ const total = params.total;
22659
+ if (typeof total === 'undefined') {
22660
+ throw new AppwriteException('Missing required parameter: "total"');
22661
+ }
22662
+ const apiPath = '/project/policies/user-limit';
22663
+ const payload = {};
22664
+ if (typeof total !== 'undefined') {
22665
+ payload['total'] = total;
22666
+ }
22667
+ const uri = new URL(this.client.config.endpoint + apiPath);
22668
+ const apiHeaders = {
22669
+ 'content-type': 'application/json',
22670
+ };
22671
+ return this.client.call('patch', uri, apiHeaders, payload);
22672
+ }
22673
+ updateProtocol(paramsOrFirst, ...rest) {
22389
22674
  let params;
22390
22675
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('protocolId' in paramsOrFirst || 'enabled' in paramsOrFirst))) {
22391
22676
  params = (paramsOrFirst || {});
@@ -22404,7 +22689,7 @@
22404
22689
  if (typeof enabled === 'undefined') {
22405
22690
  throw new AppwriteException('Missing required parameter: "enabled"');
22406
22691
  }
22407
- const apiPath = '/project/protocols/{protocolId}/status'.replace('{protocolId}', protocolId);
22692
+ const apiPath = '/project/protocols/{protocolId}'.replace('{protocolId}', protocolId);
22408
22693
  const payload = {};
22409
22694
  if (typeof enabled !== 'undefined') {
22410
22695
  payload['enabled'] = enabled;
@@ -22415,7 +22700,7 @@
22415
22700
  };
22416
22701
  return this.client.call('patch', uri, apiHeaders, payload);
22417
22702
  }
22418
- updateServiceStatus(paramsOrFirst, ...rest) {
22703
+ updateService(paramsOrFirst, ...rest) {
22419
22704
  let params;
22420
22705
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('serviceId' in paramsOrFirst || 'enabled' in paramsOrFirst))) {
22421
22706
  params = (paramsOrFirst || {});
@@ -22434,7 +22719,7 @@
22434
22719
  if (typeof enabled === 'undefined') {
22435
22720
  throw new AppwriteException('Missing required parameter: "enabled"');
22436
22721
  }
22437
- const apiPath = '/project/services/{serviceId}/status'.replace('{serviceId}', serviceId);
22722
+ const apiPath = '/project/services/{serviceId}'.replace('{serviceId}', serviceId);
22438
22723
  const payload = {};
22439
22724
  if (typeof enabled !== 'undefined') {
22440
22725
  payload['enabled'] = enabled;
@@ -22445,6 +22730,183 @@
22445
22730
  };
22446
22731
  return this.client.call('patch', uri, apiHeaders, payload);
22447
22732
  }
22733
+ updateSMTP(paramsOrFirst, ...rest) {
22734
+ let params;
22735
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22736
+ params = (paramsOrFirst || {});
22737
+ }
22738
+ else {
22739
+ params = {
22740
+ host: paramsOrFirst,
22741
+ port: rest[0],
22742
+ username: rest[1],
22743
+ password: rest[2],
22744
+ senderEmail: rest[3],
22745
+ senderName: rest[4],
22746
+ replyToEmail: rest[5],
22747
+ replyToName: rest[6],
22748
+ secure: rest[7],
22749
+ enabled: rest[8]
22750
+ };
22751
+ }
22752
+ const host = params.host;
22753
+ const port = params.port;
22754
+ const username = params.username;
22755
+ const password = params.password;
22756
+ const senderEmail = params.senderEmail;
22757
+ const senderName = params.senderName;
22758
+ const replyToEmail = params.replyToEmail;
22759
+ const replyToName = params.replyToName;
22760
+ const secure = params.secure;
22761
+ const enabled = params.enabled;
22762
+ const apiPath = '/project/smtp';
22763
+ const payload = {};
22764
+ if (typeof host !== 'undefined') {
22765
+ payload['host'] = host;
22766
+ }
22767
+ if (typeof port !== 'undefined') {
22768
+ payload['port'] = port;
22769
+ }
22770
+ if (typeof username !== 'undefined') {
22771
+ payload['username'] = username;
22772
+ }
22773
+ if (typeof password !== 'undefined') {
22774
+ payload['password'] = password;
22775
+ }
22776
+ if (typeof senderEmail !== 'undefined') {
22777
+ payload['senderEmail'] = senderEmail;
22778
+ }
22779
+ if (typeof senderName !== 'undefined') {
22780
+ payload['senderName'] = senderName;
22781
+ }
22782
+ if (typeof replyToEmail !== 'undefined') {
22783
+ payload['replyToEmail'] = replyToEmail;
22784
+ }
22785
+ if (typeof replyToName !== 'undefined') {
22786
+ payload['replyToName'] = replyToName;
22787
+ }
22788
+ if (typeof secure !== 'undefined') {
22789
+ payload['secure'] = secure;
22790
+ }
22791
+ if (typeof enabled !== 'undefined') {
22792
+ payload['enabled'] = enabled;
22793
+ }
22794
+ const uri = new URL(this.client.config.endpoint + apiPath);
22795
+ const apiHeaders = {
22796
+ 'content-type': 'application/json',
22797
+ };
22798
+ return this.client.call('patch', uri, apiHeaders, payload);
22799
+ }
22800
+ createSMTPTest(paramsOrFirst) {
22801
+ let params;
22802
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22803
+ params = (paramsOrFirst || {});
22804
+ }
22805
+ else {
22806
+ params = {
22807
+ emails: paramsOrFirst
22808
+ };
22809
+ }
22810
+ const emails = params.emails;
22811
+ if (typeof emails === 'undefined') {
22812
+ throw new AppwriteException('Missing required parameter: "emails"');
22813
+ }
22814
+ const apiPath = '/project/smtp/tests';
22815
+ const payload = {};
22816
+ if (typeof emails !== 'undefined') {
22817
+ payload['emails'] = emails;
22818
+ }
22819
+ const uri = new URL(this.client.config.endpoint + apiPath);
22820
+ const apiHeaders = {
22821
+ 'content-type': 'application/json',
22822
+ };
22823
+ return this.client.call('post', uri, apiHeaders, payload);
22824
+ }
22825
+ updateEmailTemplate(paramsOrFirst, ...rest) {
22826
+ let params;
22827
+ 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))) {
22828
+ params = (paramsOrFirst || {});
22829
+ }
22830
+ else {
22831
+ params = {
22832
+ templateId: paramsOrFirst,
22833
+ locale: rest[0],
22834
+ subject: rest[1],
22835
+ message: rest[2],
22836
+ senderName: rest[3],
22837
+ senderEmail: rest[4],
22838
+ replyToEmail: rest[5],
22839
+ replyToName: rest[6]
22840
+ };
22841
+ }
22842
+ const templateId = params.templateId;
22843
+ const locale = params.locale;
22844
+ const subject = params.subject;
22845
+ const message = params.message;
22846
+ const senderName = params.senderName;
22847
+ const senderEmail = params.senderEmail;
22848
+ const replyToEmail = params.replyToEmail;
22849
+ const replyToName = params.replyToName;
22850
+ if (typeof templateId === 'undefined') {
22851
+ throw new AppwriteException('Missing required parameter: "templateId"');
22852
+ }
22853
+ const apiPath = '/project/templates/email';
22854
+ const payload = {};
22855
+ if (typeof templateId !== 'undefined') {
22856
+ payload['templateId'] = templateId;
22857
+ }
22858
+ if (typeof locale !== 'undefined') {
22859
+ payload['locale'] = locale;
22860
+ }
22861
+ if (typeof subject !== 'undefined') {
22862
+ payload['subject'] = subject;
22863
+ }
22864
+ if (typeof message !== 'undefined') {
22865
+ payload['message'] = message;
22866
+ }
22867
+ if (typeof senderName !== 'undefined') {
22868
+ payload['senderName'] = senderName;
22869
+ }
22870
+ if (typeof senderEmail !== 'undefined') {
22871
+ payload['senderEmail'] = senderEmail;
22872
+ }
22873
+ if (typeof replyToEmail !== 'undefined') {
22874
+ payload['replyToEmail'] = replyToEmail;
22875
+ }
22876
+ if (typeof replyToName !== 'undefined') {
22877
+ payload['replyToName'] = replyToName;
22878
+ }
22879
+ const uri = new URL(this.client.config.endpoint + apiPath);
22880
+ const apiHeaders = {
22881
+ 'content-type': 'application/json',
22882
+ };
22883
+ return this.client.call('patch', uri, apiHeaders, payload);
22884
+ }
22885
+ getEmailTemplate(paramsOrFirst, ...rest) {
22886
+ let params;
22887
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('templateId' in paramsOrFirst || 'locale' in paramsOrFirst))) {
22888
+ params = (paramsOrFirst || {});
22889
+ }
22890
+ else {
22891
+ params = {
22892
+ templateId: paramsOrFirst,
22893
+ locale: rest[0]
22894
+ };
22895
+ }
22896
+ const templateId = params.templateId;
22897
+ const locale = params.locale;
22898
+ if (typeof templateId === 'undefined') {
22899
+ throw new AppwriteException('Missing required parameter: "templateId"');
22900
+ }
22901
+ const apiPath = '/project/templates/email/{templateId}'.replace('{templateId}', templateId);
22902
+ const payload = {};
22903
+ if (typeof locale !== 'undefined') {
22904
+ payload['locale'] = locale;
22905
+ }
22906
+ const uri = new URL(this.client.config.endpoint + apiPath);
22907
+ const apiHeaders = {};
22908
+ return this.client.call('get', uri, apiHeaders, payload);
22909
+ }
22448
22910
  getUsage(paramsOrFirst, ...rest) {
22449
22911
  let params;
22450
22912
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -22875,142 +23337,6 @@
22875
23337
  };
22876
23338
  return this.client.call('delete', uri, apiHeaders, payload);
22877
23339
  }
22878
- updateAuthDuration(paramsOrFirst, ...rest) {
22879
- let params;
22880
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22881
- params = (paramsOrFirst || {});
22882
- }
22883
- else {
22884
- params = {
22885
- projectId: paramsOrFirst,
22886
- duration: rest[0]
22887
- };
22888
- }
22889
- const projectId = params.projectId;
22890
- const duration = params.duration;
22891
- if (typeof projectId === 'undefined') {
22892
- throw new AppwriteException('Missing required parameter: "projectId"');
22893
- }
22894
- if (typeof duration === 'undefined') {
22895
- throw new AppwriteException('Missing required parameter: "duration"');
22896
- }
22897
- const apiPath = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);
22898
- const payload = {};
22899
- if (typeof duration !== 'undefined') {
22900
- payload['duration'] = duration;
22901
- }
22902
- const uri = new URL(this.client.config.endpoint + apiPath);
22903
- const apiHeaders = {
22904
- 'content-type': 'application/json',
22905
- };
22906
- return this.client.call('patch', uri, apiHeaders, payload);
22907
- }
22908
- updateAuthLimit(paramsOrFirst, ...rest) {
22909
- let params;
22910
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22911
- params = (paramsOrFirst || {});
22912
- }
22913
- else {
22914
- params = {
22915
- projectId: paramsOrFirst,
22916
- limit: rest[0]
22917
- };
22918
- }
22919
- const projectId = params.projectId;
22920
- const limit = params.limit;
22921
- if (typeof projectId === 'undefined') {
22922
- throw new AppwriteException('Missing required parameter: "projectId"');
22923
- }
22924
- if (typeof limit === 'undefined') {
22925
- throw new AppwriteException('Missing required parameter: "limit"');
22926
- }
22927
- const apiPath = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);
22928
- const payload = {};
22929
- if (typeof limit !== 'undefined') {
22930
- payload['limit'] = limit;
22931
- }
22932
- const uri = new URL(this.client.config.endpoint + apiPath);
22933
- const apiHeaders = {
22934
- 'content-type': 'application/json',
22935
- };
22936
- return this.client.call('patch', uri, apiHeaders, payload);
22937
- }
22938
- updateAuthSessionsLimit(paramsOrFirst, ...rest) {
22939
- let params;
22940
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22941
- params = (paramsOrFirst || {});
22942
- }
22943
- else {
22944
- params = {
22945
- projectId: paramsOrFirst,
22946
- limit: rest[0]
22947
- };
22948
- }
22949
- const projectId = params.projectId;
22950
- const limit = params.limit;
22951
- if (typeof projectId === 'undefined') {
22952
- throw new AppwriteException('Missing required parameter: "projectId"');
22953
- }
22954
- if (typeof limit === 'undefined') {
22955
- throw new AppwriteException('Missing required parameter: "limit"');
22956
- }
22957
- const apiPath = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);
22958
- const payload = {};
22959
- if (typeof limit !== 'undefined') {
22960
- payload['limit'] = limit;
22961
- }
22962
- const uri = new URL(this.client.config.endpoint + apiPath);
22963
- const apiHeaders = {
22964
- 'content-type': 'application/json',
22965
- };
22966
- return this.client.call('patch', uri, apiHeaders, payload);
22967
- }
22968
- updateMembershipsPrivacy(paramsOrFirst, ...rest) {
22969
- let params;
22970
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
22971
- params = (paramsOrFirst || {});
22972
- }
22973
- else {
22974
- params = {
22975
- projectId: paramsOrFirst,
22976
- userName: rest[0],
22977
- userEmail: rest[1],
22978
- mfa: rest[2]
22979
- };
22980
- }
22981
- const projectId = params.projectId;
22982
- const userName = params.userName;
22983
- const userEmail = params.userEmail;
22984
- const mfa = params.mfa;
22985
- if (typeof projectId === 'undefined') {
22986
- throw new AppwriteException('Missing required parameter: "projectId"');
22987
- }
22988
- if (typeof userName === 'undefined') {
22989
- throw new AppwriteException('Missing required parameter: "userName"');
22990
- }
22991
- if (typeof userEmail === 'undefined') {
22992
- throw new AppwriteException('Missing required parameter: "userEmail"');
22993
- }
22994
- if (typeof mfa === 'undefined') {
22995
- throw new AppwriteException('Missing required parameter: "mfa"');
22996
- }
22997
- const apiPath = '/projects/{projectId}/auth/memberships-privacy'.replace('{projectId}', projectId);
22998
- const payload = {};
22999
- if (typeof userName !== 'undefined') {
23000
- payload['userName'] = userName;
23001
- }
23002
- if (typeof userEmail !== 'undefined') {
23003
- payload['userEmail'] = userEmail;
23004
- }
23005
- if (typeof mfa !== 'undefined') {
23006
- payload['mfa'] = mfa;
23007
- }
23008
- const uri = new URL(this.client.config.endpoint + apiPath);
23009
- const apiHeaders = {
23010
- 'content-type': 'application/json',
23011
- };
23012
- return this.client.call('patch', uri, apiHeaders, payload);
23013
- }
23014
23340
  updateMockNumbers(paramsOrFirst, ...rest) {
23015
23341
  let params;
23016
23342
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -23041,156 +23367,6 @@
23041
23367
  };
23042
23368
  return this.client.call('patch', uri, apiHeaders, payload);
23043
23369
  }
23044
- updateAuthPasswordDictionary(paramsOrFirst, ...rest) {
23045
- let params;
23046
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23047
- params = (paramsOrFirst || {});
23048
- }
23049
- else {
23050
- params = {
23051
- projectId: paramsOrFirst,
23052
- enabled: rest[0]
23053
- };
23054
- }
23055
- const projectId = params.projectId;
23056
- const enabled = params.enabled;
23057
- if (typeof projectId === 'undefined') {
23058
- throw new AppwriteException('Missing required parameter: "projectId"');
23059
- }
23060
- if (typeof enabled === 'undefined') {
23061
- throw new AppwriteException('Missing required parameter: "enabled"');
23062
- }
23063
- const apiPath = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);
23064
- const payload = {};
23065
- if (typeof enabled !== 'undefined') {
23066
- payload['enabled'] = enabled;
23067
- }
23068
- const uri = new URL(this.client.config.endpoint + apiPath);
23069
- const apiHeaders = {
23070
- 'content-type': 'application/json',
23071
- };
23072
- return this.client.call('patch', uri, apiHeaders, payload);
23073
- }
23074
- updateAuthPasswordHistory(paramsOrFirst, ...rest) {
23075
- let params;
23076
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23077
- params = (paramsOrFirst || {});
23078
- }
23079
- else {
23080
- params = {
23081
- projectId: paramsOrFirst,
23082
- limit: rest[0]
23083
- };
23084
- }
23085
- const projectId = params.projectId;
23086
- const limit = params.limit;
23087
- if (typeof projectId === 'undefined') {
23088
- throw new AppwriteException('Missing required parameter: "projectId"');
23089
- }
23090
- if (typeof limit === 'undefined') {
23091
- throw new AppwriteException('Missing required parameter: "limit"');
23092
- }
23093
- const apiPath = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);
23094
- const payload = {};
23095
- if (typeof limit !== 'undefined') {
23096
- payload['limit'] = limit;
23097
- }
23098
- const uri = new URL(this.client.config.endpoint + apiPath);
23099
- const apiHeaders = {
23100
- 'content-type': 'application/json',
23101
- };
23102
- return this.client.call('patch', uri, apiHeaders, payload);
23103
- }
23104
- updatePersonalDataCheck(paramsOrFirst, ...rest) {
23105
- let params;
23106
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23107
- params = (paramsOrFirst || {});
23108
- }
23109
- else {
23110
- params = {
23111
- projectId: paramsOrFirst,
23112
- enabled: rest[0]
23113
- };
23114
- }
23115
- const projectId = params.projectId;
23116
- const enabled = params.enabled;
23117
- if (typeof projectId === 'undefined') {
23118
- throw new AppwriteException('Missing required parameter: "projectId"');
23119
- }
23120
- if (typeof enabled === 'undefined') {
23121
- throw new AppwriteException('Missing required parameter: "enabled"');
23122
- }
23123
- const apiPath = '/projects/{projectId}/auth/personal-data'.replace('{projectId}', projectId);
23124
- const payload = {};
23125
- if (typeof enabled !== 'undefined') {
23126
- payload['enabled'] = enabled;
23127
- }
23128
- const uri = new URL(this.client.config.endpoint + apiPath);
23129
- const apiHeaders = {
23130
- 'content-type': 'application/json',
23131
- };
23132
- return this.client.call('patch', uri, apiHeaders, payload);
23133
- }
23134
- updateSessionAlerts(paramsOrFirst, ...rest) {
23135
- let params;
23136
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23137
- params = (paramsOrFirst || {});
23138
- }
23139
- else {
23140
- params = {
23141
- projectId: paramsOrFirst,
23142
- alerts: rest[0]
23143
- };
23144
- }
23145
- const projectId = params.projectId;
23146
- const alerts = params.alerts;
23147
- if (typeof projectId === 'undefined') {
23148
- throw new AppwriteException('Missing required parameter: "projectId"');
23149
- }
23150
- if (typeof alerts === 'undefined') {
23151
- throw new AppwriteException('Missing required parameter: "alerts"');
23152
- }
23153
- const apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId);
23154
- const payload = {};
23155
- if (typeof alerts !== 'undefined') {
23156
- payload['alerts'] = alerts;
23157
- }
23158
- const uri = new URL(this.client.config.endpoint + apiPath);
23159
- const apiHeaders = {
23160
- 'content-type': 'application/json',
23161
- };
23162
- return this.client.call('patch', uri, apiHeaders, payload);
23163
- }
23164
- updateSessionInvalidation(paramsOrFirst, ...rest) {
23165
- let params;
23166
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23167
- params = (paramsOrFirst || {});
23168
- }
23169
- else {
23170
- params = {
23171
- projectId: paramsOrFirst,
23172
- enabled: rest[0]
23173
- };
23174
- }
23175
- const projectId = params.projectId;
23176
- const enabled = params.enabled;
23177
- if (typeof projectId === 'undefined') {
23178
- throw new AppwriteException('Missing required parameter: "projectId"');
23179
- }
23180
- if (typeof enabled === 'undefined') {
23181
- throw new AppwriteException('Missing required parameter: "enabled"');
23182
- }
23183
- const apiPath = '/projects/{projectId}/auth/session-invalidation'.replace('{projectId}', projectId);
23184
- const payload = {};
23185
- if (typeof enabled !== 'undefined') {
23186
- payload['enabled'] = enabled;
23187
- }
23188
- const uri = new URL(this.client.config.endpoint + apiPath);
23189
- const apiHeaders = {
23190
- 'content-type': 'application/json',
23191
- };
23192
- return this.client.call('patch', uri, apiHeaders, payload);
23193
- }
23194
23370
  updateAuthStatus(paramsOrFirst, ...rest) {
23195
23371
  let params;
23196
23372
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -23597,304 +23773,6 @@
23597
23773
  const apiHeaders = {};
23598
23774
  return this.client.call('get', uri, apiHeaders, payload);
23599
23775
  }
23600
- updateSmtp(paramsOrFirst, ...rest) {
23601
- let params;
23602
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23603
- params = (paramsOrFirst || {});
23604
- }
23605
- else {
23606
- params = {
23607
- projectId: paramsOrFirst,
23608
- enabled: rest[0],
23609
- senderName: rest[1],
23610
- senderEmail: rest[2],
23611
- replyTo: rest[3],
23612
- host: rest[4],
23613
- port: rest[5],
23614
- username: rest[6],
23615
- password: rest[7],
23616
- secure: rest[8]
23617
- };
23618
- }
23619
- const projectId = params.projectId;
23620
- const enabled = params.enabled;
23621
- const senderName = params.senderName;
23622
- const senderEmail = params.senderEmail;
23623
- const replyTo = params.replyTo;
23624
- const host = params.host;
23625
- const port = params.port;
23626
- const username = params.username;
23627
- const password = params.password;
23628
- const secure = params.secure;
23629
- if (typeof projectId === 'undefined') {
23630
- throw new AppwriteException('Missing required parameter: "projectId"');
23631
- }
23632
- if (typeof enabled === 'undefined') {
23633
- throw new AppwriteException('Missing required parameter: "enabled"');
23634
- }
23635
- const apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);
23636
- const payload = {};
23637
- if (typeof enabled !== 'undefined') {
23638
- payload['enabled'] = enabled;
23639
- }
23640
- if (typeof senderName !== 'undefined') {
23641
- payload['senderName'] = senderName;
23642
- }
23643
- if (typeof senderEmail !== 'undefined') {
23644
- payload['senderEmail'] = senderEmail;
23645
- }
23646
- if (typeof replyTo !== 'undefined') {
23647
- payload['replyTo'] = replyTo;
23648
- }
23649
- if (typeof host !== 'undefined') {
23650
- payload['host'] = host;
23651
- }
23652
- if (typeof port !== 'undefined') {
23653
- payload['port'] = port;
23654
- }
23655
- if (typeof username !== 'undefined') {
23656
- payload['username'] = username;
23657
- }
23658
- if (typeof password !== 'undefined') {
23659
- payload['password'] = password;
23660
- }
23661
- if (typeof secure !== 'undefined') {
23662
- payload['secure'] = secure;
23663
- }
23664
- const uri = new URL(this.client.config.endpoint + apiPath);
23665
- const apiHeaders = {
23666
- 'content-type': 'application/json',
23667
- };
23668
- return this.client.call('patch', uri, apiHeaders, payload);
23669
- }
23670
- updateSMTP(paramsOrFirst, ...rest) {
23671
- let params;
23672
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23673
- params = (paramsOrFirst || {});
23674
- }
23675
- else {
23676
- params = {
23677
- projectId: paramsOrFirst,
23678
- enabled: rest[0],
23679
- senderName: rest[1],
23680
- senderEmail: rest[2],
23681
- replyTo: rest[3],
23682
- host: rest[4],
23683
- port: rest[5],
23684
- username: rest[6],
23685
- password: rest[7],
23686
- secure: rest[8]
23687
- };
23688
- }
23689
- const projectId = params.projectId;
23690
- const enabled = params.enabled;
23691
- const senderName = params.senderName;
23692
- const senderEmail = params.senderEmail;
23693
- const replyTo = params.replyTo;
23694
- const host = params.host;
23695
- const port = params.port;
23696
- const username = params.username;
23697
- const password = params.password;
23698
- const secure = params.secure;
23699
- if (typeof projectId === 'undefined') {
23700
- throw new AppwriteException('Missing required parameter: "projectId"');
23701
- }
23702
- if (typeof enabled === 'undefined') {
23703
- throw new AppwriteException('Missing required parameter: "enabled"');
23704
- }
23705
- const apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);
23706
- const payload = {};
23707
- if (typeof enabled !== 'undefined') {
23708
- payload['enabled'] = enabled;
23709
- }
23710
- if (typeof senderName !== 'undefined') {
23711
- payload['senderName'] = senderName;
23712
- }
23713
- if (typeof senderEmail !== 'undefined') {
23714
- payload['senderEmail'] = senderEmail;
23715
- }
23716
- if (typeof replyTo !== 'undefined') {
23717
- payload['replyTo'] = replyTo;
23718
- }
23719
- if (typeof host !== 'undefined') {
23720
- payload['host'] = host;
23721
- }
23722
- if (typeof port !== 'undefined') {
23723
- payload['port'] = port;
23724
- }
23725
- if (typeof username !== 'undefined') {
23726
- payload['username'] = username;
23727
- }
23728
- if (typeof password !== 'undefined') {
23729
- payload['password'] = password;
23730
- }
23731
- if (typeof secure !== 'undefined') {
23732
- payload['secure'] = secure;
23733
- }
23734
- const uri = new URL(this.client.config.endpoint + apiPath);
23735
- const apiHeaders = {
23736
- 'content-type': 'application/json',
23737
- };
23738
- return this.client.call('patch', uri, apiHeaders, payload);
23739
- }
23740
- createSmtpTest(paramsOrFirst, ...rest) {
23741
- let params;
23742
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23743
- params = (paramsOrFirst || {});
23744
- }
23745
- else {
23746
- params = {
23747
- projectId: paramsOrFirst,
23748
- emails: rest[0],
23749
- senderName: rest[1],
23750
- senderEmail: rest[2],
23751
- host: rest[3],
23752
- replyTo: rest[4],
23753
- port: rest[5],
23754
- username: rest[6],
23755
- password: rest[7],
23756
- secure: rest[8]
23757
- };
23758
- }
23759
- const projectId = params.projectId;
23760
- const emails = params.emails;
23761
- const senderName = params.senderName;
23762
- const senderEmail = params.senderEmail;
23763
- const host = params.host;
23764
- const replyTo = params.replyTo;
23765
- const port = params.port;
23766
- const username = params.username;
23767
- const password = params.password;
23768
- const secure = params.secure;
23769
- if (typeof projectId === 'undefined') {
23770
- throw new AppwriteException('Missing required parameter: "projectId"');
23771
- }
23772
- if (typeof emails === 'undefined') {
23773
- throw new AppwriteException('Missing required parameter: "emails"');
23774
- }
23775
- if (typeof senderName === 'undefined') {
23776
- throw new AppwriteException('Missing required parameter: "senderName"');
23777
- }
23778
- if (typeof senderEmail === 'undefined') {
23779
- throw new AppwriteException('Missing required parameter: "senderEmail"');
23780
- }
23781
- if (typeof host === 'undefined') {
23782
- throw new AppwriteException('Missing required parameter: "host"');
23783
- }
23784
- const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
23785
- const payload = {};
23786
- if (typeof emails !== 'undefined') {
23787
- payload['emails'] = emails;
23788
- }
23789
- if (typeof senderName !== 'undefined') {
23790
- payload['senderName'] = senderName;
23791
- }
23792
- if (typeof senderEmail !== 'undefined') {
23793
- payload['senderEmail'] = senderEmail;
23794
- }
23795
- if (typeof replyTo !== 'undefined') {
23796
- payload['replyTo'] = replyTo;
23797
- }
23798
- if (typeof host !== 'undefined') {
23799
- payload['host'] = host;
23800
- }
23801
- if (typeof port !== 'undefined') {
23802
- payload['port'] = port;
23803
- }
23804
- if (typeof username !== 'undefined') {
23805
- payload['username'] = username;
23806
- }
23807
- if (typeof password !== 'undefined') {
23808
- payload['password'] = password;
23809
- }
23810
- if (typeof secure !== 'undefined') {
23811
- payload['secure'] = secure;
23812
- }
23813
- const uri = new URL(this.client.config.endpoint + apiPath);
23814
- const apiHeaders = {
23815
- 'content-type': 'application/json',
23816
- };
23817
- return this.client.call('post', uri, apiHeaders, payload);
23818
- }
23819
- createSMTPTest(paramsOrFirst, ...rest) {
23820
- let params;
23821
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23822
- params = (paramsOrFirst || {});
23823
- }
23824
- else {
23825
- params = {
23826
- projectId: paramsOrFirst,
23827
- emails: rest[0],
23828
- senderName: rest[1],
23829
- senderEmail: rest[2],
23830
- host: rest[3],
23831
- replyTo: rest[4],
23832
- port: rest[5],
23833
- username: rest[6],
23834
- password: rest[7],
23835
- secure: rest[8]
23836
- };
23837
- }
23838
- const projectId = params.projectId;
23839
- const emails = params.emails;
23840
- const senderName = params.senderName;
23841
- const senderEmail = params.senderEmail;
23842
- const host = params.host;
23843
- const replyTo = params.replyTo;
23844
- const port = params.port;
23845
- const username = params.username;
23846
- const password = params.password;
23847
- const secure = params.secure;
23848
- if (typeof projectId === 'undefined') {
23849
- throw new AppwriteException('Missing required parameter: "projectId"');
23850
- }
23851
- if (typeof emails === 'undefined') {
23852
- throw new AppwriteException('Missing required parameter: "emails"');
23853
- }
23854
- if (typeof senderName === 'undefined') {
23855
- throw new AppwriteException('Missing required parameter: "senderName"');
23856
- }
23857
- if (typeof senderEmail === 'undefined') {
23858
- throw new AppwriteException('Missing required parameter: "senderEmail"');
23859
- }
23860
- if (typeof host === 'undefined') {
23861
- throw new AppwriteException('Missing required parameter: "host"');
23862
- }
23863
- const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
23864
- const payload = {};
23865
- if (typeof emails !== 'undefined') {
23866
- payload['emails'] = emails;
23867
- }
23868
- if (typeof senderName !== 'undefined') {
23869
- payload['senderName'] = senderName;
23870
- }
23871
- if (typeof senderEmail !== 'undefined') {
23872
- payload['senderEmail'] = senderEmail;
23873
- }
23874
- if (typeof replyTo !== 'undefined') {
23875
- payload['replyTo'] = replyTo;
23876
- }
23877
- if (typeof host !== 'undefined') {
23878
- payload['host'] = host;
23879
- }
23880
- if (typeof port !== 'undefined') {
23881
- payload['port'] = port;
23882
- }
23883
- if (typeof username !== 'undefined') {
23884
- payload['username'] = username;
23885
- }
23886
- if (typeof password !== 'undefined') {
23887
- payload['password'] = password;
23888
- }
23889
- if (typeof secure !== 'undefined') {
23890
- payload['secure'] = secure;
23891
- }
23892
- const uri = new URL(this.client.config.endpoint + apiPath);
23893
- const apiHeaders = {
23894
- 'content-type': 'application/json',
23895
- };
23896
- return this.client.call('post', uri, apiHeaders, payload);
23897
- }
23898
23776
  updateStatus(paramsOrFirst, ...rest) {
23899
23777
  let params;
23900
23778
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -23955,335 +23833,6 @@
23955
23833
  };
23956
23834
  return this.client.call('patch', uri, apiHeaders, payload);
23957
23835
  }
23958
- getEmailTemplate(paramsOrFirst, ...rest) {
23959
- let params;
23960
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23961
- params = (paramsOrFirst || {});
23962
- }
23963
- else {
23964
- params = {
23965
- projectId: paramsOrFirst,
23966
- type: rest[0],
23967
- locale: rest[1]
23968
- };
23969
- }
23970
- const projectId = params.projectId;
23971
- const type = params.type;
23972
- const locale = params.locale;
23973
- if (typeof projectId === 'undefined') {
23974
- throw new AppwriteException('Missing required parameter: "projectId"');
23975
- }
23976
- if (typeof type === 'undefined') {
23977
- throw new AppwriteException('Missing required parameter: "type"');
23978
- }
23979
- if (typeof locale === 'undefined') {
23980
- throw new AppwriteException('Missing required parameter: "locale"');
23981
- }
23982
- const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
23983
- const payload = {};
23984
- const uri = new URL(this.client.config.endpoint + apiPath);
23985
- const apiHeaders = {};
23986
- return this.client.call('get', uri, apiHeaders, payload);
23987
- }
23988
- updateEmailTemplate(paramsOrFirst, ...rest) {
23989
- let params;
23990
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
23991
- params = (paramsOrFirst || {});
23992
- }
23993
- else {
23994
- params = {
23995
- projectId: paramsOrFirst,
23996
- type: rest[0],
23997
- locale: rest[1],
23998
- subject: rest[2],
23999
- message: rest[3],
24000
- senderName: rest[4],
24001
- senderEmail: rest[5],
24002
- replyTo: rest[6]
24003
- };
24004
- }
24005
- const projectId = params.projectId;
24006
- const type = params.type;
24007
- const locale = params.locale;
24008
- const subject = params.subject;
24009
- const message = params.message;
24010
- const senderName = params.senderName;
24011
- const senderEmail = params.senderEmail;
24012
- const replyTo = params.replyTo;
24013
- if (typeof projectId === 'undefined') {
24014
- throw new AppwriteException('Missing required parameter: "projectId"');
24015
- }
24016
- if (typeof type === 'undefined') {
24017
- throw new AppwriteException('Missing required parameter: "type"');
24018
- }
24019
- if (typeof locale === 'undefined') {
24020
- throw new AppwriteException('Missing required parameter: "locale"');
24021
- }
24022
- if (typeof subject === 'undefined') {
24023
- throw new AppwriteException('Missing required parameter: "subject"');
24024
- }
24025
- if (typeof message === 'undefined') {
24026
- throw new AppwriteException('Missing required parameter: "message"');
24027
- }
24028
- const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
24029
- const payload = {};
24030
- if (typeof subject !== 'undefined') {
24031
- payload['subject'] = subject;
24032
- }
24033
- if (typeof message !== 'undefined') {
24034
- payload['message'] = message;
24035
- }
24036
- if (typeof senderName !== 'undefined') {
24037
- payload['senderName'] = senderName;
24038
- }
24039
- if (typeof senderEmail !== 'undefined') {
24040
- payload['senderEmail'] = senderEmail;
24041
- }
24042
- if (typeof replyTo !== 'undefined') {
24043
- payload['replyTo'] = replyTo;
24044
- }
24045
- const uri = new URL(this.client.config.endpoint + apiPath);
24046
- const apiHeaders = {
24047
- 'content-type': 'application/json',
24048
- };
24049
- return this.client.call('patch', uri, apiHeaders, payload);
24050
- }
24051
- deleteEmailTemplate(paramsOrFirst, ...rest) {
24052
- let params;
24053
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
24054
- params = (paramsOrFirst || {});
24055
- }
24056
- else {
24057
- params = {
24058
- projectId: paramsOrFirst,
24059
- type: rest[0],
24060
- locale: rest[1]
24061
- };
24062
- }
24063
- const projectId = params.projectId;
24064
- const type = params.type;
24065
- const locale = params.locale;
24066
- if (typeof projectId === 'undefined') {
24067
- throw new AppwriteException('Missing required parameter: "projectId"');
24068
- }
24069
- if (typeof type === 'undefined') {
24070
- throw new AppwriteException('Missing required parameter: "type"');
24071
- }
24072
- if (typeof locale === 'undefined') {
24073
- throw new AppwriteException('Missing required parameter: "locale"');
24074
- }
24075
- const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
24076
- const payload = {};
24077
- const uri = new URL(this.client.config.endpoint + apiPath);
24078
- const apiHeaders = {
24079
- 'content-type': 'application/json',
24080
- };
24081
- return this.client.call('delete', uri, apiHeaders, payload);
24082
- }
24083
- getSmsTemplate(paramsOrFirst, ...rest) {
24084
- let params;
24085
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
24086
- params = (paramsOrFirst || {});
24087
- }
24088
- else {
24089
- params = {
24090
- projectId: paramsOrFirst,
24091
- type: rest[0],
24092
- locale: rest[1]
24093
- };
24094
- }
24095
- const projectId = params.projectId;
24096
- const type = params.type;
24097
- const locale = params.locale;
24098
- if (typeof projectId === 'undefined') {
24099
- throw new AppwriteException('Missing required parameter: "projectId"');
24100
- }
24101
- if (typeof type === 'undefined') {
24102
- throw new AppwriteException('Missing required parameter: "type"');
24103
- }
24104
- if (typeof locale === 'undefined') {
24105
- throw new AppwriteException('Missing required parameter: "locale"');
24106
- }
24107
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
24108
- const payload = {};
24109
- const uri = new URL(this.client.config.endpoint + apiPath);
24110
- const apiHeaders = {};
24111
- return this.client.call('get', uri, apiHeaders, payload);
24112
- }
24113
- getSMSTemplate(paramsOrFirst, ...rest) {
24114
- let params;
24115
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
24116
- params = (paramsOrFirst || {});
24117
- }
24118
- else {
24119
- params = {
24120
- projectId: paramsOrFirst,
24121
- type: rest[0],
24122
- locale: rest[1]
24123
- };
24124
- }
24125
- const projectId = params.projectId;
24126
- const type = params.type;
24127
- const locale = params.locale;
24128
- if (typeof projectId === 'undefined') {
24129
- throw new AppwriteException('Missing required parameter: "projectId"');
24130
- }
24131
- if (typeof type === 'undefined') {
24132
- throw new AppwriteException('Missing required parameter: "type"');
24133
- }
24134
- if (typeof locale === 'undefined') {
24135
- throw new AppwriteException('Missing required parameter: "locale"');
24136
- }
24137
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
24138
- const payload = {};
24139
- const uri = new URL(this.client.config.endpoint + apiPath);
24140
- const apiHeaders = {};
24141
- return this.client.call('get', uri, apiHeaders, payload);
24142
- }
24143
- updateSmsTemplate(paramsOrFirst, ...rest) {
24144
- let params;
24145
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
24146
- params = (paramsOrFirst || {});
24147
- }
24148
- else {
24149
- params = {
24150
- projectId: paramsOrFirst,
24151
- type: rest[0],
24152
- locale: rest[1],
24153
- message: rest[2]
24154
- };
24155
- }
24156
- const projectId = params.projectId;
24157
- const type = params.type;
24158
- const locale = params.locale;
24159
- const message = params.message;
24160
- if (typeof projectId === 'undefined') {
24161
- throw new AppwriteException('Missing required parameter: "projectId"');
24162
- }
24163
- if (typeof type === 'undefined') {
24164
- throw new AppwriteException('Missing required parameter: "type"');
24165
- }
24166
- if (typeof locale === 'undefined') {
24167
- throw new AppwriteException('Missing required parameter: "locale"');
24168
- }
24169
- if (typeof message === 'undefined') {
24170
- throw new AppwriteException('Missing required parameter: "message"');
24171
- }
24172
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
24173
- const payload = {};
24174
- if (typeof message !== 'undefined') {
24175
- payload['message'] = message;
24176
- }
24177
- const uri = new URL(this.client.config.endpoint + apiPath);
24178
- const apiHeaders = {
24179
- 'content-type': 'application/json',
24180
- };
24181
- return this.client.call('patch', uri, apiHeaders, payload);
24182
- }
24183
- updateSMSTemplate(paramsOrFirst, ...rest) {
24184
- let params;
24185
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
24186
- params = (paramsOrFirst || {});
24187
- }
24188
- else {
24189
- params = {
24190
- projectId: paramsOrFirst,
24191
- type: rest[0],
24192
- locale: rest[1],
24193
- message: rest[2]
24194
- };
24195
- }
24196
- const projectId = params.projectId;
24197
- const type = params.type;
24198
- const locale = params.locale;
24199
- const message = params.message;
24200
- if (typeof projectId === 'undefined') {
24201
- throw new AppwriteException('Missing required parameter: "projectId"');
24202
- }
24203
- if (typeof type === 'undefined') {
24204
- throw new AppwriteException('Missing required parameter: "type"');
24205
- }
24206
- if (typeof locale === 'undefined') {
24207
- throw new AppwriteException('Missing required parameter: "locale"');
24208
- }
24209
- if (typeof message === 'undefined') {
24210
- throw new AppwriteException('Missing required parameter: "message"');
24211
- }
24212
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
24213
- const payload = {};
24214
- if (typeof message !== 'undefined') {
24215
- payload['message'] = message;
24216
- }
24217
- const uri = new URL(this.client.config.endpoint + apiPath);
24218
- const apiHeaders = {
24219
- 'content-type': 'application/json',
24220
- };
24221
- return this.client.call('patch', uri, apiHeaders, payload);
24222
- }
24223
- deleteSmsTemplate(paramsOrFirst, ...rest) {
24224
- let params;
24225
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
24226
- params = (paramsOrFirst || {});
24227
- }
24228
- else {
24229
- params = {
24230
- projectId: paramsOrFirst,
24231
- type: rest[0],
24232
- locale: rest[1]
24233
- };
24234
- }
24235
- const projectId = params.projectId;
24236
- const type = params.type;
24237
- const locale = params.locale;
24238
- if (typeof projectId === 'undefined') {
24239
- throw new AppwriteException('Missing required parameter: "projectId"');
24240
- }
24241
- if (typeof type === 'undefined') {
24242
- throw new AppwriteException('Missing required parameter: "type"');
24243
- }
24244
- if (typeof locale === 'undefined') {
24245
- throw new AppwriteException('Missing required parameter: "locale"');
24246
- }
24247
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
24248
- const payload = {};
24249
- const uri = new URL(this.client.config.endpoint + apiPath);
24250
- const apiHeaders = {
24251
- 'content-type': 'application/json',
24252
- };
24253
- return this.client.call('delete', uri, apiHeaders, payload);
24254
- }
24255
- deleteSMSTemplate(paramsOrFirst, ...rest) {
24256
- let params;
24257
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
24258
- params = (paramsOrFirst || {});
24259
- }
24260
- else {
24261
- params = {
24262
- projectId: paramsOrFirst,
24263
- type: rest[0],
24264
- locale: rest[1]
24265
- };
24266
- }
24267
- const projectId = params.projectId;
24268
- const type = params.type;
24269
- const locale = params.locale;
24270
- if (typeof projectId === 'undefined') {
24271
- throw new AppwriteException('Missing required parameter: "projectId"');
24272
- }
24273
- if (typeof type === 'undefined') {
24274
- throw new AppwriteException('Missing required parameter: "type"');
24275
- }
24276
- if (typeof locale === 'undefined') {
24277
- throw new AppwriteException('Missing required parameter: "locale"');
24278
- }
24279
- const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
24280
- const payload = {};
24281
- const uri = new URL(this.client.config.endpoint + apiPath);
24282
- const apiHeaders = {
24283
- 'content-type': 'application/json',
24284
- };
24285
- return this.client.call('delete', uri, apiHeaders, payload);
24286
- }
24287
23836
  }
24288
23837
 
24289
23838
  class Proxy {
@@ -33454,17 +33003,13 @@
33454
33003
  this.TYPE_EVENT = 'event';
33455
33004
  this.TYPE_PONG = 'pong';
33456
33005
  this.TYPE_CONNECTED = 'connected';
33006
+ this.TYPE_RESPONSE = 'response';
33457
33007
  this.DEBOUNCE_MS = 1;
33458
33008
  this.HEARTBEAT_INTERVAL = 20000; // 20 seconds in milliseconds
33459
- // Slot-centric state: Map<slot, { channels: Set<string>, queries: string[], callback: Function }>
33460
33009
  this.activeSubscriptions = new Map();
33461
- // Map slot index -> subscriptionId (from backend)
33462
- this.slotToSubscriptionId = new Map();
33463
- // Inverse map: subscriptionId -> slot index (for O(1) lookup)
33464
- this.subscriptionIdToSlot = new Map();
33010
+ this.pendingSubscribes = new Map();
33465
33011
  this.subCallDepth = 0;
33466
33012
  this.reconnectAttempts = 0;
33467
- this.subscriptionsCounter = 0;
33468
33013
  this.connectionId = 0;
33469
33014
  this.reconnect = true;
33470
33015
  this.onErrorCallbacks = [];
@@ -33501,15 +33046,15 @@
33501
33046
  }
33502
33047
  startHeartbeat() {
33503
33048
  this.stopHeartbeat();
33504
- this.heartbeatTimer = window.setInterval(() => {
33049
+ this.heartbeatTimer = window === null || window === void 0 ? void 0 : window.setInterval(() => {
33505
33050
  if (this.socket && this.socket.readyState === WebSocket.OPEN) {
33506
- this.socket.send(JSON.stringify({ type: 'ping' }));
33051
+ this.socket.send(JSONbig.stringify({ type: 'ping' }));
33507
33052
  }
33508
33053
  }, this.HEARTBEAT_INTERVAL);
33509
33054
  }
33510
33055
  stopHeartbeat() {
33511
33056
  if (this.heartbeatTimer) {
33512
- window.clearInterval(this.heartbeatTimer);
33057
+ window === null || window === void 0 ? void 0 : window.clearInterval(this.heartbeatTimer);
33513
33058
  this.heartbeatTimer = undefined;
33514
33059
  }
33515
33060
  }
@@ -33524,36 +33069,8 @@
33524
33069
  if (!projectId) {
33525
33070
  throw new AppwriteException('Missing project ID');
33526
33071
  }
33527
- // Collect all unique channels from all slots
33528
- const allChannels = new Set();
33529
- for (const subscription of this.activeSubscriptions.values()) {
33530
- for (const channel of subscription.channels) {
33531
- allChannels.add(channel);
33532
- }
33533
- }
33534
- let queryParams = `project=${projectId}`;
33535
- for (const channel of allChannels) {
33536
- queryParams += `&channels[]=${encodeURIComponent(channel)}`;
33537
- }
33538
- // Build query string from slots → channels → queries
33539
- // Format: channel[slot][]=query
33540
- // For each slot, repeat its queries under each channel it subscribes to
33541
- // Example: slot 1 → channels [tests, prod], queries [q1, q2]
33542
- // Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
33543
- const selectAllQuery = Query.select(['*']).toString();
33544
- for (const [slot, subscription] of this.activeSubscriptions) {
33545
- // queries is string[] - iterate over each query string
33546
- const queries = subscription.queries.length === 0
33547
- ? [selectAllQuery]
33548
- : subscription.queries;
33549
- // Repeat this slot's queries under each channel it subscribes to
33550
- // Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
33551
- for (const channel of subscription.channels) {
33552
- for (const query of queries) {
33553
- queryParams += `&${encodeURIComponent(channel)}[${slot}][]=${encodeURIComponent(query)}`;
33554
- }
33555
- }
33556
- }
33072
+ // URL carries only the project; channels/queries are sent via the subscribe message.
33073
+ const queryParams = `project=${projectId}`;
33557
33074
  const endpoint = this.client.config.endpointRealtime !== ''
33558
33075
  ? this.client.config.endpointRealtime
33559
33076
  : this.client.config.endpoint || '';
@@ -33587,7 +33104,7 @@
33587
33104
  return;
33588
33105
  }
33589
33106
  try {
33590
- const message = JSON.parse(event.data);
33107
+ const message = JSONbig.parse(event.data);
33591
33108
  this.handleMessage(message);
33592
33109
  }
33593
33110
  catch (error) {
@@ -33672,6 +33189,67 @@
33672
33189
  sleep(ms) {
33673
33190
  return new Promise(resolve => setTimeout(resolve, ms));
33674
33191
  }
33192
+ sendUnsubscribeMessage(subscriptionIds) {
33193
+ const ids = subscriptionIds.filter(id => typeof id === 'string' && id.length > 0);
33194
+ if (ids.length === 0) {
33195
+ return;
33196
+ }
33197
+ if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {
33198
+ return;
33199
+ }
33200
+ this.socket.send(JSONbig.stringify({
33201
+ type: 'unsubscribe',
33202
+ data: ids.map(subscriptionId => ({ subscriptionId }))
33203
+ }));
33204
+ }
33205
+ generateUniqueSubscriptionId() {
33206
+ const attempts = this.activeSubscriptions.size + 1;
33207
+ for (let i = 0; i < attempts; i++) {
33208
+ const id = ID.unique();
33209
+ if (!this.activeSubscriptions.has(id)) {
33210
+ return id;
33211
+ }
33212
+ }
33213
+ throw new AppwriteException('Failed to generate unique subscription id');
33214
+ }
33215
+ enqueuePendingSubscribe(subscriptionId) {
33216
+ var _a;
33217
+ const subscription = this.activeSubscriptions.get(subscriptionId);
33218
+ if (!subscription) {
33219
+ return;
33220
+ }
33221
+ this.pendingSubscribes.set(subscriptionId, {
33222
+ subscriptionId,
33223
+ channels: Array.from(subscription.channels),
33224
+ queries: (_a = subscription.queries) !== null && _a !== void 0 ? _a : []
33225
+ });
33226
+ }
33227
+ /**
33228
+ * Close the WebSocket connection and drop all active subscriptions client-side.
33229
+ * Use this instead of calling `unsubscribe()` on every subscription when you want to tear everything down.
33230
+ */
33231
+ disconnect() {
33232
+ return __awaiter(this, void 0, void 0, function* () {
33233
+ this.activeSubscriptions.clear();
33234
+ this.pendingSubscribes.clear();
33235
+ this.reconnect = false;
33236
+ yield this.closeSocket();
33237
+ });
33238
+ }
33239
+ sendPendingSubscribes() {
33240
+ if (!this.socket || this.socket.readyState !== WebSocket.OPEN) {
33241
+ return;
33242
+ }
33243
+ if (this.pendingSubscribes.size < 1) {
33244
+ return;
33245
+ }
33246
+ const rows = Array.from(this.pendingSubscribes.values());
33247
+ this.pendingSubscribes.clear();
33248
+ this.socket.send(JSONbig.stringify({
33249
+ type: 'subscribe',
33250
+ data: rows
33251
+ }));
33252
+ }
33675
33253
  /**
33676
33254
  * Convert a channel value to a string
33677
33255
  *
@@ -33711,38 +33289,86 @@
33711
33289
  queryStrings.push(typeof q === 'string' ? q : q.toString());
33712
33290
  }
33713
33291
  }
33714
- // Allocate a new slot index
33715
- this.subscriptionsCounter++;
33716
- const slot = this.subscriptionsCounter;
33717
- // Store slot-centric data: channels, queries, and callback belong to the slot
33718
- // queries is stored as string[] (array of query strings)
33719
- // No channel mutation occurs here - channels are derived from slots in createSocket()
33720
- this.activeSubscriptions.set(slot, {
33292
+ const subscriptionId = this.generateUniqueSubscriptionId();
33293
+ this.activeSubscriptions.set(subscriptionId, {
33721
33294
  channels,
33722
33295
  queries: queryStrings,
33723
33296
  callback
33724
33297
  });
33298
+ this.enqueuePendingSubscribe(subscriptionId);
33725
33299
  this.subCallDepth++;
33726
- yield this.sleep(this.DEBOUNCE_MS);
33727
- if (this.subCallDepth === 1) {
33728
- yield this.createSocket();
33300
+ try {
33301
+ yield this.sleep(this.DEBOUNCE_MS);
33302
+ if (this.subCallDepth === 1) {
33303
+ if (!this.socket || this.socket.readyState > WebSocket.OPEN) {
33304
+ yield this.createSocket();
33305
+ }
33306
+ else if (this.socket.readyState === WebSocket.OPEN) {
33307
+ this.sendPendingSubscribes();
33308
+ }
33309
+ }
33729
33310
  }
33730
- this.subCallDepth--;
33731
- return {
33732
- close: () => __awaiter(this, void 0, void 0, function* () {
33733
- const subscriptionId = this.slotToSubscriptionId.get(slot);
33734
- this.activeSubscriptions.delete(slot);
33735
- this.slotToSubscriptionId.delete(slot);
33736
- if (subscriptionId) {
33737
- this.subscriptionIdToSlot.delete(subscriptionId);
33311
+ finally {
33312
+ this.subCallDepth--;
33313
+ }
33314
+ const unsubscribe = () => __awaiter(this, void 0, void 0, function* () {
33315
+ if (!this.activeSubscriptions.has(subscriptionId)) {
33316
+ return;
33317
+ }
33318
+ this.activeSubscriptions.delete(subscriptionId);
33319
+ this.pendingSubscribes.delete(subscriptionId);
33320
+ this.sendUnsubscribeMessage([subscriptionId]);
33321
+ });
33322
+ const update = (changes) => __awaiter(this, void 0, void 0, function* () {
33323
+ const subscription = this.activeSubscriptions.get(subscriptionId);
33324
+ if (!subscription) {
33325
+ return;
33326
+ }
33327
+ if (changes.channels !== undefined) {
33328
+ const nextChannelStrings = changes.channels.map(ch => this.channelToString(ch));
33329
+ subscription.channels = new Set(nextChannelStrings);
33330
+ }
33331
+ if (changes.queries !== undefined) {
33332
+ const nextQueries = [];
33333
+ for (const q of changes.queries) {
33334
+ if (Array.isArray(q)) {
33335
+ for (const inner of q) {
33336
+ nextQueries.push(typeof inner === 'string' ? inner : inner.toString());
33337
+ }
33338
+ }
33339
+ else {
33340
+ nextQueries.push(typeof q === 'string' ? q : q.toString());
33341
+ }
33738
33342
  }
33739
- yield this.createSocket();
33740
- })
33741
- };
33343
+ subscription.queries = nextQueries;
33344
+ }
33345
+ this.enqueuePendingSubscribe(subscriptionId);
33346
+ this.subCallDepth++;
33347
+ try {
33348
+ yield this.sleep(this.DEBOUNCE_MS);
33349
+ if (this.subCallDepth === 1) {
33350
+ if (!this.socket || this.socket.readyState > WebSocket.OPEN) {
33351
+ yield this.createSocket();
33352
+ }
33353
+ else if (this.socket.readyState === WebSocket.OPEN) {
33354
+ this.sendPendingSubscribes();
33355
+ }
33356
+ }
33357
+ }
33358
+ finally {
33359
+ this.subCallDepth--;
33360
+ }
33361
+ });
33362
+ const close = () => __awaiter(this, void 0, void 0, function* () {
33363
+ yield unsubscribe();
33364
+ if (this.activeSubscriptions.size === 0) {
33365
+ this.reconnect = false;
33366
+ yield this.closeSocket();
33367
+ }
33368
+ });
33369
+ return { unsubscribe, update, close };
33742
33370
  });
33743
33371
  }
33744
- // cleanUp is no longer needed - slots are removed directly in subscribe().close()
33745
- // Channels are automatically rebuilt from remaining slots in createSocket()
33746
33372
  handleMessage(message) {
33747
33373
  if (!message.type) {
33748
33374
  return;
@@ -33760,6 +33386,9 @@
33760
33386
  case this.TYPE_PONG:
33761
33387
  // Handle pong response if needed
33762
33388
  break;
33389
+ case this.TYPE_RESPONSE:
33390
+ this.handleResponseAction(message);
33391
+ break;
33763
33392
  }
33764
33393
  }
33765
33394
  handleResponseConnected(message) {
@@ -33768,23 +33397,10 @@
33768
33397
  return;
33769
33398
  }
33770
33399
  const messageData = message.data;
33771
- // Store subscription ID mappings from backend
33772
- // Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
33773
- if (messageData.subscriptions) {
33774
- this.slotToSubscriptionId.clear();
33775
- this.subscriptionIdToSlot.clear();
33776
- for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
33777
- const slot = Number(slotStr);
33778
- if (!isNaN(slot)) {
33779
- this.slotToSubscriptionId.set(slot, subscriptionId);
33780
- this.subscriptionIdToSlot.set(subscriptionId, slot);
33781
- }
33782
- }
33783
- }
33784
33400
  let session = this.client.config.session;
33785
33401
  if (!session) {
33786
33402
  try {
33787
- const cookie = JSON.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
33403
+ const cookie = JSONbig.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
33788
33404
  session = cookie === null || cookie === void 0 ? void 0 : cookie[`a_session_${this.client.config.project}`];
33789
33405
  }
33790
33406
  catch (error) {
@@ -33792,13 +33408,17 @@
33792
33408
  }
33793
33409
  }
33794
33410
  if (session && !messageData.user) {
33795
- (_b = this.socket) === null || _b === void 0 ? void 0 : _b.send(JSON.stringify({
33411
+ (_b = this.socket) === null || _b === void 0 ? void 0 : _b.send(JSONbig.stringify({
33796
33412
  type: 'authentication',
33797
33413
  data: {
33798
33414
  session
33799
33415
  }
33800
33416
  }));
33801
33417
  }
33418
+ for (const subscriptionId of this.activeSubscriptions.keys()) {
33419
+ this.enqueuePendingSubscribe(subscriptionId);
33420
+ }
33421
+ this.sendPendingSubscribes();
33802
33422
  }
33803
33423
  handleResponseError(message) {
33804
33424
  var _a, _b;
@@ -33819,25 +33439,25 @@
33819
33439
  if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) {
33820
33440
  return;
33821
33441
  }
33822
- // Iterate over all matching subscriptionIds and call callback for each
33823
33442
  for (const subscriptionId of subscriptions) {
33824
- // O(1) lookup using subscriptionId
33825
- const slot = this.subscriptionIdToSlot.get(subscriptionId);
33826
- if (slot !== undefined) {
33827
- const subscription = this.activeSubscriptions.get(slot);
33828
- if (subscription) {
33829
- const response = {
33830
- events,
33831
- channels,
33832
- timestamp,
33833
- payload,
33834
- subscriptions
33835
- };
33836
- subscription.callback(response);
33837
- }
33443
+ const subscription = this.activeSubscriptions.get(subscriptionId);
33444
+ if (!subscription) {
33445
+ continue;
33838
33446
  }
33447
+ subscription.callback({
33448
+ events,
33449
+ channels,
33450
+ timestamp,
33451
+ payload,
33452
+ subscriptions
33453
+ });
33839
33454
  }
33840
33455
  }
33456
+ handleResponseAction(_message) {
33457
+ // The SDK generates subscriptionIds client-side and sends them on every
33458
+ // subscribe/unsubscribe, so subscribe/unsubscribe acks carry no state
33459
+ // the SDK needs to reconcile.
33460
+ }
33841
33461
  }
33842
33462
 
33843
33463
  /**
@@ -33988,46 +33608,6 @@
33988
33608
  }
33989
33609
  }
33990
33610
 
33991
- var _a, _ID_hexTimestamp;
33992
- /**
33993
- * Helper class to generate ID strings for resources.
33994
- */
33995
- class ID {
33996
- /**
33997
- * Uses the provided ID as the ID for the resource.
33998
- *
33999
- * @param {string} id
34000
- * @returns {string}
34001
- */
34002
- static custom(id) {
34003
- return id;
34004
- }
34005
- /**
34006
- * Have Appwrite generate a unique ID for you.
34007
- *
34008
- * @param {number} padding. Default is 7.
34009
- * @returns {string}
34010
- */
34011
- static unique(padding = 7) {
34012
- // Generate a unique ID with padding to have a longer ID
34013
- const baseId = __classPrivateFieldGet(_a, _a, "m", _ID_hexTimestamp).call(_a);
34014
- let randomPadding = '';
34015
- for (let i = 0; i < padding; i++) {
34016
- const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
34017
- randomPadding += randomHexDigit;
34018
- }
34019
- return baseId + randomPadding;
34020
- }
34021
- }
34022
- _a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
34023
- const now = new Date();
34024
- const sec = Math.floor(now.getTime() / 1000);
34025
- const msec = now.getMilliseconds();
34026
- // Convert to hexadecimal
34027
- const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0');
34028
- return hexTimestamp;
34029
- };
34030
-
34031
33611
  function normalize(id) {
34032
33612
  if (id === undefined || id === null) {
34033
33613
  throw new Error("Channel ID is required");
@@ -34471,6 +34051,8 @@
34471
34051
  Scopes["PlatformsRead"] = "platforms.read";
34472
34052
  Scopes["PlatformsWrite"] = "platforms.write";
34473
34053
  Scopes["PoliciesWrite"] = "policies.write";
34054
+ Scopes["TemplatesRead"] = "templates.read";
34055
+ Scopes["TemplatesWrite"] = "templates.write";
34474
34056
  Scopes["PoliciesRead"] = "policies.read";
34475
34057
  Scopes["ArchivesRead"] = "archives.read";
34476
34058
  Scopes["ArchivesWrite"] = "archives.write";
@@ -35355,9 +34937,6 @@
35355
34937
  Runtime["Pythonml311"] = "python-ml-3.11";
35356
34938
  Runtime["Pythonml312"] = "python-ml-3.12";
35357
34939
  Runtime["Pythonml313"] = "python-ml-3.13";
35358
- Runtime["Deno121"] = "deno-1.21";
35359
- Runtime["Deno124"] = "deno-1.24";
35360
- Runtime["Deno135"] = "deno-1.35";
35361
34940
  Runtime["Deno140"] = "deno-1.40";
35362
34941
  Runtime["Deno146"] = "deno-1.46";
35363
34942
  Runtime["Deno20"] = "deno-2.0";
@@ -35450,9 +35029,6 @@
35450
35029
  Runtimes["Pythonml311"] = "python-ml-3.11";
35451
35030
  Runtimes["Pythonml312"] = "python-ml-3.12";
35452
35031
  Runtimes["Pythonml313"] = "python-ml-3.13";
35453
- Runtimes["Deno121"] = "deno-1.21";
35454
- Runtimes["Deno124"] = "deno-1.24";
35455
- Runtimes["Deno135"] = "deno-1.35";
35456
35032
  Runtimes["Deno140"] = "deno-1.40";
35457
35033
  Runtimes["Deno146"] = "deno-1.46";
35458
35034
  Runtimes["Deno20"] = "deno-2.0";
@@ -35697,51 +35273,11 @@
35697
35273
  ServiceId["Messaging"] = "messaging";
35698
35274
  })(exports.ServiceId || (exports.ServiceId = {}));
35699
35275
 
35700
- exports.ProjectUsageRange = void 0;
35701
- (function (ProjectUsageRange) {
35702
- ProjectUsageRange["OneHour"] = "1h";
35703
- ProjectUsageRange["OneDay"] = "1d";
35704
- })(exports.ProjectUsageRange || (exports.ProjectUsageRange = {}));
35705
-
35706
- exports.Region = void 0;
35707
- (function (Region) {
35708
- Region["Fra"] = "fra";
35709
- Region["Nyc"] = "nyc";
35710
- Region["Syd"] = "syd";
35711
- Region["Sfo"] = "sfo";
35712
- Region["Sgp"] = "sgp";
35713
- Region["Tor"] = "tor";
35714
- })(exports.Region || (exports.Region = {}));
35715
-
35716
- exports.AuthMethod = void 0;
35717
- (function (AuthMethod) {
35718
- AuthMethod["Emailpassword"] = "email-password";
35719
- AuthMethod["Magicurl"] = "magic-url";
35720
- AuthMethod["Emailotp"] = "email-otp";
35721
- AuthMethod["Anonymous"] = "anonymous";
35722
- AuthMethod["Invites"] = "invites";
35723
- AuthMethod["Jwt"] = "jwt";
35724
- AuthMethod["Phone"] = "phone";
35725
- })(exports.AuthMethod || (exports.AuthMethod = {}));
35726
-
35727
- exports.ResourceType = void 0;
35728
- (function (ResourceType) {
35729
- ResourceType["Function"] = "function";
35730
- ResourceType["Execution"] = "execution";
35731
- ResourceType["Message"] = "message";
35732
- ResourceType["Backup"] = "backup";
35733
- })(exports.ResourceType || (exports.ResourceType = {}));
35734
-
35735
- exports.SMTPSecure = void 0;
35736
- (function (SMTPSecure) {
35737
- SMTPSecure["Tls"] = "tls";
35738
- SMTPSecure["Ssl"] = "ssl";
35739
- })(exports.SMTPSecure || (exports.SMTPSecure = {}));
35740
-
35741
- exports.Status = void 0;
35742
- (function (Status) {
35743
- Status["Active"] = "active";
35744
- })(exports.Status || (exports.Status = {}));
35276
+ exports.Secure = void 0;
35277
+ (function (Secure) {
35278
+ Secure["Tls"] = "tls";
35279
+ Secure["Ssl"] = "ssl";
35280
+ })(exports.Secure || (exports.Secure = {}));
35745
35281
 
35746
35282
  exports.EmailTemplateType = void 0;
35747
35283
  (function (EmailTemplateType) {
@@ -35889,148 +35425,45 @@
35889
35425
  EmailTemplateLocale["Zu"] = "zu";
35890
35426
  })(exports.EmailTemplateLocale || (exports.EmailTemplateLocale = {}));
35891
35427
 
35892
- exports.SmsTemplateType = void 0;
35893
- (function (SmsTemplateType) {
35894
- SmsTemplateType["Verification"] = "verification";
35895
- SmsTemplateType["Login"] = "login";
35896
- SmsTemplateType["Invitation"] = "invitation";
35897
- SmsTemplateType["MfaChallenge"] = "mfaChallenge";
35898
- })(exports.SmsTemplateType || (exports.SmsTemplateType = {}));
35899
-
35900
- exports.SmsTemplateLocale = void 0;
35901
- (function (SmsTemplateLocale) {
35902
- SmsTemplateLocale["Af"] = "af";
35903
- SmsTemplateLocale["Arae"] = "ar-ae";
35904
- SmsTemplateLocale["Arbh"] = "ar-bh";
35905
- SmsTemplateLocale["Ardz"] = "ar-dz";
35906
- SmsTemplateLocale["Areg"] = "ar-eg";
35907
- SmsTemplateLocale["Ariq"] = "ar-iq";
35908
- SmsTemplateLocale["Arjo"] = "ar-jo";
35909
- SmsTemplateLocale["Arkw"] = "ar-kw";
35910
- SmsTemplateLocale["Arlb"] = "ar-lb";
35911
- SmsTemplateLocale["Arly"] = "ar-ly";
35912
- SmsTemplateLocale["Arma"] = "ar-ma";
35913
- SmsTemplateLocale["Arom"] = "ar-om";
35914
- SmsTemplateLocale["Arqa"] = "ar-qa";
35915
- SmsTemplateLocale["Arsa"] = "ar-sa";
35916
- SmsTemplateLocale["Arsy"] = "ar-sy";
35917
- SmsTemplateLocale["Artn"] = "ar-tn";
35918
- SmsTemplateLocale["Arye"] = "ar-ye";
35919
- SmsTemplateLocale["As"] = "as";
35920
- SmsTemplateLocale["Az"] = "az";
35921
- SmsTemplateLocale["Be"] = "be";
35922
- SmsTemplateLocale["Bg"] = "bg";
35923
- SmsTemplateLocale["Bh"] = "bh";
35924
- SmsTemplateLocale["Bn"] = "bn";
35925
- SmsTemplateLocale["Bs"] = "bs";
35926
- SmsTemplateLocale["Ca"] = "ca";
35927
- SmsTemplateLocale["Cs"] = "cs";
35928
- SmsTemplateLocale["Cy"] = "cy";
35929
- SmsTemplateLocale["Da"] = "da";
35930
- SmsTemplateLocale["De"] = "de";
35931
- SmsTemplateLocale["Deat"] = "de-at";
35932
- SmsTemplateLocale["Dech"] = "de-ch";
35933
- SmsTemplateLocale["Deli"] = "de-li";
35934
- SmsTemplateLocale["Delu"] = "de-lu";
35935
- SmsTemplateLocale["El"] = "el";
35936
- SmsTemplateLocale["En"] = "en";
35937
- SmsTemplateLocale["Enau"] = "en-au";
35938
- SmsTemplateLocale["Enbz"] = "en-bz";
35939
- SmsTemplateLocale["Enca"] = "en-ca";
35940
- SmsTemplateLocale["Engb"] = "en-gb";
35941
- SmsTemplateLocale["Enie"] = "en-ie";
35942
- SmsTemplateLocale["Enjm"] = "en-jm";
35943
- SmsTemplateLocale["Ennz"] = "en-nz";
35944
- SmsTemplateLocale["Entt"] = "en-tt";
35945
- SmsTemplateLocale["Enus"] = "en-us";
35946
- SmsTemplateLocale["Enza"] = "en-za";
35947
- SmsTemplateLocale["Eo"] = "eo";
35948
- SmsTemplateLocale["Es"] = "es";
35949
- SmsTemplateLocale["Esar"] = "es-ar";
35950
- SmsTemplateLocale["Esbo"] = "es-bo";
35951
- SmsTemplateLocale["Escl"] = "es-cl";
35952
- SmsTemplateLocale["Esco"] = "es-co";
35953
- SmsTemplateLocale["Escr"] = "es-cr";
35954
- SmsTemplateLocale["Esdo"] = "es-do";
35955
- SmsTemplateLocale["Esec"] = "es-ec";
35956
- SmsTemplateLocale["Esgt"] = "es-gt";
35957
- SmsTemplateLocale["Eshn"] = "es-hn";
35958
- SmsTemplateLocale["Esmx"] = "es-mx";
35959
- SmsTemplateLocale["Esni"] = "es-ni";
35960
- SmsTemplateLocale["Espa"] = "es-pa";
35961
- SmsTemplateLocale["Espe"] = "es-pe";
35962
- SmsTemplateLocale["Espr"] = "es-pr";
35963
- SmsTemplateLocale["Espy"] = "es-py";
35964
- SmsTemplateLocale["Essv"] = "es-sv";
35965
- SmsTemplateLocale["Esuy"] = "es-uy";
35966
- SmsTemplateLocale["Esve"] = "es-ve";
35967
- SmsTemplateLocale["Et"] = "et";
35968
- SmsTemplateLocale["Eu"] = "eu";
35969
- SmsTemplateLocale["Fa"] = "fa";
35970
- SmsTemplateLocale["Fi"] = "fi";
35971
- SmsTemplateLocale["Fo"] = "fo";
35972
- SmsTemplateLocale["Fr"] = "fr";
35973
- SmsTemplateLocale["Frbe"] = "fr-be";
35974
- SmsTemplateLocale["Frca"] = "fr-ca";
35975
- SmsTemplateLocale["Frch"] = "fr-ch";
35976
- SmsTemplateLocale["Frlu"] = "fr-lu";
35977
- SmsTemplateLocale["Ga"] = "ga";
35978
- SmsTemplateLocale["Gd"] = "gd";
35979
- SmsTemplateLocale["He"] = "he";
35980
- SmsTemplateLocale["Hi"] = "hi";
35981
- SmsTemplateLocale["Hr"] = "hr";
35982
- SmsTemplateLocale["Hu"] = "hu";
35983
- SmsTemplateLocale["Id"] = "id";
35984
- SmsTemplateLocale["Is"] = "is";
35985
- SmsTemplateLocale["It"] = "it";
35986
- SmsTemplateLocale["Itch"] = "it-ch";
35987
- SmsTemplateLocale["Ja"] = "ja";
35988
- SmsTemplateLocale["Ji"] = "ji";
35989
- SmsTemplateLocale["Ko"] = "ko";
35990
- SmsTemplateLocale["Ku"] = "ku";
35991
- SmsTemplateLocale["Lt"] = "lt";
35992
- SmsTemplateLocale["Lv"] = "lv";
35993
- SmsTemplateLocale["Mk"] = "mk";
35994
- SmsTemplateLocale["Ml"] = "ml";
35995
- SmsTemplateLocale["Ms"] = "ms";
35996
- SmsTemplateLocale["Mt"] = "mt";
35997
- SmsTemplateLocale["Nb"] = "nb";
35998
- SmsTemplateLocale["Ne"] = "ne";
35999
- SmsTemplateLocale["Nl"] = "nl";
36000
- SmsTemplateLocale["Nlbe"] = "nl-be";
36001
- SmsTemplateLocale["Nn"] = "nn";
36002
- SmsTemplateLocale["No"] = "no";
36003
- SmsTemplateLocale["Pa"] = "pa";
36004
- SmsTemplateLocale["Pl"] = "pl";
36005
- SmsTemplateLocale["Pt"] = "pt";
36006
- SmsTemplateLocale["Ptbr"] = "pt-br";
36007
- SmsTemplateLocale["Rm"] = "rm";
36008
- SmsTemplateLocale["Ro"] = "ro";
36009
- SmsTemplateLocale["Romd"] = "ro-md";
36010
- SmsTemplateLocale["Ru"] = "ru";
36011
- SmsTemplateLocale["Rumd"] = "ru-md";
36012
- SmsTemplateLocale["Sb"] = "sb";
36013
- SmsTemplateLocale["Sk"] = "sk";
36014
- SmsTemplateLocale["Sl"] = "sl";
36015
- SmsTemplateLocale["Sq"] = "sq";
36016
- SmsTemplateLocale["Sr"] = "sr";
36017
- SmsTemplateLocale["Sv"] = "sv";
36018
- SmsTemplateLocale["Svfi"] = "sv-fi";
36019
- SmsTemplateLocale["Th"] = "th";
36020
- SmsTemplateLocale["Tn"] = "tn";
36021
- SmsTemplateLocale["Tr"] = "tr";
36022
- SmsTemplateLocale["Ts"] = "ts";
36023
- SmsTemplateLocale["Ua"] = "ua";
36024
- SmsTemplateLocale["Ur"] = "ur";
36025
- SmsTemplateLocale["Ve"] = "ve";
36026
- SmsTemplateLocale["Vi"] = "vi";
36027
- SmsTemplateLocale["Xh"] = "xh";
36028
- SmsTemplateLocale["Zhcn"] = "zh-cn";
36029
- SmsTemplateLocale["Zhhk"] = "zh-hk";
36030
- SmsTemplateLocale["Zhsg"] = "zh-sg";
36031
- SmsTemplateLocale["Zhtw"] = "zh-tw";
36032
- SmsTemplateLocale["Zu"] = "zu";
36033
- })(exports.SmsTemplateLocale || (exports.SmsTemplateLocale = {}));
35428
+ exports.ProjectUsageRange = void 0;
35429
+ (function (ProjectUsageRange) {
35430
+ ProjectUsageRange["OneHour"] = "1h";
35431
+ ProjectUsageRange["OneDay"] = "1d";
35432
+ })(exports.ProjectUsageRange || (exports.ProjectUsageRange = {}));
35433
+
35434
+ exports.Region = void 0;
35435
+ (function (Region) {
35436
+ Region["Fra"] = "fra";
35437
+ Region["Nyc"] = "nyc";
35438
+ Region["Syd"] = "syd";
35439
+ Region["Sfo"] = "sfo";
35440
+ Region["Sgp"] = "sgp";
35441
+ Region["Tor"] = "tor";
35442
+ })(exports.Region || (exports.Region = {}));
35443
+
35444
+ exports.AuthMethod = void 0;
35445
+ (function (AuthMethod) {
35446
+ AuthMethod["Emailpassword"] = "email-password";
35447
+ AuthMethod["Magicurl"] = "magic-url";
35448
+ AuthMethod["Emailotp"] = "email-otp";
35449
+ AuthMethod["Anonymous"] = "anonymous";
35450
+ AuthMethod["Invites"] = "invites";
35451
+ AuthMethod["Jwt"] = "jwt";
35452
+ AuthMethod["Phone"] = "phone";
35453
+ })(exports.AuthMethod || (exports.AuthMethod = {}));
35454
+
35455
+ exports.ResourceType = void 0;
35456
+ (function (ResourceType) {
35457
+ ResourceType["Function"] = "function";
35458
+ ResourceType["Execution"] = "execution";
35459
+ ResourceType["Message"] = "message";
35460
+ ResourceType["Backup"] = "backup";
35461
+ })(exports.ResourceType || (exports.ResourceType = {}));
35462
+
35463
+ exports.Status = void 0;
35464
+ (function (Status) {
35465
+ Status["Active"] = "active";
35466
+ })(exports.Status || (exports.Status = {}));
36034
35467
 
36035
35468
  exports.StatusCode = void 0;
36036
35469
  (function (StatusCode) {
@@ -36098,9 +35531,6 @@
36098
35531
  BuildRuntime["Pythonml311"] = "python-ml-3.11";
36099
35532
  BuildRuntime["Pythonml312"] = "python-ml-3.12";
36100
35533
  BuildRuntime["Pythonml313"] = "python-ml-3.13";
36101
- BuildRuntime["Deno121"] = "deno-1.21";
36102
- BuildRuntime["Deno124"] = "deno-1.24";
36103
- BuildRuntime["Deno135"] = "deno-1.35";
36104
35534
  BuildRuntime["Deno140"] = "deno-1.40";
36105
35535
  BuildRuntime["Deno146"] = "deno-1.46";
36106
35536
  BuildRuntime["Deno20"] = "deno-2.0";
@@ -36291,6 +35721,16 @@
36291
35721
  IndexStatus["Failed"] = "failed";
36292
35722
  })(exports.IndexStatus || (exports.IndexStatus = {}));
36293
35723
 
35724
+ exports.DetectionFrameworkType = void 0;
35725
+ (function (DetectionFrameworkType) {
35726
+ DetectionFrameworkType["Framework"] = "framework";
35727
+ })(exports.DetectionFrameworkType || (exports.DetectionFrameworkType = {}));
35728
+
35729
+ exports.DetectionRuntimeType = void 0;
35730
+ (function (DetectionRuntimeType) {
35731
+ DetectionRuntimeType["Runtime"] = "runtime";
35732
+ })(exports.DetectionRuntimeType || (exports.DetectionRuntimeType = {}));
35733
+
36294
35734
  exports.DeploymentStatus = void 0;
36295
35735
  (function (DeploymentStatus) {
36296
35736
  DeploymentStatus["Waiting"] = "waiting";