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.
@@ -1555,7 +1555,7 @@ var require_minimal = __commonJS({
1555
1555
  util.isString = function isString(value) {
1556
1556
  return typeof value === "string" || value instanceof String;
1557
1557
  };
1558
- util.isObject = function isObject(value) {
1558
+ util.isObject = function isObject2(value) {
1559
1559
  return value && typeof value === "object";
1560
1560
  };
1561
1561
  util.isset = /**
@@ -2295,7 +2295,7 @@ __export(index_exports, {
2295
2295
  ConnectionState: () => ConnectionState,
2296
2296
  DefaultSocket: () => DefaultSocket,
2297
2297
  NotificationType: () => NotificationType,
2298
- Session: () => Session,
2298
+ Session: () => Session2,
2299
2299
  WebSocketAdapterText: () => WebSocketAdapterText,
2300
2300
  WebrtcSignalingType: () => WebrtcSignalingType,
2301
2301
  b64DecodeUnicode: () => b64DecodeUnicode,
@@ -3113,6 +3113,57 @@ var Int32Value = {
3113
3113
  return message;
3114
3114
  }
3115
3115
  };
3116
+ function createBaseBoolValue() {
3117
+ return { value: false };
3118
+ }
3119
+ var BoolValue = {
3120
+ encode(message, writer = import_minimal3.default.Writer.create()) {
3121
+ if (message.value !== false) {
3122
+ writer.uint32(8).bool(message.value);
3123
+ }
3124
+ return writer;
3125
+ },
3126
+ decode(input, length) {
3127
+ const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
3128
+ let end = length === void 0 ? reader.len : reader.pos + length;
3129
+ const message = createBaseBoolValue();
3130
+ while (reader.pos < end) {
3131
+ const tag = reader.uint32();
3132
+ switch (tag >>> 3) {
3133
+ case 1:
3134
+ if (tag !== 8) {
3135
+ break;
3136
+ }
3137
+ message.value = reader.bool();
3138
+ continue;
3139
+ }
3140
+ if ((tag & 7) === 4 || tag === 0) {
3141
+ break;
3142
+ }
3143
+ reader.skipType(tag & 7);
3144
+ }
3145
+ return message;
3146
+ },
3147
+ fromJSON(object) {
3148
+ return { value: isSet2(object.value) ? globalThis.Boolean(object.value) : false };
3149
+ },
3150
+ toJSON(message) {
3151
+ const obj = {};
3152
+ if (message.value !== false) {
3153
+ obj.value = message.value;
3154
+ }
3155
+ return obj;
3156
+ },
3157
+ create(base) {
3158
+ return BoolValue.fromPartial(base != null ? base : {});
3159
+ },
3160
+ fromPartial(object) {
3161
+ var _a;
3162
+ const message = createBaseBoolValue();
3163
+ message.value = (_a = object.value) != null ? _a : false;
3164
+ return message;
3165
+ }
3166
+ };
3116
3167
  if (import_minimal3.default.util.Long !== import_long2.default) {
3117
3168
  import_minimal3.default.util.Long = import_long2.default;
3118
3169
  import_minimal3.default.configure();
@@ -3297,6 +3348,171 @@ var Account = {
3297
3348
  return message;
3298
3349
  }
3299
3350
  };
3351
+ function createBaseSessionRefreshRequest() {
3352
+ return { token: "", vars: {}, is_remember: void 0 };
3353
+ }
3354
+ var SessionRefreshRequest = {
3355
+ encode(message, writer = import_minimal4.default.Writer.create()) {
3356
+ if (message.token !== "") {
3357
+ writer.uint32(10).string(message.token);
3358
+ }
3359
+ Object.entries(message.vars).forEach(([key, value]) => {
3360
+ SessionRefreshRequest_VarsEntry.encode({ key, value }, writer.uint32(18).fork()).ldelim();
3361
+ });
3362
+ if (message.is_remember !== void 0) {
3363
+ BoolValue.encode({ value: message.is_remember }, writer.uint32(26).fork()).ldelim();
3364
+ }
3365
+ return writer;
3366
+ },
3367
+ decode(input, length) {
3368
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
3369
+ let end = length === void 0 ? reader.len : reader.pos + length;
3370
+ const message = createBaseSessionRefreshRequest();
3371
+ while (reader.pos < end) {
3372
+ const tag = reader.uint32();
3373
+ switch (tag >>> 3) {
3374
+ case 1:
3375
+ if (tag !== 10) {
3376
+ break;
3377
+ }
3378
+ message.token = reader.string();
3379
+ continue;
3380
+ case 2:
3381
+ if (tag !== 18) {
3382
+ break;
3383
+ }
3384
+ const entry2 = SessionRefreshRequest_VarsEntry.decode(reader, reader.uint32());
3385
+ if (entry2.value !== void 0) {
3386
+ message.vars[entry2.key] = entry2.value;
3387
+ }
3388
+ continue;
3389
+ case 3:
3390
+ if (tag !== 26) {
3391
+ break;
3392
+ }
3393
+ message.is_remember = BoolValue.decode(reader, reader.uint32()).value;
3394
+ continue;
3395
+ }
3396
+ if ((tag & 7) === 4 || tag === 0) {
3397
+ break;
3398
+ }
3399
+ reader.skipType(tag & 7);
3400
+ }
3401
+ return message;
3402
+ },
3403
+ fromJSON(object) {
3404
+ return {
3405
+ token: isSet3(object.token) ? globalThis.String(object.token) : "",
3406
+ vars: isObject(object.vars) ? Object.entries(object.vars).reduce((acc, [key, value]) => {
3407
+ acc[key] = String(value);
3408
+ return acc;
3409
+ }, {}) : {},
3410
+ is_remember: isSet3(object.is_remember) ? Boolean(object.is_remember) : void 0
3411
+ };
3412
+ },
3413
+ toJSON(message) {
3414
+ const obj = {};
3415
+ if (message.token !== "") {
3416
+ obj.token = message.token;
3417
+ }
3418
+ if (message.vars) {
3419
+ const entries = Object.entries(message.vars);
3420
+ if (entries.length > 0) {
3421
+ obj.vars = {};
3422
+ entries.forEach(([k, v]) => {
3423
+ obj.vars[k] = v;
3424
+ });
3425
+ }
3426
+ }
3427
+ if (message.is_remember !== void 0) {
3428
+ obj.is_remember = message.is_remember;
3429
+ }
3430
+ return obj;
3431
+ },
3432
+ create(base) {
3433
+ return SessionRefreshRequest.fromPartial(base != null ? base : {});
3434
+ },
3435
+ fromPartial(object) {
3436
+ var _a, _b, _c;
3437
+ const message = createBaseSessionRefreshRequest();
3438
+ message.token = (_a = object.token) != null ? _a : "";
3439
+ message.vars = Object.entries((_b = object.vars) != null ? _b : {}).reduce((acc, [key, value]) => {
3440
+ if (value !== void 0) {
3441
+ acc[key] = globalThis.String(value);
3442
+ }
3443
+ return acc;
3444
+ }, {});
3445
+ message.is_remember = (_c = object.is_remember) != null ? _c : void 0;
3446
+ return message;
3447
+ }
3448
+ };
3449
+ function createBaseSessionRefreshRequest_VarsEntry() {
3450
+ return { key: "", value: "" };
3451
+ }
3452
+ var SessionRefreshRequest_VarsEntry = {
3453
+ encode(message, writer = import_minimal4.default.Writer.create()) {
3454
+ if (message.key !== "") {
3455
+ writer.uint32(10).string(message.key);
3456
+ }
3457
+ if (message.value !== "") {
3458
+ writer.uint32(18).string(message.value);
3459
+ }
3460
+ return writer;
3461
+ },
3462
+ decode(input, length) {
3463
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
3464
+ let end = length === void 0 ? reader.len : reader.pos + length;
3465
+ const message = createBaseSessionRefreshRequest_VarsEntry();
3466
+ while (reader.pos < end) {
3467
+ const tag = reader.uint32();
3468
+ switch (tag >>> 3) {
3469
+ case 1:
3470
+ if (tag !== 10) {
3471
+ break;
3472
+ }
3473
+ message.key = reader.string();
3474
+ continue;
3475
+ case 2:
3476
+ if (tag !== 18) {
3477
+ break;
3478
+ }
3479
+ message.value = reader.string();
3480
+ continue;
3481
+ }
3482
+ if ((tag & 7) === 4 || tag === 0) {
3483
+ break;
3484
+ }
3485
+ reader.skipType(tag & 7);
3486
+ }
3487
+ return message;
3488
+ },
3489
+ fromJSON(object) {
3490
+ return {
3491
+ key: isSet3(object.key) ? globalThis.String(object.key) : "",
3492
+ value: isSet3(object.value) ? globalThis.String(object.value) : ""
3493
+ };
3494
+ },
3495
+ toJSON(message) {
3496
+ const obj = {};
3497
+ if (message.key !== "") {
3498
+ obj.key = message.key;
3499
+ }
3500
+ if (message.value !== "") {
3501
+ obj.value = message.value;
3502
+ }
3503
+ return obj;
3504
+ },
3505
+ create(base) {
3506
+ return SessionRefreshRequest_VarsEntry.fromPartial(base != null ? base : {});
3507
+ },
3508
+ fromPartial(object) {
3509
+ var _a, _b;
3510
+ const message = createBaseSessionRefreshRequest_VarsEntry();
3511
+ message.key = (_a = object.key) != null ? _a : "";
3512
+ message.value = (_b = object.value) != null ? _b : "";
3513
+ return message;
3514
+ }
3515
+ };
3300
3516
  function createBaseIsBannedResponse() {
3301
3517
  return { is_banned: false, expired_ban_time: 0 };
3302
3518
  }
@@ -4912,6 +5128,87 @@ var ClanUserList_ClanUser = {
4912
5128
  return message;
4913
5129
  }
4914
5130
  };
5131
+ function createBaseRegistFcmDeviceTokenResponse() {
5132
+ return { token: "", device_id: "", platform: "" };
5133
+ }
5134
+ var RegistFcmDeviceTokenResponse = {
5135
+ encode(message, writer = import_minimal4.default.Writer.create()) {
5136
+ if (message.token !== "") {
5137
+ writer.uint32(10).string(message.token);
5138
+ }
5139
+ if (message.device_id !== "") {
5140
+ writer.uint32(18).string(message.device_id);
5141
+ }
5142
+ if (message.platform !== "") {
5143
+ writer.uint32(26).string(message.platform);
5144
+ }
5145
+ return writer;
5146
+ },
5147
+ decode(input, length) {
5148
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
5149
+ let end = length === void 0 ? reader.len : reader.pos + length;
5150
+ const message = createBaseRegistFcmDeviceTokenResponse();
5151
+ while (reader.pos < end) {
5152
+ const tag = reader.uint32();
5153
+ switch (tag >>> 3) {
5154
+ case 1:
5155
+ if (tag !== 10) {
5156
+ break;
5157
+ }
5158
+ message.token = reader.string();
5159
+ continue;
5160
+ case 2:
5161
+ if (tag !== 18) {
5162
+ break;
5163
+ }
5164
+ message.device_id = reader.string();
5165
+ continue;
5166
+ case 3:
5167
+ if (tag !== 26) {
5168
+ break;
5169
+ }
5170
+ message.platform = reader.string();
5171
+ continue;
5172
+ }
5173
+ if ((tag & 7) === 4 || tag === 0) {
5174
+ break;
5175
+ }
5176
+ reader.skipType(tag & 7);
5177
+ }
5178
+ return message;
5179
+ },
5180
+ fromJSON(object) {
5181
+ return {
5182
+ token: isSet3(object.token) ? globalThis.String(object.token) : "",
5183
+ device_id: isSet3(object.device_id) ? globalThis.String(object.device_id) : "",
5184
+ platform: isSet3(object.platform) ? globalThis.String(object.platform) : ""
5185
+ };
5186
+ },
5187
+ toJSON(message) {
5188
+ const obj = {};
5189
+ if (message.token !== "") {
5190
+ obj.token = message.token;
5191
+ }
5192
+ if (message.device_id !== "") {
5193
+ obj.device_id = message.device_id;
5194
+ }
5195
+ if (message.platform !== "") {
5196
+ obj.platform = message.platform;
5197
+ }
5198
+ return obj;
5199
+ },
5200
+ create(base) {
5201
+ return RegistFcmDeviceTokenResponse.fromPartial(base != null ? base : {});
5202
+ },
5203
+ fromPartial(object) {
5204
+ var _a, _b, _c;
5205
+ const message = createBaseRegistFcmDeviceTokenResponse();
5206
+ message.token = (_a = object.token) != null ? _a : "";
5207
+ message.device_id = (_b = object.device_id) != null ? _b : "";
5208
+ message.platform = (_c = object.platform) != null ? _c : "";
5209
+ return message;
5210
+ }
5211
+ };
4915
5212
  function createBaseNotification() {
4916
5213
  return {
4917
5214
  id: "",
@@ -5365,6 +5662,115 @@ var NotificationList = {
5365
5662
  return message;
5366
5663
  }
5367
5664
  };
5665
+ function createBaseSession() {
5666
+ return { created: false, token: "", refresh_token: "", user_id: "", is_remember: false };
5667
+ }
5668
+ var Session = {
5669
+ encode(message, writer = import_minimal4.default.Writer.create()) {
5670
+ if (message.created !== false) {
5671
+ writer.uint32(8).bool(message.created);
5672
+ }
5673
+ if (message.token !== "") {
5674
+ writer.uint32(18).string(message.token);
5675
+ }
5676
+ if (message.refresh_token !== "") {
5677
+ writer.uint32(26).string(message.refresh_token);
5678
+ }
5679
+ if (message.user_id !== "") {
5680
+ writer.uint32(34).string(message.user_id);
5681
+ }
5682
+ if (message.is_remember !== false) {
5683
+ writer.uint32(40).bool(message.is_remember);
5684
+ }
5685
+ return writer;
5686
+ },
5687
+ decode(input, length) {
5688
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
5689
+ let end = length === void 0 ? reader.len : reader.pos + length;
5690
+ const message = createBaseSession();
5691
+ while (reader.pos < end) {
5692
+ const tag = reader.uint32();
5693
+ switch (tag >>> 3) {
5694
+ case 1:
5695
+ if (tag !== 8) {
5696
+ break;
5697
+ }
5698
+ message.created = reader.bool();
5699
+ continue;
5700
+ case 2:
5701
+ if (tag !== 18) {
5702
+ break;
5703
+ }
5704
+ message.token = reader.string();
5705
+ continue;
5706
+ case 3:
5707
+ if (tag !== 26) {
5708
+ break;
5709
+ }
5710
+ message.refresh_token = reader.string();
5711
+ continue;
5712
+ case 4:
5713
+ if (tag !== 34) {
5714
+ break;
5715
+ }
5716
+ message.user_id = reader.string();
5717
+ continue;
5718
+ case 5:
5719
+ if (tag !== 40) {
5720
+ break;
5721
+ }
5722
+ message.is_remember = reader.bool();
5723
+ continue;
5724
+ }
5725
+ if ((tag & 7) === 4 || tag === 0) {
5726
+ break;
5727
+ }
5728
+ reader.skipType(tag & 7);
5729
+ }
5730
+ return message;
5731
+ },
5732
+ fromJSON(object) {
5733
+ return {
5734
+ created: isSet3(object.created) ? globalThis.Boolean(object.created) : false,
5735
+ token: isSet3(object.token) ? globalThis.String(object.token) : "",
5736
+ refresh_token: isSet3(object.refresh_token) ? globalThis.String(object.refresh_token) : "",
5737
+ user_id: isSet3(object.user_id) ? globalThis.String(object.user_id) : "",
5738
+ is_remember: isSet3(object.is_remember) ? globalThis.Boolean(object.is_remember) : false
5739
+ };
5740
+ },
5741
+ toJSON(message) {
5742
+ const obj = {};
5743
+ if (message.created !== false) {
5744
+ obj.created = message.created;
5745
+ }
5746
+ if (message.token !== "") {
5747
+ obj.token = message.token;
5748
+ }
5749
+ if (message.refresh_token !== "") {
5750
+ obj.refresh_token = message.refresh_token;
5751
+ }
5752
+ if (message.user_id !== "") {
5753
+ obj.user_id = message.user_id;
5754
+ }
5755
+ if (message.is_remember !== false) {
5756
+ obj.is_remember = message.is_remember;
5757
+ }
5758
+ return obj;
5759
+ },
5760
+ create(base) {
5761
+ return Session.fromPartial(base != null ? base : {});
5762
+ },
5763
+ fromPartial(object) {
5764
+ var _a, _b, _c, _d, _e;
5765
+ const message = createBaseSession();
5766
+ message.created = (_a = object.created) != null ? _a : false;
5767
+ message.token = (_b = object.token) != null ? _b : "";
5768
+ message.refresh_token = (_c = object.refresh_token) != null ? _c : "";
5769
+ message.user_id = (_d = object.user_id) != null ? _d : "";
5770
+ message.is_remember = (_e = object.is_remember) != null ? _e : false;
5771
+ return message;
5772
+ }
5773
+ };
5368
5774
  function createBaseUser() {
5369
5775
  return {
5370
5776
  id: "",
@@ -14432,7 +14838,9 @@ function createBaseLogedDevice() {
14432
14838
  status: 0,
14433
14839
  platform: "",
14434
14840
  ip: "",
14435
- last_active: void 0
14841
+ last_active: void 0,
14842
+ location: "",
14843
+ is_current_device: false
14436
14844
  };
14437
14845
  }
14438
14846
  var LogedDevice = {
@@ -14458,6 +14866,12 @@ var LogedDevice = {
14458
14866
  if (message.last_active !== void 0) {
14459
14867
  Timestamp.encode(toTimestamp(message.last_active), writer.uint32(58).fork()).ldelim();
14460
14868
  }
14869
+ if (message.location !== "") {
14870
+ writer.uint32(66).string(message.location);
14871
+ }
14872
+ if (message.is_current_device !== false) {
14873
+ writer.uint32(72).bool(message.is_current_device);
14874
+ }
14461
14875
  return writer;
14462
14876
  },
14463
14877
  decode(input, length) {
@@ -14509,6 +14923,18 @@ var LogedDevice = {
14509
14923
  }
14510
14924
  message.last_active = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
14511
14925
  continue;
14926
+ case 8:
14927
+ if (tag !== 66) {
14928
+ break;
14929
+ }
14930
+ message.location = reader.string();
14931
+ continue;
14932
+ case 9:
14933
+ if (tag !== 72) {
14934
+ break;
14935
+ }
14936
+ message.is_current_device = reader.bool();
14937
+ continue;
14512
14938
  }
14513
14939
  if ((tag & 7) === 4 || tag === 0) {
14514
14940
  break;
@@ -14525,7 +14951,9 @@ var LogedDevice = {
14525
14951
  status: isSet3(object.status) ? globalThis.Number(object.status) : 0,
14526
14952
  platform: isSet3(object.platform) ? globalThis.String(object.platform) : "",
14527
14953
  ip: isSet3(object.ip) ? globalThis.String(object.ip) : "",
14528
- last_active: isSet3(object.last_active) ? fromJsonTimestamp(object.last_active) : void 0
14954
+ last_active: isSet3(object.last_active) ? fromJsonTimestamp(object.last_active) : void 0,
14955
+ location: isSet3(object.location) ? globalThis.String(object.location) : "",
14956
+ is_current_device: isSet3(object.is_current_device) ? globalThis.Boolean(object.is_current_device) : false
14529
14957
  };
14530
14958
  },
14531
14959
  toJSON(message) {
@@ -14551,13 +14979,19 @@ var LogedDevice = {
14551
14979
  if (message.last_active !== void 0) {
14552
14980
  obj.last_active = message.last_active.toISOString();
14553
14981
  }
14982
+ if (message.location !== "") {
14983
+ obj.location = message.location;
14984
+ }
14985
+ if (message.is_current_device !== false) {
14986
+ obj.is_current_device = message.is_current_device;
14987
+ }
14554
14988
  return obj;
14555
14989
  },
14556
14990
  create(base) {
14557
14991
  return LogedDevice.fromPartial(base != null ? base : {});
14558
14992
  },
14559
14993
  fromPartial(object) {
14560
- var _a, _b, _c, _d, _e, _f, _g;
14994
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
14561
14995
  const message = createBaseLogedDevice();
14562
14996
  message.device_id = (_a = object.device_id) != null ? _a : "";
14563
14997
  message.device_name = (_b = object.device_name) != null ? _b : "";
@@ -14566,6 +15000,8 @@ var LogedDevice = {
14566
15000
  message.platform = (_e = object.platform) != null ? _e : "";
14567
15001
  message.ip = (_f = object.ip) != null ? _f : "";
14568
15002
  message.last_active = (_g = object.last_active) != null ? _g : void 0;
15003
+ message.location = (_h = object.location) != null ? _h : "";
15004
+ message.is_current_device = (_i = object.is_current_device) != null ? _i : false;
14569
15005
  return message;
14570
15006
  }
14571
15007
  };
@@ -14601,6 +15037,9 @@ if (import_minimal4.default.util.Long !== import_long3.default) {
14601
15037
  import_minimal4.default.util.Long = import_long3.default;
14602
15038
  import_minimal4.default.configure();
14603
15039
  }
15040
+ function isObject(value) {
15041
+ return typeof value === "object" && value !== null;
15042
+ }
14604
15043
  function isSet3(value) {
14605
15044
  return value !== null && value !== void 0;
14606
15045
  }
@@ -15093,25 +15532,31 @@ var MezonApi = class {
15093
15532
  }
15094
15533
  const urlPath = "/v2/account/session/refresh";
15095
15534
  const queryParams = /* @__PURE__ */ new Map();
15096
- let bodyJson = "";
15097
- bodyJson = JSON.stringify(body || {});
15535
+ const bodyWriter = SessionRefreshRequest.encode(
15536
+ SessionRefreshRequest.fromPartial(body)
15537
+ );
15538
+ const encodedBody = bodyWriter.finish();
15098
15539
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
15099
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
15540
+ const fetchOptions = buildFetchOptions("POST", options, "");
15541
+ fetchOptions.body = encodedBody;
15100
15542
  if (basicAuthUsername) {
15101
15543
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15102
15544
  }
15545
+ fetchOptions.headers["Content-Type"] = "application/x-protobuf";
15546
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15103
15547
  return Promise.race([
15104
- fetch(fullUrl, fetchOptions).then((response) => {
15548
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15105
15549
  if (response.status == 204) {
15106
- return response;
15550
+ return {};
15107
15551
  } else if (response.status >= 200 && response.status < 300) {
15108
- return response.json();
15552
+ const buffer = yield response.arrayBuffer();
15553
+ return Session.decode(new Uint8Array(buffer));
15109
15554
  } else {
15110
15555
  throw response;
15111
15556
  }
15112
- }),
15557
+ })),
15113
15558
  new Promise(
15114
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15559
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15115
15560
  )
15116
15561
  ]);
