mezon-js 2.10.88 → 2.10.89

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -7598,199 +7598,38 @@ export class MezonApi {
7598
7598
  ),
7599
7599
  ]);
7600
7600
  }
7601
-
7602
- /** Delete mezon OAuth client */
7603
- deleteMezonOauthClient(bearerToken: string,
7604
- accessTokenStrategy?:string,
7605
- allowedCorsOrigins?:Array<string>,
7606
- audience?:Array<string>,
7607
- authorizationCodeGrantAccessTokenLifespan?:string,
7608
- authorizationCodeGrantIdTokenLifespan?:string,
7609
- authorizationCodeGrantRefreshTokenLifespan?:string,
7610
- backchannelLogoutSessionRequired?:boolean,
7611
- backchannelLogoutUri?:string,
7612
- clientCredentialsGrantAccessTokenLifespan?:string,
7613
- clientId?:string,
7614
- clientName?:string,
7615
- clientSecret?:string,
7616
- clientSecretExpiresAt?:number,
7617
- clientUri?:string,
7618
- contacts?:Array<string>,
7619
- createdAt?:string,
7620
- frontchannelLogoutSessionRequired?:boolean,
7621
- frontchannelLogoutUri?:string,
7622
- grantTypes?:Array<string>,
7623
- implicitGrantAccessTokenLifespan?:string,
7624
- implicitGrantIdTokenLifespan?:string,
7625
- jwks?:Array<string>,
7626
- jwksUri?:string,
7627
- jwtBearerGrantAccessTokenLifespan?:string,
7628
- logoUri?:string,
7629
- owner?:string,
7630
- policyUri?:string,
7631
- postLogoutRedirectUris?:Array<string>,
7632
- redirectUris?:Array<string>,
7633
- refreshTokenGrantAccessTokenLifespan?:string,
7634
- refreshTokenGrantIdTokenLifespan?:string,
7635
- refreshTokenGrantRefreshTokenLifespan?:string,
7636
- registrationAccessToken?:string,
7637
- registrationClientUri?:string,
7638
- requestObjectSigningAlg?:string,
7639
- requestUris?:Array<string>,
7640
- responseTypes?:Array<string>,
7641
- scope?:string,
7642
- sectorIdentifierUri?:string,
7643
- skipConsent?:boolean,
7644
- skipLogoutConsent?:boolean,
7645
- subjectType?:string,
7646
- tokenEndpointAuthMethod?:string,
7647
- tokenEndpointAuthSigningAlg?:string,
7648
- tosUri?:string,
7649
- updatedAt?:string,
7650
- userinfoSignedResponseAlg?:string,
7651
- options: any = {}): Promise<any> {
7652
-
7653
- const urlPath = "/v2/mznoauthclient";
7654
- const queryParams = new Map<string, any>();
7655
- queryParams.set("access_token_strategy", accessTokenStrategy);
7656
- queryParams.set("allowed_cors_origins", allowedCorsOrigins);
7657
- queryParams.set("audience", audience);
7658
- queryParams.set("authorization_code_grant_access_token_lifespan", authorizationCodeGrantAccessTokenLifespan);
7659
- queryParams.set("authorization_code_grant_id_token_lifespan", authorizationCodeGrantIdTokenLifespan);
7660
- queryParams.set("authorization_code_grant_refresh_token_lifespan", authorizationCodeGrantRefreshTokenLifespan);
7661
- queryParams.set("backchannel_logout_session_required", backchannelLogoutSessionRequired);
7662
- queryParams.set("backchannel_logout_uri", backchannelLogoutUri);
7663
- queryParams.set("client_credentials_grant_access_token_lifespan", clientCredentialsGrantAccessTokenLifespan);
7664
- queryParams.set("client_id", clientId);
7665
- queryParams.set("client_name", clientName);
7666
- queryParams.set("client_secret", clientSecret);
7667
- queryParams.set("client_secret_expires_at", clientSecretExpiresAt);
7668
- queryParams.set("client_uri", clientUri);
7669
- queryParams.set("contacts", contacts);
7670
- queryParams.set("created_at", createdAt);
7671
- queryParams.set("frontchannel_logout_session_required", frontchannelLogoutSessionRequired);
7672
- queryParams.set("frontchannel_logout_uri", frontchannelLogoutUri);
7673
- queryParams.set("grant_types", grantTypes);
7674
- queryParams.set("implicit_grant_access_token_lifespan", implicitGrantAccessTokenLifespan);
7675
- queryParams.set("implicit_grant_id_token_lifespan", implicitGrantIdTokenLifespan);
7676
- queryParams.set("jwks", jwks);
7677
- queryParams.set("jwks_uri", jwksUri);
7678
- queryParams.set("jwt_bearer_grant_access_token_lifespan", jwtBearerGrantAccessTokenLifespan);
7679
- queryParams.set("logo_uri", logoUri);
7680
- queryParams.set("owner", owner);
7681
- queryParams.set("policy_uri", policyUri);
7682
- queryParams.set("post_logout_redirect_uris", postLogoutRedirectUris);
7683
- queryParams.set("redirect_uris", redirectUris);
7684
- queryParams.set("refresh_token_grant_access_token_lifespan", refreshTokenGrantAccessTokenLifespan);
7685
- queryParams.set("refresh_token_grant_id_token_lifespan", refreshTokenGrantIdTokenLifespan);
7686
- queryParams.set("refresh_token_grant_refresh_token_lifespan", refreshTokenGrantRefreshTokenLifespan);
7687
- queryParams.set("registration_access_token", registrationAccessToken);
7688
- queryParams.set("registration_client_uri", registrationClientUri);
7689
- queryParams.set("request_object_signing_alg", requestObjectSigningAlg);
7690
- queryParams.set("request_uris", requestUris);
7691
- queryParams.set("response_types", responseTypes);
7692
- queryParams.set("scope", scope);
7693
- queryParams.set("sector_identifier_uri", sectorIdentifierUri);
7694
- queryParams.set("skip_consent", skipConsent);
7695
- queryParams.set("skip_logout_consent", skipLogoutConsent);
7696
- queryParams.set("subject_type", subjectType);
7697
- queryParams.set("token_endpoint_auth_method", tokenEndpointAuthMethod);
7698
- queryParams.set("token_endpoint_auth_signing_alg", tokenEndpointAuthSigningAlg);
7699
- queryParams.set("tos_uri", tosUri);
7700
- queryParams.set("updated_at", updatedAt);
7701
- queryParams.set("userinfo_signed_response_alg", userinfoSignedResponseAlg);
7702
-
7703
- let bodyJson : string = "";
7704
-
7705
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7706
- const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
7707
- if (bearerToken) {
7708
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7709
- }
7710
-
7711
- return Promise.race([
7712
- fetch(fullUrl, fetchOptions).then((response) => {
7713
- if (response.status == 204) {
7714
- return response;
7715
- } else if (response.status >= 200 && response.status < 300) {
7716
- return response.json();
7717
- } else {
7718
- throw response;
7719
- }
7720
- }),
7721
- new Promise((_, reject) =>
7722
- setTimeout(reject, this.timeoutMs, "Request timed out.")
7723
- ),
7724
- ]);
7725
- }
7726
7601
 
