mezon-js 2.13.72 → 2.13.73

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.
@@ -1549,7 +1549,7 @@ var require_minimal = __commonJS({
1549
1549
  util.isString = function isString(value) {
1550
1550
  return typeof value === "string" || value instanceof String;
1551
1551
  };
1552
- util.isObject = function isObject(value) {
1552
+ util.isObject = function isObject2(value) {
1553
1553
  return value && typeof value === "object";
1554
1554
  };
1555
1555
  util.isset = /**
@@ -3088,6 +3088,57 @@ var Int32Value = {
3088
3088
  return message;
3089
3089
  }
3090
3090
  };
3091
+ function createBaseBoolValue() {
3092
+ return { value: false };
3093
+ }
3094
+ var BoolValue = {
3095
+ encode(message, writer = import_minimal3.default.Writer.create()) {
3096
+ if (message.value !== false) {
3097
+ writer.uint32(8).bool(message.value);
3098
+ }
3099
+ return writer;
3100
+ },
3101
+ decode(input, length) {
3102
+ const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
3103
+ let end = length === void 0 ? reader.len : reader.pos + length;
3104
+ const message = createBaseBoolValue();
3105
+ while (reader.pos < end) {
3106
+ const tag = reader.uint32();
3107
+ switch (tag >>> 3) {
3108
+ case 1:
3109
+ if (tag !== 8) {
3110
+ break;
3111
+ }
3112
+ message.value = reader.bool();
3113
+ continue;
3114
+ }
3115
+ if ((tag & 7) === 4 || tag === 0) {
3116
+ break;
3117
+ }
3118
+ reader.skipType(tag & 7);
3119
+ }
3120
+ return message;
3121
+ },
3122
+ fromJSON(object) {
3123
+ return { value: isSet2(object.value) ? globalThis.Boolean(object.value) : false };
3124
+ },
3125
+ toJSON(message) {
3126
+ const obj = {};
3127
+ if (message.value !== false) {
3128
+ obj.value = message.value;
3129
+ }
3130
+ return obj;
3131
+ },
3132
+ create(base) {
3133
+ return BoolValue.fromPartial(base != null ? base : {});
3134
+ },
3135
+ fromPartial(object) {
3136
+ var _a;
3137
+ const message = createBaseBoolValue();
3138
+ message.value = (_a = object.value) != null ? _a : false;
3139
+ return message;
3140
+ }
3141
+ };
3091
3142
  if (import_minimal3.default.util.Long !== import_long2.default) {
3092
3143
  import_minimal3.default.util.Long = import_long2.default;
3093
3144
  import_minimal3.default.configure();
@@ -3272,6 +3323,171 @@ var Account = {
3272
3323
  return message;
3273
3324
  }
3274
3325
  };
3326
+ function createBaseSessionRefreshRequest() {
3327
+ return { token: "", vars: {}, is_remember: void 0 };
3328
+ }
3329
+ var SessionRefreshRequest = {
3330
+ encode(message, writer = import_minimal4.default.Writer.create()) {
3331
+ if (message.token !== "") {
3332
+ writer.uint32(10).string(message.token);
3333
+ }
3334
+ Object.entries(message.vars).forEach(([key, value]) => {
3335
+ SessionRefreshRequest_VarsEntry.encode({ key, value }, writer.uint32(18).fork()).ldelim();
3336
+ });
3337
+ if (message.is_remember !== void 0) {
3338
+ BoolValue.encode({ value: message.is_remember }, writer.uint32(26).fork()).ldelim();
3339
+ }
3340
+ return writer;
3341
+ },
3342
+ decode(input, length) {
3343
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
3344
+ let end = length === void 0 ? reader.len : reader.pos + length;
3345
+ const message = createBaseSessionRefreshRequest();
3346
+ while (reader.pos < end) {
3347
+ const tag = reader.uint32();
3348
+ switch (tag >>> 3) {
3349
+ case 1:
3350
+ if (tag !== 10) {
3351
+ break;
3352
+ }
3353
+ message.token = reader.string();
3354
+ continue;
3355
+ case 2:
3356
+ if (tag !== 18) {
3357
+ break;
3358
+ }
3359
+ const entry2 = SessionRefreshRequest_VarsEntry.decode(reader, reader.uint32());
3360
+ if (entry2.value !== void 0) {
3361
+ message.vars[entry2.key] = entry2.value;
3362
+ }
3363
+ continue;
3364
+ case 3:
3365
+ if (tag !== 26) {
3366
+ break;
3367
+ }
3368
+ message.is_remember = BoolValue.decode(reader, reader.uint32()).value;
3369
+ continue;
3370
+ }
3371
+ if ((tag & 7) === 4 || tag === 0) {
3372
+ break;
3373
+ }
3374
+ reader.skipType(tag & 7);
3375
+ }
3376
+ return message;
3377
+ },
3378
+ fromJSON(object) {
3379
+ return {
3380
+ token: isSet3(object.token) ? globalThis.String(object.token) : "",
3381
+ vars: isObject(object.vars) ? Object.entries(object.vars).reduce((acc, [key, value]) => {
3382
+ acc[key] = String(value);
3383
+ return acc;
3384
+ }, {}) : {},
3385
+ is_remember: isSet3(object.is_remember) ? Boolean(object.is_remember) : void 0
3386
+ };
3387
+ },
3388
+ toJSON(message) {
3389
+ const obj = {};
3390
+ if (message.token !== "") {
3391
+ obj.token = message.token;
3392
+ }
3393
+ if (message.vars) {
3394
+ const entries = Object.entries(message.vars);
3395
+ if (entries.length > 0) {
3396
+ obj.vars = {};
3397
+ entries.forEach(([k, v]) => {
3398
+ obj.vars[k] = v;
3399
+ });
3400
+ }
3401
+ }
3402
+ if (message.is_remember !== void 0) {
3403
+ obj.is_remember = message.is_remember;
3404
+ }
3405
+ return obj;
3406
+ },
3407
+ create(base) {
3408
+ return SessionRefreshRequest.fromPartial(base != null ? base : {});
3409
+ },
3410
+ fromPartial(object) {
3411
+ var _a, _b, _c;
3412
+ const message = createBaseSessionRefreshRequest();
3413
+ message.token = (_a = object.token) != null ? _a : "";
3414
+ message.vars = Object.entries((_b = object.vars) != null ? _b : {}).reduce((acc, [key, value]) => {
3415
+ if (value !== void 0) {
3416
+ acc[key] = globalThis.String(value);
3417
+ }
3418
+ return acc;
3419
+ }, {});
3420
+ message.is_remember = (_c = object.is_remember) != null ? _c : void 0;
3421
+ return message;
3422
+ }
3423
+ };
3424
+ function createBaseSessionRefreshRequest_VarsEntry() {
3425
+ return { key: "", value: "" };
3426
+ }
3427
+ var SessionRefreshRequest_VarsEntry = {
3428
+ encode(message, writer = import_minimal4.default.Writer.create()) {
3429
+ if (message.key !== "") {
3430
+ writer.uint32(10).string(message.key);
3431
+ }
3432
+ if (message.value !== "") {
3433
+ writer.uint32(18).string(message.value);
3434
+ }
3435
+ return writer;
3436
+ },
3437
+ decode(input, length) {
3438
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
3439
+ let end = length === void 0 ? reader.len : reader.pos + length;
3440
+ const message = createBaseSessionRefreshRequest_VarsEntry();
3441
+ while (reader.pos < end) {
3442
+ const tag = reader.uint32();
3443
+ switch (tag >>> 3) {
3444
+ case 1:
3445
+ if (tag !== 10) {
3446
+ break;
3447
+ }
3448
+ message.key = reader.string();
3449
+ continue;
3450
+ case 2:
3451
+ if (tag !== 18) {
3452
+ break;
3453
+ }
3454
+ message.value = reader.string();
3455
+ continue;
3456
+ }
3457
+ if ((tag & 7) === 4 || tag === 0) {
3458
+ break;
3459
+ }
3460
+ reader.skipType(tag & 7);
3461
+ }
3462
+ return message;
3463
+ },
3464
+ fromJSON(object) {
3465
+ return {
3466
+ key: isSet3(object.key) ? globalThis.String(object.key) : "",
3467
+ value: isSet3(object.value) ? globalThis.String(object.value) : ""
3468
+ };
3469
+ },
3470
+ toJSON(message) {
3471
+ const obj = {};
3472
+ if (message.key !== "") {
3473
+ obj.key = message.key;
3474
+ }
3475
+ if (message.value !== "") {
3476
+ obj.value = message.value;
3477
+ }
3478
+ return obj;
3479
+ },
3480
+ create(base) {
3481
+ return SessionRefreshRequest_VarsEntry.fromPartial(base != null ? base : {});
3482
+ },
3483
+ fromPartial(object) {
3484
+ var _a, _b;
3485
+ const message = createBaseSessionRefreshRequest_VarsEntry();
3486
+ message.key = (_a = object.key) != null ? _a : "";
3487
+ message.value = (_b = object.value) != null ? _b : "";
3488
+ return message;
3489
+ }
3490
+ };
3275
3491
  function createBaseIsBannedResponse() {
3276
3492
  return { is_banned: false, expired_ban_time: 0 };
3277
3493
  }
@@ -4887,6 +5103,87 @@ var ClanUserList_ClanUser = {
4887
5103
  return message;
4888
5104
  }
4889
5105
  };
5106
+ function createBaseRegistFcmDeviceTokenResponse() {
5107
+ return { token: "", device_id: "", platform: "" };
5108
+ }
5109
+ var RegistFcmDeviceTokenResponse = {
5110
+ encode(message, writer = import_minimal4.default.Writer.create()) {
5111
+ if (message.token !== "") {
5112
+ writer.uint32(10).string(message.token);
5113
+ }
5114
+ if (message.device_id !== "") {
5115
+ writer.uint32(18).string(message.device_id);
5116
+ }
5117
+ if (message.platform !== "") {
5118
+ writer.uint32(26).string(message.platform);
5119
+ }
5120
+ return writer;
5121
+ },
5122
+ decode(input, length) {
5123
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
5124
+ let end = length === void 0 ? reader.len : reader.pos + length;
5125
+ const message = createBaseRegistFcmDeviceTokenResponse();
5126
+ while (reader.pos < end) {
5127
+ const tag = reader.uint32();
5128
+ switch (tag >>> 3) {
5129
+ case 1:
5130
+ if (tag !== 10) {
5131
+ break;
5132
+ }
5133
+ message.token = reader.string();
5134
+ continue;
5135
+ case 2:
5136
+ if (tag !== 18) {
5137
+ break;
5138
+ }
5139
+ message.device_id = reader.string();
5140
+ continue;
5141
+ case 3:
5142
+ if (tag !== 26) {
5143
+ break;
5144
+ }
5145
+ message.platform = reader.string();
5146
+ continue;
5147
+ }
5148
+ if ((tag & 7) === 4 || tag === 0) {
5149
+ break;
5150
+ }
5151
+ reader.skipType(tag & 7);
5152
+ }
5153
+ return message;
5154
+ },
5155
+ fromJSON(object) {
5156
+ return {
5157
+ token: isSet3(object.token) ? globalThis.String(object.token) : "",
5158
+ device_id: isSet3(object.device_id) ? globalThis.String(object.device_id) : "",
5159
+ platform: isSet3(object.platform) ? globalThis.String(object.platform) : ""
5160
+ };
5161
+ },
5162
+ toJSON(message) {
5163
+ const obj = {};
5164
+ if (message.token !== "") {
5165
+ obj.token = message.token;
5166
+ }
5167
+ if (message.device_id !== "") {
5168
+ obj.device_id = message.device_id;
5169
+ }
5170
+ if (message.platform !== "") {
5171
+ obj.platform = message.platform;
5172
+ }
5173
+ return obj;
5174
+ },
5175
+ create(base) {
5176
+ return RegistFcmDeviceTokenResponse.fromPartial(base != null ? base : {});
5177
+ },
5178
+ fromPartial(object) {
5179
+ var _a, _b, _c;
5180
+ const message = createBaseRegistFcmDeviceTokenResponse();
5181
+ message.token = (_a = object.token) != null ? _a : "";
5182
+ message.device_id = (_b = object.device_id) != null ? _b : "";
5183
+ message.platform = (_c = object.platform) != null ? _c : "";
5184
+ return message;
5185
+ }
5186
+ };
4890
5187
  function createBaseNotification() {
4891
5188
  return {
4892
5189
  id: "",
@@ -5340,6 +5637,115 @@ var NotificationList = {
5340
5637
  return message;
5341
5638
  }
5342
5639
  };
5640
+ function createBaseSession() {
5641
+ return { created: false, token: "", refresh_token: "", user_id: "", is_remember: false };
5642
+ }
5643
+ var Session = {
5644
+ encode(message, writer = import_minimal4.default.Writer.create()) {
5645
+ if (message.created !== false) {
5646
+ writer.uint32(8).bool(message.created);
5647
+ }
5648
+ if (message.token !== "") {
5649
+ writer.uint32(18).string(message.token);
5650
+ }
5651
+ if (message.refresh_token !== "") {
5652
+ writer.uint32(26).string(message.refresh_token);
5653
+ }
5654
+ if (message.user_id !== "") {
5655
+ writer.uint32(34).string(message.user_id);
5656
+ }
5657
+ if (message.is_remember !== false) {
5658
+ writer.uint32(40).bool(message.is_remember);
5659
+ }
5660
+ return writer;
5661
+ },
5662
+ decode(input, length) {
5663
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
5664
+ let end = length === void 0 ? reader.len : reader.pos + length;
5665
+ const message = createBaseSession();
5666
+ while (reader.pos < end) {
5667
+ const tag = reader.uint32();
5668
+ switch (tag >>> 3) {
5669
+ case 1:
5670
+ if (tag !== 8) {
5671
+ break;
5672
+ }
5673
+ message.created = reader.bool();
5674
+ continue;
5675
+ case 2:
5676
+ if (tag !== 18) {
5677
+ break;
5678
+ }
5679
+ message.token = reader.string();
5680
+ continue;
5681
+ case 3:
5682
+ if (tag !== 26) {
5683
+ break;
5684
+ }
5685
+ message.refresh_token = reader.string();
5686
+ continue;
5687
+ case 4:
5688
+ if (tag !== 34) {
5689
+ break;
5690
+ }
5691
+ message.user_id = reader.string();
5692
+ continue;
5693
+ case 5:
5694
+ if (tag !== 40) {
5695
+ break;
5696
+ }
5697
+ message.is_remember = reader.bool();
5698
+ continue;
5699
+ }
5700
+ if ((tag & 7) === 4 || tag === 0) {
5701
+ break;
5702
+ }
5703
+ reader.skipType(tag & 7);
5704
+ }
5705
+ return message;
5706
+ },
5707
+ fromJSON(object) {
5708
+ return {
5709
+ created: isSet3(object.created) ? globalThis.Boolean(object.created) : false,
5710
+ token: isSet3(object.token) ? globalThis.String(object.token) : "",
5711
+ refresh_token: isSet3(object.refresh_token) ? globalThis.String(object.refresh_token) : "",
5712
+ user_id: isSet3(object.user_id) ? globalThis.String(object.user_id) : "",
5713
+ is_remember: isSet3(object.is_remember) ? globalThis.Boolean(object.is_remember) : false
5714
+ };
5715
+ },
5716
+ toJSON(message) {
5717
+ const obj = {};
5718
+ if (message.created !== false) {
5719
+ obj.created = message.created;
5720
+ }
5721
+ if (message.token !== "") {
5722
+ obj.token = message.token;
5723
+ }
5724
+ if (message.refresh_token !== "") {
5725
+ obj.refresh_token = message.refresh_token;
5726
+ }
5727
+ if (message.user_id !== "") {
5728
+ obj.user_id = message.user_id;
5729
+ }
5730
+ if (message.is_remember !== false) {
5731
+ obj.is_remember = message.is_remember;
5732
+ }
5733
+ return obj;
5734
+ },
5735
+ create(base) {
5736
+ return Session.fromPartial(base != null ? base : {});
5737
+ },
5738
+ fromPartial(object) {
5739
+ var _a, _b, _c, _d, _e;
5740
+ const message = createBaseSession();
5741
+ message.created = (_a = object.created) != null ? _a : false;
5742
+ message.token = (_b = object.token) != null ? _b : "";
5743
+ message.refresh_token = (_c = object.refresh_token) != null ? _c : "";
5744
+ message.user_id = (_d = object.user_id) != null ? _d : "";
5745
+ message.is_remember = (_e = object.is_remember) != null ? _e : false;
5746
+ return message;
5747
+ }
5748
+ };
5343
5749
  function createBaseUser() {
5344
5750
  return {
5345
5751
  id: "",
@@ -14407,7 +14813,9 @@ function createBaseLogedDevice() {
14407
14813
  status: 0,
14408
14814
  platform: "",
14409
14815
  ip: "",
14410
- last_active: void 0
14816
+ last_active: void 0,
14817
+ location: "",
14818
+ is_current_device: false
14411
14819
  };
14412
14820
  }
14413
14821
  var LogedDevice = {
@@ -14433,6 +14841,12 @@ var LogedDevice = {
14433
14841
  if (message.last_active !== void 0) {
14434
14842
  Timestamp.encode(toTimestamp(message.last_active), writer.uint32(58).fork()).ldelim();
14435
14843
  }
14844
+ if (message.location !== "") {
14845
+ writer.uint32(66).string(message.location);
14846
+ }
14847
+ if (message.is_current_device !== false) {
14848
+ writer.uint32(72).bool(message.is_current_device);
14849
+ }
14436
14850
  return writer;
14437
14851
  },
14438
14852
  decode(input, length) {
@@ -14484,6 +14898,18 @@ var LogedDevice = {
14484
14898
  }
14485
14899
  message.last_active = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
14486
14900
  continue;
14901
+ case 8:
14902
+ if (tag !== 66) {
14903
+ break;
14904
+ }
14905
+ message.location = reader.string();
14906
+ continue;
14907
+ case 9:
14908
+ if (tag !== 72) {
14909
+ break;
14910
+ }
14911
+ message.is_current_device = reader.bool();
14912
+ continue;
14487
14913
  }
14488
14914
  if ((tag & 7) === 4 || tag === 0) {
14489
14915
  break;
@@ -14500,7 +14926,9 @@ var LogedDevice = {
14500
14926
  status: isSet3(object.status) ? globalThis.Number(object.status) : 0,
14501
14927
  platform: isSet3(object.platform) ? globalThis.String(object.platform) : "",
14502
14928
  ip: isSet3(object.ip) ? globalThis.String(object.ip) : "",
14503
- last_active: isSet3(object.last_active) ? fromJsonTimestamp(object.last_active) : void 0
14929
+ last_active: isSet3(object.last_active) ? fromJsonTimestamp(object.last_active) : void 0,
14930
+ location: isSet3(object.location) ? globalThis.String(object.location) : "",
14931
+ is_current_device: isSet3(object.is_current_device) ? globalThis.Boolean(object.is_current_device) : false
14504
14932
  };
14505
14933
  },
14506
14934
  toJSON(message) {
@@ -14526,13 +14954,19 @@ var LogedDevice = {
14526
14954
  if (message.last_active !== void 0) {
14527
14955
  obj.last_active = message.last_active.toISOString();
14528
14956
  }
14957
+ if (message.location !== "") {
14958
+ obj.location = message.location;
14959
+ }
14960
+ if (message.is_current_device !== false) {
14961
+ obj.is_current_device = message.is_current_device;
14962
+ }
14529
14963
  return obj;
14530
14964
  },
14531
14965
  create(base) {
14532
14966
  return LogedDevice.fromPartial(base != null ? base : {});
14533
14967
  },
14534
14968
  fromPartial(object) {
14535
- var _a, _b, _c, _d, _e, _f, _g;
14969
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
14536
14970
  const message = createBaseLogedDevice();
14537
14971
  message.device_id = (_a = object.device_id) != null ? _a : "";
14538
14972
  message.device_name = (_b = object.device_name) != null ? _b : "";
@@ -14541,6 +14975,8 @@ var LogedDevice = {
14541
14975
  message.platform = (_e = object.platform) != null ? _e : "";
14542
14976
  message.ip = (_f = object.ip) != null ? _f : "";
14543
14977
  message.last_active = (_g = object.last_active) != null ? _g : void 0;
14978
+ message.location = (_h = object.location) != null ? _h : "";
14979
+ message.is_current_device = (_i = object.is_current_device) != null ? _i : false;
14544
14980
  return message;
14545
14981
  }
14546
14982
  };
@@ -14576,6 +15012,9 @@ if (import_minimal4.default.util.Long !== import_long3.default) {
14576
15012
  import_minimal4.default.util.Long = import_long3.default;
14577
15013
  import_minimal4.default.configure();
14578
15014
  }
15015
+ function isObject(value) {
15016
+ return typeof value === "object" && value !== null;
15017
+ }
14579
15018
  function isSet3(value) {
14580
15019
  return value !== null && value !== void 0;
14581
15020
  }
@@ -15068,25 +15507,31 @@ var MezonApi = class {
15068
15507
  }
15069
15508
  const urlPath = "/v2/account/session/refresh";
15070
15509
  const queryParams = /* @__PURE__ */ new Map();
15071
- let bodyJson = "";
15072
- bodyJson = JSON.stringify(body || {});
15510
+ const bodyWriter = SessionRefreshRequest.encode(
15511
+ SessionRefreshRequest.fromPartial(body)
15512
+ );
15513
+ const encodedBody = bodyWriter.finish();
15073
15514
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
15074
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
15515
+ const fetchOptions = buildFetchOptions("POST", options, "");
15516
+ fetchOptions.body = encodedBody;
15075
15517
  if (basicAuthUsername) {
15076
15518
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15077
15519
  }
15520
+ fetchOptions.headers["Content-Type"] = "application/x-protobuf";
15521
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15078
15522
  return Promise.race([
15079
- fetch(fullUrl, fetchOptions).then((response) => {
15523
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15080
15524
  if (response.status == 204) {
15081
- return response;
15525
+ return {};
15082
15526
  } else if (response.status >= 200 && response.status < 300) {
15083
- return response.json();
15527
+ const buffer = yield response.arrayBuffer();
15528
+ return Session.decode(new Uint8Array(buffer));
15084
15529
  } else {
15085
15530
  throw response;
15086
15531
  }
15087
- }),
15532
+ })),
15088
15533
  new Promise(
15089
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15534
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15090
15535
  )
15091
15536
  ]);
