mezon-js 2.12.77 → 2.12.79
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 +50 -0
- package/client.ts +18 -0
- package/dist/api.gen.d.ts +10 -0
- package/dist/client.d.ts +2 -1
- package/dist/mezon-js.cjs.js +42 -2
- package/dist/mezon-js.esm.mjs +42 -2
- package/dist/socket.d.ts +4 -2
- package/package.json +1 -1
- package/socket.ts +7 -2
package/api.gen.ts
CHANGED
|
@@ -374,6 +374,8 @@ export interface ApiAccount {
|
|
|
374
374
|
verify_time?: string;
|
|
375
375
|
//The user's wallet data.
|
|
376
376
|
wallet?: number;
|
|
377
|
+
// MMN information
|
|
378
|
+
mmn_encrypt_private_key: string;
|
|
377
379
|
}
|
|
378
380
|
|
|
379
381
|
/** Send a app token to the server. Used with authenticate/link/unlink. */
|
|
@@ -2569,6 +2571,8 @@ export interface ApiUpdateAccountRequest {
|
|
|
2569
2571
|
timezone?: string;
|
|
2570
2572
|
//The username of the user's account.
|
|
2571
2573
|
username?: string;
|
|
2574
|
+
//The email of the user's account.
|
|
2575
|
+
email?: string;
|
|
2572
2576
|
}
|
|
2573
2577
|
|
|
2574
2578
|
/** */
|
|
@@ -2680,6 +2684,8 @@ export interface ApiUser {
|
|
|
2680
2684
|
username?: string;
|
|
2681
2685
|
// list nick name
|
|
2682
2686
|
list_nick_names?: Array<string>;
|
|
2687
|
+
// MMN address
|
|
2688
|
+
wallet_address?: string
|
|
2683
2689
|
}
|
|
2684
2690
|
|
|
2685
2691
|
/** */
|
|
@@ -2800,6 +2806,14 @@ export interface ApiVoiceChannelUserList {
|
|
|
2800
2806
|
voice_channel_users?: Array<ApiVoiceChannelUser>;
|
|
2801
2807
|
}
|
|
2802
2808
|
|
|
2809
|
+
/** */
|
|
2810
|
+
export interface ApiStoreWalletKeyRequest {
|
|
2811
|
+
//
|
|
2812
|
+
address?: string;
|
|
2813
|
+
//
|
|
2814
|
+
enc_privkey?: string;
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2803
2817
|
/** */
|
|
2804
2818
|
export interface ApiWalletLedger {
|
|
2805
2819
|
//
|
|
@@ -9549,6 +9563,42 @@ export class MezonApi {
|
|
|
9549
9563
|
]);
|
|
9550
9564
|
}
|
|
9551
9565
|
|
|
9566
|
+
/** Store wallet key */
|
|
9567
|
+
storeWalletKey(bearerToken: string,
|
|
9568
|
+
body:ApiStoreWalletKeyRequest,
|
|
9569
|
+
options: any = {}): Promise<any> {
|
|
9570
|
+
|
|
9571
|
+
if (body === null || body === undefined) {
|
|
9572
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
9573
|
+
}
|
|
9574
|
+
const urlPath = "/v2/wallet/key";
|
|
9575
|
+
const queryParams = new Map<string, any>();
|
|
9576
|
+
|
|
9577
|
+
let bodyJson : string = "";
|
|
9578
|
+
bodyJson = JSON.stringify(body || {});
|
|
9579
|
+
|
|
9580
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
9581
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
9582
|
+
if (bearerToken) {
|
|
9583
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
9584
|
+
}
|
|
9585
|
+
|
|
9586
|
+
return Promise.race([
|
|
9587
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
9588
|
+
if (response.status == 204) {
|
|
9589
|
+
return response;
|
|
9590
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
9591
|
+
return response.json();
|
|
9592
|
+
} else {
|
|
9593
|
+
throw response;
|
|
9594
|
+
}
|
|
9595
|
+
}),
|
|
9596
|
+
new Promise((_, reject) =>
|
|
9597
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
9598
|
+
),
|
|
9599
|
+
]);
|
|
9600
|
+
}
|
|
9601
|
+
|
|
9552
9602
|
/** Get user status */
|
|
9553
9603
|
listWalletLedger(bearerToken: string,
|
|
9554
9604
|
limit?:number,
|
package/client.ts
CHANGED
|
@@ -172,6 +172,7 @@ import {
|
|
|
172
172
|
ApiIsFollowerRequest,
|
|
173
173
|
ApiTransferOwnershipRequest,
|
|
174
174
|
ApiMeetParticipantRequest,
|
|
175
|
+
ApiStoreWalletKeyRequest,
|
|
175
176
|
} from "./api.gen";
|
|
176
177
|
|
|
177
178
|
import { Session } from "./session";
|
|
@@ -4899,4 +4900,21 @@ export class Client {
|
|
|
4899
4900
|
});
|
|
4900
4901
|
}
|
|
4901
4902
|
|
|
4903
|
+
async createMmnWallet(session: Session,
|
|
4904
|
+
req: ApiStoreWalletKeyRequest): Promise<any> {
|
|
4905
|
+
if (
|
|
4906
|
+
this.autoRefreshSession &&
|
|
4907
|
+
session.refresh_token &&
|
|
4908
|
+
session.isexpired(Date.now() / 1000)
|
|
4909
|
+
) {
|
|
4910
|
+
await this.sessionRefresh(session);
|
|
4911
|
+
}
|
|
4912
|
+
|
|
4913
|
+
return this.apiClient
|
|
4914
|
+
.storeWalletKey(session.token, req)
|
|
4915
|
+
.then((response: any) => {
|
|
4916
|
+
return response !== undefined;
|
|
4917
|
+
});
|
|
4918
|
+
}
|
|
4919
|
+
|
|
4902
4920
|
}
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -213,6 +213,7 @@ export interface ApiAccount {
|
|
|
213
213
|
user?: ApiUser;
|
|
214
214
|
verify_time?: string;
|
|
215
215
|
wallet?: number;
|
|
216
|
+
mmn_encrypt_private_key: string;
|
|
216
217
|
}
|
|
217
218
|
/** Send a app token to the server. Used with authenticate/link/unlink. */
|
|
218
219
|
export interface ApiAccountApp {
|
|
@@ -1468,6 +1469,7 @@ export interface ApiUpdateAccountRequest {
|
|
|
1468
1469
|
splash_screen?: string;
|
|
1469
1470
|
timezone?: string;
|
|
1470
1471
|
username?: string;
|
|
1472
|
+
email?: string;
|
|
1471
1473
|
}
|
|
1472
1474
|
/** */
|
|
1473
1475
|
export interface ApiUpdateCategoryDescRequest {
|
|
@@ -1531,6 +1533,7 @@ export interface ApiUser {
|
|
|
1531
1533
|
update_time?: string;
|
|
1532
1534
|
username?: string;
|
|
1533
1535
|
list_nick_names?: Array<string>;
|
|
1536
|
+
wallet_address?: string;
|
|
1534
1537
|
}
|
|
1535
1538
|
/** */
|
|
1536
1539
|
export interface ApiUserActivity {
|
|
@@ -1602,6 +1605,11 @@ export interface ApiVoiceChannelUserList {
|
|
|
1602
1605
|
voice_channel_users?: Array<ApiVoiceChannelUser>;
|
|
1603
1606
|
}
|
|
1604
1607
|
/** */
|
|
1608
|
+
export interface ApiStoreWalletKeyRequest {
|
|
1609
|
+
address?: string;
|
|
1610
|
+
enc_privkey?: string;
|
|
1611
|
+
}
|
|
1612
|
+
/** */
|
|
1605
1613
|
export interface ApiWalletLedger {
|
|
1606
1614
|
create_time?: string;
|
|
1607
1615
|
id?: string;
|
|
@@ -2228,6 +2236,8 @@ export declare class MezonApi {
|
|
|
2228
2236
|
updateUserStatus(bearerToken: string, body: ApiUserStatusUpdate, options?: any): Promise<any>;
|
|
2229
2237
|
/** list transaction detail */
|
|
2230
2238
|
listTransactionDetail(bearerToken: string, transId: string, options?: any): Promise<ApiTransactionDetail>;
|
|
2239
|
+
/** Store wallet key */
|
|
2240
|
+
storeWalletKey(bearerToken: string, body: ApiStoreWalletKeyRequest, options?: any): Promise<any>;
|
|
2231
2241
|
/** Get user status */
|
|
2232
2242
|
listWalletLedger(bearerToken: string, limit?: number, filter?: number, transactionId?: string, page?: number, options?: any): Promise<ApiWalletLedgerList>;
|
|
2233
2243
|
/** create webhook */
|
package/dist/client.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ApiAccount, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, 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, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse, ApiIsFollowerResponse, ApiIsFollowerRequest, ApiTransferOwnershipRequest, ApiMeetParticipantRequest } from "./api.gen";
|
|
16
|
+
import { ApiAccount, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, 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, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse, ApiIsFollowerResponse, ApiIsFollowerRequest, ApiTransferOwnershipRequest, ApiMeetParticipantRequest, ApiStoreWalletKeyRequest } from "./api.gen";
|
|
17
17
|
import { Session } from "./session";
|
|
18
18
|
import { Socket } from "./socket";
|
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
@@ -621,4 +621,5 @@ export declare class Client {
|
|
|
621
621
|
listForSaleItems(session: Session, page?: number): Promise<ApiForSaleItemList>;
|
|
622
622
|
isFollower(session: Session, req: ApiIsFollowerRequest): Promise<ApiIsFollowerResponse>;
|
|
623
623
|
transferOwnership(session: Session, req: ApiTransferOwnershipRequest): Promise<any>;
|
|
624
|
+
createMmnWallet(session: Session, req: ApiStoreWalletKeyRequest): Promise<any>;
|
|
624
625
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -5578,6 +5578,35 @@ var MezonApi = class {
|
|
|
5578
5578
|
)
|
|
5579
5579
|
]);
|
|
5580
5580
|
}
|
|
5581
|
+
/** Store wallet key */
|
|
5582
|
+
storeWalletKey(bearerToken, body, options = {}) {
|
|
5583
|
+
if (body === null || body === void 0) {
|
|
5584
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
5585
|
+
}
|
|
5586
|
+
const urlPath = "/v2/wallet/key";
|
|
5587
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
5588
|
+
let bodyJson = "";
|
|
5589
|
+
bodyJson = JSON.stringify(body || {});
|
|
5590
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5591
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
5592
|
+
if (bearerToken) {
|
|
5593
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5594
|
+
}
|
|
5595
|
+
return Promise.race([
|
|
5596
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5597
|
+
if (response.status == 204) {
|
|
5598
|
+
return response;
|
|
5599
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
5600
|
+
return response.json();
|
|
5601
|
+
} else {
|
|
5602
|
+
throw response;
|
|
5603
|
+
}
|
|
5604
|
+
}),
|
|
5605
|
+
new Promise(
|
|
5606
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5607
|
+
)
|
|
5608
|
+
]);
|
|
5609
|
+
}
|
|
5581
5610
|
/** Get user status */
|
|
5582
5611
|
listWalletLedger(bearerToken, limit, filter, transactionId, page, options = {}) {
|
|
5583
5612
|
const urlPath = "/v2/walletledger";
|
|
@@ -7805,14 +7834,15 @@ var _DefaultSocket = class _DefaultSocket {
|
|
|
7805
7834
|
return response.channel;
|
|
7806
7835
|
});
|
|
7807
7836
|
}
|
|
7808
|
-
handleParticipantMeetState(clan_id, channel_id, display_name, state) {
|
|
7837
|
+
handleParticipantMeetState(clan_id, channel_id, display_name, state, room_name) {
|
|
7809
7838
|
return __async(this, null, function* () {
|
|
7810
7839
|
const response = yield this.send({
|
|
7811
7840
|
handle_participant_meet_state_event: {
|
|
7812
7841
|
clan_id,
|
|
7813
7842
|
channel_id,
|
|
7814
7843
|
display_name,
|
|
7815
|
-
state
|
|
7844
|
+
state,
|
|
7845
|
+
room_name
|
|
7816
7846
|
}
|
|
7817
7847
|
});
|
|
7818
7848
|
return response.handle_participant_meet_state_event;
|
|
@@ -10757,4 +10787,14 @@ var Client = class {
|
|
|
10757
10787
|
});
|
|
10758
10788
|
});
|
|
10759
10789
|
}
|
|
10790
|
+
createMmnWallet(session, req) {
|
|
10791
|
+
return __async(this, null, function* () {
|
|
10792
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
|
10793
|
+
yield this.sessionRefresh(session);
|
|
10794
|
+
}
|
|
10795
|
+
return this.apiClient.storeWalletKey(session.token, req).then((response) => {
|
|
10796
|
+
return response !== void 0;
|
|
10797
|
+
});
|
|
10798
|
+
});
|
|
10799
|
+
}
|
|
10760
10800
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -5544,6 +5544,35 @@ var MezonApi = class {
|
|
|
5544
5544
|
)
|
|
5545
5545
|
]);
|
|
5546
5546
|
}
|
|
5547
|
+
/** Store wallet key */
|
|
5548
|
+
storeWalletKey(bearerToken, body, options = {}) {
|
|
5549
|
+
if (body === null || body === void 0) {
|
|
5550
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
5551
|
+
}
|
|
5552
|
+
const urlPath = "/v2/wallet/key";
|
|
5553
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
5554
|
+
let bodyJson = "";
|
|
5555
|
+
bodyJson = JSON.stringify(body || {});
|
|
5556
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5557
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
5558
|
+
if (bearerToken) {
|
|
5559
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5560
|
+
}
|
|
5561
|
+
return Promise.race([
|
|
5562
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5563
|
+
if (response.status == 204) {
|
|
5564
|
+
return response;
|
|
5565
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
5566
|
+
return response.json();
|
|
5567
|
+
} else {
|
|
5568
|
+
throw response;
|
|
5569
|
+
}
|
|
5570
|
+
}),
|
|
5571
|
+
new Promise(
|
|
5572
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5573
|
+
)
|
|
5574
|
+
]);
|
|
5575
|
+
}
|
|
5547
5576
|
/** Get user status */
|
|
5548
5577
|
listWalletLedger(bearerToken, limit, filter, transactionId, page, options = {}) {
|
|
5549
5578
|
const urlPath = "/v2/walletledger";
|
|
@@ -7771,14 +7800,15 @@ var _DefaultSocket = class _DefaultSocket {
|
|
|
7771
7800
|
return response.channel;
|
|
7772
7801
|
});
|
|
7773
7802
|
}
|
|
7774
|
-
handleParticipantMeetState(clan_id, channel_id, display_name, state) {
|
|
7803
|
+
handleParticipantMeetState(clan_id, channel_id, display_name, state, room_name) {
|
|
7775
7804
|
return __async(this, null, function* () {
|
|
7776
7805
|
const response = yield this.send({
|
|
7777
7806
|
handle_participant_meet_state_event: {
|
|
7778
7807
|
clan_id,
|
|
7779
7808
|
channel_id,
|
|
7780
7809
|
display_name,
|
|
7781
|
-
state
|
|
7810
|
+
state,
|
|
7811
|
+
room_name
|
|
7782
7812
|
}
|
|
7783
7813
|
});
|
|
7784
7814
|
return response.handle_participant_meet_state_event;
|
|
@@ -10723,6 +10753,16 @@ var Client = class {
|
|
|
10723
10753
|
});
|
|
10724
10754
|
});
|
|
10725
10755
|
}
|
|
10756
|
+
createMmnWallet(session, req) {
|
|
10757
|
+
return __async(this, null, function* () {
|
|
10758
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
|
10759
|
+
yield this.sessionRefresh(session);
|
|
10760
|
+
}
|
|
10761
|
+
return this.apiClient.storeWalletKey(session.token, req).then((response) => {
|
|
10762
|
+
return response !== void 0;
|
|
10763
|
+
});
|
|
10764
|
+
});
|
|
10765
|
+
}
|
|
10726
10766
|
};
|
|
10727
10767
|
export {
|
|
10728
10768
|
ChannelStreamMode,
|
package/dist/socket.d.ts
CHANGED
|
@@ -739,6 +739,8 @@ export interface HandleParticipantMeetStateEvent {
|
|
|
739
739
|
display_name: string;
|
|
740
740
|
/** state (0: join, 1: leave) */
|
|
741
741
|
state: number;
|
|
742
|
+
/** room name */
|
|
743
|
+
room_name: string;
|
|
742
744
|
}
|
|
743
745
|
export interface PermissionSet {
|
|
744
746
|
/** Role ID */
|
|
@@ -908,7 +910,7 @@ export interface Socket {
|
|
|
908
910
|
/** Leave a chat channel on the server. */
|
|
909
911
|
leaveChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<void>;
|
|
910
912
|
/** handle user join/leave channel voice on the server. */
|
|
911
|
-
handleParticipantMeetState(clan_id: string, channel_id: string, display_name: string, state: number): Promise<void>;
|
|
913
|
+
handleParticipantMeetState(clan_id: string, channel_id: string, display_name: string, state: number, room_name: string): Promise<void>;
|
|
912
914
|
/** Remove a chat message from a chat channel on the server. */
|
|
913
915
|
removeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, has_attachment?: boolean, topic_id?: string, mentions?: string, references?: string): Promise<ChannelMessageAck>;
|
|
914
916
|
/** Execute an RPC function to the server. */
|
|
@@ -1135,7 +1137,7 @@ export declare class DefaultSocket implements Socket {
|
|
|
1135
1137
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
|
1136
1138
|
follower(): Promise<void>;
|
|
1137
1139
|
joinChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<Channel>;
|
|
1138
|
-
handleParticipantMeetState(clan_id: string, channel_id: string, display_name: string, state: number): Promise<void>;
|
|
1140
|
+
handleParticipantMeetState(clan_id: string, channel_id: string, display_name: string, state: number, room_name: string): Promise<void>;
|
|
1139
1141
|
leaveChat(clan_id: string, channel_id: string, channel_type: number, is_public: boolean): Promise<void>;
|
|
1140
1142
|
removeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, has_attachment?: boolean, topic_id?: string, mentions?: string, references?: string): Promise<ChannelMessageAck>;
|
|
1141
1143
|
rpc(id?: string, payload?: string, http_key?: string): Promise<ApiRpc>;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
|
@@ -1103,6 +1103,8 @@ export interface HandleParticipantMeetStateEvent {
|
|
|
1103
1103
|
display_name: string;
|
|
1104
1104
|
/** state (0: join, 1: leave) */
|
|
1105
1105
|
state: number;
|
|
1106
|
+
/** room name */
|
|
1107
|
+
room_name: string;
|
|
1106
1108
|
}
|
|
1107
1109
|
|
|
1108
1110
|
export interface PermissionSet {
|
|
@@ -1396,7 +1398,8 @@ export interface Socket {
|
|
|
1396
1398
|
clan_id: string,
|
|
1397
1399
|
channel_id: string,
|
|
1398
1400
|
display_name: string,
|
|
1399
|
-
state: number
|
|
1401
|
+
state: number,
|
|
1402
|
+
room_name: string
|
|
1400
1403
|
): Promise<void>
|
|
1401
1404
|
|
|
1402
1405
|
/** Remove a chat message from a chat channel on the server. */
|
|
@@ -2611,7 +2614,8 @@ export class DefaultSocket implements Socket {
|
|
|
2611
2614
|
clan_id: string,
|
|
2612
2615
|
channel_id: string,
|
|
2613
2616
|
display_name: string,
|
|
2614
|
-
state: number
|
|
2617
|
+
state: number,
|
|
2618
|
+
room_name: string,
|
|
2615
2619
|
): Promise<void> {
|
|
2616
2620
|
const response = await this.send({
|
|
2617
2621
|
handle_participant_meet_state_event: {
|
|
@@ -2619,6 +2623,7 @@ export class DefaultSocket implements Socket {
|
|
|
2619
2623
|
channel_id: channel_id,
|
|
2620
2624
|
display_name: display_name,
|
|
2621
2625
|
state: state,
|
|
2626
|
+
room_name: room_name,
|
|
2622
2627
|
},
|
|
2623
2628
|
});
|
|
2624
2629
|
|