7727
- /** List mezon OAuth client */
7728
- listMezonOauthClient(bearerToken: string,
7729
- options: any = {}): Promise<ApiMezonOauthClientList> {
7730
-
7731
- const urlPath = "/v2/mznoauthclient";
7732
- const queryParams = new Map<string, any>();
7733
-
7734
- let bodyJson : string = "";
7735
-
7736
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7737
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
7738
- if (bearerToken) {
7739
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7740
- }
7741
-
7742
- return Promise.race([
7743
- fetch(fullUrl, fetchOptions).then((response) => {
7744
- if (response.status == 204) {
7745
- return response;
7746
- } else if (response.status >= 200 && response.status < 300) {
7747
- return response.json();
7748
- } else {
7749
- throw response;
7750
- }
7751
- }),
7752
- new Promise((_, reject) =>
7753
- setTimeout(reject, this.timeoutMs, "Request timed out.")
7754
- ),
7755
- ]);
7602
+ /** List mezon OAuth client */
7603
+ listMezonOauthClient(bearerToken: string,
7604
+ options: any = {}): Promise<ApiMezonOauthClientList> {
7605
+
7606
+ const urlPath = "/v2/mznoauthclient";
7607
+ const queryParams = new Map<string, any>();
7608
+
7609
+ let bodyJson : string = "";
7610
+
7611
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7612
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
7613
+ if (bearerToken) {
7614
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7615
+ }
7616
+
7617
+ return Promise.race([
7618
+ fetch(fullUrl, fetchOptions).then((response) => {
7619
+ if (response.status == 204) {
7620
+ return response;
7621
+ } else if (response.status >= 200 && response.status < 300) {
7622
+ return response.json();
7623
+ } else {
7624
+ throw response;
7625
+ }
7626
+ }),
7627
+ new Promise((_, reject) =>
7628
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
7629
+ ),
7630
+ ]);
7756
7631
  }
7757
7632
 
7758
- /** Create mezon OAuth client */
7759
- createMezonOauthClient(bearerToken: string,
7760
- body:ApiMezonOauthClient,
7761
- options: any = {}): Promise<ApiMezonOauthClient> {
7762
-
7763
- if (body === null || body === undefined) {
7764
- throw new Error("'body' is a required parameter but is null or undefined.");
7765
- }
7766
- const urlPath = "/v2/mznoauthclient";
7767
- const queryParams = new Map<string, any>();
7768
-
7769
- let bodyJson : string = "";
7770
- bodyJson = JSON.stringify(body || {});
7771
-
7772
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7773
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
7774
- if (bearerToken) {
7775
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7776
- }
7777
-
7778
- return Promise.race([
7779
- fetch(fullUrl, fetchOptions).then((response) => {
7780
- if (response.status == 204) {
7781
- return response;
7782
- } else if (response.status >= 200 && response.status < 300) {
7783
- return response.json();
7784
- } else {
7785
- throw response;
7786
- }
7787
- }),
7788
- new Promise((_, reject) =>
7789
- setTimeout(reject, this.timeoutMs, "Request timed out.")
7790
- ),
7791
- ]);
7792
- }
7793
-
7794
7633
  /** set mute notification user channel. */
7795
7634
  setMuteNotificationCategory(
7796
7635
  bearerToken: string,
package/client.ts CHANGED
@@ -162,6 +162,7 @@ import {
162
162
  ApiGenerateMeetTokenRequest,
163
163
  ApiGenerateMeetTokenResponse,
164
164
  ApiHandleParticipantMeetStateRequest,
165
+ ApiMezonOauthClientList,
165
166
  } from "./api.gen";
166
167
 
167
168
  import { Session } from "./session";
@@ -4931,4 +4932,23 @@ export class Client {
4931
4932
  return Promise.resolve(response);
4932
4933
  });
4933
4934
  }
