mezon-js 2.12.45 → 2.12.46
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 +21 -0
- package/dist/api.gen.d.ts +11 -0
- package/dist/client.d.ts +2 -1
- package/dist/mezon-js.cjs.js +37 -0
- package/dist/mezon-js.esm.mjs +37 -0
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -3289,6 +3289,21 @@ export interface ApiClanDiscoverRequest {
|
|
3289
3289
|
page_number?: number;
|
3290
3290
|
}
|
3291
3291
|
|
3292
|
+
/** */
|
3293
|
+
export interface ApiChannelMemberDetail {
|
3294
|
+
//
|
3295
|
+
added_by?: string;
|
3296
|
+
//
|
3297
|
+
member_id?: string;
|
3298
|
+
}
|
3299
|
+
|
3300
|
+
/** */
|
3301
|
+
export interface ApiChannelMemberList {
|
3302
|
+
//
|
3303
|
+
channel_members?: Array<ApiChannelMemberDetail>;
|
3304
|
+
}
|
3305
|
+
|
3306
|
+
|
3292
3307
|
export class MezonApi {
|
3293
3308
|
basePath: string;
|
3294
3309
|
constructor(
|
@@ -11095,4 +11110,39 @@ export class MezonApi {
|
|
11095
11110
|
),
|
11096
11111
|
]);
|
11097
11112
|
}
|
11113
|
+
|
11114
|
+
/** */
|
11115
|
+
listChannelMember(bearerToken: string,
|
11116
|
+
channelId?:string,
|
11117
|
+
clanId?:string,
|
11118
|
+
options: any = {}): Promise<ApiChannelMemberList> {
|
11119
|
+
|
11120
|
+
const urlPath = "/v2/listchannelmember";
|
11121
|
+
const queryParams = new Map<string, any>();
|
11122
|
+
queryParams.set("channel_id", channelId);
|
11123
|
+
queryParams.set("clan_id", clanId);
|
11124
|
+
|
11125
|
+
let bodyJson : string = "";
|
11126
|
+
|
11127
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
11128
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
11129
|
+
if (bearerToken) {
|
11130
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
11131
|
+
}
|
11132
|
+
|
11133
|
+
return Promise.race([
|
11134
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
11135
|
+
if (response.status == 204) {
|
11136
|
+
return response;
|
11137
|
+
} else if (response.status >= 200 && response.status < 300) {
|
11138
|
+
return response.json();
|
11139
|
+
} else {
|
11140
|
+
throw response;
|
11141
|
+
}
|
11142
|
+
}),
|
11143
|
+
new Promise((_, reject) =>
|
11144
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11145
|
+
),
|
11146
|
+
]);
|
11147
|
+
}
|
11098
11148
|
}
|
package/client.ts
CHANGED
@@ -169,6 +169,7 @@ import {
|
|
169
169
|
ApiUnlockedItemRequest,
|
170
170
|
ApiForSaleItemList,
|
171
171
|
ApiUnlockedItemResponse,
|
172
|
+
ApiChannelMemberList,
|
172
173
|
} from "./api.gen";
|
173
174
|
|
174
175
|
import { Session } from "./session";
|
@@ -4858,4 +4859,24 @@ export class Client {
|
|
4858
4859
|
return Promise.resolve(response);
|
4859
4860
|
});
|
4860
4861
|
}
|
4862
|
+
|
4863
|
+
async listChannelMember(
|
4864
|
+
session: Session,
|
4865
|
+
channelId:string,
|
4866
|
+
clanId:string,
|
4867
|
+
): Promise<ApiChannelMemberList> {
|
4868
|
+
if (
|
4869
|
+
this.autoRefreshSession &&
|
4870
|
+
session.refresh_token &&
|
4871
|
+
session.isexpired(Date.now() / 1000)
|
4872
|
+
) {
|
4873
|
+
await this.sessionRefresh(session);
|
4874
|
+
}
|
4875
|
+
|
4876
|
+
return this.apiClient
|
4877
|
+
.listChannelMember(session.token, channelId, clanId)
|
4878
|
+
.then((response: ApiChannelMemberList) => {
|
4879
|
+
return Promise.resolve(response);
|
4880
|
+
});
|
4881
|
+
}
|
4861
4882
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -1884,6 +1884,15 @@ export interface ApiClanDiscoverRequest {
|
|
1884
1884
|
item_per_page?: number;
|
1885
1885
|
page_number?: number;
|
1886
1886
|
}
|
1887
|
+
/** */
|
1888
|
+
export interface ApiChannelMemberDetail {
|
1889
|
+
added_by?: string;
|
1890
|
+
member_id?: string;
|
1891
|
+
}
|
1892
|
+
/** */
|
1893
|
+
export interface ApiChannelMemberList {
|
1894
|
+
channel_members?: Array<ApiChannelMemberDetail>;
|
1895
|
+
}
|
1887
1896
|
export declare class MezonApi {
|
1888
1897
|
readonly serverKey: string;
|
1889
1898
|
readonly timeoutMs: number;
|
@@ -2283,4 +2292,6 @@ export declare class MezonApi {
|
|
2283
2292
|
unlockItem(bearerToken: string, body: ApiUnlockedItemRequest, options?: any): Promise<ApiUnlockedItemResponse>;
|
2284
2293
|
/** For sale items */
|
2285
2294
|
listForSaleItems(bearerToken: string, page?: number, options?: any): Promise<ApiForSaleItemList>;
|
2295
|
+
/** */
|
2296
|
+
listChannelMember(bearerToken: string, channelId?: string, clanId?: string, options?: any): Promise<ApiChannelMemberList>;
|
2286
2297
|
}
|
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, 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, 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 } 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, 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, 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, ApiChannelMemberList } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -631,4 +631,5 @@ export declare class Client {
|
|
631
631
|
updateQuickMenuAccess(session: Session, request: ApiQuickMenuAccessRequest): Promise<any>;
|
632
632
|
unlockItem(session: Session, request: ApiUnlockedItemRequest): Promise<ApiUnlockedItemResponse>;
|
633
633
|
listForSaleItems(session: Session, page?: number): Promise<ApiForSaleItemList>;
|
634
|
+
listChannelMember(session: Session, channelId: string, clanId: string): Promise<ApiChannelMemberList>;
|
634
635
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -6828,6 +6828,33 @@ var MezonApi = class {
|
|
6828
6828
|
)
|
6829
6829
|
]);
|
6830
6830
|
}
|
6831
|
+
/** */
|
6832
|
+
listChannelMember(bearerToken, channelId, clanId, options = {}) {
|
6833
|
+
const urlPath = "/v2/listchannelmember";
|
6834
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6835
|
+
queryParams.set("channel_id", channelId);
|
6836
|
+
queryParams.set("clan_id", clanId);
|
6837
|
+
let bodyJson = "";
|
6838
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6839
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
6840
|
+
if (bearerToken) {
|
6841
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6842
|
+
}
|
6843
|
+
return Promise.race([
|
6844
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6845
|
+
if (response.status == 204) {
|
6846
|
+
return response;
|
6847
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6848
|
+
return response.json();
|
6849
|
+
} else {
|
6850
|
+
throw response;
|
6851
|
+
}
|
6852
|
+
}),
|
6853
|
+
new Promise(
|
6854
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6855
|
+
)
|
6856
|
+
]);
|
6857
|
+
}
|
6831
6858
|
};
|
6832
6859
|
|
6833
6860
|
// session.ts
|
@@ -10633,4 +10660,14 @@ var Client = class {
|
|
10633
10660
|
});
|
10634
10661
|
});
|
10635
10662
|
}
|
10663
|
+
listChannelMember(session, channelId, clanId) {
|
10664
|
+
return __async(this, null, function* () {
|
10665
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10666
|
+
yield this.sessionRefresh(session);
|
10667
|
+
}
|
10668
|
+
return this.apiClient.listChannelMember(session.token, channelId, clanId).then((response) => {
|
10669
|
+
return Promise.resolve(response);
|
10670
|
+
});
|
10671
|
+
});
|
10672
|
+
}
|
10636
10673
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -6794,6 +6794,33 @@ var MezonApi = class {
|
|
6794
6794
|
)
|
6795
6795
|
]);
|
6796
6796
|
}
|
6797
|
+
/** */
|
6798
|
+
listChannelMember(bearerToken, channelId, clanId, options = {}) {
|
6799
|
+
const urlPath = "/v2/listchannelmember";
|
6800
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6801
|
+
queryParams.set("channel_id", channelId);
|
6802
|
+
queryParams.set("clan_id", clanId);
|
6803
|
+
let bodyJson = "";
|
6804
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6805
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
6806
|
+
if (bearerToken) {
|
6807
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6808
|
+
}
|
6809
|
+
return Promise.race([
|
6810
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6811
|
+
if (response.status == 204) {
|
6812
|
+
return response;
|
6813
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6814
|
+
return response.json();
|
6815
|
+
} else {
|
6816
|
+
throw response;
|
6817
|
+
}
|
6818
|
+
}),
|
6819
|
+
new Promise(
|
6820
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6821
|
+
)
|
6822
|
+
]);
|
6823
|
+
}
|
6797
6824
|
};
|
6798
6825
|
|
6799
6826
|
// session.ts
|
@@ -10599,6 +10626,16 @@ var Client = class {
|
|
10599
10626
|
});
|
10600
10627
|
});
|
10601
10628
|
}
|
10629
|
+
listChannelMember(session, channelId, clanId) {
|
10630
|
+
return __async(this, null, function* () {
|
10631
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10632
|
+
yield this.sessionRefresh(session);
|
10633
|
+
}
|
10634
|
+
return this.apiClient.listChannelMember(session.token, channelId, clanId).then((response) => {
|
10635
|
+
return Promise.resolve(response);
|
10636
|
+
});
|
10637
|
+
});
|
10638
|
+
}
|
10602
10639
|
};
|
10603
10640
|
export {
|
10604
10641
|
ChannelStreamMode,
|