@appwrite.io/console 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/sdk.js CHANGED
@@ -24,6 +24,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
24
24
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
25
25
  step((generator = generator.apply(thisArg, _arguments || [])).next());
26
26
  });
27
+ }
28
+
29
+ function __classPrivateFieldGet(receiver, state, kind, f) {
30
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
31
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
32
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
27
33
  }
28
34
 
29
35
  class Service {
@@ -115,7 +121,7 @@ class Client {
115
121
  'x-sdk-name': 'Console',
116
122
  'x-sdk-platform': 'console',
117
123
  'x-sdk-language': 'web',
118
- 'x-sdk-version': '0.6.0',
124
+ 'x-sdk-version': '0.6.1',
119
125
  'X-Appwrite-Response-Format': '1.5.0',
120
126
  };
121
127
  this.realtime = {
@@ -6619,14 +6625,14 @@ class Messaging extends Service {
6619
6625
  *
6620
6626
  * @param {string} providerId
6621
6627
  * @param {string} name
6622
- * @param {string} from
6628
+ * @param {string} templateId
6623
6629
  * @param {string} senderId
6624
6630
  * @param {string} authKey
6625
6631
  * @param {boolean} enabled
6626
6632
  * @throws {AppwriteException}
6627
6633
  * @returns {Promise}
6628
6634
  */
6629
- createMsg91Provider(providerId, name, from, senderId, authKey, enabled) {
6635
+ createMsg91Provider(providerId, name, templateId, senderId, authKey, enabled) {
6630
6636
  return __awaiter(this, void 0, void 0, function* () {
6631
6637
  if (typeof providerId === 'undefined') {
6632
6638
  throw new AppwriteException('Missing required parameter: "providerId"');
@@ -6642,8 +6648,8 @@ class Messaging extends Service {
6642
6648
  if (typeof name !== 'undefined') {
6643
6649
  payload['name'] = name;
6644
6650
  }
6645
- if (typeof from !== 'undefined') {
6646
- payload['from'] = from;
6651
+ if (typeof templateId !== 'undefined') {
6652
+ payload['templateId'] = templateId;
6647
6653
  }
6648
6654
  if (typeof senderId !== 'undefined') {
6649
6655
  payload['senderId'] = senderId;
@@ -6668,13 +6674,13 @@ class Messaging extends Service {
6668
6674
  * @param {string} providerId
6669
6675
  * @param {string} name
6670
6676
  * @param {boolean} enabled
6677
+ * @param {string} templateId
6671
6678
  * @param {string} senderId
6672
6679
  * @param {string} authKey
6673
- * @param {string} from
6674
6680
  * @throws {AppwriteException}
6675
6681
  * @returns {Promise}
6676
6682
  */
6677
- updateMsg91Provider(providerId, name, enabled, senderId, authKey, from) {
6683
+ updateMsg91Provider(providerId, name, enabled, templateId, senderId, authKey) {
6678
6684
  return __awaiter(this, void 0, void 0, function* () {
6679
6685
  if (typeof providerId === 'undefined') {
6680
6686
  throw new AppwriteException('Missing required parameter: "providerId"');
@@ -6687,15 +6693,15 @@ class Messaging extends Service {
6687
6693
  if (typeof enabled !== 'undefined') {
6688
6694
  payload['enabled'] = enabled;
6689
6695
  }
6696
+ if (typeof templateId !== 'undefined') {
6697
+ payload['templateId'] = templateId;
6698
+ }
6690
6699
  if (typeof senderId !== 'undefined') {
6691
6700
  payload['senderId'] = senderId;
6692
6701
  }
6693
6702
  if (typeof authKey !== 'undefined') {
6694
6703
  payload['authKey'] = authKey;
6695
6704
  }
6696
- if (typeof from !== 'undefined') {
6697
- payload['from'] = from;
6698
- }
6699
6705
  const uri = new URL(this.client.config.endpoint + apiPath);
6700
6706
  return yield this.client.call('patch', uri, {
6701
6707
  'content-type': 'application/json',
@@ -12881,14 +12887,30 @@ class Role {
12881
12887
  }
12882
12888
  }
12883
12889
 
12890
+ var _a, _ID_hexTimestamp;
12884
12891
  class ID {
12885
12892
  static custom(id) {
12886
12893
  return id;
12887
12894
  }
12888
- static unique() {
12889
- return 'unique()';
12895
+ static unique(padding = 7) {
12896
+ // Generate a unique ID with padding to have a longer ID
12897
+ const baseId = __classPrivateFieldGet(ID, _a, "m", _ID_hexTimestamp).call(ID);
12898
+ let randomPadding = '';
12899
+ for (let i = 0; i < padding; i++) {
12900
+ const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
12901
+ randomPadding += randomHexDigit;
12902
+ }
12903
+ return baseId + randomPadding;
12890
12904
  }
12891
12905
  }
12906
+ _a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
12907
+ const now = new Date();
12908
+ const sec = Math.floor(now.getTime() / 1000);
12909
+ const msec = now.getMilliseconds();
12910
+ // Convert to hexadecimal
12911
+ const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0');
12912
+ return hexTimestamp;
12913
+ };
12892
12914
 
12893
12915
  var AuthenticatorType;
12894
12916
  (function (AuthenticatorType) {
@@ -13019,7 +13041,7 @@ var Flag;
13019
13041
  Flag["Switzerland"] = "ch";
13020
13042
  Flag["Chile"] = "cl";
13021
13043
  Flag["China"] = "cn";
13022
- Flag["CTeDIvoire"] = "ci";
13044
+ Flag["CoteDIvoire"] = "ci";
13023
13045
  Flag["Cameroon"] = "cm";
13024
13046
  Flag["DemocraticRepublicOfTheCongo"] = "cd";
13025
13047
  Flag["RepublicOfTheCongo"] = "cg";