mezon-js 2.9.36 → 2.9.38

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -1631,6 +1631,10 @@ export interface ApiPinMessage {
1631
1631
  channel_id?: string;
1632
1632
  //
1633
1633
  content?: string;
1634
+ //The UNIX time (for gRPC clients) or ISO string (for REST clients) when the message was created.
1635
+ create_time?: string;
1636
+ //
1637
+ create_time_seconds?: number;
1634
1638
  //
1635
1639
  id?: string;
1636
1640
  //
@@ -4109,11 +4113,10 @@ export class MezonApi {
4109
4113
  }
4110
4114
 
4111
4115
  /** Leave a channel the user is a member of. */
4112
- leaveChannel(
4113
- bearerToken: string,
4114
- channelId: string,
4115
- options: any = {}
4116
- ): Promise<any> {
4116
+ leaveThread(bearerToken: string,
4117
+ channelId:string,
4118
+ options: any = {}): Promise<any> {
4119
+
4117
4120
  if (channelId === null || channelId === undefined) {
4118
4121
  throw new Error(
4119
4122
  "'channelId' is a required parameter but is null or undefined."
package/client.ts CHANGED
@@ -123,6 +123,7 @@ import {
123
123
  ApiMarkAsReadRequest,
124
124
  ApiChannelCanvasListResponse,
125
125
  ApiEditChannelCanvasRequest,
126
+ ApiChannelSettingListResponse,
126
127
  } from "./api.gen";
127
128
 
128
129
  import { Session } from "./session";
@@ -3926,11 +3927,11 @@ export class Client {
3926
3927
  /** List Threads. */
3927
3928
  async listThreadDescs(
3928
3929
  session: Session,
3929
- channelId:string,
3930
- limit?:number,
3931
- state?:number,
3932
- clanId?:string,
3933
- threadId?: string,
3930
+ channelId: string,
3931
+ limit?: number,
3932
+ state?: number,
3933
+ clanId?: string,
3934
+ threadId?: string
3934
3935
  ): Promise<ApiChannelDescList> {
3935
3936
  if (
3936
3937
  this.autoRefreshSession &&
@@ -3941,14 +3942,7 @@ export class Client {
3941
3942
  }
3942
3943
 
3943
3944
  return this.apiClient
3944
- .listThreadDescs(
3945
- session.token,
3946
- channelId,
3947
- limit,
3948
- state,
3949
- clanId,
3950
- threadId
3951
- )
3945
+ .listThreadDescs(session.token, channelId, limit, state, clanId, threadId)
3952
3946
  .then((response: ApiChannelDescList) => {
3953
3947
  var result: ApiChannelDescList = {
3954
3948
  channeldesc: [],
@@ -3961,7 +3955,23 @@ export class Client {
3961
3955
  result.channeldesc = response.channeldesc;
3962
3956
  return Promise.resolve(result);
3963
3957
  });
3964
- }
3958
+ }
3959
+
3960
+ async leaveThread(session: Session, channelId: string): Promise<any> {
3961
+ if (
3962
+ this.autoRefreshSession &&
3963
+ session.refresh_token &&
3964
+ session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
3965
+ ) {
3966
+ await this.sessionRefresh(session);
3967
+ }
3968
+
3969
+ return this.apiClient
3970
+ .leaveThread(session.token, channelId)
3971
+ .then((response: any) => {
3972
+ return Promise.resolve(response);
3973
+ });
3974
+ }
3965
3975
 
3966
3976
  async getChannelSettingInClan(
3967
3977
  session: Session,
@@ -3974,7 +3984,7 @@ export class Client {
3974
3984
  type?: number,
3975
3985
  limit?: number,
3976
3986
  page?: number
3977
- ): Promise<any> {
3987
+ ): Promise<ApiChannelSettingListResponse> {
3978
3988
  if (
3979
3989
  this.autoRefreshSession &&
3980
3990
  session.refresh_token &&
@@ -4003,10 +4013,10 @@ export class Client {
4003
4013
 
4004
4014
  async getChannelCanvasList(
4005
4015
  session: Session,
4006
- channelId:string,
4007
- clanId?:string,
4008
- limit?:number,
4009
- page?:number,
4016
+ channelId: string,
4017
+ clanId?: string,
4018
+ limit?: number,
4019
+ page?: number
4010
4020
  ): Promise<any> {
4011
4021
  if (
4012
4022
  this.autoRefreshSession &&
@@ -4017,13 +4027,7 @@ export class Client {
4017
4027
  }
4018
4028
 
4019
4029
  return this.apiClient
4020
- .getChannelCanvasList(
4021
- session.token,
4022
- channelId,
4023
- clanId,
4024
- limit,
4025
- page
4026
- )
4030
+ .getChannelCanvasList(session.token, channelId, clanId, limit, page)
4027
4031
  .then((response: ApiChannelCanvasListResponse) => {
4028
4032
  var result: ApiChannelCanvasListResponse = {
4029
4033
  channel_canvases: [],
@@ -4042,9 +4046,9 @@ export class Client {
4042
4046
 
4043
4047
  async getChannelCanvasDetail(
4044
4048
  session: Session,
4045
- id:string,
4046
- clanId?:string,
4047
- channelId?:string,
4049
+ id: string,
4050
+ clanId?: string,
4051
+ channelId?: string
4048
4052
  ): Promise<any> {
4049
4053
  if (
4050
4054
  this.autoRefreshSession &&
@@ -4055,12 +4059,7 @@ export class Client {
4055
4059
  }
4056
4060
 
4057
4061
  return this.apiClient
4058
- .getChannelCanvasDetail(
4059
- session.token,
4060
- id,
4061
- clanId,
4062
- channelId,
4063
- )
4062
+ .getChannelCanvasDetail(session.token, id, clanId, channelId)
4064
4063
  .then((response: any) => {
4065
4064
  return Promise.resolve(response);
4066
4065
  });
package/dist/api.gen.d.ts CHANGED
@@ -947,6 +947,8 @@ export interface ApiPinMessage {
947
947
  avatar?: string;
948
948
  channel_id?: string;
949
949
  content?: string;
950
+ create_time?: string;
951
+ create_time_seconds?: number;
950
952
  id?: string;
951
953
  message_id?: string;
952
954
  sender_id?: string;
@@ -1380,7 +1382,7 @@ export declare class MezonApi {
1380
1382
  /** List all attachment that are part of a channel. */
1381
1383
  listChannelAttachment(bearerToken: string, channelId: string, clanId?: string, fileType?: string, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiChannelAttachmentList>;
1382
1384
  /** Leave a channel the user is a member of. */
1383
- leaveChannel(bearerToken: string, channelId: string, options?: any): Promise<any>;
1385
+ leaveThread(bearerToken: string, channelId: string, options?: any): Promise<any>;
1384
1386
  /** Kick a set of users from a channel. */
1385
1387
  removeChannelUsers(bearerToken: string, channelId: string, userIds?: Array<string>, options?: any): Promise<any>;
1386
1388
  /** List all users that are part of a channel. */
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 } 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 } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -579,7 +579,8 @@ export declare class Client {
579
579
  markAsRead(session: Session, request: ApiMarkAsReadRequest): Promise<any>;
580
580
  /** List Threads. */
581
581
  listThreadDescs(session: Session, channelId: string, limit?: number, state?: number, clanId?: string, threadId?: string): Promise<ApiChannelDescList>;
582
- getChannelSettingInClan(session: Session, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number): Promise<any>;
582
+ leaveThread(session: Session, channelId: string): Promise<any>;
583
+ getChannelSettingInClan(session: Session, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number): Promise<ApiChannelSettingListResponse>;
583
584
  getChannelCanvasList(session: Session, channelId: string, clanId?: string, limit?: number, page?: number): Promise<any>;
584
585
  getChannelCanvasDetail(session: Session, id: string, clanId?: string, channelId?: string): Promise<any>;
585
586
  editChannelCanvases(session: Session, request: ApiEditChannelCanvasRequest): Promise<any>;
@@ -2172,7 +2172,7 @@ var MezonApi = class {
2172
2172
  ]);
2173
2173
  }
2174
2174
  /** Leave a channel the user is a member of. */
2175
- leaveChannel(bearerToken, channelId, options = {}) {
2175
+ leaveThread(bearerToken, channelId, options = {}) {
2176
2176
  if (channelId === null || channelId === void 0) {
2177
2177
  throw new Error(
2178
2178
  "'channelId' is a required parameter but is null or undefined."
@@ -8636,14 +8636,7 @@ var Client = class {
8636
8636
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8637
8637
  yield this.sessionRefresh(session);
8638
8638
  }
8639
- return this.apiClient.listThreadDescs(
8640
- session.token,
8641
- channelId,
8642
- limit,
8643
- state,
8644
- clanId,
8645
- threadId
8646
- ).then((response) => {
8639
+ return this.apiClient.listThreadDescs(session.token, channelId, limit, state, clanId, threadId).then((response) => {
8647
8640
  var result = {
8648
8641
  channeldesc: []
8649
8642
  };
@@ -8655,6 +8648,16 @@ var Client = class {
8655
8648
  });
8656
8649
  });
8657
8650
  }
8651
+ leaveThread(session, channelId) {
8652
+ return __async(this, null, function* () {
8653
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8654
+ yield this.sessionRefresh(session);
8655
+ }
8656
+ return this.apiClient.leaveThread(session.token, channelId).then((response) => {
8657
+ return Promise.resolve(response);
8658
+ });
8659
+ });
8660
+ }
8658
8661
  getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page) {
8659
8662
  return __async(this, null, function* () {
8660
8663
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
@@ -8681,13 +8684,7 @@ var Client = class {
8681
8684
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8682
8685
  yield this.sessionRefresh(session);
8683
8686
  }
8684
- return this.apiClient.getChannelCanvasList(
8685
- session.token,
8686
- channelId,
8687
- clanId,
8688
- limit,
8689
- page
8690
- ).then((response) => {
8687
+ return this.apiClient.getChannelCanvasList(session.token, channelId, clanId, limit, page).then((response) => {
8691
8688
  var result = {
8692
8689
  channel_canvases: []
8693
8690
  };
@@ -8706,12 +8703,7 @@ var Client = class {
8706
8703
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8707
8704
  yield this.sessionRefresh(session);
8708
8705
  }
8709
- return this.apiClient.getChannelCanvasDetail(
8710
- session.token,
8711
- id,
8712
- clanId,
8713
- channelId
8714
- ).then((response) => {
8706
+ return this.apiClient.getChannelCanvasDetail(session.token, id, clanId, channelId).then((response) => {
8715
8707
  return Promise.resolve(response);
8716
8708
  });
8717
8709
  });
@@ -2143,7 +2143,7 @@ var MezonApi = class {
2143
2143
  ]);
2144
2144
  }
2145
2145
  /** Leave a channel the user is a member of. */
2146
- leaveChannel(bearerToken, channelId, options = {}) {
2146
+ leaveThread(bearerToken, channelId, options = {}) {
2147
2147
  if (channelId === null || channelId === void 0) {
2148
2148
  throw new Error(
2149
2149
  "'channelId' is a required parameter but is null or undefined."
@@ -8607,14 +8607,7 @@ var Client = class {
8607
8607
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8608
8608
  yield this.sessionRefresh(session);
8609
8609
  }
8610
- return this.apiClient.listThreadDescs(
8611
- session.token,
8612
- channelId,
8613
- limit,
8614
- state,
8615
- clanId,
8616
- threadId
8617
- ).then((response) => {
8610
+ return this.apiClient.listThreadDescs(session.token, channelId, limit, state, clanId, threadId).then((response) => {
8618
8611
  var result = {
8619
8612
  channeldesc: []
8620
8613
  };
@@ -8626,6 +8619,16 @@ var Client = class {
8626
8619
  });
8627
8620
  });
8628
8621
  }
8622
+ leaveThread(session, channelId) {
8623
+ return __async(this, null, function* () {
8624
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8625
+ yield this.sessionRefresh(session);
8626
+ }
8627
+ return this.apiClient.leaveThread(session.token, channelId).then((response) => {
8628
+ return Promise.resolve(response);
8629
+ });
8630
+ });
8631
+ }
8629
8632
  getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page) {
8630
8633
  return __async(this, null, function* () {
8631
8634
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
@@ -8652,13 +8655,7 @@ var Client = class {
8652
8655
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8653
8656
  yield this.sessionRefresh(session);
8654
8657
  }
8655
- return this.apiClient.getChannelCanvasList(
8656
- session.token,
8657
- channelId,
8658
- clanId,
8659
- limit,
8660
- page
8661
- ).then((response) => {
8658
+ return this.apiClient.getChannelCanvasList(session.token, channelId, clanId, limit, page).then((response) => {
8662
8659
  var result = {
8663
8660
  channel_canvases: []
8664
8661
  };
@@ -8677,12 +8674,7 @@ var Client = class {
8677
8674
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8678
8675
  yield this.sessionRefresh(session);
8679
8676
  }
8680
- return this.apiClient.getChannelCanvasDetail(
8681
- session.token,
8682
- id,
8683
- clanId,
8684
- channelId
8685
- ).then((response) => {
8677
+ return this.apiClient.getChannelCanvasDetail(session.token, id, clanId, channelId).then((response) => {
8686
8678
  return Promise.resolve(response);
8687
8679
  });
8688
8680
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.9.36",
4
+ "version": "2.9.38",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"