4935
+
4936
+ //**list webhook belong to the clan */
4937
+ async listMezonOauthClient(
4938
+ session: Session
4939
+ ): Promise<ApiMezonOauthClientList> {
4940
+ if (
4941
+ this.autoRefreshSession &&
4942
+ session.refresh_token &&
4943
+ session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
4944
+ ) {
4945
+ await this.sessionRefresh(session);
4946
+ }
4947
+
4948
+ return this.apiClient
4949
+ .listMezonOauthClient(session.token)
4950
+ .then((response: ApiMezonOauthClientList) => {
4951
+ return Promise.resolve(response);
4952
+ });
4953
+ }
4934
4954
  }
package/dist/api.gen.d.ts CHANGED
@@ -1943,12 +1943,8 @@ export declare class MezonApi {
1943
1943
  listChannelByUserId(bearerToken: string, options?: any): Promise<ApiChannelDescList>;
1944
1944
  /** Mark as read */
1945
1945
  markAsRead(bearerToken: string, body: ApiMarkAsReadRequest, options?: any): Promise<any>;
1946
- /** Delete mezon OAuth client */
1947
- deleteMezonOauthClient(bearerToken: string, accessTokenStrategy?: string, allowedCorsOrigins?: Array<string>, audience?: Array<string>, authorizationCodeGrantAccessTokenLifespan?: string, authorizationCodeGrantIdTokenLifespan?: string, authorizationCodeGrantRefreshTokenLifespan?: string, backchannelLogoutSessionRequired?: boolean, backchannelLogoutUri?: string, clientCredentialsGrantAccessTokenLifespan?: string, clientId?: string, clientName?: string, clientSecret?: string, clientSecretExpiresAt?: number, clientUri?: string, contacts?: Array<string>, createdAt?: string, frontchannelLogoutSessionRequired?: boolean, frontchannelLogoutUri?: string, grantTypes?: Array<string>, implicitGrantAccessTokenLifespan?: string, implicitGrantIdTokenLifespan?: string, jwks?: Array<string>, jwksUri?: string, jwtBearerGrantAccessTokenLifespan?: string, logoUri?: string, owner?: string, policyUri?: string, postLogoutRedirectUris?: Array<string>, redirectUris?: Array<string>, refreshTokenGrantAccessTokenLifespan?: string, refreshTokenGrantIdTokenLifespan?: string, refreshTokenGrantRefreshTokenLifespan?: string, registrationAccessToken?: string, registrationClientUri?: string, requestObjectSigningAlg?: string, requestUris?: Array<string>, responseTypes?: Array<string>, scope?: string, sectorIdentifierUri?: string, skipConsent?: boolean, skipLogoutConsent?: boolean, subjectType?: string, tokenEndpointAuthMethod?: string, tokenEndpointAuthSigningAlg?: string, tosUri?: string, updatedAt?: string, userinfoSignedResponseAlg?: string, options?: any): Promise<any>;
1948
1946
  /** List mezon OAuth client */
1949
1947
  listMezonOauthClient(bearerToken: string, options?: any): Promise<ApiMezonOauthClientList>;
1950
- /** Create mezon OAuth client */
1951
- createMezonOauthClient(bearerToken: string, body: ApiMezonOauthClient, options?: any): Promise<ApiMezonOauthClient>;
1952
1948
  /** set mute notification user channel. */
1953
1949
  setMuteNotificationCategory(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
1954
1950
  /** set mute notification user channel. */
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, 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, 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, ApiHandleParticipantMeetStateRequest } from "./api.gen";
16
+ import { ApiAccount, ApiAccountMezon, 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, 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, ApiHandleParticipantMeetStateRequest, ApiMezonOauthClientList } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -644,4 +644,5 @@ export declare class Client {
644
644
  generateMeetToken(session: Session, body: ApiGenerateMeetTokenRequest): Promise<ApiGenerateMeetTokenResponse>;
645
645
  /** Handle participant meet state */
646
646
  handleParticipantMeetState(session: Session, body: ApiHandleParticipantMeetStateRequest): Promise<any>;
647
+ listMezonOauthClient(session: Session): Promise<ApiMezonOauthClientList>;
647
648
  }
@@ -4352,78 +4352,6 @@ var MezonApi = class {
4352
4352
  )
4353
4353
  ]);
