mezon-js 2.10.69 → 2.10.70
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 +0 -62
- package/client.ts +0 -56
- package/dist/api.gen.d.ts +0 -13
- package/dist/client.d.ts +1 -8
- package/dist/mezon-js.cjs.js +0 -71
- package/dist/mezon-js.esm.mjs +0 -71
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -1783,24 +1783,6 @@ export interface ApiStreamHttpCallbackResponse {
|
|
|
1783
1783
|
msg?: string;
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
-
/** A list of users belonging to a channel, along with their role. */
|
|
1787
|
-
export interface ApiSFUChannelUser {
|
|
1788
|
-
//
|
|
1789
|
-
channel_id?: string;
|
|
1790
|
-
//
|
|
1791
|
-
id?: string;
|
|
1792
|
-
//
|
|
1793
|
-
participant?: string;
|
|
1794
|
-
//user for a channel.
|
|
1795
|
-
user_id?: string;
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
/** A list of users belonging to a channel, along with their role. */
|
|
1799
|
-
export interface ApiSFUChannelUserList {
|
|
1800
|
-
//
|
|
1801
|
-
sfu_channel_users?: Array<ApiSFUChannelUser>;
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
1786
|
/** */
|
|
1805
1787
|
export interface ApiPermission {
|
|
1806
1788
|
//
|
|
@@ -8136,50 +8118,6 @@ export class MezonApi {
|
|
|
8136
8118
|
]);
|
|
8137
8119
|
}
|
|
8138
8120
|
|
|
8139
|
-
/** List all users in SFU channel. */
|
|
8140
|
-
listSFUChannelUsers(
|
|
8141
|
-
bearerToken: string,
|
|
8142
|
-
clanId?: string,
|
|
8143
|
-
channelId?: string,
|
|
8144
|
-
channelType?: number,
|
|
8145
|
-
limit?: number,
|
|
8146
|
-
state?: number,
|
|
8147
|
-
cursor?: string,
|
|
8148
|
-
options: any = {}
|
|
8149
|
-
): Promise<ApiSFUChannelUserList> {
|
|
8150
|
-
const urlPath = "/v2/sfu_channels/users";
|
|
8151
|
-
const queryParams = new Map<string, any>();
|
|
8152
|
-
queryParams.set("clan_id", clanId);
|
|
8153
|
-
queryParams.set("channel_id", channelId);
|
|
8154
|
-
queryParams.set("channel_type", channelType);
|
|
8155
|
-
queryParams.set("limit", limit);
|
|
8156
|
-
queryParams.set("state", state);
|
|
8157
|
-
queryParams.set("cursor", cursor);
|
|
8158
|
-
|
|
8159
|
-
let bodyJson: string = "";
|
|
8160
|
-
|
|
8161
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
8162
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
8163
|
-
if (bearerToken) {
|
|
8164
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
8165
|
-
}
|
|
8166
|
-
|
|
8167
|
-
return Promise.race([
|
|
8168
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
8169
|
-
if (response.status == 204) {
|
|
8170
|
-
return response;
|
|
8171
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
8172
|
-
return response.json();
|
|
8173
|
-
} else {
|
|
8174
|
-
throw response;
|
|
8175
|
-
}
|
|
8176
|
-
}),
|
|
8177
|
-
new Promise((_, reject) =>
|
|
8178
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
8179
|
-
),
|
|
8180
|
-
]);
|
|
8181
|
-
}
|
|
8182
|
-
|
|
8183
8121
|
/** get pubkey */
|
|
8184
8122
|
getPubKeys(
|
|
8185
8123
|
bearerToken: string,
|
package/client.ts
CHANGED
|
@@ -156,7 +156,6 @@ import {
|
|
|
156
156
|
ApiSdTopicList,
|
|
157
157
|
ApiSdTopicRequest,
|
|
158
158
|
ApiSdTopic,
|
|
159
|
-
ApiSFUChannelUserList,
|
|
160
159
|
MezonUpdateEventBody,
|
|
161
160
|
} from "./api.gen";
|
|
162
161
|
|
|
@@ -204,12 +203,6 @@ export enum WebrtcSignalingType {
|
|
|
204
203
|
WEBRTC_SDP_QUIT = 4,
|
|
205
204
|
}
|
|
206
205
|
|
|
207
|
-
export enum SFUSignalingType {
|
|
208
|
-
JOINE = 0,
|
|
209
|
-
LEAVE = 1,
|
|
210
|
-
TALK = 2,
|
|
211
|
-
}
|
|
212
|
-
|
|
213
206
|
/** Response for an RPC function executed on the server. */
|
|
214
207
|
export interface RpcResponse {
|
|
215
208
|
/** The identifier of the function. */
|
|
@@ -4769,55 +4762,6 @@ export class Client {
|
|
|
4769
4762
|
});
|
|
4770
4763
|
}
|
|
4771
4764
|
|
|
4772
|
-
/** List a ptt channel's users. */
|
|
4773
|
-
async listSFUChannelUsers(
|
|
4774
|
-
session: Session,
|
|
4775
|
-
clanId: string,
|
|
4776
|
-
channelId: string,
|
|
4777
|
-
channelType: number,
|
|
4778
|
-
state?: number,
|
|
4779
|
-
limit?: number,
|
|
4780
|
-
cursor?: string
|
|
4781
|
-
): Promise<ApiSFUChannelUserList> {
|
|
4782
|
-
if (
|
|
4783
|
-
this.autoRefreshSession &&
|
|
4784
|
-
session.refresh_token &&
|
|
4785
|
-
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4786
|
-
) {
|
|
4787
|
-
await this.sessionRefresh(session);
|
|
4788
|
-
}
|
|
4789
|
-
|
|
4790
|
-
return this.apiClient
|
|
4791
|
-
.listSFUChannelUsers(
|
|
4792
|
-
session.token,
|
|
4793
|
-
clanId,
|
|
4794
|
-
channelId,
|
|
4795
|
-
channelType,
|
|
4796
|
-
limit,
|
|
4797
|
-
state,
|
|
4798
|
-
cursor
|
|
4799
|
-
)
|
|
4800
|
-
.then((response: ApiSFUChannelUserList) => {
|
|
4801
|
-
var result: ApiSFUChannelUserList = {
|
|
4802
|
-
sfu_channel_users: [],
|
|
4803
|
-
};
|
|
4804
|
-
|
|
4805
|
-
if (response.sfu_channel_users == null) {
|
|
4806
|
-
return Promise.resolve(result);
|
|
4807
|
-
}
|
|
4808
|
-
|
|
4809
|
-
response.sfu_channel_users!.forEach((gu) => {
|
|
4810
|
-
result.sfu_channel_users!.push({
|
|
4811
|
-
id: gu.id,
|
|
4812
|
-
channel_id: gu.channel_id,
|
|
4813
|
-
user_id: gu.user_id,
|
|
4814
|
-
participant: gu.participant,
|
|
4815
|
-
});
|
|
4816
|
-
});
|
|
4817
|
-
return Promise.resolve(result);
|
|
4818
|
-
});
|
|
4819
|
-
}
|
|
4820
|
-
|
|
4821
4765
|
//**list wallet ledger */
|
|
4822
4766
|
async listWalletLedger(
|
|
4823
4767
|
session: Session,
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -1030,17 +1030,6 @@ export interface ApiStreamHttpCallbackResponse {
|
|
|
1030
1030
|
code?: number;
|
|
1031
1031
|
msg?: string;
|
|
1032
1032
|
}
|
|
1033
|
-
/** A list of users belonging to a channel, along with their role. */
|
|
1034
|
-
export interface ApiSFUChannelUser {
|
|
1035
|
-
channel_id?: string;
|
|
1036
|
-
id?: string;
|
|
1037
|
-
participant?: string;
|
|
1038
|
-
user_id?: string;
|
|
1039
|
-
}
|
|
1040
|
-
/** A list of users belonging to a channel, along with their role. */
|
|
1041
|
-
export interface ApiSFUChannelUserList {
|
|
1042
|
-
sfu_channel_users?: Array<ApiSFUChannelUser>;
|
|
1043
|
-
}
|
|
1044
1033
|
/** */
|
|
1045
1034
|
export interface ApiPermission {
|
|
1046
1035
|
active?: number;
|
|
@@ -1903,8 +1892,6 @@ export declare class MezonApi {
|
|
|
1903
1892
|
getPinMessagesList(bearerToken: string, messageId?: string, channelId?: string, clanId?: string, options?: any): Promise<ApiPinMessagesList>;
|
|
1904
1893
|
/** set notification user channel. */
|
|
1905
1894
|
createPinMessage(bearerToken: string, body: ApiPinMessageRequest, options?: any): Promise<ApiChannelMessageHeader>;
|
|
1906
|
-
/** List all users in SFU channel. */
|
|
1907
|
-
listSFUChannelUsers(bearerToken: string, clanId?: string, channelId?: string, channelType?: number, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiSFUChannelUserList>;
|
|
1908
1895
|
/** get pubkey */
|
|
1909
1896
|
getPubKeys(bearerToken: string, userIds?: Array<string>, options?: any): Promise<ApiGetPubKeysResponse>;
|
|
1910
1897
|
/** store pubkey for e2ee */
|
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,
|
|
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 } from "./api.gen";
|
|
17
17
|
import { Session } from "./session";
|
|
18
18
|
import { Socket } from "./socket";
|
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
@@ -47,11 +47,6 @@ export declare enum WebrtcSignalingType {
|
|
|
47
47
|
WEBRTC_ICE_CANDIDATE = 3,
|
|
48
48
|
WEBRTC_SDP_QUIT = 4
|
|
49
49
|
}
|
|
50
|
-
export declare enum SFUSignalingType {
|
|
51
|
-
JOINE = 0,
|
|
52
|
-
LEAVE = 1,
|
|
53
|
-
TALK = 2
|
|
54
|
-
}
|
|
55
50
|
/** Response for an RPC function executed on the server. */
|
|
56
51
|
export interface RpcResponse {
|
|
57
52
|
/** The identifier of the function. */
|
|
@@ -637,8 +632,6 @@ export declare class Client {
|
|
|
637
632
|
updateOnboardingStepByClanId(session: Session, clan_id: string, request: MezonUpdateOnboardingStepByClanIdBody): Promise<boolean>;
|
|
638
633
|
updateUserStatus(session: Session, request: ApiUserStatusUpdate): Promise<boolean>;
|
|
639
634
|
getUserStatus(session: Session): Promise<ApiUserStatus>;
|
|
640
|
-
/** List a ptt channel's users. */
|
|
641
|
-
listSFUChannelUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ApiSFUChannelUserList>;
|
|
642
635
|
listWalletLedger(session: Session, limit?: number, cursor?: string, transactionId?: string): Promise<ApiWalletLedgerList>;
|
|
643
636
|
listSdTopic(session: Session, clanId?: string, limit?: number): Promise<ApiSdTopicList>;
|
|
644
637
|
createSdTopic(session: Session, request: ApiSdTopicRequest): Promise<ApiSdTopic>;
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -59,7 +59,6 @@ __export(mezon_js_exports, {
|
|
|
59
59
|
Client: () => Client,
|
|
60
60
|
DefaultSocket: () => DefaultSocket,
|
|
61
61
|
NotificationType: () => NotificationType,
|
|
62
|
-
SFUSignalingType: () => SFUSignalingType,
|
|
63
62
|
Session: () => Session,
|
|
64
63
|
WebSocketAdapterText: () => WebSocketAdapterText,
|
|
65
64
|
WebrtcSignalingType: () => WebrtcSignalingType,
|
|
@@ -4879,37 +4878,6 @@ var MezonApi = class {
|
|
|
4879
4878
|
)
|
|
4880
4879
|
]);
|
|
4881
4880
|
}
|
|
4882
|
-
/** List all users in SFU channel. */
|
|
4883
|
-
listSFUChannelUsers(bearerToken, clanId, channelId, channelType, limit, state, cursor, options = {}) {
|
|
4884
|
-
const urlPath = "/v2/sfu_channels/users";
|
|
4885
|
-
const queryParams = /* @__PURE__ */ new Map();
|
|
4886
|
-
queryParams.set("clan_id", clanId);
|
|
4887
|
-
queryParams.set("channel_id", channelId);
|
|
4888
|
-
queryParams.set("channel_type", channelType);
|
|
4889
|
-
queryParams.set("limit", limit);
|
|
4890
|
-
queryParams.set("state", state);
|
|
4891
|
-
queryParams.set("cursor", cursor);
|
|
4892
|
-
let bodyJson = "";
|
|
4893
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4894
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4895
|
-
if (bearerToken) {
|
|
4896
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4897
|
-
}
|
|
4898
|
-
return Promise.race([
|
|
4899
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4900
|
-
if (response.status == 204) {
|
|
4901
|
-
return response;
|
|
4902
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
4903
|
-
return response.json();
|
|
4904
|
-
} else {
|
|
4905
|
-
throw response;
|
|
4906
|
-
}
|
|
4907
|
-
}),
|
|
4908
|
-
new Promise(
|
|
4909
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4910
|
-
)
|
|
4911
|
-
]);
|
|
4912
|
-
}
|
|
4913
4881
|
/** get pubkey */
|
|
4914
4882
|
getPubKeys(bearerToken, userIds, options = {}) {
|
|
4915
4883
|
const urlPath = "/v2/pubkey";
|
|
@@ -8098,12 +8066,6 @@ var WebrtcSignalingType = /* @__PURE__ */ ((WebrtcSignalingType2) => {
|
|
|
8098
8066
|
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_SDP_QUIT"] = 4] = "WEBRTC_SDP_QUIT";
|
|
8099
8067
|
return WebrtcSignalingType2;
|
|
8100
8068
|
})(WebrtcSignalingType || {});
|
|
8101
|
-
var SFUSignalingType = /* @__PURE__ */ ((SFUSignalingType2) => {
|
|
8102
|
-
SFUSignalingType2[SFUSignalingType2["JOINE"] = 0] = "JOINE";
|
|
8103
|
-
SFUSignalingType2[SFUSignalingType2["LEAVE"] = 1] = "LEAVE";
|
|
8104
|
-
SFUSignalingType2[SFUSignalingType2["TALK"] = 2] = "TALK";
|
|
8105
|
-
return SFUSignalingType2;
|
|
8106
|
-
})(SFUSignalingType || {});
|
|
8107
8069
|
var Client = class {
|
|
8108
8070
|
constructor(serverkey = DEFAULT_SERVER_KEY, host = DEFAULT_HOST, port = DEFAULT_PORT, useSSL = false, timeout = DEFAULT_TIMEOUT_MS, autoRefreshSession = true) {
|
|
8109
8071
|
this.serverkey = serverkey;
|
|
@@ -10597,39 +10559,6 @@ var Client = class {
|
|
|
10597
10559
|
});
|
|
10598
10560
|
});
|
|
10599
10561
|
}
|
|
10600
|
-
/** List a ptt channel's users. */
|
|
10601
|
-
listSFUChannelUsers(session, clanId, channelId, channelType, state, limit, cursor) {
|
|
10602
|
-
return __async(this, null, function* () {
|
|
10603
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10604
|
-
yield this.sessionRefresh(session);
|
|
10605
|
-
}
|
|
10606
|
-
return this.apiClient.listSFUChannelUsers(
|
|
10607
|
-
session.token,
|
|
10608
|
-
clanId,
|
|
10609
|
-
channelId,
|
|
10610
|
-
channelType,
|
|
10611
|
-
limit,
|
|
10612
|
-
state,
|
|
10613
|
-
cursor
|
|
10614
|
-
).then((response) => {
|
|
10615
|
-
var result = {
|
|
10616
|
-
sfu_channel_users: []
|
|
10617
|
-
};
|
|
10618
|
-
if (response.sfu_channel_users == null) {
|
|
10619
|
-
return Promise.resolve(result);
|
|
10620
|
-
}
|
|
10621
|
-
response.sfu_channel_users.forEach((gu) => {
|
|
10622
|
-
result.sfu_channel_users.push({
|
|
10623
|
-
id: gu.id,
|
|
10624
|
-
channel_id: gu.channel_id,
|
|
10625
|
-
user_id: gu.user_id,
|
|
10626
|
-
participant: gu.participant
|
|
10627
|
-
});
|
|
10628
|
-
});
|
|
10629
|
-
return Promise.resolve(result);
|
|
10630
|
-
});
|
|
10631
|
-
});
|
|
10632
|
-
}
|
|
10633
10562
|
//**list wallet ledger */
|
|
10634
10563
|
listWalletLedger(session, limit, cursor, transactionId) {
|
|
10635
10564
|
return __async(this, null, function* () {
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -4844,37 +4844,6 @@ var MezonApi = class {
|
|
|
4844
4844
|
)
|
|
4845
4845
|
]);
|
|
4846
4846
|
}
|
|
4847
|
-
/** List all users in SFU channel. */
|
|
4848
|
-
listSFUChannelUsers(bearerToken, clanId, channelId, channelType, limit, state, cursor, options = {}) {
|
|
4849
|
-
const urlPath = "/v2/sfu_channels/users";
|
|
4850
|
-
const queryParams = /* @__PURE__ */ new Map();
|
|
4851
|
-
queryParams.set("clan_id", clanId);
|
|
4852
|
-
queryParams.set("channel_id", channelId);
|
|
4853
|
-
queryParams.set("channel_type", channelType);
|
|
4854
|
-
queryParams.set("limit", limit);
|
|
4855
|
-
queryParams.set("state", state);
|
|
4856
|
-
queryParams.set("cursor", cursor);
|
|
4857
|
-
let bodyJson = "";
|
|
4858
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4859
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4860
|
-
if (bearerToken) {
|
|
4861
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4862
|
-
}
|
|
4863
|
-
return Promise.race([
|
|
4864
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4865
|
-
if (response.status == 204) {
|
|
4866
|
-
return response;
|
|
4867
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
4868
|
-
return response.json();
|
|
4869
|
-
} else {
|
|
4870
|
-
throw response;
|
|
4871
|
-
}
|
|
4872
|
-
}),
|
|
4873
|
-
new Promise(
|
|
4874
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4875
|
-
)
|
|
4876
|
-
]);
|
|
4877
|
-
}
|
|
4878
4847
|
/** get pubkey */
|
|
4879
4848
|
getPubKeys(bearerToken, userIds, options = {}) {
|
|
4880
4849
|
const urlPath = "/v2/pubkey";
|
|
@@ -8063,12 +8032,6 @@ var WebrtcSignalingType = /* @__PURE__ */ ((WebrtcSignalingType2) => {
|
|
|
8063
8032
|
WebrtcSignalingType2[WebrtcSignalingType2["WEBRTC_SDP_QUIT"] = 4] = "WEBRTC_SDP_QUIT";
|
|
8064
8033
|
return WebrtcSignalingType2;
|
|
8065
8034
|
})(WebrtcSignalingType || {});
|
|
8066
|
-
var SFUSignalingType = /* @__PURE__ */ ((SFUSignalingType2) => {
|
|
8067
|
-
SFUSignalingType2[SFUSignalingType2["JOINE"] = 0] = "JOINE";
|
|
8068
|
-
SFUSignalingType2[SFUSignalingType2["LEAVE"] = 1] = "LEAVE";
|
|
8069
|
-
SFUSignalingType2[SFUSignalingType2["TALK"] = 2] = "TALK";
|
|
8070
|
-
return SFUSignalingType2;
|
|
8071
|
-
})(SFUSignalingType || {});
|
|
8072
8035
|
var Client = class {
|
|
8073
8036
|
constructor(serverkey = DEFAULT_SERVER_KEY, host = DEFAULT_HOST, port = DEFAULT_PORT, useSSL = false, timeout = DEFAULT_TIMEOUT_MS, autoRefreshSession = true) {
|
|
8074
8037
|
this.serverkey = serverkey;
|
|
@@ -10562,39 +10525,6 @@ var Client = class {
|
|
|
10562
10525
|
});
|
|
10563
10526
|
});
|
|
10564
10527
|
}
|
|
10565
|
-
/** List a ptt channel's users. */
|
|
10566
|
-
listSFUChannelUsers(session, clanId, channelId, channelType, state, limit, cursor) {
|
|
10567
|
-
return __async(this, null, function* () {
|
|
10568
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10569
|
-
yield this.sessionRefresh(session);
|
|
10570
|
-
}
|
|
10571
|
-
return this.apiClient.listSFUChannelUsers(
|
|
10572
|
-
session.token,
|
|
10573
|
-
clanId,
|
|
10574
|
-
channelId,
|
|
10575
|
-
channelType,
|
|
10576
|
-
limit,
|
|
10577
|
-
state,
|
|
10578
|
-
cursor
|
|
10579
|
-
).then((response) => {
|
|
10580
|
-
var result = {
|
|
10581
|
-
sfu_channel_users: []
|
|
10582
|
-
};
|
|
10583
|
-
if (response.sfu_channel_users == null) {
|
|
10584
|
-
return Promise.resolve(result);
|
|
10585
|
-
}
|
|
10586
|
-
response.sfu_channel_users.forEach((gu) => {
|
|
10587
|
-
result.sfu_channel_users.push({
|
|
10588
|
-
id: gu.id,
|
|
10589
|
-
channel_id: gu.channel_id,
|
|
10590
|
-
user_id: gu.user_id,
|
|
10591
|
-
participant: gu.participant
|
|
10592
|
-
});
|
|
10593
|
-
});
|
|
10594
|
-
return Promise.resolve(result);
|
|
10595
|
-
});
|
|
10596
|
-
});
|
|
10597
|
-
}
|
|
10598
10528
|
//**list wallet ledger */
|
|
10599
10529
|
listWalletLedger(session, limit, cursor, transactionId) {
|
|
10600
10530
|
return __async(this, null, function* () {
|
|
@@ -10646,7 +10576,6 @@ export {
|
|
|
10646
10576
|
Client,
|
|
10647
10577
|
DefaultSocket,
|
|
10648
10578
|
NotificationType,
|
|
10649
|
-
SFUSignalingType,
|
|
10650
10579
|
Session,
|
|
10651
10580
|
WebSocketAdapterText,
|
|
10652
10581
|
WebrtcSignalingType,
|