15117
15562
  }
@@ -16736,18 +17181,20 @@ var MezonApi = class {
16736
17181
  if (bearerToken) {
16737
17182
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
16738
17183
  }
17184
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
16739
17185
  return Promise.race([
16740
- fetch(fullUrl, fetchOptions).then((response) => {
17186
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
16741
17187
  if (response.status == 204) {
16742
- return response;
17188
+ return {};
16743
17189
  } else if (response.status >= 200 && response.status < 300) {
16744
- return response.json();
17190
+ const buffer = yield response.arrayBuffer();
17191
+ return RegistFcmDeviceTokenResponse.decode(new Uint8Array(buffer));
16745
17192
  } else {
16746
17193
  throw response;
16747
17194
  }
16748
- }),
17195
+ })),
16749
17196
  new Promise(
16750
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
17197
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
16751
17198
  )
16752
17199
  ]);
16753
17200
  }
@@ -19685,35 +20132,6 @@ var MezonApi = class {
19685
20132
  )
19686
20133
  ]);
19687
20134
  }
19688
- /** Store wallet key */
19689
- storeWalletKey(bearerToken, body, options = {}) {
19690
- if (body === null || body === void 0) {
19691
- throw new Error("'body' is a required parameter but is null or undefined.");
19692
- }
19693
- const urlPath = "/v2/wallet/key";
19694
- const queryParams = /* @__PURE__ */ new Map();
19695
- let bodyJson = "";
19696
- bodyJson = JSON.stringify(body || {});
19697
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
19698
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
19699
- if (bearerToken) {
19700
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
19701
- }
19702
- return Promise.race([
19703
- fetch(fullUrl, fetchOptions).then((response) => {
19704
- if (response.status == 204) {
19705
- return response;
19706
- } else if (response.status >= 200 && response.status < 300) {
19707
- return response.json();
19708
- } else {
19709
- throw response;
19710
- }
19711
- }),
19712
- new Promise(
19713
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
19714
- )
19715
- ]);
19716
- }
19717
20135
  /** create webhook */