4354
4354
  }
4355
- /** Delete mezon OAuth client */
4356
- deleteMezonOauthClient(bearerToken, accessTokenStrategy, allowedCorsOrigins, audience, authorizationCodeGrantAccessTokenLifespan, authorizationCodeGrantIdTokenLifespan, authorizationCodeGrantRefreshTokenLifespan, backchannelLogoutSessionRequired, backchannelLogoutUri, clientCredentialsGrantAccessTokenLifespan, clientId, clientName, clientSecret, clientSecretExpiresAt, clientUri, contacts, createdAt, frontchannelLogoutSessionRequired, frontchannelLogoutUri, grantTypes, implicitGrantAccessTokenLifespan, implicitGrantIdTokenLifespan, jwks, jwksUri, jwtBearerGrantAccessTokenLifespan, logoUri, owner, policyUri, postLogoutRedirectUris, redirectUris, refreshTokenGrantAccessTokenLifespan, refreshTokenGrantIdTokenLifespan, refreshTokenGrantRefreshTokenLifespan, registrationAccessToken, registrationClientUri, requestObjectSigningAlg, requestUris, responseTypes, scope, sectorIdentifierUri, skipConsent, skipLogoutConsent, subjectType, tokenEndpointAuthMethod, tokenEndpointAuthSigningAlg, tosUri, updatedAt, userinfoSignedResponseAlg, options = {}) {
4357
- const urlPath = "/v2/mznoauthclient";
4358
- const queryParams = /* @__PURE__ */ new Map();
4359
- queryParams.set("access_token_strategy", accessTokenStrategy);
4360
- queryParams.set("allowed_cors_origins", allowedCorsOrigins);
4361
- queryParams.set("audience", audience);
4362
- queryParams.set("authorization_code_grant_access_token_lifespan", authorizationCodeGrantAccessTokenLifespan);
4363
- queryParams.set("authorization_code_grant_id_token_lifespan", authorizationCodeGrantIdTokenLifespan);
4364
- queryParams.set("authorization_code_grant_refresh_token_lifespan", authorizationCodeGrantRefreshTokenLifespan);
4365
- queryParams.set("backchannel_logout_session_required", backchannelLogoutSessionRequired);
4366
- queryParams.set("backchannel_logout_uri", backchannelLogoutUri);
4367
- queryParams.set("client_credentials_grant_access_token_lifespan", clientCredentialsGrantAccessTokenLifespan);
4368
- queryParams.set("client_id", clientId);
4369
- queryParams.set("client_name", clientName);
4370
- queryParams.set("client_secret", clientSecret);
4371
- queryParams.set("client_secret_expires_at", clientSecretExpiresAt);
4372
- queryParams.set("client_uri", clientUri);
4373
- queryParams.set("contacts", contacts);
4374
- queryParams.set("created_at", createdAt);
4375
- queryParams.set("frontchannel_logout_session_required", frontchannelLogoutSessionRequired);
4376
- queryParams.set("frontchannel_logout_uri", frontchannelLogoutUri);
4377
- queryParams.set("grant_types", grantTypes);
4378
- queryParams.set("implicit_grant_access_token_lifespan", implicitGrantAccessTokenLifespan);
4379
- queryParams.set("implicit_grant_id_token_lifespan", implicitGrantIdTokenLifespan);
4380
- queryParams.set("jwks", jwks);
4381
- queryParams.set("jwks_uri", jwksUri);
4382
- queryParams.set("jwt_bearer_grant_access_token_lifespan", jwtBearerGrantAccessTokenLifespan);
4383
- queryParams.set("logo_uri", logoUri);
4384
- queryParams.set("owner", owner);
4385
- queryParams.set("policy_uri", policyUri);
4386
- queryParams.set("post_logout_redirect_uris", postLogoutRedirectUris);
4387
- queryParams.set("redirect_uris", redirectUris);
4388
- queryParams.set("refresh_token_grant_access_token_lifespan", refreshTokenGrantAccessTokenLifespan);
4389
- queryParams.set("refresh_token_grant_id_token_lifespan", refreshTokenGrantIdTokenLifespan);
4390
- queryParams.set("refresh_token_grant_refresh_token_lifespan", refreshTokenGrantRefreshTokenLifespan);
4391
- queryParams.set("registration_access_token", registrationAccessToken);
4392
- queryParams.set("registration_client_uri", registrationClientUri);
4393
- queryParams.set("request_object_signing_alg", requestObjectSigningAlg);
4394
- queryParams.set("request_uris", requestUris);
4395
- queryParams.set("response_types", responseTypes);
4396
- queryParams.set("scope", scope);
4397
- queryParams.set("sector_identifier_uri", sectorIdentifierUri);
4398
- queryParams.set("skip_consent", skipConsent);
4399
- queryParams.set("skip_logout_consent", skipLogoutConsent);
4400
- queryParams.set("subject_type", subjectType);
4401
- queryParams.set("token_endpoint_auth_method", tokenEndpointAuthMethod);
4402
- queryParams.set("token_endpoint_auth_signing_alg", tokenEndpointAuthSigningAlg);
4403
- queryParams.set("tos_uri", tosUri);
4404
- queryParams.set("updated_at", updatedAt);
4405
- queryParams.set("userinfo_signed_response_alg", userinfoSignedResponseAlg);
4406
- let bodyJson = "";
4407
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4408
- const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
4409
- if (bearerToken) {
4410
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4411
- }
4412
- return Promise.race([
4413
- fetch(fullUrl, fetchOptions).then((response) => {
4414
- if (response.status == 204) {
4415
- return response;
4416
- } else if (response.status >= 200 && response.status < 300) {
4417
- return response.json();
4418
- } else {
4419
- throw response;
4420
- }
4421
- }),
4422
- new Promise(
4423
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4424
- )
4425
- ]);
4426
- }
4427
4355
  /** List mezon OAuth client */
