mezon-js 2.9.96 → 2.9.98

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/client.ts CHANGED
@@ -154,7 +154,6 @@ import {
154
154
  ApiListOnboardingStepResponse,
155
155
  MezonUpdateOnboardingStepByClanIdBody,
156
156
  ApiPTTChannelUserList,
157
- ApiCustomDisplay,
158
157
  ApiWalletLedgerList,
159
158
  } from "./api.gen";
160
159
 
@@ -2288,7 +2287,9 @@ export class Client {
2288
2287
  .then((response: ApiRpc) => {
2289
2288
  return Promise.resolve({
2290
2289
  id: response.id,
2291
- payload: !response.payload ? undefined : safeJSONParse(response.payload),
2290
+ payload: !response.payload
2291
+ ? undefined
2292
+ : safeJSONParse(response.payload),
2292
2293
  });
2293
2294
  });
2294
2295
  }
@@ -2304,7 +2305,9 @@ export class Client {
2304
2305
  .then((response: ApiRpc) => {
2305
2306
  return Promise.resolve({
2306
2307
  id: response.id,
2307
- payload: !response.payload ? undefined : safeJSONParse(response.payload),
2308
+ payload: !response.payload
2309
+ ? undefined
2310
+ : safeJSONParse(response.payload),
2308
2311
  });
2309
2312
  })
2310
2313
  .catch((err: any) => {
@@ -4758,40 +4761,6 @@ export class Client {
4758
4761
  });
4759
4762
  }
4760
4763
 
4761
- //**get custom display */
4762
- async getCustomDisplay(session: Session): Promise<ApiCustomDisplay> {
4763
- if (
4764
- this.autoRefreshSession &&
4765
- session.refresh_token &&
4766
- session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
4767
- ) {
4768
- await this.sessionRefresh(session);
4769
- }
4770
-
4771
- return this.apiClient
4772
- .getCustomDisplay(session.token)
4773
- .then((response: ApiCustomDisplay) => {
4774
- return Promise.resolve(response);
4775
- });
4776
- }
4777
-
4778
- //**update custom display */
4779
- async updateCustomDisplay(session: Session, request: ApiCustomDisplay) {
4780
- if (
4781
- this.autoRefreshSession &&
4782
- session.refresh_token &&
4783
- session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
4784
- ) {
4785
- await this.sessionRefresh(session);
4786
- }
4787
-
4788
- return this.apiClient
4789
- .updateCustomDisplay(session.token, request)
4790
- .then((response: any) => {
4791
- return response !== undefined;
4792
- });
4793
- }
4794
-
4795
4764
  //**list wallet ledger */
4796
4765
  async listWalletLedger(
4797
4766
  session: Session,
package/dist/api.gen.d.ts CHANGED
@@ -183,6 +183,8 @@ export interface ApiAccount {
183
183
  devices?: Array<ApiAccountDevice>;
184
184
  disable_time?: string;
185
185
  email?: string;
186
+ logo?: string;
187
+ splash_screen?: string;
186
188
  user?: ApiUser;
187
189
  verify_time?: string;
188
190
  wallet?: string;
@@ -663,11 +665,6 @@ export interface ApiCreateRoleRequest {
663
665
  role_icon?: string;
664
666
  title?: string;
665
667
  }
666
- /** */
667
- export interface ApiCustomDisplay {
668
- logo?: string;
669
- splash_screen?: string;
670
- }
671
668
  /** Delete a channel the user has access to. */
672
669
  export interface ApiDeleteChannelDescRequest {
673
670
  channel_id?: string;
@@ -1293,6 +1290,8 @@ export interface ApiUpdateAccountRequest {
1293
1290
  display_name?: string;
1294
1291
  lang_tag?: string;
1295
1292
  location?: string;
1293
+ logo?: string;
1294
+ splash_screen?: string;
1296
1295
  timezone?: string;
1297
1296
  username?: string;
1298
1297
  }
@@ -1738,10 +1737,6 @@ export declare class MezonApi {
1738
1737
  /** */
1739
1738
  createCategoryDesc(bearerToken: string, body: ApiCreateCategoryDescRequest, options?: any): Promise<ApiCategoryDesc>;
1740
1739
  /** */
1741
- getCustomDisplay(bearerToken: string, options?: any): Promise<ApiCustomDisplay>;
1742
- /** */
1743
- updateCustomDisplay(bearerToken: string, body: ApiCustomDisplay, options?: any): Promise<any>;
1744
- /** */
1745
1740
  deleteCategoryDesc(bearerToken: string, categoryId: string, clanId: string, options?: any): Promise<any>;
1746
1741
  /** */
1747
1742
  deleteCategoryOrder(bearerToken: string, clanId: string, options?: any): Promise<any>;
package/dist/client.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiPTTChannelUserList, ApiCustomDisplay, ApiWalletLedgerList } from "./api.gen";
16
+ import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiPTTChannelUserList, ApiWalletLedgerList } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -629,7 +629,5 @@ export declare class Client {
629
629
  getUserStatus(session: Session): Promise<ApiUserStatus>;
630
630
  /** List a ptt channel's users. */
631
631
  listPTTChannelUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ApiPTTChannelUserList>;
632
- getCustomDisplay(session: Session): Promise<ApiCustomDisplay>;
633
- updateCustomDisplay(session: Session, request: ApiCustomDisplay): Promise<boolean>;
634
632
  listWalletLedger(session: Session, limit?: number, cursor?: string, transactionId?: string): Promise<ApiWalletLedgerList>;
635
633
  }
@@ -720,10 +720,6 @@ function safeJSONParse(jsonString) {
720
720
  switch (match) {
721
721
  case '\\"':
722
722
  return '"';
723
- case "\\n":
724
- return "\n";
725
- case "\\t":
726
- return " ";
727
723
  default:
728
724
  return match[1];
729
725
  }
@@ -731,7 +727,7 @@ function safeJSONParse(jsonString) {
731
727
  const parsedData = JSON.parse(unescapedJSON);
732
728
  return parsedData;
733
729
  } catch (error) {
734
- console.error("Error parsing JSON:", error);
730
+ console.error("Error parsing JSON:", jsonString, error);
735
731
  return null;
736
732
  }
737
733
  }
@@ -885,7 +881,9 @@ var MezonApi = class {
885
881
  /** */
886
882
  checkLoginRequest(basicAuthUsername, basicAuthPassword, body, options = {}) {
887
883
  if (body === null || body === void 0) {
888
- throw new Error("'body' is a required parameter but is null or undefined.");
884
+ throw new Error(
885
+ "'body' is a required parameter but is null or undefined."
886
+ );
889
887
  }
890
888
  const urlPath = "/v2/account/authenticate/checklogin";
891
889
  const queryParams = /* @__PURE__ */ new Map();
@@ -914,7 +912,9 @@ var MezonApi = class {
914
912
  /** */
915
913
  confirmLogin(bearerToken, body, options = {}) {
916
914
  if (body === null || body === void 0) {
917
- throw new Error("'body' is a required parameter but is null or undefined.");
915
+ throw new Error(
916
+ "'body' is a required parameter but is null or undefined."
917
+ );
918
918
  }
919
919
  const urlPath = "/v2/account/authenticate/confirmlogin";
920
920
  const queryParams = /* @__PURE__ */ new Map();
@@ -943,7 +943,9 @@ var MezonApi = class {
943
943
  /** */
944
944
  createQRLogin(basicAuthUsername, basicAuthPassword, body, options = {}) {
945
945
  if (body === null || body === void 0) {
946
- throw new Error("'body' is a required parameter but is null or undefined.");
946
+ throw new Error(
947
+ "'body' is a required parameter but is null or undefined."
948
+ );
947
949
  }
948
950
  const urlPath = "/v2/account/authenticate/createqrlogin";
949
951
  const queryParams = /* @__PURE__ */ new Map();
@@ -1883,7 +1885,9 @@ var MezonApi = class {
1883
1885
  /** Create user activity */
1884
1886
  createActiviy(bearerToken, body, options = {}) {
1885
1887
  if (body === null || body === void 0) {
1886
- throw new Error("'body' is a required parameter but is null or undefined.");
1888
+ throw new Error(
1889
+ "'body' is a required parameter but is null or undefined."
1890
+ );
1887
1891
  }
1888
1892
  const urlPath = "/v2/activity";
1889
1893
  const queryParams = /* @__PURE__ */ new Map();
@@ -2292,9 +2296,14 @@ var MezonApi = class {
2292
2296
  /** */
2293
2297
  getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
2294
2298
  if (channelId === null || channelId === void 0) {
2295
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2299
+ throw new Error(
2300
+ "'channelId' is a required parameter but is null or undefined."
2301
+ );
2296
2302
  }
2297
- const urlPath = "/v2/channel-canvases/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
2303
+ const urlPath = "/v2/channel-canvases/{channelId}".replace(
2304
+ "{channelId}",
2305
+ encodeURIComponent(String(channelId))
2306
+ );
2298
2307
  const queryParams = /* @__PURE__ */ new Map();
2299
2308
  queryParams.set("clan_id", clanId);
2300
2309
  queryParams.set("limit", limit);
@@ -2323,7 +2332,9 @@ var MezonApi = class {
2323
2332
  /** */
2324
2333
  addChannelFavorite(bearerToken, body, options = {}) {
2325
2334
  if (body === null || body === void 0) {
2326
- throw new Error("'body' is a required parameter but is null or undefined.");
2335
+ throw new Error(
2336
+ "'body' is a required parameter but is null or undefined."
2337
+ );
2327
2338
  }
2328
2339
  const urlPath = "/v2/channel/favorite";
2329
2340
  const queryParams = /* @__PURE__ */ new Map();
@@ -2352,9 +2363,14 @@ var MezonApi = class {
2352
2363
  /** */
2353
2364
  removeChannelFavorite(bearerToken, channelId, options = {}) {
2354
2365
  if (channelId === null || channelId === void 0) {
2355
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2366
+ throw new Error(
2367
+ "'channelId' is a required parameter but is null or undefined."
2368
+ );
2356
2369
  }
2357
- const urlPath = "/v2/channel/favorite/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
2370
+ const urlPath = "/v2/channel/favorite/{channelId}".replace(
2371
+ "{channelId}",
2372
+ encodeURIComponent(String(channelId))
2373
+ );
2358
2374
  const queryParams = /* @__PURE__ */ new Map();
2359
2375
  let bodyJson = "";
2360
2376
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2380,9 +2396,14 @@ var MezonApi = class {
2380
2396
  /** */
2381
2397
  getListFavoriteChannel(bearerToken, clanId, options = {}) {
2382
2398
  if (clanId === null || clanId === void 0) {
2383
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2399
+ throw new Error(
2400
+ "'clanId' is a required parameter but is null or undefined."
2401
+ );
2384
2402
  }
2385
- const urlPath = "/v2/channel/favorite/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2403
+ const urlPath = "/v2/channel/favorite/{clanId}".replace(
2404
+ "{clanId}",
2405
+ encodeURIComponent(String(clanId))
2406
+ );
2386
2407
  const queryParams = /* @__PURE__ */ new Map();
2387
2408
  let bodyJson = "";
2388
2409
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2517,9 +2538,14 @@ var MezonApi = class {
2517
2538
  /** get channel encryption method */
2518
2539
  getChanEncryptionMethod(bearerToken, channelId, method, options = {}) {
2519
2540
  if (channelId === null || channelId === void 0) {
2520
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2541
+ throw new Error(
2542
+ "'channelId' is a required parameter but is null or undefined."
2543
+ );
2521
2544
  }
2522
- const urlPath = "/v2/channel/{channelId}/encrypt_method".replace("{channelId}", encodeURIComponent(String(channelId)));
2545
+ const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
2546
+ "{channelId}",
2547
+ encodeURIComponent(String(channelId))
2548
+ );
2523
2549
  const queryParams = /* @__PURE__ */ new Map();
2524
2550
  queryParams.set("method", method);
2525
2551
  let bodyJson = "";
@@ -2546,12 +2572,19 @@ var MezonApi = class {
2546
2572
  /** store channel encryption method */
2547
2573
  setChanEncryptionMethod(bearerToken, channelId, body, options = {}) {
2548
2574
  if (channelId === null || channelId === void 0) {
2549
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2575
+ throw new Error(
2576
+ "'channelId' is a required parameter but is null or undefined."
2577
+ );
2550
2578
  }
2551
2579
  if (body === null || body === void 0) {
2552
- throw new Error("'body' is a required parameter but is null or undefined.");
2580
+ throw new Error(
2581
+ "'body' is a required parameter but is null or undefined."
2582
+ );
2553
2583
  }
2554
- const urlPath = "/v2/channel/{channelId}/encrypt_method".replace("{channelId}", encodeURIComponent(String(channelId)));
2584
+ const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
2585
+ "{channelId}",
2586
+ encodeURIComponent(String(channelId))
2587
+ );
2555
2588
  const queryParams = /* @__PURE__ */ new Map();
2556
2589
  let bodyJson = "";
2557
2590
  bodyJson = JSON.stringify(body || {});
@@ -2843,9 +2876,14 @@ var MezonApi = class {
2843
2876
  /** List channel setting */
2844
2877
  listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channelLabel, options = {}) {
2845
2878
  if (clanId === null || clanId === void 0) {
2846
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2879
+ throw new Error(
2880
+ "'clanId' is a required parameter but is null or undefined."
2881
+ );
2847
2882
  }
2848
- const urlPath = "/v2/channelsetting/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2883
+ const urlPath = "/v2/channelsetting/{clanId}".replace(
2884
+ "{clanId}",
2885
+ encodeURIComponent(String(clanId))
2886
+ );
2849
2887
  const queryParams = /* @__PURE__ */ new Map();
2850
2888
  queryParams.set("parent_id", parentId);
2851
2889
  queryParams.set("category_id", categoryId);
@@ -3243,60 +3281,6 @@ var MezonApi = class {
3243
3281
  ]);
3244
3282
  }
3245
3283
  /** */
3246
- getCustomDisplay(bearerToken, options = {}) {
3247
- const urlPath = "/v2/customdisplay";
3248
- const queryParams = /* @__PURE__ */ new Map();
3249
- let bodyJson = "";
3250
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3251
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3252
- if (bearerToken) {
3253
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3254
- }
3255
- return Promise.race([
3256
- fetch(fullUrl, fetchOptions).then((response) => {
3257
- if (response.status == 204) {
3258
- return response;
3259
- } else if (response.status >= 200 && response.status < 300) {
3260
- return response.json();
3261
- } else {
3262
- throw response;
3263
- }
3264
- }),
3265
- new Promise(
3266
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3267
- )
3268
- ]);
3269
- }
3270
- /** */
3271
- updateCustomDisplay(bearerToken, body, options = {}) {
3272
- if (body === null || body === void 0) {
3273
- throw new Error("'body' is a required parameter but is null or undefined.");
3274
- }
3275
- const urlPath = "/v2/customdisplay";
3276
- const queryParams = /* @__PURE__ */ new Map();
3277
- let bodyJson = "";
3278
- bodyJson = JSON.stringify(body || {});
3279
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3280
- const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
3281
- if (bearerToken) {
3282
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3283
- }
3284
- return Promise.race([
3285
- fetch(fullUrl, fetchOptions).then((response) => {
3286
- if (response.status == 204) {
3287
- return response;
3288
- } else if (response.status >= 200 && response.status < 300) {
3289
- return response.json();
3290
- } else {
3291
- throw response;
3292
- }
3293
- }),
3294
- new Promise(
3295
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3296
- )
3297
- ]);
3298
- }
3299
- /** */
3300
3284
  deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
3301
3285
  if (categoryId === null || categoryId === void 0) {
3302
3286
  throw new Error(
@@ -4347,7 +4331,9 @@ var MezonApi = class {
4347
4331
  /** Mark as read */
4348
4332
  markAsRead(bearerToken, body, options = {}) {
4349
4333
  if (body === null || body === void 0) {
4350
- throw new Error("'body' is a required parameter but is null or undefined.");
4334
+ throw new Error(
4335
+ "'body' is a required parameter but is null or undefined."
4336
+ );
4351
4337
  }
4352
4338
  const urlPath = "/v2/markasread";
4353
4339
  const queryParams = /* @__PURE__ */ new Map();
@@ -4863,7 +4849,9 @@ var MezonApi = class {
4863
4849
  /** set notification user channel. */
4864
4850
  createPinMessage(bearerToken, body, options = {}) {
4865
4851
  if (body === null || body === void 0) {
4866
- throw new Error("'body' is a required parameter but is null or undefined.");
4852
+ throw new Error(
4853
+ "'body' is a required parameter but is null or undefined."
4854
+ );
4867
4855
  }
4868
4856
  const urlPath = "/v2/pinmessage/set";
4869
4857
  const queryParams = /* @__PURE__ */ new Map();
@@ -4949,7 +4937,9 @@ var MezonApi = class {
4949
4937
  /** store pubkey for e2ee */
4950
4938
  pushPubKey(bearerToken, body, options = {}) {
4951
4939
  if (body === null || body === void 0) {
4952
- throw new Error("'body' is a required parameter but is null or undefined.");
4940
+ throw new Error(
4941
+ "'body' is a required parameter but is null or undefined."
4942
+ );
4953
4943
  }
4954
4944
  const urlPath = "/v2/pubkey/push";
4955
4945
  const queryParams = /* @__PURE__ */ new Map();
@@ -5431,7 +5421,9 @@ var MezonApi = class {
5431
5421
  /** UpdateWallets */
5432
5422
  sendToken(bearerToken, body, options = {}) {
5433
5423
  if (body === null || body === void 0) {
5434
- throw new Error("'body' is a required parameter but is null or undefined.");
5424
+ throw new Error(
5425
+ "'body' is a required parameter but is null or undefined."
5426
+ );
5435
5427
  }
5436
5428
  const urlPath = "/v2/sendtoken";
5437
5429
  const queryParams = /* @__PURE__ */ new Map();
@@ -5865,9 +5857,14 @@ var MezonApi = class {
5865
5857
  /** List user channels */
5866
5858
  listThreadDescs(bearerToken, channelId, limit, state, clanId, threadId, options = {}) {
5867
5859
  if (channelId === null || channelId === void 0) {
5868
- throw new Error("'channelId' is a required parameter but is null or undefined.");
5860
+ throw new Error(
5861
+ "'channelId' is a required parameter but is null or undefined."
5862
+ );
5869
5863
  }
5870
- const urlPath = "/v2/thread/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
5864
+ const urlPath = "/v2/thread/{channelId}".replace(
5865
+ "{channelId}",
5866
+ encodeURIComponent(String(channelId))
5867
+ );
5871
5868
  const queryParams = /* @__PURE__ */ new Map();
5872
5869
  queryParams.set("limit", limit);
5873
5870
  queryParams.set("state", state);
@@ -6173,7 +6170,9 @@ var MezonApi = class {
6173
6170
  /** Update user status */
6174
6171
  updateUserStatus(bearerToken, body, options = {}) {
6175
6172
  if (body === null || body === void 0) {
6176
- throw new Error("'body' is a required parameter but is null or undefined.");
6173
+ throw new Error(
6174
+ "'body' is a required parameter but is null or undefined."
6175
+ );
6177
6176
  }
6178
6177
  const urlPath = "/v2/userstatus";
6179
6178
  const queryParams = /* @__PURE__ */ new Map();
@@ -6335,9 +6334,14 @@ var MezonApi = class {
6335
6334
  throw new Error("'id' is a required parameter but is null or undefined.");
6336
6335
  }
6337
6336
  if (body === null || body === void 0) {
6338
- throw new Error("'body' is a required parameter but is null or undefined.");
6337
+ throw new Error(
6338
+ "'body' is a required parameter but is null or undefined."
6339
+ );
6339
6340
  }
6340
- const urlPath = "/v2/webhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6341
+ const urlPath = "/v2/webhooks/{id}".replace(
6342
+ "{id}",
6343
+ encodeURIComponent(String(id))
6344
+ );
6341
6345
  const queryParams = /* @__PURE__ */ new Map();
6342
6346
  let bodyJson = "";
6343
6347
  bodyJson = JSON.stringify(body || {});
@@ -6410,7 +6414,9 @@ var MezonApi = class {
6410
6414
  /** WithdrawToken */
6411
6415
  withdrawToken(bearerToken, body, options = {}) {
6412
6416
  if (body === null || body === void 0) {
6413
- throw new Error("'body' is a required parameter but is null or undefined.");
6417
+ throw new Error(
6418
+ "'body' is a required parameter but is null or undefined."
6419
+ );
6414
6420
  }
6415
6421
  const urlPath = "/v2/withdrawtoken";
6416
6422
  const queryParams = /* @__PURE__ */ new Map();
@@ -6536,7 +6542,9 @@ var MezonApi = class {
6536
6542
  /** create onboarding. */
6537
6543
  createOnboarding(bearerToken, body, options = {}) {
6538
6544
  if (body === null || body === void 0) {
6539
- throw new Error("'body' is a required parameter but is null or undefined.");
6545
+ throw new Error(
6546
+ "'body' is a required parameter but is null or undefined."
6547
+ );
6540
6548
  }
6541
6549
  const urlPath = "/v2/onboarding";
6542
6550
  const queryParams = /* @__PURE__ */ new Map();
@@ -6567,7 +6575,10 @@ var MezonApi = class {
6567
6575
  if (id === null || id === void 0) {
6568
6576
  throw new Error("'id' is a required parameter but is null or undefined.");
6569
6577
  }
6570
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6578
+ const urlPath = "/v2/onboarding/{id}".replace(
6579
+ "{id}",
6580
+ encodeURIComponent(String(id))
6581
+ );
6571
6582
  const queryParams = /* @__PURE__ */ new Map();
6572
6583
  queryParams.set("clan_id", clanId);
6573
6584
  let bodyJson = "";
@@ -6596,7 +6607,10 @@ var MezonApi = class {
6596
6607
  if (id === null || id === void 0) {
6597
6608
  throw new Error("'id' is a required parameter but is null or undefined.");
6598
6609
  }
6599
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6610
+ const urlPath = "/v2/onboarding/{id}".replace(
6611
+ "{id}",
6612
+ encodeURIComponent(String(id))
6613
+ );
6600
6614
  const queryParams = /* @__PURE__ */ new Map();
6601
6615
  queryParams.set("clan_id", clanId);
6602
6616
  let bodyJson = "";
@@ -6626,9 +6640,14 @@ var MezonApi = class {
6626
6640
  throw new Error("'id' is a required parameter but is null or undefined.");
6627
6641
  }
6628
6642
  if (body === null || body === void 0) {
6629
- throw new Error("'body' is a required parameter but is null or undefined.");
6643
+ throw new Error(
6644
+ "'body' is a required parameter but is null or undefined."
6645
+ );
6630
6646
  }
6631
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6647
+ const urlPath = "/v2/onboarding/{id}".replace(
6648
+ "{id}",
6649
+ encodeURIComponent(String(id))
6650
+ );
6632
6651
  const queryParams = /* @__PURE__ */ new Map();
6633
6652
  let bodyJson = "";
6634
6653
  bodyJson = JSON.stringify(body || {});
@@ -6655,7 +6674,9 @@ var MezonApi = class {
6655
6674
  /** Generate clan webhook. */
6656
6675
  generateClanWebhook(bearerToken, body, options = {}) {
6657
6676
  if (body === null || body === void 0) {
6658
- throw new Error("'body' is a required parameter but is null or undefined.");
6677
+ throw new Error(
6678
+ "'body' is a required parameter but is null or undefined."
6679
+ );
6659
6680
  }
6660
6681
  const urlPath = "/v2/clanwebhooks";
6661
6682
  const queryParams = /* @__PURE__ */ new Map();
@@ -6684,9 +6705,14 @@ var MezonApi = class {
6684
6705
  /** List clan webhook. */
6685
6706
  listClanWebhook(bearerToken, clanId, options = {}) {
6686
6707
  if (clanId === null || clanId === void 0) {
6687
- throw new Error("'clanId' is a required parameter but is null or undefined.");
6708
+ throw new Error(
6709
+ "'clanId' is a required parameter but is null or undefined."
6710
+ );
6688
6711
  }
6689
- const urlPath = "/v2/clanwebhooks/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
6712
+ const urlPath = "/v2/clanwebhooks/{clanId}".replace(
6713
+ "{clanId}",
6714
+ encodeURIComponent(String(clanId))
6715
+ );
6690
6716
  const queryParams = /* @__PURE__ */ new Map();
6691
6717
  let bodyJson = "";
6692
6718
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -6714,7 +6740,10 @@ var MezonApi = class {
6714
6740
  if (id === null || id === void 0) {
6715
6741
  throw new Error("'id' is a required parameter but is null or undefined.");
6716
6742
  }
6717
- const urlPath = "/v2/clanwebhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6743
+ const urlPath = "/v2/clanwebhooks/{id}".replace(
6744
+ "{id}",
6745
+ encodeURIComponent(String(id))
6746
+ );
6718
6747
  const queryParams = /* @__PURE__ */ new Map();
6719
6748
  queryParams.set("clan_id", clanId);
6720
6749
  let bodyJson = "";
@@ -6744,9 +6773,14 @@ var MezonApi = class {
6744
6773
  throw new Error("'id' is a required parameter but is null or undefined.");
6745
6774
  }
6746
6775
  if (body === null || body === void 0) {
6747
- throw new Error("'body' is a required parameter but is null or undefined.");
6776
+ throw new Error(
6777
+ "'body' is a required parameter but is null or undefined."
6778
+ );
6748
6779
  }
6749
- const urlPath = "/v2/clanwebhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6780
+ const urlPath = "/v2/clanwebhooks/{id}".replace(
6781
+ "{id}",
6782
+ encodeURIComponent(String(id))
6783
+ );
6750
6784
  const queryParams = /* @__PURE__ */ new Map();
6751
6785
  let bodyJson = "";
6752
6786
  bodyJson = JSON.stringify(body || {});
@@ -6801,12 +6835,19 @@ var MezonApi = class {
6801
6835
  /** Update onboarding step. */
6802
6836
  updateOnboardingStepByClanId(bearerToken, clanId, body, options = {}) {
6803
6837
  if (clanId === null || clanId === void 0) {
6804
- throw new Error("'clanId' is a required parameter but is null or undefined.");
6838
+ throw new Error(
6839
+ "'clanId' is a required parameter but is null or undefined."
6840
+ );
6805
6841
  }
6806
6842
  if (body === null || body === void 0) {
6807
- throw new Error("'body' is a required parameter but is null or undefined.");
6843
+ throw new Error(
6844
+ "'body' is a required parameter but is null or undefined."
6845
+ );
6808
6846
  }
6809
- const urlPath = "/v2/onboardingsteps/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
6847
+ const urlPath = "/v2/onboardingsteps/{clanId}".replace(
6848
+ "{clanId}",
6849
+ encodeURIComponent(String(clanId))
6850
+ );
6810
6851
  const queryParams = /* @__PURE__ */ new Map();
6811
6852
  let bodyJson = "";
6812
6853
  bodyJson = JSON.stringify(body || {});
@@ -10448,28 +10489,6 @@ var Client = class {
10448
10489
  });
10449
10490
  });
10450
10491
  }
10451
- //**get custom display */
10452
- getCustomDisplay(session) {
10453
- return __async(this, null, function* () {
10454
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10455
- yield this.sessionRefresh(session);
10456
- }
10457
- return this.apiClient.getCustomDisplay(session.token).then((response) => {
10458
- return Promise.resolve(response);
10459
- });
10460
- });
10461
- }
10462
- //**update custom display */
10463
- updateCustomDisplay(session, request) {
10464
- return __async(this, null, function* () {
10465
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10466
- yield this.sessionRefresh(session);
10467
- }
10468
- return this.apiClient.updateCustomDisplay(session.token, request).then((response) => {
10469
- return response !== void 0;
10470
- });
10471
- });
10472
- }
10473
10492
  //**list wallet ledger */
10474
10493
  listWalletLedger(session, limit, cursor, transactionId) {
10475
10494
  return __async(this, null, function* () {