mezon-js 2.10.95 → 2.10.96

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
@@ -3064,6 +3064,14 @@ export interface ApiMezonOauthClient {
3064
3064
  userinfo_signed_response_alg?: string;
3065
3065
  }
3066
3066
 
3067
+ /** */
3068
+ export interface ApiCreateHashChannelAppsResponse {
3069
+ //
3070
+ hash?: string;
3071
+ //
3072
+ user_id?: string;
3073
+ }
3074
+
3067
3075
  export class MezonApi {
3068
3076
  constructor(
3069
3077
  readonly serverKey: string,
@@ -11279,4 +11287,37 @@ export class MezonApi {
11279
11287
  ),
11280
11288
  ]);
11281
11289
  }
11290
+ /** */
11291
+ generateHashChannelApps(bearerToken: string,
11292
+ appId?:string,
11293
+ options: any = {}
11294
+ ): Promise<ApiCreateHashChannelAppsResponse> {
11295
+
11296
+ const urlPath = "/v2/channel-apps/hash";
11297
+ const queryParams = new Map<string, any>();
11298
+ queryParams.set("app_id", appId);
11299
+
11300
+ let bodyJson : string = "";
11301
+
11302
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
11303
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
11304
+ if (bearerToken) {
11305
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
11306
+ }
11307
+
11308
+ return Promise.race([
11309
+ fetch(fullUrl, fetchOptions).then((response) => {
11310
+ if (response.status == 204) {
11311
+ return response;
11312
+ } else if (response.status >= 200 && response.status < 300) {
11313
+ return response.json();
11314
+ } else {
11315
+ throw response;
11316
+ }
11317
+ }),
11318
+ new Promise((_, reject) =>
11319
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
11320
+ ),
11321
+ ]);
11322
+ }
11282
11323
  }
package/client.ts CHANGED
@@ -164,6 +164,7 @@ import {
164
164
  ApiHandleParticipantMeetStateRequest,
165
165
  ApiMezonOauthClientList,
166
166
  ApiMezonOauthClient,
167
+ ApiCreateHashChannelAppsResponse,
167
168
  } from "./api.gen";
168
169
 
169
170
  import { Session } from "./session";
@@ -5012,4 +5013,24 @@ export class Client {
5012
5013
  return Promise.resolve(response);
5013
5014
  });
5014
5015
  }
5016
+
5017
+ //**Generate Hash */
5018
+ async generateHashChannelApps(
5019
+ session: Session,
5020
+ appId?:string,
5021
+ ): Promise<ApiCreateHashChannelAppsResponse> {
5022
+ if (
5023
+ this.autoRefreshSession &&
5024
+ session.refresh_token &&
5025
+ session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
5026
+ ) {
5027
+ await this.sessionRefresh(session);
5028
+ }
5029
+
5030
+ return this.apiClient
5031
+ .generateHashChannelApps(session.token, appId)
5032
+ .then((response: ApiCreateHashChannelAppsResponse) => {
5033
+ return Promise.resolve(response);
5034
+ });
5035
+ }
5015
5036
  }
package/dist/api.gen.d.ts CHANGED
@@ -1760,6 +1760,11 @@ export interface ApiMezonOauthClient {
1760
1760
  updated_at?: string;
1761
1761
  userinfo_signed_response_alg?: string;
1762
1762
  }
1763
+ /** */
1764
+ export interface ApiCreateHashChannelAppsResponse {
1765
+ hash?: string;
1766
+ user_id?: string;
1767
+ }
1763
1768
  export declare class MezonApi {
1764
1769
  readonly serverKey: string;
1765
1770
  readonly basePath: string;
@@ -2174,4 +2179,6 @@ export declare class MezonApi {
2174
2179
  getMezonOauthClient(bearerToken: string, clientId?: string, options?: any): Promise<ApiMezonOauthClient>;
2175
2180
  /** update mezon OAuth */
2176
2181
  updateMezonOauthClient(bearerToken: string, body: ApiMezonOauthClient, options?: any): Promise<ApiMezonOauthClient>;
2182
+ /** */
2183
+ generateHashChannelApps(bearerToken: string, appId?: string, options?: any): Promise<ApiCreateHashChannelAppsResponse>;
2177
2184
  }
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, ApiMezonOauthClientList, ApiMezonOauthClient } 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, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -648,4 +648,5 @@ export declare class Client {
648
648
  getMezonOauthClient(session: Session, clientId?: string): Promise<ApiMezonOauthClient>;
649
649
  updateMezonOauthClient(session: Session, body: ApiMezonOauthClient): Promise<ApiMezonOauthClient>;
650
650
  searchThread(session: Session, clanId?: string, channelId?: string, label?: string): Promise<ApiChannelDescList>;
651
+ generateHashChannelApps(session: Session, appId?: string): Promise<ApiCreateHashChannelAppsResponse>;
651
652
  }
@@ -7146,6 +7146,32 @@ var MezonApi = class {
7146
7146
  )
7147
7147
  ]);
7148
7148
  }
7149
+ /** */
7150
+ generateHashChannelApps(bearerToken, appId, options = {}) {
7151
+ const urlPath = "/v2/channel-apps/hash";
7152
+ const queryParams = /* @__PURE__ */ new Map();
7153
+ queryParams.set("app_id", appId);
7154
+ let bodyJson = "";
7155
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7156
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
7157
+ if (bearerToken) {
7158
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7159
+ }
7160
+ return Promise.race([
7161
+ fetch(fullUrl, fetchOptions).then((response) => {
7162
+ if (response.status == 204) {
7163
+ return response;
7164
+ } else if (response.status >= 200 && response.status < 300) {
7165
+ return response.json();
7166
+ } else {
7167
+ throw response;
7168
+ }
7169
+ }),
7170
+ new Promise(
7171
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
7172
+ )
7173
+ ]);
7174
+ }
7149
7175
  };
7150
7176
 
7151
7177
  // session.ts
@@ -10932,4 +10958,15 @@ var Client = class {
10932
10958
  });
10933
10959
  });
10934
10960
  }
10961
+ //**Generate Hash */
10962
+ generateHashChannelApps(session, appId) {
10963
+ return __async(this, null, function* () {
10964
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10965
+ yield this.sessionRefresh(session);
10966
+ }
10967
+ return this.apiClient.generateHashChannelApps(session.token, appId).then((response) => {
10968
+ return Promise.resolve(response);
10969
+ });
10970
+ });
10971
+ }
10935
10972
  };
@@ -7112,6 +7112,32 @@ var MezonApi = class {
7112
7112
  )
7113
7113
  ]);
7114
7114
  }
7115
+ /** */
7116
+ generateHashChannelApps(bearerToken, appId, options = {}) {
7117
+ const urlPath = "/v2/channel-apps/hash";
7118
+ const queryParams = /* @__PURE__ */ new Map();
7119
+ queryParams.set("app_id", appId);
7120
+ let bodyJson = "";
7121
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7122
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
7123
+ if (bearerToken) {
7124
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7125
+ }
7126
+ return Promise.race([
7127
+ fetch(fullUrl, fetchOptions).then((response) => {
7128
+ if (response.status == 204) {
7129
+ return response;
7130
+ } else if (response.status >= 200 && response.status < 300) {
7131
+ return response.json();
7132
+ } else {
7133
+ throw response;
7134
+ }
7135
+ }),
7136
+ new Promise(
7137
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
7138
+ )
7139
+ ]);
7140
+ }
7115
7141
  };
7116
7142
 
7117
7143
  // session.ts
@@ -10898,6 +10924,17 @@ var Client = class {
10898
10924
  });
10899
10925
  });
10900
10926
  }
10927
+ //**Generate Hash */
10928
+ generateHashChannelApps(session, appId) {
10929
+ return __async(this, null, function* () {
10930
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10931
+ yield this.sessionRefresh(session);
10932
+ }
10933
+ return this.apiClient.generateHashChannelApps(session.token, appId).then((response) => {
10934
+ return Promise.resolve(response);
10935
+ });
10936
+ });
10937
+ }
10901
10938
  };
10902
10939
  export {
10903
10940
  ChannelStreamMode,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.10.95",
4
+ "version": "2.10.96",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"