mezon-js 2.10.10 → 2.10.11
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 +62 -0
- package/client.ts +50 -0
- package/dist/api.gen.d.ts +13 -0
- package/dist/client.d.ts +3 -1
- package/dist/mezon-js.cjs.js +64 -0
- package/dist/mezon-js.esm.mjs +64 -0
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -1724,6 +1724,24 @@ export interface ApiOssrsHttpCallbackResponse {
|
|
1724
1724
|
msg?: string;
|
1725
1725
|
}
|
1726
1726
|
|
1727
|
+
/** A list of users belonging to a channel, along with their role. */
|
1728
|
+
export interface ApiPTTChannelUser {
|
1729
|
+
//
|
1730
|
+
channel_id?: string;
|
1731
|
+
//
|
1732
|
+
id?: string;
|
1733
|
+
//
|
1734
|
+
participant?: string;
|
1735
|
+
//user for a channel.
|
1736
|
+
user_id?: string;
|
1737
|
+
}
|
1738
|
+
|
1739
|
+
/** A list of users belonging to a channel, along with their role. */
|
1740
|
+
export interface ApiPTTChannelUserList {
|
1741
|
+
//
|
1742
|
+
ptt_channel_users?: Array<ApiPTTChannelUser>;
|
1743
|
+
}
|
1744
|
+
|
1727
1745
|
/** */
|
1728
1746
|
export interface ApiPermission {
|
1729
1747
|
//
|
@@ -8031,6 +8049,50 @@ export class MezonApi {
|
|
8031
8049
|
]);
|
8032
8050
|
}
|
8033
8051
|
|
8052
|
+
/** List all users in ptt channel. */
|
8053
|
+
listPTTChannelUsers(
|
8054
|
+
bearerToken: string,
|
8055
|
+
clanId?: string,
|
8056
|
+
channelId?: string,
|
8057
|
+
channelType?: number,
|
8058
|
+
limit?: number,
|
8059
|
+
state?: number,
|
8060
|
+
cursor?: string,
|
8061
|
+
options: any = {}
|
8062
|
+
): Promise<ApiPTTChannelUserList> {
|
8063
|
+
const urlPath = "/v2/ptt_channels/users";
|
8064
|
+
const queryParams = new Map<string, any>();
|
8065
|
+
queryParams.set("clan_id", clanId);
|
8066
|
+
queryParams.set("channel_id", channelId);
|
8067
|
+
queryParams.set("channel_type", channelType);
|
8068
|
+
queryParams.set("limit", limit);
|
8069
|
+
queryParams.set("state", state);
|
8070
|
+
queryParams.set("cursor", cursor);
|
8071
|
+
|
8072
|
+
let bodyJson: string = "";
|
8073
|
+
|
8074
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
8075
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
8076
|
+
if (bearerToken) {
|
8077
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
8078
|
+
}
|
8079
|
+
|
8080
|
+
return Promise.race([
|
8081
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
8082
|
+
if (response.status == 204) {
|
8083
|
+
return response;
|
8084
|
+
} else if (response.status >= 200 && response.status < 300) {
|
8085
|
+
return response.json();
|
8086
|
+
} else {
|
8087
|
+
throw response;
|
8088
|
+
}
|
8089
|
+
}),
|
8090
|
+
new Promise((_, reject) =>
|
8091
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
8092
|
+
),
|
8093
|
+
]);
|
8094
|
+
}
|
8095
|
+
|
8034
8096
|
/** get pubkey */
|
8035
8097
|
getPubKeys(
|
8036
8098
|
bearerToken: string,
|
package/client.ts
CHANGED
@@ -157,6 +157,7 @@ import {
|
|
157
157
|
ApiSdTopicList,
|
158
158
|
ApiSdTopicRequest,
|
159
159
|
ApiSdTopic,
|
160
|
+
ApiPTTChannelUserList,
|
160
161
|
} from "./api.gen";
|
161
162
|
|
162
163
|
import { Session } from "./session";
|
@@ -4714,6 +4715,55 @@ export class Client {
|
|
4714
4715
|
});
|
4715
4716
|
}
|
4716
4717
|
|
4718
|
+
/** List a ptt channel's users. */
|
4719
|
+
async listPTTChannelUsers(
|
4720
|
+
session: Session,
|
4721
|
+
clanId: string,
|
4722
|
+
channelId: string,
|
4723
|
+
channelType: number,
|
4724
|
+
state?: number,
|
4725
|
+
limit?: number,
|
4726
|
+
cursor?: string
|
4727
|
+
): Promise<ApiPTTChannelUserList> {
|
4728
|
+
if (
|
4729
|
+
this.autoRefreshSession &&
|
4730
|
+
session.refresh_token &&
|
4731
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
4732
|
+
) {
|
4733
|
+
await this.sessionRefresh(session);
|
4734
|
+
}
|
4735
|
+
|
4736
|
+
return this.apiClient
|
4737
|
+
.listPTTChannelUsers(
|
4738
|
+
session.token,
|
4739
|
+
clanId,
|
4740
|
+
channelId,
|
4741
|
+
channelType,
|
4742
|
+
limit,
|
4743
|
+
state,
|
4744
|
+
cursor
|
4745
|
+
)
|
4746
|
+
.then((response: ApiPTTChannelUserList) => {
|
4747
|
+
var result: ApiPTTChannelUserList = {
|
4748
|
+
ptt_channel_users: [],
|
4749
|
+
};
|
4750
|
+
|
4751
|
+
if (response.ptt_channel_users == null) {
|
4752
|
+
return Promise.resolve(result);
|
4753
|
+
}
|
4754
|
+
|
4755
|
+
response.ptt_channel_users!.forEach((gu) => {
|
4756
|
+
result.ptt_channel_users!.push({
|
4757
|
+
id: gu.id,
|
4758
|
+
channel_id: gu.channel_id,
|
4759
|
+
user_id: gu.user_id,
|
4760
|
+
participant: gu.participant,
|
4761
|
+
});
|
4762
|
+
});
|
4763
|
+
return Promise.resolve(result);
|
4764
|
+
});
|
4765
|
+
}
|
4766
|
+
|
4717
4767
|
//**list wallet ledger */
|
4718
4768
|
async listWalletLedger(
|
4719
4769
|
session: Session,
|
package/dist/api.gen.d.ts
CHANGED
@@ -1001,6 +1001,17 @@ export interface ApiOssrsHttpCallbackResponse {
|
|
1001
1001
|
code?: number;
|
1002
1002
|
msg?: string;
|
1003
1003
|
}
|
1004
|
+
/** A list of users belonging to a channel, along with their role. */
|
1005
|
+
export interface ApiPTTChannelUser {
|
1006
|
+
channel_id?: string;
|
1007
|
+
id?: string;
|
1008
|
+
participant?: string;
|
1009
|
+
user_id?: string;
|
1010
|
+
}
|
1011
|
+
/** A list of users belonging to a channel, along with their role. */
|
1012
|
+
export interface ApiPTTChannelUserList {
|
1013
|
+
ptt_channel_users?: Array<ApiPTTChannelUser>;
|
1014
|
+
}
|
1004
1015
|
/** */
|
1005
1016
|
export interface ApiPermission {
|
1006
1017
|
active?: number;
|
@@ -1856,6 +1867,8 @@ export declare class MezonApi {
|
|
1856
1867
|
getPinMessagesList(bearerToken: string, messageId?: string, channelId?: string, clanId?: string, options?: any): Promise<ApiPinMessagesList>;
|
1857
1868
|
/** set notification user channel. */
|
1858
1869
|
createPinMessage(bearerToken: string, body: ApiPinMessageRequest, options?: any): Promise<ApiChannelMessageHeader>;
|
1870
|
+
/** List all users in ptt channel. */
|
1871
|
+
listPTTChannelUsers(bearerToken: string, clanId?: string, channelId?: string, channelType?: number, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiPTTChannelUserList>;
|
1859
1872
|
/** get pubkey */
|
1860
1873
|
getPubKeys(bearerToken: string, userIds?: Array<string>, options?: any): Promise<ApiGetPubKeysResponse>;
|
1861
1874
|
/** 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, ApiUpdateEventRequest, 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, 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 } from "./api.gen";
|
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, ApiUpdateEventRequest, 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, 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, ApiPTTChannelUserList } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -627,6 +627,8 @@ export declare class Client {
|
|
627
627
|
updateOnboardingStepByClanId(session: Session, clan_id: string, request: MezonUpdateOnboardingStepByClanIdBody): Promise<boolean>;
|
628
628
|
updateUserStatus(session: Session, request: ApiUserStatusUpdate): Promise<boolean>;
|
629
629
|
getUserStatus(session: Session): Promise<ApiUserStatus>;
|
630
|
+
/** List a ptt channel's users. */
|
631
|
+
listPTTChannelUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ApiPTTChannelUserList>;
|
630
632
|
listWalletLedger(session: Session, limit?: number, cursor?: string, transactionId?: string): Promise<ApiWalletLedgerList>;
|
631
633
|
listSdTopic(session: Session, channelId?: string, limit?: number): Promise<ApiSdTopicList>;
|
632
634
|
createSdTopic(session: Session, request: ApiSdTopicRequest): Promise<ApiSdTopic>;
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -4869,6 +4869,37 @@ var MezonApi = class {
|
|
4869
4869
|
)
|
4870
4870
|
]);
|
4871
4871
|
}
|
4872
|
+
/** List all users in ptt channel. */
|
4873
|
+
listPTTChannelUsers(bearerToken, clanId, channelId, channelType, limit, state, cursor, options = {}) {
|
4874
|
+
const urlPath = "/v2/ptt_channels/users";
|
4875
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4876
|
+
queryParams.set("clan_id", clanId);
|
4877
|
+
queryParams.set("channel_id", channelId);
|
4878
|
+
queryParams.set("channel_type", channelType);
|
4879
|
+
queryParams.set("limit", limit);
|
4880
|
+
queryParams.set("state", state);
|
4881
|
+
queryParams.set("cursor", cursor);
|
4882
|
+
let bodyJson = "";
|
4883
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4884
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4885
|
+
if (bearerToken) {
|
4886
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4887
|
+
}
|
4888
|
+
return Promise.race([
|
4889
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4890
|
+
if (response.status == 204) {
|
4891
|
+
return response;
|
4892
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4893
|
+
return response.json();
|
4894
|
+
} else {
|
4895
|
+
throw response;
|
4896
|
+
}
|
4897
|
+
}),
|
4898
|
+
new Promise(
|
4899
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4900
|
+
)
|
4901
|
+
]);
|
4902
|
+
}
|
4872
4903
|
/** get pubkey */
|
4873
4904
|
getPubKeys(bearerToken, userIds, options = {}) {
|
4874
4905
|
const urlPath = "/v2/pubkey";
|
@@ -10479,6 +10510,39 @@ var Client = class {
|
|
10479
10510
|
});
|
10480
10511
|
});
|
10481
10512
|
}
|
10513
|
+
/** List a ptt channel's users. */
|
10514
|
+
listPTTChannelUsers(session, clanId, channelId, channelType, state, limit, cursor) {
|
10515
|
+
return __async(this, null, function* () {
|
10516
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10517
|
+
yield this.sessionRefresh(session);
|
10518
|
+
}
|
10519
|
+
return this.apiClient.listPTTChannelUsers(
|
10520
|
+
session.token,
|
10521
|
+
clanId,
|
10522
|
+
channelId,
|
10523
|
+
channelType,
|
10524
|
+
limit,
|
10525
|
+
state,
|
10526
|
+
cursor
|
10527
|
+
).then((response) => {
|
10528
|
+
var result = {
|
10529
|
+
ptt_channel_users: []
|
10530
|
+
};
|
10531
|
+
if (response.ptt_channel_users == null) {
|
10532
|
+
return Promise.resolve(result);
|
10533
|
+
}
|
10534
|
+
response.ptt_channel_users.forEach((gu) => {
|
10535
|
+
result.ptt_channel_users.push({
|
10536
|
+
id: gu.id,
|
10537
|
+
channel_id: gu.channel_id,
|
10538
|
+
user_id: gu.user_id,
|
10539
|
+
participant: gu.participant
|
10540
|
+
});
|
10541
|
+
});
|
10542
|
+
return Promise.resolve(result);
|
10543
|
+
});
|
10544
|
+
});
|
10545
|
+
}
|
10482
10546
|
//**list wallet ledger */
|
10483
10547
|
listWalletLedger(session, limit, cursor, transactionId) {
|
10484
10548
|
return __async(this, null, function* () {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -4835,6 +4835,37 @@ var MezonApi = class {
|
|
4835
4835
|
)
|
4836
4836
|
]);
|
4837
4837
|
}
|
4838
|
+
/** List all users in ptt channel. */
|
4839
|
+
listPTTChannelUsers(bearerToken, clanId, channelId, channelType, limit, state, cursor, options = {}) {
|
4840
|
+
const urlPath = "/v2/ptt_channels/users";
|
4841
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4842
|
+
queryParams.set("clan_id", clanId);
|
4843
|
+
queryParams.set("channel_id", channelId);
|
4844
|
+
queryParams.set("channel_type", channelType);
|
4845
|
+
queryParams.set("limit", limit);
|
4846
|
+
queryParams.set("state", state);
|
4847
|
+
queryParams.set("cursor", cursor);
|
4848
|
+
let bodyJson = "";
|
4849
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4850
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4851
|
+
if (bearerToken) {
|
4852
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4853
|
+
}
|
4854
|
+
return Promise.race([
|
4855
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4856
|
+
if (response.status == 204) {
|
4857
|
+
return response;
|
4858
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4859
|
+
return response.json();
|
4860
|
+
} else {
|
4861
|
+
throw response;
|
4862
|
+
}
|
4863
|
+
}),
|
4864
|
+
new Promise(
|
4865
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4866
|
+
)
|
4867
|
+
]);
|
4868
|
+
}
|
4838
4869
|
/** get pubkey */
|
4839
4870
|
getPubKeys(bearerToken, userIds, options = {}) {
|
4840
4871
|
const urlPath = "/v2/pubkey";
|
@@ -10445,6 +10476,39 @@ var Client = class {
|
|
10445
10476
|
});
|
10446
10477
|
});
|
10447
10478
|
}
|
10479
|
+
/** List a ptt channel's users. */
|
10480
|
+
listPTTChannelUsers(session, clanId, channelId, channelType, state, limit, cursor) {
|
10481
|
+
return __async(this, null, function* () {
|
10482
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10483
|
+
yield this.sessionRefresh(session);
|
10484
|
+
}
|
10485
|
+
return this.apiClient.listPTTChannelUsers(
|
10486
|
+
session.token,
|
10487
|
+
clanId,
|
10488
|
+
channelId,
|
10489
|
+
channelType,
|
10490
|
+
limit,
|
10491
|
+
state,
|
10492
|
+
cursor
|
10493
|
+
).then((response) => {
|
10494
|
+
var result = {
|
10495
|
+
ptt_channel_users: []
|
10496
|
+
};
|
10497
|
+
if (response.ptt_channel_users == null) {
|
10498
|
+
return Promise.resolve(result);
|
10499
|
+
}
|
10500
|
+
response.ptt_channel_users.forEach((gu) => {
|
10501
|
+
result.ptt_channel_users.push({
|
10502
|
+
id: gu.id,
|
10503
|
+
channel_id: gu.channel_id,
|
10504
|
+
user_id: gu.user_id,
|
10505
|
+
participant: gu.participant
|
10506
|
+
});
|
10507
|
+
});
|
10508
|
+
return Promise.resolve(result);
|
10509
|
+
});
|
10510
|
+
});
|
10511
|
+
}
|
10448
10512
|
//**list wallet ledger */
|
10449
10513
|
listWalletLedger(session, limit, cursor, transactionId) {
|
10450
10514
|
return __async(this, null, function* () {
|