mezon-js 2.12.7 → 2.12.9

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/api.gen.ts CHANGED
@@ -3190,6 +3190,14 @@ export interface ApiListClanDiscover {
3190
3190
  page_count?: number;
3191
3191
  }
3192
3192
 
3193
+ /** */
3194
+ export interface ApiClanDiscoverRequest {
3195
+ //
3196
+ item_per_page?: number;
3197
+ //
3198
+ page_number?: number;
3199
+ }
3200
+
3193
3201
  export class MezonApi {
3194
3202
  basePath: string;
3195
3203
  constructor(
@@ -10781,18 +10789,18 @@ export class MezonApi {
10781
10789
  /** Discover mezon clan. */
10782
10790
  clanDiscover(basicAuthUsername: string,
10783
10791
  basicAuthPassword: string,
10784
- basePath: string,
10785
- page: number,
10792
+ basePath: string,
10793
+ body:ApiClanDiscoverRequest,
10786
10794
  options: any = {}): Promise<ApiListClanDiscover> {
10787
10795
 
10788
- if (page === null || page === undefined) {
10789
- throw new Error("'page' is a required parameter but is null or undefined.");
10796
+ if (body === null || body === undefined) {
10797
+ throw new Error("'body' is a required parameter but is null or undefined.");
10790
10798
  }
10791
10799
  const urlPath = "/v2/clan/discover";
10792
10800
  const queryParams = new Map<string, any>();
10793
10801
 
10794
10802
  let bodyJson : string = "";
10795
- bodyJson = JSON.stringify(page || {});
10803
+ bodyJson = JSON.stringify(body || {});
10796
10804
 
10797
10805
  const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
10798
10806
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
package/client.ts CHANGED
@@ -164,6 +164,7 @@ import {
164
164
  ApiUpdateClanOrderRequest,
165
165
  ApiMessage2InboxRequest,
166
166
  ApiListClanDiscover,
167
+ ApiClanDiscoverRequest,
167
168
  } from "./api.gen";
168
169
 
169
170
  import { Session } from "./session";
@@ -583,6 +584,11 @@ export class Client {
583
584
  this.apiClient = new MezonApi(serverkey, timeout, basePath);
584
585
  }
585
586
 
587
+ /** check session isexpired */
588
+ isexpired(session: Session): boolean {
589
+ return session.isexpired(Date.now() / 1000)
590
+ }
591
+
586
592
  /** Authenticate a user with a custom id against the server. */
587
593
  authenticateMezon(
588
594
  token: string,
@@ -4741,10 +4747,10 @@ export class Client {
4741
4747
  /** list clan discover. */
4742
4748
  listClanDiscover(
4743
4749
  basePath: string,
4744
- page: number
4750
+ request: ApiClanDiscoverRequest
4745
4751
  ): Promise<ApiListClanDiscover> {
4746
4752
  return this.apiClient
4747
- .clanDiscover(this.serverkey, "", basePath, page)
4753
+ .clanDiscover(this.serverkey, "", basePath, request)
4748
4754
  .then((response: ApiListClanDiscover) => {
4749
4755
  return Promise.resolve(response);
4750
4756
  });
package/dist/api.gen.d.ts CHANGED
@@ -1826,6 +1826,11 @@ export interface ApiListClanDiscover {
1826
1826
  page?: number;
1827
1827
  page_count?: number;
1828
1828
  }
1829
+ /** */
1830
+ export interface ApiClanDiscoverRequest {
1831
+ item_per_page?: number;
1832
+ page_number?: number;
1833
+ }
1829
1834
  export declare class MezonApi {
1830
1835
  readonly serverKey: string;
1831
1836
  readonly timeoutMs: number;
@@ -2214,5 +2219,5 @@ export declare class MezonApi {
2214
2219
  /** */
2215
2220
  updateClanOrder(bearerToken: string, body: ApiUpdateClanOrderRequest, options?: any): Promise<any>;
2216
2221
  /** Discover mezon clan. */
2217
- clanDiscover(basicAuthUsername: string, basicAuthPassword: string, basePath: string, page: number, options?: any): Promise<ApiListClanDiscover>;
2222
+ clanDiscover(basicAuthUsername: string, basicAuthPassword: string, basePath: string, body: ApiClanDiscoverRequest, options?: any): Promise<ApiListClanDiscover>;
2218
2223
  }
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, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, 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, ApiChannelCanvasListResponse, 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, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, MezonapiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover } from "./api.gen";
16
+ import { ApiAccount, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, 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, ApiChannelCanvasListResponse, 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, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, MezonapiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -352,6 +352,8 @@ export declare class Client {
352
352
  port: string;
353
353
  useSSL: boolean;
354
354
  constructor(serverkey?: string, host?: string, port?: string, useSSL?: boolean, timeout?: number, autoRefreshSession?: boolean);
355
+ /** check session isexpired */
356
+ isexpired(session: Session): boolean;
355
357
  /** Authenticate a user with a custom id against the server. */
356
358
  authenticateMezon(token: string, create?: boolean, username?: string, isRemember?: boolean, vars?: Record<string, string>, options?: any): Promise<Session>;
357
359
  /** Authenticate a user with an email+password against the server. */
@@ -622,5 +624,5 @@ export declare class Client {
622
624
  /** Update clan order to view. */
623
625
  updateClanOrder(session: Session, request: ApiUpdateClanOrderRequest): Promise<boolean>;
624
626
  /** list clan discover. */
625
- listClanDiscover(basePath: string, page: number): Promise<ApiListClanDiscover>;
627
+ listClanDiscover(basePath: string, request: ApiClanDiscoverRequest): Promise<ApiListClanDiscover>;
626
628
  }
@@ -6661,14 +6661,14 @@ var MezonApi = class {
6661
6661
  ]);
6662
6662
  }
6663
6663
  /** Discover mezon clan. */
6664
- clanDiscover(basicAuthUsername, basicAuthPassword, basePath, page, options = {}) {
6665
- if (page === null || page === void 0) {
6666
- throw new Error("'page' is a required parameter but is null or undefined.");
6664
+ clanDiscover(basicAuthUsername, basicAuthPassword, basePath, body, options = {}) {
6665
+ if (body === null || body === void 0) {
6666
+ throw new Error("'body' is a required parameter but is null or undefined.");
6667
6667
  }
6668
6668
  const urlPath = "/v2/clan/discover";
6669
6669
  const queryParams = /* @__PURE__ */ new Map();
6670
6670
  let bodyJson = "";
6671
- bodyJson = JSON.stringify(page || {});
6671
+ bodyJson = JSON.stringify(body || {});
6672
6672
  const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
6673
6673
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
6674
6674
  if (basicAuthUsername) {
@@ -7893,6 +7893,10 @@ var Client = class {
7893
7893
  const basePath = `${scheme}${host}:${port}`;
7894
7894
  this.apiClient = new MezonApi(serverkey, timeout, basePath);
7895
7895
  }
7896
+ /** check session isexpired */
7897
+ isexpired(session) {
7898
+ return session.isexpired(Date.now() / 1e3);
7899
+ }
7896
7900
  /** Authenticate a user with a custom id against the server. */
7897
7901
  authenticateMezon(token, create, username, isRemember, vars = {}, options = {}) {
7898
7902
  const request = {
@@ -10332,8 +10336,8 @@ var Client = class {
10332
10336
  });
10333
10337
  }
10334
10338
  /** list clan discover. */
10335
- listClanDiscover(basePath, page) {
10336
- return this.apiClient.clanDiscover(this.serverkey, "", basePath, page).then((response) => {
10339
+ listClanDiscover(basePath, request) {
10340
+ return this.apiClient.clanDiscover(this.serverkey, "", basePath, request).then((response) => {
10337
10341
  return Promise.resolve(response);
10338
10342
  });
10339
10343
  }
@@ -6627,14 +6627,14 @@ var MezonApi = class {
6627
6627
  ]);
6628
6628
  }
6629
6629
  /** Discover mezon clan. */
6630
- clanDiscover(basicAuthUsername, basicAuthPassword, basePath, page, options = {}) {
6631
- if (page === null || page === void 0) {
6632
- throw new Error("'page' is a required parameter but is null or undefined.");
6630
+ clanDiscover(basicAuthUsername, basicAuthPassword, basePath, body, options = {}) {
6631
+ if (body === null || body === void 0) {
6632
+ throw new Error("'body' is a required parameter but is null or undefined.");
6633
6633
  }
6634
6634
  const urlPath = "/v2/clan/discover";
6635
6635
  const queryParams = /* @__PURE__ */ new Map();
6636
6636
  let bodyJson = "";
6637
- bodyJson = JSON.stringify(page || {});
6637
+ bodyJson = JSON.stringify(body || {});
6638
6638
  const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
6639
6639
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
6640
6640
  if (basicAuthUsername) {
@@ -7859,6 +7859,10 @@ var Client = class {
7859
7859
  const basePath = `${scheme}${host}:${port}`;
7860
7860
  this.apiClient = new MezonApi(serverkey, timeout, basePath);
7861
7861
  }
7862
+ /** check session isexpired */
7863
+ isexpired(session) {
7864
+ return session.isexpired(Date.now() / 1e3);
7865
+ }
7862
7866
  /** Authenticate a user with a custom id against the server. */
7863
7867
  authenticateMezon(token, create, username, isRemember, vars = {}, options = {}) {
7864
7868
  const request = {
@@ -10298,8 +10302,8 @@ var Client = class {
10298
10302
  });
10299
10303
  }
10300
10304
  /** list clan discover. */
10301
- listClanDiscover(basePath, page) {
10302
- return this.apiClient.clanDiscover(this.serverkey, "", basePath, page).then((response) => {
10305
+ listClanDiscover(basePath, request) {
10306
+ return this.apiClient.clanDiscover(this.serverkey, "", basePath, request).then((response) => {
10303
10307
  return Promise.resolve(response);
10304
10308
  });
10305
10309
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.12.7",
4
+ "version": "2.12.9",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"