mezon-js 2.12.45 → 2.12.47

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 CHANGED
@@ -20,6 +20,8 @@ export interface ChannelUserListChannelUser {
20
20
  thread_id?: string;
21
21
  //User.
22
22
  user_id?: string;
23
+ //Added by
24
+ added_by?: string;
23
25
  }
24
26
 
25
27
  /** A single user-role pair. */
@@ -3289,6 +3291,21 @@ export interface ApiClanDiscoverRequest {
3289
3291
  page_number?: number;
3290
3292
  }
3291
3293
 
3294
+ /** */
3295
+ export interface ApiChannelMemberDetail {
3296
+ //
3297
+ added_by?: string;
3298
+ //
3299
+ member_id?: string;
3300
+ }
3301
+
3302
+ /** */
3303
+ export interface ApiChannelMemberList {
3304
+ //
3305
+ channel_members?: Array<ApiChannelMemberDetail>;
3306
+ }
3307
+
3308
+
3292
3309
  export class MezonApi {
3293
3310
  basePath: string;
3294
3311
  constructor(
@@ -11095,4 +11112,39 @@ export class MezonApi {
11095
11112
  ),
11096
11113
  ]);
11097
11114
  }
11115
+
11116
+ /** */
11117
+ listChannelMember(bearerToken: string,
11118
+ channelId?:string,
11119
+ clanId?:string,
11120
+ options: any = {}): Promise<ApiChannelMemberList> {
11121
+
11122
+ const urlPath = "/v2/listchannelmember";
11123
+ const queryParams = new Map<string, any>();
11124
+ queryParams.set("channel_id", channelId);
11125
+ queryParams.set("clan_id", clanId);
11126
+
11127
+ let bodyJson : string = "";
11128
+
11129
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
11130
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
11131
+ if (bearerToken) {
11132
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
11133
+ }
11134
+
11135
+ return Promise.race([
11136
+ fetch(fullUrl, fetchOptions).then((response) => {
11137
+ if (response.status == 204) {
11138
+ return response;
11139
+ } else if (response.status >= 200 && response.status < 300) {
11140
+ return response.json();
11141
+ } else {
11142
+ throw response;
11143
+ }
11144
+ }),
11145
+ new Promise((_, reject) =>
11146
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
11147
+ ),
11148
+ ]);
11149
+ }
11098
11150
  }
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
@@ -7,6 +7,7 @@ export interface ChannelUserListChannelUser {
7
7
  role_id?: Array<string>;
8
8
  thread_id?: string;
9
9
  user_id?: string;
10
+ added_by?: string;
10
11
  }
11
12
  /** A single user-role pair. */
12
13
  export interface ClanUserListClanUser {
@@ -1884,6 +1885,15 @@ export interface ApiClanDiscoverRequest {
1884
1885
  item_per_page?: number;
1885
1886
  page_number?: number;
1886
1887
  }
1888
+ /** */
1889
+ export interface ApiChannelMemberDetail {
1890
+ added_by?: string;
1891
+ member_id?: string;
1892
+ }
1893
+ /** */
1894
+ export interface ApiChannelMemberList {
1895
+ channel_members?: Array<ApiChannelMemberDetail>;
1896
+ }
1887
1897
  export declare class MezonApi {
1888
1898
  readonly serverKey: string;
1889
1899
  readonly timeoutMs: number;
@@ -2283,4 +2293,6 @@ export declare class MezonApi {
2283
2293
  unlockItem(bearerToken: string, body: ApiUnlockedItemRequest, options?: any): Promise<ApiUnlockedItemResponse>;
2284
2294
  /** For sale items */
2285
2295
  listForSaleItems(bearerToken: string, page?: number, options?: any): Promise<ApiForSaleItemList>;
2296
+ /** */
2297
+ listChannelMember(bearerToken: string, channelId?: string, clanId?: string, options?: any): Promise<ApiChannelMemberList>;
2286
2298
  }
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
  }
@@ -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
  };
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.12.45",
3
+ "version": "2.12.47",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },