mezon-js 2.9.95 → 2.9.97

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.
@@ -61,7 +61,11 @@ __export(mezon_js_exports, {
61
61
  NotificationType: () => NotificationType,
62
62
  Session: () => Session,
63
63
  WebSocketAdapterText: () => WebSocketAdapterText,
64
- WebrtcSignalingType: () => WebrtcSignalingType
64
+ WebrtcSignalingType: () => WebrtcSignalingType,
65
+ b64DecodeUnicode: () => b64DecodeUnicode,
66
+ b64EncodeUnicode: () => b64EncodeUnicode,
67
+ buildFetchOptions: () => buildFetchOptions,
68
+ safeJSONParse: () => safeJSONParse
65
69
  });
66
70
  module.exports = __toCommonJS(mezon_js_exports);
67
71
 
@@ -640,6 +644,19 @@ var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
640
644
  var utob = (u) => u.replace(re_utob, cb_utob);
641
645
  var _encode = _hasBuffer ? (s) => Buffer.from(s, "utf8").toString("base64") : _TE ? (s) => _fromUint8Array(_TE.encode(s)) : (s) => _btoa(utob(s));
642
646
  var encode = (src, urlsafe = false) => urlsafe ? _mkUriSafe(_encode(src)) : _encode(src);
647
+ var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
648
+ var cb_btou = (cccc) => {
649
+ switch (cccc.length) {
650
+ case 4:
651
+ var cp = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset = cp - 65536;
652
+ return _fromCC((offset >>> 10) + 55296) + _fromCC((offset & 1023) + 56320);
653
+ case 3:
654
+ return _fromCC((15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2));
655
+ default:
656
+ return _fromCC((31 & cccc.charCodeAt(0)) << 6 | 63 & cccc.charCodeAt(1));
657
+ }
658
+ };
659
+ var btou = (b) => b.replace(re_btou, cb_btou);
643
660
  var atobPolyfill = (asc) => {
644
661
  asc = asc.replace(/\s+/g, "");
645
662
  if (!b64re.test(asc))
@@ -653,6 +670,10 @@ var atobPolyfill = (asc) => {
653
670
  return bin;
654
671
  };
655
672
  var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
673
+ var _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
674
+ var _decode = _hasBuffer ? (a) => Buffer.from(a, "base64").toString("utf8") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
675
+ var _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == "-" ? "+" : "/"));
676
+ var decode2 = (src) => _decode(_unURI(src));
656
677
 
657
678
  // utils.ts
658
679
  function buildFetchOptions(method, options, bodyJson) {
@@ -680,6 +701,19 @@ function buildFetchOptions(method, options, bodyJson) {
680
701
  }
681
702
  return fetchOptions;
682
703
  }
