mezon-js 2.9.96 → 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.
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
  }
@@ -731,7 +731,7 @@ function safeJSONParse(jsonString) {
731
731
  const parsedData = JSON.parse(unescapedJSON);
732
732
  return parsedData;
733
733
  } catch (error) {
734
- console.error("Error parsing JSON:", error);
734
+ console.error("Error parsing JSON:", jsonString, error);
735
735
  return null;
736
736
  }
737
737
  }
@@ -885,7 +885,9 @@ var MezonApi = class {
885
885
  /** */
886
886
  checkLoginRequest(basicAuthUsername, basicAuthPassword, body, options = {}) {
887
887
  if (body === null || body === void 0) {
888
- 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
+ );
889
891
  }
890
892
  const urlPath = "/v2/account/authenticate/checklogin";
891
893
  const queryParams = /* @__PURE__ */ new Map();
@@ -914,7 +916,9 @@ var MezonApi = class {
914
916
  /** */
915
917
  confirmLogin(bearerToken, body, options = {}) {
916
918
  if (body === null || body === void 0) {
917
- 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
+ );
918
922
  }
919
923
  const urlPath = "/v2/account/authenticate/confirmlogin";
920
924
  const queryParams = /* @__PURE__ */ new Map();
@@ -943,7 +947,9 @@ var MezonApi = class {
943
947
  /** */
944
948
  createQRLogin(basicAuthUsername, basicAuthPassword, body, options = {}) {
945
949
  if (body === null || body === void 0) {
946
- 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
+ );
947
953
  }
948
954
  const urlPath = "/v2/account/authenticate/createqrlogin";
949
955
  const queryParams = /* @__PURE__ */ new Map();
@@ -1883,7 +1889,9 @@ var MezonApi = class {
1883
1889
  /** Create user activity */
1884
1890
  createActiviy(bearerToken, body, options = {}) {
1885
1891
  if (body === null || body === void 0) {
1886
- 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
+ );
1887
1895
  }
1888
1896
  const urlPath = "/v2/activity";
1889
1897
  const queryParams = /* @__PURE__ */ new Map();
@@ -2292,9 +2300,14 @@ var MezonApi = class {
2292
2300
  /** */
2293
2301
  getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
2294
2302
  if (channelId === null || channelId === void 0) {
2295
- 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
+ );
2296
2306
  }
2297
- 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
+ );
2298
2311
  const queryParams = /* @__PURE__ */ new Map();
2299
2312
  queryParams.set("clan_id", clanId);
2300
2313
  queryParams.set("limit", limit);
@@ -2323,7 +2336,9 @@ var MezonApi = class {
2323
2336
  /** */
2324
2337
  addChannelFavorite(bearerToken, body, options = {}) {
2325
2338
  if (body === null || body === void 0) {
2326
- 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
+ );
2327
2342
  }
2328
2343
  const urlPath = "/v2/channel/favorite";
2329
2344
  const queryParams = /* @__PURE__ */ new Map();
@@ -2352,9 +2367,14 @@ var MezonApi = class {
2352
2367
  /** */
2353
2368
  removeChannelFavorite(bearerToken, channelId, options = {}) {
2354
2369
  if (channelId === null || channelId === void 0) {
2355
- 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
+ );
2356
2373
  }
2357
- 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
+ );
2358
2378
  const queryParams = /* @__PURE__ */ new Map();
2359
2379
  let bodyJson = "";
2360
2380
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2380,9 +2400,14 @@ var MezonApi = class {
2380
2400
  /** */
2381
2401
  getListFavoriteChannel(bearerToken, clanId, options = {}) {
2382
2402
  if (clanId === null || clanId === void 0) {
2383
- 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
+ );
2384
2406
  }
2385
- 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
+ );
2386
2411
  const queryParams = /* @__PURE__ */ new Map();
2387
2412
  let bodyJson = "";
2388
2413
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2517,9 +2542,14 @@ var MezonApi = class {
2517
2542
  /** get channel encryption method */
2518
2543
  getChanEncryptionMethod(bearerToken, channelId, method, options = {}) {
2519
2544
  if (channelId === null || channelId === void 0) {
2520
- 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
+ );
2521
2548
  }
2522
- 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
+ );
2523
2553
  const queryParams = /* @__PURE__ */ new Map();
2524
2554
  queryParams.set("method", method);
2525
2555
  let bodyJson = "";
@@ -2546,12 +2576,19 @@ var MezonApi = class {
2546
2576
  /** store channel encryption method */
2547
2577
  setChanEncryptionMethod(bearerToken, channelId, body, options = {}) {
2548
2578
  if (channelId === null || channelId === void 0) {
2549
- 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
+ );
2550
2582
  }
2551
2583
  if (body === null || body === void 0) {
2552
- 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
+ );
2553
2587
  }
2554
- 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
+ );
2555
2592
  const queryParams = /* @__PURE__ */ new Map();
2556
2593
  let bodyJson = "";
2557
2594
  bodyJson = JSON.stringify(body || {});
@@ -2843,9 +2880,14 @@ var MezonApi = class {
2843
2880
  /** List channel setting */
2844
2881
  listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channelLabel, options = {}) {
2845
2882
  if (clanId === null || clanId === void 0) {
2846
- 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
+ );
2847
2886
  }
2848
- const urlPath = "/v2/channelsetting/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2887
+ const urlPath = "/v2/channelsetting/{clanId}".replace(
2888
+ "{clanId}",
2889
+ encodeURIComponent(String(clanId))
2890
+ );
2849
2891
  const queryParams = /* @__PURE__ */ new Map();
2850
2892
  queryParams.set("parent_id", parentId);
2851
2893
  queryParams.set("category_id", categoryId);
@@ -3243,60 +3285,6 @@ var MezonApi = class {
3243
3285
  ]);
3244
3286
  }
3245
3287
  /** */
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
3288
  deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
3301
3289
  if (categoryId === null || categoryId === void 0) {
3302
3290
  throw new Error(
@@ -4347,7 +4335,9 @@ var MezonApi = class {
4347
4335
  /** Mark as read */
4348
4336
  markAsRead(bearerToken, body, options = {}) {
4349
4337
  if (body === null || body === void 0) {
4350
- 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
+ );
4351
4341
  }
4352
4342
  const urlPath = "/v2/markasread";
4353
4343
  const queryParams = /* @__PURE__ */ new Map();
@@ -4863,7 +4853,9 @@ var MezonApi = class {
4863
4853
  /** set notification user channel. */
4864
4854
  createPinMessage(bearerToken, body, options = {}) {
4865
4855
  if (body === null || body === void 0) {
4866
- 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
+ );
4867
4859
  }
4868
4860
  const urlPath = "/v2/pinmessage/set";
4869
4861
  const queryParams = /* @__PURE__ */ new Map();
@@ -4949,7 +4941,9 @@ var MezonApi = class {
4949
4941
  /** store pubkey for e2ee */
4950
4942
  pushPubKey(bearerToken, body, options = {}) {
4951
4943
  if (body === null || body === void 0) {
4952
- 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
+ );
4953
4947
  }
4954
4948
  const urlPath = "/v2/pubkey/push";
4955
4949
  const queryParams = /* @__PURE__ */ new Map();
@@ -5431,7 +5425,9 @@ var MezonApi = class {
5431
5425
  /** UpdateWallets */
5432
5426
  sendToken(bearerToken, body, options = {}) {
5433
5427
  if (body === null || body === void 0) {
5434
- 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
+ );
5435
5431
  }
5436
5432
  const urlPath = "/v2/sendtoken";
5437
5433
  const queryParams = /* @__PURE__ */ new Map();
@@ -5865,9 +5861,14 @@ var MezonApi = class {
5865
5861
  /** List user channels */
5866
5862
  listThreadDescs(bearerToken, channelId, limit, state, clanId, threadId, options = {}) {
5867
5863
  if (channelId === null || channelId === void 0) {
5868
- 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
+ );
5869
5867
  }
5870
- const urlPath = "/v2/thread/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
5868
+ const urlPath = "/v2/thread/{channelId}".replace(
5869
+ "{channelId}",
5870
+ encodeURIComponent(String(channelId))
5871
+ );
5871
5872
  const queryParams = /* @__PURE__ */ new Map();
5872
5873
  queryParams.set("limit", limit);
5873
5874
  queryParams.set("state", state);
@@ -6173,7 +6174,9 @@ var MezonApi = class {
6173
6174
  /** Update user status */
6174
6175
  updateUserStatus(bearerToken, body, options = {}) {
6175
6176
  if (body === null || body === void 0) {
6176
- 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
+ );
6177
6180
  }
6178
6181
  const urlPath = "/v2/userstatus";
6179
6182
  const queryParams = /* @__PURE__ */ new Map();
@@ -6335,9 +6338,14 @@ var MezonApi = class {
6335
6338
  throw new Error("'id' is a required parameter but is null or undefined.");
6336
6339
  }
6337
6340
  if (body === null || body === void 0) {
6338
- 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
+ );
6339
6344
  }
6340
- const urlPath = "/v2/webhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6345
+ const urlPath = "/v2/webhooks/{id}".replace(
6346
+ "{id}",
6347
+ encodeURIComponent(String(id))
6348
+ );
6341
6349
  const queryParams = /* @__PURE__ */ new Map();
6342
6350
  let bodyJson = "";
6343
6351
  bodyJson = JSON.stringify(body || {});
@@ -6410,7 +6418,9 @@ var MezonApi = class {
6410
6418
  /** WithdrawToken */
6411
6419
  withdrawToken(bearerToken, body, options = {}) {
6412
6420
  if (body === null || body === void 0) {
6413
- 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
+ );
6414
6424
  }
6415
6425
  const urlPath = "/v2/withdrawtoken";
6416
6426
  const queryParams = /* @__PURE__ */ new Map();
@@ -6536,7 +6546,9 @@ var MezonApi = class {
6536
6546
  /** create onboarding. */
6537
6547
  createOnboarding(bearerToken, body, options = {}) {
6538
6548
  if (body === null || body === void 0) {
6539
- 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
+ );
6540
6552
  }
6541
6553
  const urlPath = "/v2/onboarding";
6542
6554
  const queryParams = /* @__PURE__ */ new Map();
@@ -6567,7 +6579,10 @@ var MezonApi = class {
6567
6579
  if (id === null || id === void 0) {
6568
6580
  throw new Error("'id' is a required parameter but is null or undefined.");
6569
6581
  }
6570
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6582
+ const urlPath = "/v2/onboarding/{id}".replace(
6583
+ "{id}",
6584
+ encodeURIComponent(String(id))
6585
+ );
6571
6586
  const queryParams = /* @__PURE__ */ new Map();
6572
6587
  queryParams.set("clan_id", clanId);
6573
6588
  let bodyJson = "";
@@ -6596,7 +6611,10 @@ var MezonApi = class {
6596
6611
  if (id === null || id === void 0) {
6597
6612
  throw new Error("'id' is a required parameter but is null or undefined.");
6598
6613
  }
6599
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6614
+ const urlPath = "/v2/onboarding/{id}".replace(
6615
+ "{id}",
6616
+ encodeURIComponent(String(id))
6617
+ );
6600
6618
  const queryParams = /* @__PURE__ */ new Map();
6601
6619
  queryParams.set("clan_id", clanId);
6602
6620
  let bodyJson = "";
@@ -6626,9 +6644,14 @@ var MezonApi = class {
6626
6644
  throw new Error("'id' is a required parameter but is null or undefined.");
6627
6645
  }
6628
6646
  if (body === null || body === void 0) {
6629
- 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
+ );
6630
6650
  }
6631
- const urlPath = "/v2/onboarding/{id}".replace("{id}", encodeURIComponent(String(id)));
6651
+ const urlPath = "/v2/onboarding/{id}".replace(
6652
+ "{id}",
6653
+ encodeURIComponent(String(id))
6654
+ );
6632
6655
  const queryParams = /* @__PURE__ */ new Map();
6633
6656
  let bodyJson = "";
6634
6657
  bodyJson = JSON.stringify(body || {});
@@ -6655,7 +6678,9 @@ var MezonApi = class {
6655
6678
  /** Generate clan webhook. */
6656
6679
  generateClanWebhook(bearerToken, body, options = {}) {
6657
6680
  if (body === null || body === void 0) {
6658
- 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
+ );
6659
6684
  }
6660
6685
  const urlPath = "/v2/clanwebhooks";
6661
6686
  const queryParams = /* @__PURE__ */ new Map();
@@ -6684,9 +6709,14 @@ var MezonApi = class {
6684
6709
  /** List clan webhook. */
6685
6710
  listClanWebhook(bearerToken, clanId, options = {}) {
6686
6711
  if (clanId === null || clanId === void 0) {
6687
- 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
+ );
6688
6715
  }
6689
- const urlPath = "/v2/clanwebhooks/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
6716
+ const urlPath = "/v2/clanwebhooks/{clanId}".replace(
6717
+ "{clanId}",
6718
+ encodeURIComponent(String(clanId))
6719
+ );
6690
6720
  const queryParams = /* @__PURE__ */ new Map();
6691
6721
  let bodyJson = "";
6692
6722
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -6714,7 +6744,10 @@ var MezonApi = class {
6714
6744
  if (id === null || id === void 0) {
6715
6745
  throw new Error("'id' is a required parameter but is null or undefined.");
6716
6746
  }
6717
- const urlPath = "/v2/clanwebhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6747
+ const urlPath = "/v2/clanwebhooks/{id}".replace(
6748
+ "{id}",
6749
+ encodeURIComponent(String(id))
6750
+ );
6718
6751
  const queryParams = /* @__PURE__ */ new Map();
6719
6752
  queryParams.set("clan_id", clanId);
6720
6753
  let bodyJson = "";
@@ -6744,9 +6777,14 @@ var MezonApi = class {
6744
6777
  throw new Error("'id' is a required parameter but is null or undefined.");
6745
6778
  }
6746
6779
  if (body === null || body === void 0) {
6747
- 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
+ );
6748
6783
  }
6749
- const urlPath = "/v2/clanwebhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
6784
+ const urlPath = "/v2/clanwebhooks/{id}".replace(
6785
+ "{id}",
6786
+ encodeURIComponent(String(id))
6787
+ );
6750
6788
  const queryParams = /* @__PURE__ */ new Map();
6751
6789
  let bodyJson = "";
6752
6790
  bodyJson = JSON.stringify(body || {});
@@ -6801,12 +6839,19 @@ var MezonApi = class {
6801
6839
  /** Update onboarding step. */
6802
6840
  updateOnboardingStepByClanId(bearerToken, clanId, body, options = {}) {
6803
6841
  if (clanId === null || clanId === void 0) {
6804
- 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
+ );
6805
6845
  }
6806
6846
  if (body === null || body === void 0) {
6807
- 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
+ );
6808
6850
  }
6809
- const urlPath = "/v2/onboardingsteps/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
6851
+ const urlPath = "/v2/onboardingsteps/{clanId}".replace(
6852
+ "{clanId}",
6853
+ encodeURIComponent(String(clanId))
6854
+ );
6810
6855
  const queryParams = /* @__PURE__ */ new Map();
6811
6856
  let bodyJson = "";
6812
6857
  bodyJson = JSON.stringify(body || {});
@@ -10448,28 +10493,6 @@ var Client = class {
10448
10493
  });
10449
10494
  });
10450
10495
  }
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
10496
  //**list wallet ledger */
10474
10497
  listWalletLedger(session, limit, cursor, transactionId) {
10475
10498
  return __async(this, null, function* () {