15092
15537
  }
@@ -16711,18 +17156,20 @@ var MezonApi = class {
16711
17156
  if (bearerToken) {
16712
17157
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
16713
17158
  }
17159
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
16714
17160
  return Promise.race([
16715
- fetch(fullUrl, fetchOptions).then((response) => {
17161
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
16716
17162
  if (response.status == 204) {
16717
- return response;
17163
+ return {};
16718
17164
  } else if (response.status >= 200 && response.status < 300) {
16719
- return response.json();
17165
+ const buffer = yield response.arrayBuffer();
17166
+ return RegistFcmDeviceTokenResponse.decode(new Uint8Array(buffer));
16720
17167
  } else {
16721
17168
  throw response;
16722
17169
  }
16723
- }),
17170
+ })),
16724
17171
  new Promise(
16725
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
17172
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
16726
17173
  )
16727
17174
  ]);
16728
17175
  }
@@ -19660,35 +20107,6 @@ var MezonApi = class {
19660
20107
  )
19661
20108
  ]);
19662
20109
  }
19663
- /** Store wallet key */
19664
- storeWalletKey(bearerToken, body, options = {}) {
19665
- if (body === null || body === void 0) {
19666
- throw new Error("'body' is a required parameter but is null or undefined.");
19667
- }
19668
- const urlPath = "/v2/wallet/key";
19669
- const queryParams = /* @__PURE__ */ new Map();
19670
- let bodyJson = "";
19671
- bodyJson = JSON.stringify(body || {});
19672
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
19673
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
19674
- if (bearerToken) {
19675
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
19676
- }
19677
- return Promise.race([
19678
- fetch(fullUrl, fetchOptions).then((response) => {
19679
- if (response.status == 204) {
19680
- return response;
19681
- } else if (response.status >= 200 && response.status < 300) {
19682
- return response.json();
19683
- } else {
19684
- throw response;
19685
- }
19686
- }),
19687
- new Promise(
19688
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
19689
- )
19690
- ]);
19691
- }
19692
20110
  /** create webhook */