704
+ function b64EncodeUnicode(str) {
705
+ return encode(encodeURIComponent(str).replace(
706
+ /%([0-9A-F]{2})/g,
707
+ function toSolidBytes(_match, p1) {
708
+ return String.fromCharCode(Number("0x" + p1));
709
+ }
710
+ ));
711
+ }
712
+ function b64DecodeUnicode(str) {
713
+ return decodeURIComponent(decode2(str).split("").map(function(c) {
714
+ return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
715
+ }).join(""));
716
+ }
683
717
  function safeJSONParse(jsonString) {
684
718
  try {
685
719
  const unescapedJSON = jsonString.replace(/\\./g, (match) => {
@@ -697,7 +731,7 @@ function safeJSONParse(jsonString) {
697
731
  const parsedData = JSON.parse(unescapedJSON);
698
732
  return parsedData;
699
733
  } catch (error) {
700
- console.error("Error parsing JSON:", error);
734
+ console.error("Error parsing JSON:", jsonString, error);
701
735
  return null;
702
736
  }
703
737
  }
@@ -851,7 +885,9 @@ var MezonApi = class {
851
885
  /** */
852
886
  checkLoginRequest(basicAuthUsername, basicAuthPassword, body, options = {}) {
853
887
  if (body === null || body === void 0) {
854
- throw new Error("'body' is a required parameter but is null or undefined.");
888
+ throw new Error(
889
+ "'body' is a required parameter but is null or undefined."
890
+ );
855
891
  }
856
892
  const urlPath = "/v2/account/authenticate/checklogin";
857
893
  const queryParams = /* @__PURE__ */ new Map();
@@ -880,7 +916,9 @@ var MezonApi = class {
880
916
  /** */
881
917
  confirmLogin(bearerToken, body, options = {}) {
882
918
  if (body === null || body === void 0) {
883
- throw new Error("'body' is a required parameter but is null or undefined.");
919
+ throw new Error(
920
+ "'body' is a required parameter but is null or undefined."
921
+ );
884
922
  }
885
923
  const urlPath = "/v2/account/authenticate/confirmlogin";
886
924
  const queryParams = /* @__PURE__ */ new Map();
@@ -909,7 +947,9 @@ var MezonApi = class {
909
947
  /** */
910
948
  createQRLogin(basicAuthUsername, basicAuthPassword, body, options = {}) {
911
949
  if (body === null || body === void 0) {
912
- throw new Error("'body' is a required parameter but is null or undefined.");
950
+ throw new Error(
951
+ "'body' is a required parameter but is null or undefined."
952
+ );
913
953
  }
914
954
  const urlPath = "/v2/account/authenticate/createqrlogin";
915
955
  const queryParams = /* @__PURE__ */ new Map();
@@ -1849,7 +1889,9 @@ var MezonApi = class {
1849
1889
  /** Create user activity */
1850
1890
  createActiviy(bearerToken, body, options = {}) {
1851
1891
  if (body === null || body === void 0) {
1852
- throw new Error("'body' is a required parameter but is null or undefined.");
1892
+ throw new Error(
1893
+ "'body' is a required parameter but is null or undefined."
1894
+ );
1853
1895
  }
1854
1896
  const urlPath = "/v2/activity";
1855
1897
  const queryParams = /* @__PURE__ */ new Map();
@@ -2258,9 +2300,14 @@ var MezonApi = class {
2258
2300
  /** */
2259
2301
  getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
2260
2302
  if (channelId === null || channelId === void 0) {
2261
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2303
+ throw new Error(
2304
+ "'channelId' is a required parameter but is null or undefined."
2305
+ );
2262
2306
  }
2263
- const urlPath = "/v2/channel-canvases/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
2307
+ const urlPath = "/v2/channel-canvases/{channelId}".replace(
2308
+ "{channelId}",
2309
+ encodeURIComponent(String(channelId))
2310
+ );
2264
2311
  const queryParams = /* @__PURE__ */ new Map();
2265
2312
  queryParams.set("clan_id", clanId);
2266
2313
  queryParams.set("limit", limit);
@@ -2289,7 +2336,9 @@ var MezonApi = class {
2289
2336
  /** */
2290
2337
  addChannelFavorite(bearerToken, body, options = {}) {
2291
2338
  if (body === null || body === void 0) {
2292
- throw new Error("'body' is a required parameter but is null or undefined.");
2339
+ throw new Error(
2340
+ "'body' is a required parameter but is null or undefined."
2341
+ );
2293
2342
  }
2294
2343
  const urlPath = "/v2/channel/favorite";
2295
2344
  const queryParams = /* @__PURE__ */ new Map();
@@ -2318,9 +2367,14 @@ var MezonApi = class {
2318
2367
  /** */
2319
2368
  removeChannelFavorite(bearerToken, channelId, options = {}) {
2320
2369
  if (channelId === null || channelId === void 0) {
2321
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2370
+ throw new Error(
2371
+ "'channelId' is a required parameter but is null or undefined."
2372
+ );
2322
2373
  }
2323
- const urlPath = "/v2/channel/favorite/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
2374
+ const urlPath = "/v2/channel/favorite/{channelId}".replace(
2375
+ "{channelId}",
2376
+ encodeURIComponent(String(channelId))
2377
+ );
2324
2378
  const queryParams = /* @__PURE__ */ new Map();
2325
2379
  let bodyJson = "";
2326
2380
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2346,9 +2400,14 @@ var MezonApi = class {
2346
2400
  /** */
2347
2401
  getListFavoriteChannel(bearerToken, clanId, options = {}) {
2348
2402
  if (clanId === null || clanId === void 0) {
2349
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2403
+ throw new Error(
2404
+ "'clanId' is a required parameter but is null or undefined."
2405
+ );
2350
2406
  }
2351
- const urlPath = "/v2/channel/favorite/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2407
+ const urlPath = "/v2/channel/favorite/{clanId}".replace(
2408
+ "{clanId}",
2409
+ encodeURIComponent(String(clanId))
2410
+ );
2352
2411
  const queryParams = /* @__PURE__ */ new Map();
2353
2412
  let bodyJson = "";
2354
2413
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2483,9 +2542,14 @@ var MezonApi = class {
2483
2542
  /** get channel encryption method */
2484
2543
  getChanEncryptionMethod(bearerToken, channelId, method, options = {}) {
2485
2544
  if (channelId === null || channelId === void 0) {
2486
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2545
+ throw new Error(
2546
+ "'channelId' is a required parameter but is null or undefined."
2547
+ );
2487
2548
  }
2488
- const urlPath = "/v2/channel/{channelId}/encrypt_method".replace("{channelId}", encodeURIComponent(String(channelId)));
2549
+ const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
2550
+ "{channelId}",
2551
+ encodeURIComponent(String(channelId))
2552
+ );
2489
2553
  const queryParams = /* @__PURE__ */ new Map();
2490
2554
  queryParams.set("method", method);
2491
2555
  let bodyJson = "";
@@ -2512,12 +2576,19 @@ var MezonApi = class {
2512
2576
  /** store channel encryption method */
2513
2577
  setChanEncryptionMethod(bearerToken, channelId, body, options = {}) {
2514
2578
  if (channelId === null || channelId === void 0) {
2515
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2579
+ throw new Error(
2580
+ "'channelId' is a required parameter but is null or undefined."
2581
+ );
2516
2582
  }
2517
2583
  if (body === null || body === void 0) {
2518
- throw new Error("'body' is a required parameter but is null or undefined.");
2584
+ throw new Error(
2585
+ "'body' is a required parameter but is null or undefined."
2586
+ );
2519
2587
  }
2520
- const urlPath = "/v2/channel/{channelId}/encrypt_method".replace("{channelId}", encodeURIComponent(String(channelId)));
2588
+ const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
2589
+ "{channelId}",
2590
+ encodeURIComponent(String(channelId))
2591
+ );
2521
2592
  const queryParams = /* @__PURE__ */ new Map();
2522
2593
  let bodyJson = "";
2523
2594
  bodyJson = JSON.stringify(body || {});
@@ -2809,9 +2880,14 @@ var MezonApi = class {
2809
2880
  /** List channel setting */
2810
2881
  listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channelLabel, options = {}) {
2811
2882
  if (clanId === null || clanId === void 0) {
2812
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2883
+ throw new Error(
2884
+ "'clanId' is a required parameter but is null or undefined."
2885
+ );
2813
2886
  }
2814
- const urlPath = "/v2/channelsetting/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2887
+ const urlPath = "/v2/channelsetting/{clanId}".replace(
2888
+ "{clanId}",
2889
+ encodeURIComponent(String(clanId))
2890
+ );
2815
2891
  const queryParams = /* @__PURE__ */ new Map();
2816
2892
  queryParams.set("parent_id", parentId);
2817
2893
  queryParams.set("category_id", categoryId);
@@ -3209,60 +3285,6 @@ var MezonApi = class {
3209
3285
  ]);
3210
3286
  }
3211
3287
  /** */
3212
- getCustomDisplay(bearerToken, options = {}) {
3213
- const urlPath = "/v2/customdisplay";
3214
- const queryParams = /* @__PURE__ */ new Map();
3215
- let bodyJson = "";
3216
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3217
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3218
- if (bearerToken) {
3219
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3220
- }
3221
- return Promise.race([
3222
- fetch(fullUrl, fetchOptions).then((response) => {
3223
- if (response.status == 204) {
3224
- return response;
3225
- } else if (response.status >= 200 && response.status < 300) {
3226
- return response.json();
3227
- } else {
3228
- throw response;
3229
- }
3230
- }),
3231
- new Promise(
3232
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3233
- )
3234
- ]);
3235
- }
3236
- /** */
3237
- updateCustomDisplay(bearerToken, body, options = {}) {
3238
- if (body === null || body === void 0) {
3239
- throw new Error("'body' is a required parameter but is null or undefined.");
3240
- }
3241
- const urlPath = "/v2/customdisplay";
3242
- const queryParams = /* @__PURE__ */ new Map();
3243
- let bodyJson = "";
3244
- bodyJson = JSON.stringify(body || {});
3245
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3246
- const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
3247
- if (bearerToken) {
3248
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3249
- }
3250
- return Promise.race([
3251
- fetch(fullUrl, fetchOptions).then((response) => {
3252
- if (response.status == 204) {
3253
- return response;
3254
- } else if (response.status >= 200 && response.status < 300) {
3255
- return response.json();
3256
- } else {
3257
- throw response;
3258
- }
3259
- }),
3260
- new Promise(
3261
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3262
- )
3263
- ]);
3264
- }
3265
- /** */
3266
3288
  deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
3267
3289
  if (categoryId === null || categoryId === void 0) {
3268
3290
  throw new Error(
@@ -4313,7 +4335,9 @@ var MezonApi = class {
4313
4335
  /** Mark as read */
4314
4336
  markAsRead(bearerToken, body, options = {}) {
4315
4337
  if (body === null || body === void 0) {
4316
- throw new Error("'body' is a required parameter but is null or undefined.");
4338
+ throw new Error(
4339
+ "'body' is a required parameter but is null or undefined."
4340
+ );
4317
4341
  }
4318
4342
  const urlPath = "/v2/markasread";
4319
4343
  const queryParams = /* @__PURE__ */ new Map();
@@ -4829,7 +4853,9 @@ var MezonApi = class {
4829
4853
  /** set notification user channel. */
4830
4854
  createPinMessage(bearerToken, body, options = {}) {
4831
4855
  if (body === null || body === void 0) {
4832
- throw new Error("'body' is a required parameter but is null or undefined.");
4856
+ throw new Error(
4857
+ "'body' is a required parameter but is null or undefined."
4858
+ );
4833
4859
  }
4834
4860
  const urlPath = "/v2/pinmessage/set";
4835
4861
  const queryParams = /* @__PURE__ */ new Map();
@@ -4915,7 +4941,9 @@ var MezonApi = class {
4915
4941
  /** store pubkey for e2ee */
4916
4942
  pushPubKey(bearerToken, body, options = {}) {
4917
4943
  if (body === null || body === void 0) {
4918
- throw new Error("'body' is a required parameter but is null or undefined.");
4944
+ throw new Error(
4945
+ "'body' is a required parameter but is null or undefined."
4946
+ );
4919
4947
  }
4920
4948
  const urlPath = "/v2/pubkey/push";
4921
4949
  const queryParams = /* @__PURE__ */ new Map();
@@ -5397,7 +5425,9 @@ var MezonApi = class {
5397
5425
  /** UpdateWallets */
5398
5426
  sendToken(bearerToken, body, options = {}) {
5399
5427
  if (body === null || body === void 0) {
5400
- throw new Error("'body' is a required parameter but is null or undefined.");
5428
+ throw new Error(
5429
+ "'body' is a required parameter but is null or undefined."
5430
+ );
5401
5431
  }
5402
5432
  const urlPath = "/v2/sendtoken";
5403
5433
  const queryParams = /* @__PURE__ */ new Map();
@@ -5831,9 +5861,14 @@ var MezonApi = class {
5831
5861
  /** List user channels */
5832
5862
  listThreadDescs(bearerToken, channelId, limit, state, clanId, threadId, options = {}) {
5833
5863
  if (channelId === null || channelId === void 0) {
5834
- throw new Error("'channelId' is a required parameter but is null or undefined.");
5864
+ throw new Error(
5865
+ "'channelId' is a required parameter but is null or undefined."
5866
+ );
5835
5867
  }
5836
- const urlPath = "/v2/thread/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
5868
+ const urlPath = "/v2/thread/{channelId}".replace(
5869
+ "{channelId}",
5870
+ encodeURIComponent(String(channelId))
5871
+ );
5837
5872
  const queryParams = /* @__PURE__ */ new Map();
5838
5873
  queryParams.set("limit", limit);
5839
5874
  queryParams.set("state", state);
@@ -6139,7 +6174,9 @@ var MezonApi = class {
6139
6174
  /** Update user status */
6140
6175
  updateUserStatus(bearerToken, body, options = {}) {
6141
6176
  if (body === null || body === void 0) {
6142
- throw new Error("'body' is a required parameter but is null or undefined.");
6177
+ throw new Error(
6178
+ "'body' is a required parameter but is null or undefined."
6179
+ );
6143
6180
  }
6144
6181
  const urlPath = "/v2/userstatus";
6145
6182
  const queryParams = /* @__PURE__ */ new Map();
@@ -6301,9 +6338,14 @@ var MezonApi = class {
6301
6338
  throw new Error("'id' is a required parameter but is null or undefined.");
6302
6339
  }
6303
6340
  if (body === null || body === void 0) {
6304
- throw new Error("'body' is a required parameter but is null or undefined.");
6341
+ throw new Error(
6342
+ "'body' is a required parameter but is null or undefined."
6343
+ );
6305
6344
  }
6306
- const urlPath = "/v2/webhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6345
+ const urlPath = "/v2/webhooks/{id}".replace(
6346
+ "{id}",
6347
+ encodeURIComponent(String(id))
6348
+ );
6307
6349
  const queryParams = /* @__PURE__ */ new Map();
6308
6350
  let bodyJson = "";
6309
6351
  bodyJson = JSON.stringify(body || {});
@@ -6376,7 +6418,9 @@ var MezonApi = class {
6376
6418
  /** WithdrawToken */
6377
6419
  withdrawToken(bearerToken, body, options = {}) {
6378
6420
  if (body === null || body === void 0) {
6379
- throw new Error("'body' is a required parameter but is null or undefined.");
6421
+ throw new Error(
6422
+ "'body' is a required parameter but is null or undefined."
6423
+ );
6380
6424
  }
6381
6425
  const urlPath = "/v2/withdrawtoken";
6382
6426
  const queryParams = /* @__PURE__ */ new Map();
@@ -6502,7 +6546,9 @@ var MezonApi = class {
6502
6546
  /** create onboarding. */
6503
6547
  createOnboarding(bearerToken, body, options = {}) {
6504
6548
  if (body === null || body === void 0) {
6505
- throw new Error("'body' is a required parameter but is null or undefined.");
6549
+ throw new Error(
6550
+ "'body' is a required parameter but is null or undefined."
6551
+ );
6506
6552
  }
6507
6553
  const urlPath = "/v2/onboarding";
6508
6554
  const queryParams = /* @__PURE__ */ new Map();
@@ -6533,7 +6579,10 @@ var MezonApi = class {
6533
6579
  if (id === null || id === void 0) {
6534
6580
  throw new Error("'id' is a required parameter but is null or undefined.");
6535
6581
  }
6536
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6582
+ const urlPath = "/v2/onboarding/{id}".replace(
6583
+ "{id}",
6584
+ encodeURIComponent(String(id))
6585
+ );
6537
6586
  const queryParams = /* @__PURE__ */ new Map();
6538
6587
  queryParams.set("clan_id", clanId);
6539
6588
  let bodyJson = "";
@@ -6562,7 +6611,10 @@ var MezonApi = class {
6562
6611
  if (id === null || id === void 0) {
6563
6612
  throw new Error("'id' is a required parameter but is null or undefined.");
6564
6613
  }
6565
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6614
+ const urlPath = "/v2/onboarding/{id}".replace(
6615
+ "{id}",
6616
+ encodeURIComponent(String(id))
6617
+ );
6566
6618
  const queryParams = /* @__PURE__ */ new Map();
6567
6619
  queryParams.set("clan_id", clanId);
6568
6620
  let bodyJson = "";
@@ -6592,9 +6644,14 @@ var MezonApi = class {
6592
6644
  throw new Error("'id' is a required parameter but is null or undefined.");
6593
6645
  }
6594
6646
  if (body === null || body === void 0) {
6595
- throw new Error("'body' is a required parameter but is null or undefined.");
6647
+ throw new Error(
6648
+ "'body' is a required parameter but is null or undefined."
6649
+ );
6596
6650
  }
6597
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6651
+ const urlPath = "/v2/onboarding/{id}".replace(
6652
+ "{id}",
6653
+ encodeURIComponent(String(id))
6654
+ );
6598
6655
  const queryParams = /* @__PURE__ */ new Map();
6599
6656
  let bodyJson = "";
6600
6657
  bodyJson = JSON.stringify(body || {});
@@ -6621,7 +6678,9 @@ var MezonApi = class {
6621
6678
  /** Generate clan webhook. */
6622
6679
  generateClanWebhook(bearerToken, body, options = {}) {
6623
6680
  if (body === null || body === void 0) {
6624
- throw new Error("'body' is a required parameter but is null or undefined.");
6681
+ throw new Error(
6682
+ "'body' is a required parameter but is null or undefined."
6683
+ );
6625
6684
  }
6626
6685
  const urlPath = "/v2/clanwebhooks";
6627
6686
  const queryParams = /* @__PURE__ */ new Map();
@@ -6650,9 +6709,14 @@ var MezonApi = class {
6650
6709
  /** List clan webhook. */
6651
6710
  listClanWebhook(bearerToken, clanId, options = {}) {
6652
6711
  if (clanId === null || clanId === void 0) {
6653
- throw new Error("'clanId' is a required parameter but is null or undefined.");
6712
+ throw new Error(
6713
+ "'clanId' is a required parameter but is null or undefined."
6714
+ );
6654
6715
  }
6655
- const urlPath = "/v2/clanwebhooks/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
6716
+ const urlPath = "/v2/clanwebhooks/{clanId}".replace(
6717
+ "{clanId}",
6718
+ encodeURIComponent(String(clanId))
6719
+ );
6656
6720
  const queryParams = /* @__PURE__ */ new Map();
6657
6721
  let bodyJson = "";
6658
6722
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -6680,7 +6744,10 @@ var MezonApi = class {
6680
6744
  if (id === null || id === void 0) {
6681
6745
  throw new Error("'id' is a required parameter but is null or undefined.");
6682
6746
  }
6683
- const urlPath = "/v2/clanwebhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6747
+ const urlPath = "/v2/clanwebhooks/{id}".replace(
6748
+ "{id}",
6749
+ encodeURIComponent(String(id))
6750
+ );
6684
6751
  const queryParams = /* @__PURE__ */ new Map();
6685
6752
  queryParams.set("clan_id", clanId);
6686
6753
  let bodyJson = "";
@@ -6710,9 +6777,14 @@ var MezonApi = class {
6710
6777
  throw new Error("'id' is a required parameter but is null or undefined.");
6711
6778
  }
6712
6779
  if (body === null || body === void 0) {
6713
- throw new Error("'body' is a required parameter but is null or undefined.");
6780
+ throw new Error(
6781
+ "'body' is a required parameter but is null or undefined."
6782
+ );
6714
6783
  }
6715
- const urlPath = "/v2/clanwebhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6784
+ const urlPath = "/v2/clanwebhooks/{id}".replace(
6785
+ "{id}",
6786
+ encodeURIComponent(String(id))
6787
+ );
6716
6788
  const queryParams = /* @__PURE__ */ new Map();
6717
6789
  let bodyJson = "";
6718
6790
  bodyJson = JSON.stringify(body || {});
@@ -6767,12 +6839,19 @@ var MezonApi = class {
6767
6839
  /** Update onboarding step. */
6768
6840
  updateOnboardingStepByClanId(bearerToken, clanId, body, options = {}) {
6769
6841
  if (clanId === null || clanId === void 0) {
6770
- throw new Error("'clanId' is a required parameter but is null or undefined.");
6842
+ throw new Error(
6843
+ "'clanId' is a required parameter but is null or undefined."
6844
+ );
6771
6845
  }
6772
6846
  if (body === null || body === void 0) {
6773
- throw new Error("'body' is a required parameter but is null or undefined.");
6847
+ throw new Error(
6848
+ "'body' is a required parameter but is null or undefined."
6849
+ );
6774
6850
  }
6775
- const urlPath = "/v2/onboardingsteps/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
6851
+ const urlPath = "/v2/onboardingsteps/{clanId}".replace(
6852
+ "{clanId}",
6853
+ encodeURIComponent(String(clanId))
6854
+ );
6776
6855
  const queryParams = /* @__PURE__ */ new Map();
6777
6856
  let bodyJson = "";
6778
6857
  bodyJson = JSON.stringify(body || {});
@@ -6863,7 +6942,7 @@ var encode2 = function(arraybuffer) {
6863
6942
  }
6864
6943
  return base64;
6865
6944
  };
6866
- var decode2 = function(base64) {
6945
+ var decode3 = function(base64) {
6867
6946
  var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;
6868
6947
  if (base64[base64.length - 1] === "=") {
6869
6948
  bufferLength--;
@@ -6907,7 +6986,7 @@ var WebSocketAdapterText = class {
6907
6986
  const message = safeJSONParse(evt.data);
6908
6987
  if (message.party_data && message.party_data.data) {
6909
6988
  message.party_data.data = new Uint8Array(
6910
- decode2(message.party_data.data)
6989
+ decode3(message.party_data.data)
6911
6990
  );
6912
6991
  }
6913
6992
  value(message);
@@ -10414,28 +10493,6 @@ var Client = class {
10414
10493
  });
10415
10494
  });
10416
10495
  }
10417
- //**get custom display */
10418
- getCustomDisplay(session) {
10419
- return __async(this, null, function* () {
10420
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10421
- yield this.sessionRefresh(session);
10422
- }
10423
- return this.apiClient.getCustomDisplay(session.token).then((response) => {
10424
- return Promise.resolve(response);
10425
- });
10426
- });
10427
- }
10428
- //**update custom display */
10429
- updateCustomDisplay(session, request) {
10430
- return __async(this, null, function* () {
10431
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10432
- yield this.sessionRefresh(session);
10433
- }
10434
- return this.apiClient.updateCustomDisplay(session.token, request).then((response) => {
10435
- return response !== void 0;
10436
- });
10437
- });
10438
- }
10439
10496
  //**list wallet ledger */
10440
10497
  listWalletLedger(session, limit, cursor, transactionId) {
10441
10498
  return __async(this, null, function* () {