4428
4356
  listMezonOauthClient(bearerToken, options = {}) {
4429
4357
  const urlPath = "/v2/mznoauthclient";
@@ -4449,35 +4377,6 @@ var MezonApi = class {
4449
4377
  )
4450
4378
  ]);
4451
4379
  }
4452
- /** Create mezon OAuth client */
4453
- createMezonOauthClient(bearerToken, body, options = {}) {
4454
- if (body === null || body === void 0) {
4455
- throw new Error("'body' is a required parameter but is null or undefined.");
4456
- }
4457
- const urlPath = "/v2/mznoauthclient";
4458
- const queryParams = /* @__PURE__ */ new Map();
4459
- let bodyJson = "";
4460
- bodyJson = JSON.stringify(body || {});
4461
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4462
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4463
- if (bearerToken) {
4464
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4465
- }
4466
- return Promise.race([
4467
- fetch(fullUrl, fetchOptions).then((response) => {
4468
- if (response.status == 204) {
4469
- return response;
4470
- } else if (response.status >= 200 && response.status < 300) {
4471
- return response.json();
4472
- } else {
4473
- throw response;
4474
- }
4475
- }),
4476
- new Promise(
4477
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4478
- )
4479
- ]);
4480
- }
4481
4380
  /** set mute notification user channel. */
4482
4381
  setMuteNotificationCategory(bearerToken, body, options = {}) {
4483
4382
  if (body === null || body === void 0) {
@@ -10901,4 +10800,15 @@ var Client = class {
10901
10800
  });
10902
10801
  });
10903
10802
  }
10803
+ //**list webhook belong to the clan */
10804
+ listMezonOauthClient(session) {
10805
+ return __async(this, null, function* () {
10806
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10807
+ yield this.sessionRefresh(session);
10808
+ }
10809
+ return this.apiClient.listMezonOauthClient(session.token).then((response) => {
10810
+ return Promise.resolve(response);
10811
+ });
10812
+ });
10813
+ }
10904
10814
  };
@@ -4318,78 +4318,6 @@ var MezonApi = class {
4318
4318
  )
4319
4319
  ]);
4320
4320
  }
4321
- /** Delete mezon OAuth client */
4322
- deleteMezonOauthClient(bearerToken, accessTokenStrategy, allowedCorsOrigins, audience, authorizationCodeGrantAccessTokenLifespan, authorizationCodeGrantIdTokenLifespan, authorizationCodeGrantRefreshTokenLifespan, backchannelLogoutSessionRequired, backchannelLogoutUri, clientCredentialsGrantAccessTokenLifespan, clientId, clientName, clientSecret, clientSecretExpiresAt, clientUri, contacts, createdAt, frontchannelLogoutSessionRequired, frontchannelLogoutUri, grantTypes, implicitGrantAccessTokenLifespan, implicitGrantIdTokenLifespan, jwks, jwksUri, jwtBearerGrantAccessTokenLifespan, logoUri, owner, policyUri, postLogoutRedirectUris, redirectUris, refreshTokenGrantAccessTokenLifespan, refreshTokenGrantIdTokenLifespan, refreshTokenGrantRefreshTokenLifespan, registrationAccessToken, registrationClientUri, requestObjectSigningAlg, requestUris, responseTypes, scope, sectorIdentifierUri, skipConsent, skipLogoutConsent, subjectType, tokenEndpointAuthMethod, tokenEndpointAuthSigningAlg, tosUri, updatedAt, userinfoSignedResponseAlg, options = {}) {
4323
- const urlPath = "/v2/mznoauthclient";
4324
- const queryParams = /* @__PURE__ */ new Map();
4325
- queryParams.set("access_token_strategy", accessTokenStrategy);
4326
- queryParams.set("allowed_cors_origins", allowedCorsOrigins);
4327
- queryParams.set("audience", audience);
4328
- queryParams.set("authorization_code_grant_access_token_lifespan", authorizationCodeGrantAccessTokenLifespan);
4329
- queryParams.set("authorization_code_grant_id_token_lifespan", authorizationCodeGrantIdTokenLifespan);
4330
- queryParams.set("authorization_code_grant_refresh_token_lifespan", authorizationCodeGrantRefreshTokenLifespan);
4331
- queryParams.set("backchannel_logout_session_required", backchannelLogoutSessionRequired);
4332
- queryParams.set("backchannel_logout_uri", backchannelLogoutUri);
4333
- queryParams.set("client_credentials_grant_access_token_lifespan", clientCredentialsGrantAccessTokenLifespan);
4334
- queryParams.set("client_id", clientId);
4335
- queryParams.set("client_name", clientName);
4336
- queryParams.set("client_secret", clientSecret);
4337
- queryParams.set("client_secret_expires_at", clientSecretExpiresAt);
4338
- queryParams.set("client_uri", clientUri);
4339
- queryParams.set("contacts", contacts);
4340
- queryParams.set("created_at", createdAt);
4341
- queryParams.set("frontchannel_logout_session_required", frontchannelLogoutSessionRequired);
4342
- queryParams.set("frontchannel_logout_uri", frontchannelLogoutUri);
4343
- queryParams.set("grant_types", grantTypes);
4344
- queryParams.set("implicit_grant_access_token_lifespan", implicitGrantAccessTokenLifespan);
4345
- queryParams.set("implicit_grant_id_token_lifespan", implicitGrantIdTokenLifespan);
4346
- queryParams.set("jwks", jwks);
4347
- queryParams.set("jwks_uri", jwksUri);
4348
- queryParams.set("jwt_bearer_grant_access_token_lifespan", jwtBearerGrantAccessTokenLifespan);
4349
- queryParams.set("logo_uri", logoUri);
4350
- queryParams.set("owner", owner);
4351
- queryParams.set("policy_uri", policyUri);
4352
- queryParams.set("post_logout_redirect_uris", postLogoutRedirectUris);
4353
- queryParams.set("redirect_uris", redirectUris);
4354
- queryParams.set("refresh_token_grant_access_token_lifespan", refreshTokenGrantAccessTokenLifespan);
4355
- queryParams.set("refresh_token_grant_id_token_lifespan", refreshTokenGrantIdTokenLifespan);
4356
- queryParams.set("refresh_token_grant_refresh_token_lifespan", refreshTokenGrantRefreshTokenLifespan);
4357
- queryParams.set("registration_access_token", registrationAccessToken);
4358
- queryParams.set("registration_client_uri", registrationClientUri);
4359
- queryParams.set("request_object_signing_alg", requestObjectSigningAlg);
4360
- queryParams.set("request_uris", requestUris);
4361
- queryParams.set("response_types", responseTypes);
4362
- queryParams.set("scope", scope);
4363
- queryParams.set("sector_identifier_uri", sectorIdentifierUri);
4364
- queryParams.set("skip_consent", skipConsent);
4365
- queryParams.set("skip_logout_consent", skipLogoutConsent);
4366
- queryParams.set("subject_type", subjectType);
4367
- queryParams.set("token_endpoint_auth_method", tokenEndpointAuthMethod);
4368
- queryParams.set("token_endpoint_auth_signing_alg", tokenEndpointAuthSigningAlg);
4369
- queryParams.set("tos_uri", tosUri);
4370
- queryParams.set("updated_at", updatedAt);
4371
- queryParams.set("userinfo_signed_response_alg", userinfoSignedResponseAlg);
4372
- let bodyJson = "";
4373
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4374
- const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
4375
- if (bearerToken) {
4376
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4377
- }
4378
- return Promise.race([
4379
- fetch(fullUrl, fetchOptions).then((response) => {
4380
- if (response.status == 204) {
4381
- return response;
4382
- } else if (response.status >= 200 && response.status < 300) {
4383
- return response.json();
4384
- } else {
4385
- throw response;
4386
- }
4387
- }),
4388
- new Promise(
4389
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4390
- )
4391
- ]);
4392
- }
4393
4321
  /** List mezon OAuth client */