19693
20111
  generateWebhook(bearerToken, body, options = {}) {
19694
20112
  if (body === null || body === void 0) {
@@ -21111,7 +21529,7 @@ var MezonApi = class {
21111
21529
  };
21112
21530
 
21113
21531
  // session.ts
21114
- var Session = class _Session {
21532
+ var Session2 = class _Session {
21115
21533
  constructor(token, refresh_token, created, api_url, id_token, is_remember) {
21116
21534
  this.created = created;
21117
21535
  this.api_url = api_url;
@@ -22567,7 +22985,7 @@ var Client = class {
22567
22985
  isRemember,
22568
22986
  options
22569
22987
  ).then((apiSession) => {
22570
- return new Session(
22988
+ return new Session2(
22571
22989
  apiSession.token || "",
22572
22990
  apiSession.refresh_token || "",
22573
22991
  apiSession.created || false,
@@ -22606,7 +23024,7 @@ var Client = class {
22606
23024
  confirmAuthenticateOTP(request) {
22607
23025
  return __async(this, null, function* () {
22608
23026
  return this.apiClient.confirmAuthenticateOTP(this.serverkey, "", request).then((apiSession) => {
22609
- return new Session(
23027
+ return new Session2(
22610
23028
  apiSession.token || "",
22611
23029
  apiSession.refresh_token || "",
22612
23030
  apiSession.created || false,
@@ -22628,7 +23046,7 @@ var Client = class {
22628
23046
  }
22629
23047
  };
22630
23048
  return this.apiClient.authenticateEmail(this.serverkey, "", request, username).then((apiSession) => {
22631
- return new Session(
23049
+ return new Session2(
22632
23050
  apiSession.token || "",
22633
23051
  apiSession.refresh_token || "",
22634
23052
  apiSession.created || false,
@@ -24617,7 +25035,7 @@ var Client = class {
24617
25035
  if (!(apiSession == null ? void 0 : apiSession.token)) {
24618
25036
  return null;
24619
25037
  }
24620
- return new Session(
25038
+ return new Session2(
24621
25039
  apiSession.token || "",
24622
25040
  apiSession.refresh_token || "",
24623
25041
  apiSession.created || false,
@@ -25173,7 +25591,7 @@ export {
25173
25591
  ConnectionState,
25174
25592
  DefaultSocket,
25175
25593
  NotificationType,
25176
- Session,
25594
+ Session2 as Session,
25177
25595
  WebSocketAdapterText,
25178
25596
  WebrtcSignalingType,
25179
25597
  b64DecodeUnicode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.13.72",
3
+ "version": "2.13.73",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },