mezon-js 2.10.82 → 2.10.84
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +79 -25
- package/client.ts +37 -16
- package/dist/api.gen.d.ts +18 -7
- package/dist/client.d.ts +5 -2
- package/dist/mezon-js.cjs.js +58 -16
- package/dist/mezon-js.esm.mjs +58 -16
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -2827,27 +2827,41 @@ export interface ApiOnboardingSteps {
|
|
2827
2827
|
}
|
2828
2828
|
|
2829
2829
|
/** */
|
2830
|
-
export interface
|
2830
|
+
export interface MezonapiCreateRoomChannelApps {
|
2831
2831
|
//
|
2832
2832
|
channel_id?: string;
|
2833
2833
|
//
|
2834
2834
|
room_name?: string;
|
2835
|
-
//
|
2836
|
-
token?: string;
|
2837
|
-
//
|
2838
|
-
user_id?: string;
|
2839
|
-
//
|
2840
|
-
user_name?: string;
|
2841
2835
|
}
|
2842
2836
|
|
2843
2837
|
/** */
|
2844
|
-
export interface
|
2838
|
+
export interface ApiGenerateMeetTokenRequest {
|
2845
2839
|
//
|
2846
2840
|
channel_id?: string;
|
2847
2841
|
//
|
2848
2842
|
room_name?: string;
|
2849
2843
|
}
|
2850
2844
|
|
2845
|
+
/** */
|
2846
|
+
export interface ApiGenerateMeetTokenResponse {
|
2847
|
+
//
|
2848
|
+
token?: string;
|
2849
|
+
}
|
2850
|
+
|
2851
|
+
/** */
|
2852
|
+
export interface ApiHandleParticipantMeetStateRequest {
|
2853
|
+
// clan id
|
2854
|
+
clan_id?: string;
|
2855
|
+
// channel id
|
2856
|
+
channel_id?: string;
|
2857
|
+
// user id
|
2858
|
+
user_id?: string;
|
2859
|
+
// display name
|
2860
|
+
display_name?: string;
|
2861
|
+
// state (0: join, 1: leave)
|
2862
|
+
state?: number;
|
2863
|
+
}
|
2864
|
+
|
2851
2865
|
export class MezonApi {
|
2852
2866
|
constructor(
|
2853
2867
|
readonly serverKey: string,
|
@@ -8295,7 +8309,7 @@ export class MezonApi {
|
|
8295
8309
|
"'body' is a required parameter but is null or undefined."
|
8296
8310
|
);
|
8297
8311
|
}
|
8298
|
-
const urlPath = "/v2/
|
8312
|
+
const urlPath = "/v2/channel/category/{newCategoryId}".replace(
|
8299
8313
|
"{newCategoryId}",
|
8300
8314
|
encodeURIComponent(String(newCategoryId))
|
8301
8315
|
);
|
@@ -10823,22 +10837,22 @@ export class MezonApi {
|
|
10823
10837
|
]);
|
10824
10838
|
}
|
10825
10839
|
|
10826
|
-
/**
|
10827
|
-
|
10828
|
-
|
10829
|
-
|
10830
|
-
|
10831
|
-
|
10832
|
-
|
10833
|
-
|
10840
|
+
/** create meeting room */
|
10841
|
+
createRoomChannelApps(bearerToken: string,
|
10842
|
+
body:MezonapiCreateRoomChannelApps,
|
10843
|
+
options: any = {}): Promise<MezonapiCreateRoomChannelApps> {
|
10844
|
+
|
10845
|
+
if (body === null || body === undefined) {
|
10846
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
10847
|
+
}
|
10848
|
+
const urlPath = "/v2/channel-apps/createroom";
|
10834
10849
|
const queryParams = new Map<string, any>();
|
10835
|
-
queryParams.set("channel_id", channelId);
|
10836
|
-
queryParams.set("room_name", roomName);
|
10837
10850
|
|
10838
10851
|
let bodyJson : string = "";
|
10852
|
+
bodyJson = JSON.stringify(body || {});
|
10839
10853
|
|
10840
10854
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
10841
|
-
const fetchOptions = buildFetchOptions("
|
10855
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
10842
10856
|
if (bearerToken) {
|
10843
10857
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
10844
10858
|
}
|
@@ -10859,15 +10873,55 @@ export class MezonApi {
|
|
10859
10873
|
]);
|
10860
10874
|
}
|
10861
10875
|
|
10862
|
-
/**
|
10863
|
-
|
10864
|
-
|
10865
|
-
|
10876
|
+
/** Generate Meet Token */
|
10877
|
+
generateMeetToken(
|
10878
|
+
bearerToken: string,
|
10879
|
+
body:ApiGenerateMeetTokenRequest,
|
10880
|
+
options: any = {}
|
10881
|
+
): Promise<ApiGenerateMeetTokenResponse> {
|
10882
|
+
|
10883
|
+
if (body === null || body === undefined) {
|
10884
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
10885
|
+
}
|
10886
|
+
const urlPath = "/v2/meet/generate";
|
10887
|
+
const queryParams = new Map<string, any>();
|
10888
|
+
|
10889
|
+
let bodyJson : string = "";
|
10890
|
+
bodyJson = JSON.stringify(body || {});
|
10891
|
+
|
10892
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
10893
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
10894
|
+
if (bearerToken) {
|
10895
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
10896
|
+
}
|
10897
|
+
|
10898
|
+
return Promise.race([
|
10899
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
10900
|
+
if (response.status == 204) {
|
10901
|
+
return response;
|
10902
|
+
} else if (response.status >= 200 && response.status < 300) {
|
10903
|
+
return response.json();
|
10904
|
+
} else {
|
10905
|
+
throw response;
|
10906
|
+
}
|
10907
|
+
}),
|
10908
|
+
new Promise((_, reject) =>
|
10909
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
10910
|
+
),
|
10911
|
+
]);
|
10912
|
+
}
|
10913
|
+
|
10914
|
+
/** Handle participant meet state */
|
10915
|
+
handleParticipantMeetState(
|
10916
|
+
bearerToken: string,
|
10917
|
+
body:ApiHandleParticipantMeetStateRequest,
|
10918
|
+
options: any = {}
|
10919
|
+
): Promise<any> {
|
10866
10920
|
|
10867
10921
|
if (body === null || body === undefined) {
|
10868
10922
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
10869
10923
|
}
|
10870
|
-
const urlPath = "/v2/
|
10924
|
+
const urlPath = "/v2/meet/handle_participant_state";
|
10871
10925
|
const queryParams = new Map<string, any>();
|
10872
10926
|
|
10873
10927
|
let bodyJson : string = "";
|
package/client.ts
CHANGED
@@ -158,8 +158,10 @@ import {
|
|
158
158
|
ApiSdTopic,
|
159
159
|
MezonUpdateEventBody,
|
160
160
|
ApiTransactionDetail,
|
161
|
-
ApiGetJoinMezonMeetResponse,
|
162
161
|
MezonapiCreateRoomChannelApps,
|
162
|
+
ApiGenerateMeetTokenRequest,
|
163
|
+
ApiGenerateMeetTokenResponse,
|
164
|
+
ApiHandleParticipantMeetStateRequest,
|
163
165
|
} from "./api.gen";
|
164
166
|
|
165
167
|
import { Session } from "./session";
|
@@ -4870,12 +4872,11 @@ export class Client {
|
|
4870
4872
|
});
|
4871
4873
|
}
|
4872
4874
|
|
4873
|
-
//**
|
4874
|
-
async
|
4875
|
+
//**create room channel apps */
|
4876
|
+
async createRoomChannelApps(
|
4875
4877
|
session: Session,
|
4876
|
-
|
4877
|
-
|
4878
|
-
): Promise<ApiGetJoinMezonMeetResponse> {
|
4878
|
+
body: MezonapiCreateRoomChannelApps
|
4879
|
+
): Promise<MezonapiCreateRoomChannelApps> {
|
4879
4880
|
if (
|
4880
4881
|
this.autoRefreshSession &&
|
4881
4882
|
session.refresh_token &&
|
@@ -4885,17 +4886,37 @@ export class Client {
|
|
4885
4886
|
}
|
4886
4887
|
|
4887
4888
|
return this.apiClient
|
4888
|
-
.
|
4889
|
-
.then((response:
|
4889
|
+
.createRoomChannelApps(session.token, body)
|
4890
|
+
.then((response: MezonapiCreateRoomChannelApps) => {
|
4890
4891
|
return Promise.resolve(response);
|
4891
|
-
|
4892
|
+
});
|
4893
|
+
}
|
4894
|
+
|
4895
|
+
/** Generate Meet Token */
|
4896
|
+
async generateMeetToken(
|
4897
|
+
session: Session,
|
4898
|
+
body: ApiGenerateMeetTokenRequest
|
4899
|
+
): Promise<ApiGenerateMeetTokenResponse> {
|
4900
|
+
if (
|
4901
|
+
this.autoRefreshSession &&
|
4902
|
+
session.refresh_token &&
|
4903
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
4904
|
+
) {
|
4905
|
+
await this.sessionRefresh(session);
|
4892
4906
|
}
|
4893
4907
|
|
4894
|
-
|
4895
|
-
|
4908
|
+
return this.apiClient
|
4909
|
+
.generateMeetToken(session.token, body)
|
4910
|
+
.then((response: ApiGenerateMeetTokenResponse) => {
|
4911
|
+
return Promise.resolve(response);
|
4912
|
+
});
|
4913
|
+
}
|
4914
|
+
|
4915
|
+
/** Handle participant meet state */
|
4916
|
+
async handleParticipantMeetState(
|
4896
4917
|
session: Session,
|
4897
|
-
body:
|
4898
|
-
): Promise<
|
4918
|
+
body:ApiHandleParticipantMeetStateRequest,
|
4919
|
+
): Promise<any> {
|
4899
4920
|
if (
|
4900
4921
|
this.autoRefreshSession &&
|
4901
4922
|
session.refresh_token &&
|
@@ -4905,9 +4926,9 @@ export class Client {
|
|
4905
4926
|
}
|
4906
4927
|
|
4907
4928
|
return this.apiClient
|
4908
|
-
.
|
4909
|
-
.then((response:
|
4929
|
+
.handleParticipantMeetState(session.token, body)
|
4930
|
+
.then((response: any) => {
|
4910
4931
|
return Promise.resolve(response);
|
4911
4932
|
});
|
4912
|
-
|
4933
|
+
}
|
4913
4934
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -1636,18 +1636,27 @@ export interface ApiOnboardingSteps {
|
|
1636
1636
|
user_id?: string;
|
1637
1637
|
}
|
1638
1638
|
/** */
|
1639
|
-
export interface
|
1639
|
+
export interface MezonapiCreateRoomChannelApps {
|
1640
1640
|
channel_id?: string;
|
1641
1641
|
room_name?: string;
|
1642
|
-
token?: string;
|
1643
|
-
user_id?: string;
|
1644
|
-
user_name?: string;
|
1645
1642
|
}
|
1646
1643
|
/** */
|
1647
|
-
export interface
|
1644
|
+
export interface ApiGenerateMeetTokenRequest {
|
1648
1645
|
channel_id?: string;
|
1649
1646
|
room_name?: string;
|
1650
1647
|
}
|
1648
|
+
/** */
|
1649
|
+
export interface ApiGenerateMeetTokenResponse {
|
1650
|
+
token?: string;
|
1651
|
+
}
|
1652
|
+
/** */
|
1653
|
+
export interface ApiHandleParticipantMeetStateRequest {
|
1654
|
+
clan_id?: string;
|
1655
|
+
channel_id?: string;
|
1656
|
+
user_id?: string;
|
1657
|
+
display_name?: string;
|
1658
|
+
state?: number;
|
1659
|
+
}
|
1651
1660
|
export declare class MezonApi {
|
1652
1661
|
readonly serverKey: string;
|
1653
1662
|
readonly basePath: string;
|
@@ -2048,8 +2057,10 @@ export declare class MezonApi {
|
|
2048
2057
|
listOnboardingStep(bearerToken: string, clanId?: string, limit?: number, page?: number, options?: any): Promise<ApiListOnboardingStepResponse>;
|
2049
2058
|
/** Update onboarding step. */
|
2050
2059
|
updateOnboardingStepByClanId(bearerToken: string, clanId: string, body: MezonUpdateOnboardingStepByClanIdBody, options?: any): Promise<any>;
|
2051
|
-
/** GetJoinMezonMeet */
|
2052
|
-
getJoinMezonMeet(bearerToken: string, channelId?: string, roomName?: string, options?: any): Promise<ApiGetJoinMezonMeetResponse>;
|
2053
2060
|
/** create meeting room */
|
2054
2061
|
createRoomChannelApps(bearerToken: string, body: MezonapiCreateRoomChannelApps, options?: any): Promise<MezonapiCreateRoomChannelApps>;
|
2062
|
+
/** Generate Meet Token */
|
2063
|
+
generateMeetToken(bearerToken: string, body: ApiGenerateMeetTokenRequest, options?: any): Promise<ApiGenerateMeetTokenResponse>;
|
2064
|
+
/** Handle participant meet state */
|
2065
|
+
handleParticipantMeetState(bearerToken: string, body: ApiHandleParticipantMeetStateRequest, options?: any): Promise<any>;
|
2055
2066
|
}
|
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, 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,
|
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, 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";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -639,6 +639,9 @@ export declare class Client {
|
|
639
639
|
listSdTopic(session: Session, clanId?: string, limit?: number): Promise<ApiSdTopicList>;
|
640
640
|
createSdTopic(session: Session, request: ApiSdTopicRequest): Promise<ApiSdTopic>;
|
641
641
|
getTopicDetail(session: Session, topicId?: string): Promise<ApiSdTopic>;
|
642
|
-
getJoinMezonMeet(session: Session, channelId?: string, roomName?: string): Promise<ApiGetJoinMezonMeetResponse>;
|
643
642
|
createRoomChannelApps(session: Session, body: MezonapiCreateRoomChannelApps): Promise<MezonapiCreateRoomChannelApps>;
|
643
|
+
/** Generate Meet Token */
|
644
|
+
generateMeetToken(session: Session, body: ApiGenerateMeetTokenRequest): Promise<ApiGenerateMeetTokenResponse>;
|
645
|
+
/** Handle participant meet state */
|
646
|
+
handleParticipantMeetState(session: Session, body: ApiHandleParticipantMeetStateRequest): Promise<any>;
|
644
647
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -4978,7 +4978,7 @@ var MezonApi = class {
|
|
4978
4978
|
"'body' is a required parameter but is null or undefined."
|
4979
4979
|
);
|
4980
4980
|
}
|
4981
|
-
const urlPath = "/v2/
|
4981
|
+
const urlPath = "/v2/channel/category/{newCategoryId}".replace(
|
4982
4982
|
"{newCategoryId}",
|
4983
4983
|
encodeURIComponent(String(newCategoryId))
|
4984
4984
|
);
|
@@ -6957,15 +6957,17 @@ var MezonApi = class {
|
|
6957
6957
|
)
|
6958
6958
|
]);
|
6959
6959
|
}
|
6960
|
-
/**
|
6961
|
-
|
6962
|
-
|
6960
|
+
/** create meeting room */
|
6961
|
+
createRoomChannelApps(bearerToken, body, options = {}) {
|
6962
|
+
if (body === null || body === void 0) {
|
6963
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6964
|
+
}
|
6965
|
+
const urlPath = "/v2/channel-apps/createroom";
|
6963
6966
|
const queryParams = /* @__PURE__ */ new Map();
|
6964
|
-
queryParams.set("channel_id", channelId);
|
6965
|
-
queryParams.set("room_name", roomName);
|
6966
6967
|
let bodyJson = "";
|
6968
|
+
bodyJson = JSON.stringify(body || {});
|
6967
6969
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6968
|
-
const fetchOptions = buildFetchOptions("
|
6970
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6969
6971
|
if (bearerToken) {
|
6970
6972
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6971
6973
|
}
|
@@ -6984,12 +6986,41 @@ var MezonApi = class {
|
|
6984
6986
|
)
|
6985
6987
|
]);
|
6986
6988
|
}
|
6987
|
-
/**
|
6988
|
-
|
6989
|
+
/** Generate Meet Token */
|
6990
|
+
generateMeetToken(bearerToken, body, options = {}) {
|
6989
6991
|
if (body === null || body === void 0) {
|
6990
6992
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
6991
6993
|
}
|
6992
|
-
const urlPath = "/v2/
|
6994
|
+
const urlPath = "/v2/meet/generate";
|
6995
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6996
|
+
let bodyJson = "";
|
6997
|
+
bodyJson = JSON.stringify(body || {});
|
6998
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6999
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
7000
|
+
if (bearerToken) {
|
7001
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
7002
|
+
}
|
7003
|
+
return Promise.race([
|
7004
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
7005
|
+
if (response.status == 204) {
|
7006
|
+
return response;
|
7007
|
+
} else if (response.status >= 200 && response.status < 300) {
|
7008
|
+
return response.json();
|
7009
|
+
} else {
|
7010
|
+
throw response;
|
7011
|
+
}
|
7012
|
+
}),
|
7013
|
+
new Promise(
|
7014
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
7015
|
+
)
|
7016
|
+
]);
|
7017
|
+
}
|
7018
|
+
/** Handle participant meet state */
|
7019
|
+
handleParticipantMeetState(bearerToken, body, options = {}) {
|
7020
|
+
if (body === null || body === void 0) {
|
7021
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
7022
|
+
}
|
7023
|
+
const urlPath = "/v2/meet/handle_participant_state";
|
6993
7024
|
const queryParams = /* @__PURE__ */ new Map();
|
6994
7025
|
let bodyJson = "";
|
6995
7026
|
bodyJson = JSON.stringify(body || {});
|
@@ -10717,24 +10748,35 @@ var Client = class {
|
|
10717
10748
|
});
|
10718
10749
|
});
|
10719
10750
|
}
|
10720
|
-
//**
|
10721
|
-
|
10751
|
+
//**create room channel apps */
|
10752
|
+
createRoomChannelApps(session, body) {
|
10753
|
+
return __async(this, null, function* () {
|
10754
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10755
|
+
yield this.sessionRefresh(session);
|
10756
|
+
}
|
10757
|
+
return this.apiClient.createRoomChannelApps(session.token, body).then((response) => {
|
10758
|
+
return Promise.resolve(response);
|
10759
|
+
});
|
10760
|
+
});
|
10761
|
+
}
|
10762
|
+
/** Generate Meet Token */
|
10763
|
+
generateMeetToken(session, body) {
|
10722
10764
|
return __async(this, null, function* () {
|
10723
10765
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10724
10766
|
yield this.sessionRefresh(session);
|
10725
10767
|
}
|
10726
|
-
return this.apiClient.
|
10768
|
+
return this.apiClient.generateMeetToken(session.token, body).then((response) => {
|
10727
10769
|
return Promise.resolve(response);
|
10728
10770
|
});
|
10729
10771
|
});
|
10730
10772
|
}
|
10731
|
-
|
10732
|
-
|
10773
|
+
/** Handle participant meet state */
|
10774
|
+
handleParticipantMeetState(session, body) {
|
10733
10775
|
return __async(this, null, function* () {
|
10734
10776
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10735
10777
|
yield this.sessionRefresh(session);
|
10736
10778
|
}
|
10737
|
-
return this.apiClient.
|
10779
|
+
return this.apiClient.handleParticipantMeetState(session.token, body).then((response) => {
|
10738
10780
|
return Promise.resolve(response);
|
10739
10781
|
});
|
10740
10782
|
});
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -4944,7 +4944,7 @@ var MezonApi = class {
|
|
4944
4944
|
"'body' is a required parameter but is null or undefined."
|
4945
4945
|
);
|
4946
4946
|
}
|
4947
|
-
const urlPath = "/v2/
|
4947
|
+
const urlPath = "/v2/channel/category/{newCategoryId}".replace(
|
4948
4948
|
"{newCategoryId}",
|
4949
4949
|
encodeURIComponent(String(newCategoryId))
|
4950
4950
|
);
|
@@ -6923,15 +6923,17 @@ var MezonApi = class {
|
|
6923
6923
|
)
|
6924
6924
|
]);
|
6925
6925
|
}
|
6926
|
-
/**
|
6927
|
-
|
6928
|
-
|
6926
|
+
/** create meeting room */
|
6927
|
+
createRoomChannelApps(bearerToken, body, options = {}) {
|
6928
|
+
if (body === null || body === void 0) {
|
6929
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6930
|
+
}
|
6931
|
+
const urlPath = "/v2/channel-apps/createroom";
|
6929
6932
|
const queryParams = /* @__PURE__ */ new Map();
|
6930
|
-
queryParams.set("channel_id", channelId);
|
6931
|
-
queryParams.set("room_name", roomName);
|
6932
6933
|
let bodyJson = "";
|
6934
|
+
bodyJson = JSON.stringify(body || {});
|
6933
6935
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6934
|
-
const fetchOptions = buildFetchOptions("
|
6936
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6935
6937
|
if (bearerToken) {
|
6936
6938
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6937
6939
|
}
|
@@ -6950,12 +6952,41 @@ var MezonApi = class {
|
|
6950
6952
|
)
|
6951
6953
|
]);
|
6952
6954
|
}
|
6953
|
-
/**
|
6954
|
-
|
6955
|
+
/** Generate Meet Token */
|
6956
|
+
generateMeetToken(bearerToken, body, options = {}) {
|
6955
6957
|
if (body === null || body === void 0) {
|
6956
6958
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
6957
6959
|
}
|
6958
|
-
const urlPath = "/v2/
|
6960
|
+
const urlPath = "/v2/meet/generate";
|
6961
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6962
|
+
let bodyJson = "";
|
6963
|
+
bodyJson = JSON.stringify(body || {});
|
6964
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6965
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6966
|
+
if (bearerToken) {
|
6967
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6968
|
+
}
|
6969
|
+
return Promise.race([
|
6970
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6971
|
+
if (response.status == 204) {
|
6972
|
+
return response;
|
6973
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6974
|
+
return response.json();
|
6975
|
+
} else {
|
6976
|
+
throw response;
|
6977
|
+
}
|
6978
|
+
}),
|
6979
|
+
new Promise(
|
6980
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6981
|
+
)
|
6982
|
+
]);
|
6983
|
+
}
|
6984
|
+
/** Handle participant meet state */
|
6985
|
+
handleParticipantMeetState(bearerToken, body, options = {}) {
|
6986
|
+
if (body === null || body === void 0) {
|
6987
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6988
|
+
}
|
6989
|
+
const urlPath = "/v2/meet/handle_participant_state";
|
6959
6990
|
const queryParams = /* @__PURE__ */ new Map();
|
6960
6991
|
let bodyJson = "";
|
6961
6992
|
bodyJson = JSON.stringify(body || {});
|
@@ -10683,24 +10714,35 @@ var Client = class {
|
|
10683
10714
|
});
|
10684
10715
|
});
|
10685
10716
|
}
|
10686
|
-
//**
|
10687
|
-
|
10717
|
+
//**create room channel apps */
|
10718
|
+
createRoomChannelApps(session, body) {
|
10719
|
+
return __async(this, null, function* () {
|
10720
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10721
|
+
yield this.sessionRefresh(session);
|
10722
|
+
}
|
10723
|
+
return this.apiClient.createRoomChannelApps(session.token, body).then((response) => {
|
10724
|
+
return Promise.resolve(response);
|
10725
|
+
});
|
10726
|
+
});
|
10727
|
+
}
|
10728
|
+
/** Generate Meet Token */
|
10729
|
+
generateMeetToken(session, body) {
|
10688
10730
|
return __async(this, null, function* () {
|
10689
10731
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10690
10732
|
yield this.sessionRefresh(session);
|
10691
10733
|
}
|
10692
|
-
return this.apiClient.
|
10734
|
+
return this.apiClient.generateMeetToken(session.token, body).then((response) => {
|
10693
10735
|
return Promise.resolve(response);
|
10694
10736
|
});
|
10695
10737
|
});
|
10696
10738
|
}
|
10697
|
-
|
10698
|
-
|
10739
|
+
/** Handle participant meet state */
|
10740
|
+
handleParticipantMeetState(session, body) {
|
10699
10741
|
return __async(this, null, function* () {
|
10700
10742
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10701
10743
|
yield this.sessionRefresh(session);
|
10702
10744
|
}
|
10703
|
-
return this.apiClient.
|
10745
|
+
return this.apiClient.handleParticipantMeetState(session.token, body).then((response) => {
|
10704
10746
|
return Promise.resolve(response);
|
10705
10747
|
});
|
10706
10748
|
});
|