4394
4322
  listMezonOauthClient(bearerToken, options = {}) {
4395
4323
  const urlPath = "/v2/mznoauthclient";
@@ -4415,35 +4343,6 @@ var MezonApi = class {
4415
4343
  )
4416
4344
  ]);
4417
4345
  }
4418
- /** Create mezon OAuth client */
4419
- createMezonOauthClient(bearerToken, body, options = {}) {
4420
- if (body === null || body === void 0) {
4421
- throw new Error("'body' is a required parameter but is null or undefined.");
4422
- }
4423
- const urlPath = "/v2/mznoauthclient";
4424
- const queryParams = /* @__PURE__ */ new Map();
4425
- let bodyJson = "";
4426
- bodyJson = JSON.stringify(body || {});
4427
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4428
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4429
- if (bearerToken) {
4430
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4431
- }
4432
- return Promise.race([
4433
- fetch(fullUrl, fetchOptions).then((response) => {
4434
- if (response.status == 204) {
4435
- return response;
4436
- } else if (response.status >= 200 && response.status < 300) {
4437
- return response.json();
4438
- } else {
4439
- throw response;
4440
- }
4441
- }),
4442
- new Promise(
4443
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4444
- )
4445
- ]);
4446
- }
4447
4346
  /** set mute notification user channel. */
4448
4347
  setMuteNotificationCategory(bearerToken, body, options = {}) {
4449
4348
  if (body === null || body === void 0) {
@@ -10867,6 +10766,17 @@ var Client = class {
10867
10766
  });
10868
10767
  });
10869
10768
  }
10769
+ //**list webhook belong to the clan */
10770
+ listMezonOauthClient(session) {
10771
+ return __async(this, null, function* () {
10772
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10773
+ yield this.sessionRefresh(session);
10774
+ }
10775
+ return this.apiClient.listMezonOauthClient(session.token).then((response) => {
10776
+ return Promise.resolve(response);
10777
+ });
10778
+ });
10779
+ }
10870
10780
  };
10871
10781
  export {
10872
10782
  ChannelStreamMode,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.10.88",
4
+ "version": "2.10.89",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"