19718
20136
  generateWebhook(bearerToken, body, options = {}) {
19719
20137
  if (body === null || body === void 0) {
@@ -21136,7 +21554,7 @@ var MezonApi = class {
21136
21554
  };
21137
21555
 
21138
21556
  // session.ts
21139
- var Session = class _Session {
21557
+ var Session2 = class _Session {
21140
21558
  constructor(token, refresh_token, created, api_url, id_token, is_remember) {
21141
21559
  this.created = created;
21142
21560
  this.api_url = api_url;
@@ -22592,7 +23010,7 @@ var Client = class {
22592
23010
  isRemember,
22593
23011
  options
22594
23012
  ).then((apiSession) => {
22595
- return new Session(
23013
+ return new Session2(
22596
23014
  apiSession.token || "",
22597
23015
  apiSession.refresh_token || "",
22598
23016
  apiSession.created || false,
@@ -22631,7 +23049,7 @@ var Client = class {
22631
23049
  confirmAuthenticateOTP(request) {
22632
23050
  return __async(this, null, function* () {
22633
23051
  return this.apiClient.confirmAuthenticateOTP(this.serverkey, "", request).then((apiSession) => {
22634
- return new Session(
23052
+ return new Session2(
22635
23053
  apiSession.token || "",
22636
23054
  apiSession.refresh_token || "",
22637
23055
  apiSession.created || false,
@@ -22653,7 +23071,7 @@ var Client = class {
22653
23071
  }
22654
23072
  };
22655
23073
  return this.apiClient.authenticateEmail(this.serverkey, "", request, username).then((apiSession) => {
22656
- return new Session(
23074
+ return new Session2(
22657
23075
  apiSession.token || "",
22658
23076
  apiSession.refresh_token || "",
22659
23077
  apiSession.created || false,
@@ -24642,7 +25060,7 @@ var Client = class {
24642
25060
  if (!(apiSession == null ? void 0 : apiSession.token)) {
24643
25061
  return null;
24644
25062
  }
24645
- return new Session(
25063
+ return new Session2(
24646
25064
  apiSession.token || "",
24647
25065
  apiSession.refresh_token || "",
24648
25066
  apiSession.created || false,