mezon-js 2.7.65 → 2.7.67

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -343,6 +343,8 @@ export interface ApiChannelDescription {
343
343
  //creator ID.
344
344
  creator_id?: string;
345
345
  //
346
+ last_pin_message?: string;
347
+ //
346
348
  last_seen_message?: ApiChannelMessageHeader;
347
349
  //
348
350
  last_sent_message?: ApiChannelMessageHeader;
package/client.ts CHANGED
@@ -96,7 +96,8 @@ import {
96
96
  ApiChangeChannelPrivateRequest,
97
97
  ApiClanEmojiList,
98
98
  ApiClanEmojiCreateRequest,
99
- ApiChannelVoiceList
99
+ ApiChannelVoiceList,
100
+ MezonUpdateClanEmojiByIdBody
100
101
  } from "./api.gen";
101
102
 
102
103
  import { Session } from "./session";
@@ -2258,4 +2259,28 @@ async createClanEmoji(session: Session, request: ApiClanEmojiCreateRequest) {
2258
2259
  });
2259
2260
  }
2260
2261
 
2262
+ //**update clan emoji by id */
2263
+ async updateClanEmojiById(session :Session,id:string,request: MezonUpdateClanEmojiByIdBody) {
2264
+ if (this.autoRefreshSession && session.refresh_token &&
2265
+ session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2266
+ await this.sessionRefresh(session);
2267
+ }
2268
+
2269
+ return this.apiClient.updateClanEmojiById(session.token,id,request).then((response: any) => {
2270
+ return response !== undefined;
2271
+ });
2272
+ }
2273
+
2274
+ //**delete clan emoji by id */
2275
+ async deleteByIdClanEmoji(session:Session,id:string) {
2276
+ if (this.autoRefreshSession && session.refresh_token &&
2277
+ session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2278
+ await this.sessionRefresh(session);
2279
+ }
2280
+
2281
+ return this.apiClient.deleteByIdClanEmoji(session.token,id).then((response: any) => {
2282
+ return response !== undefined;
2283
+ });
2284
+ }
2285
+
2261
2286
  };
package/dist/api.gen.d.ts CHANGED
@@ -197,6 +197,7 @@ export interface ApiChannelDescription {
197
197
  clan_id?: string;
198
198
  count_mess_unread?: number;
199
199
  creator_id?: string;
200
+ last_pin_message?: string;
200
201
  last_seen_message?: ApiChannelMessageHeader;
201
202
  last_sent_message?: ApiChannelMessageHeader;
202
203
  meeting_code?: string;
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, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiCreateWebhookRequest, ApiWebhookResponse, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiList, ApiClanEmojiCreateRequest, ApiChannelVoiceList } from "./api.gen";
16
+ import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiCreateWebhookRequest, ApiWebhookResponse, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiList, ApiClanEmojiCreateRequest, ApiChannelVoiceList, MezonUpdateClanEmojiByIdBody } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -582,4 +582,6 @@ export declare class Client {
582
582
  listClanEmoji(session: Session, clan_id: string): Promise<ApiClanEmojiList>;
583
583
  /** create clan emoji */
584
584
  createClanEmoji(session: Session, request: ApiClanEmojiCreateRequest): Promise<boolean>;
585
+ updateClanEmojiById(session: Session, id: string, request: MezonUpdateClanEmojiByIdBody): Promise<boolean>;
586
+ deleteByIdClanEmoji(session: Session, id: string): Promise<boolean>;
585
587
  }
@@ -4809,6 +4809,12 @@ var _DefaultSocket = class _DefaultSocket {
4809
4809
  return response.last_seen_message_event;
4810
4810
  });
4811
4811
  }
4812
+ writeLastPinMessage(channel_id, mode, message_id, timestamp) {
4813
+ return __async(this, null, function* () {
4814
+ const response = yield this.send({ last_pin_message_event: { channel_id, mode, message_id, timestamp } });
4815
+ return response.last_pin_message_event;
4816
+ });
4817
+ }
4812
4818
  writeVoiceJoined(id, clanId, clanName, voiceChannelId, voiceChannelLabel, participant, lastScreenshot) {
4813
4819
  return __async(this, null, function* () {
4814
4820
  const response = yield this.send({ voice_joined_event: { clan_id: clanId, clan_name: clanName, id, participant, voice_channel_id: voiceChannelId, voice_channel_label: voiceChannelLabel, last_screenshot: lastScreenshot } });
@@ -6469,4 +6475,26 @@ var Client = class {
6469
6475
  });
6470
6476
  });
6471
6477
  }
6478
+ //**update clan emoji by id */
6479
+ updateClanEmojiById(session, id, request) {
6480
+ return __async(this, null, function* () {
6481
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6482
+ yield this.sessionRefresh(session);
6483
+ }
6484
+ return this.apiClient.updateClanEmojiById(session.token, id, request).then((response) => {
6485
+ return response !== void 0;
6486
+ });
6487
+ });
6488
+ }
6489
+ //**delete clan emoji by id */
6490
+ deleteByIdClanEmoji(session, id) {
6491
+ return __async(this, null, function* () {
6492
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6493
+ yield this.sessionRefresh(session);
6494
+ }
6495
+ return this.apiClient.deleteByIdClanEmoji(session.token, id).then((response) => {
6496
+ return response !== void 0;
6497
+ });
6498
+ });
6499
+ }
6472
6500
  };
@@ -4780,6 +4780,12 @@ var _DefaultSocket = class _DefaultSocket {
4780
4780
  return response.last_seen_message_event;
4781
4781
  });
4782
4782
  }
4783
+ writeLastPinMessage(channel_id, mode, message_id, timestamp) {
4784
+ return __async(this, null, function* () {
4785
+ const response = yield this.send({ last_pin_message_event: { channel_id, mode, message_id, timestamp } });
4786
+ return response.last_pin_message_event;
4787
+ });
4788
+ }
4783
4789
  writeVoiceJoined(id, clanId, clanName, voiceChannelId, voiceChannelLabel, participant, lastScreenshot) {
4784
4790
  return __async(this, null, function* () {
4785
4791
  const response = yield this.send({ voice_joined_event: { clan_id: clanId, clan_name: clanName, id, participant, voice_channel_id: voiceChannelId, voice_channel_label: voiceChannelLabel, last_screenshot: lastScreenshot } });
@@ -6440,6 +6446,28 @@ var Client = class {
6440
6446
  });
6441
6447
  });
6442
6448
  }
6449
+ //**update clan emoji by id */
6450
+ updateClanEmojiById(session, id, request) {
6451
+ return __async(this, null, function* () {
6452
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6453
+ yield this.sessionRefresh(session);
6454
+ }
6455
+ return this.apiClient.updateClanEmojiById(session.token, id, request).then((response) => {
6456
+ return response !== void 0;
6457
+ });
6458
+ });
6459
+ }
6460
+ //**delete clan emoji by id */
6461
+ deleteByIdClanEmoji(session, id) {
6462
+ return __async(this, null, function* () {
6463
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6464
+ yield this.sessionRefresh(session);
6465
+ }
6466
+ return this.apiClient.deleteByIdClanEmoji(session.token, id).then((response) => {
6467
+ return response !== void 0;
6468
+ });
6469
+ });
6470
+ }
6443
6471
  };
6444
6472
  export {
6445
6473
  ChannelStreamMode,
package/dist/socket.d.ts CHANGED
@@ -72,6 +72,15 @@ interface ChannelLeave {
72
72
  };
73
73
  }
74
74
  /** Last seen message by user */
75
+ export interface LastPinMessageEvent {
76
+ /** The channel this message belongs to. */
77
+ channel_id: string;
78
+ mode: number;
79
+ channel_label: string;
80
+ /** The unique ID of this message. */
81
+ message_id: string;
82
+ }
83
+ /** Last seen message by user */
75
84
  export interface LastSeenMessageEvent {
76
85
  /** The channel this message belongs to. */
77
86
  channel_id: string;
@@ -402,6 +411,8 @@ export interface Socket {
402
411
  writeMessageReaction(id: string, channel_id: string, mode: number, message_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<MessageReactionEvent>;
403
412
  /** Send last seen message */
404
413
  writeLastSeenMessage(channel_id: string, mode: number, message_id: string, timestamp: string): Promise<LastSeenMessageEvent>;
414
+ /** Send last pin message */
415
+ writeLastPinMessage(channel_id: string, mode: number, message_id: string, timestamp: string): Promise<LastPinMessageEvent>;
405
416
  /** send voice joined */
406
417
  writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
407
418
  /** send voice leaved */
@@ -504,6 +515,7 @@ export declare class DefaultSocket implements Socket {
504
515
  writeMessageReaction(id: string, channel_id: string, mode: number, message_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<MessageReactionEvent>;
505
516
  writeMessageTyping(channel_id: string, mode: number): Promise<MessageTypingEvent>;
506
517
  writeLastSeenMessage(channel_id: string, mode: number, message_id: string, timestamp: string): Promise<LastSeenMessageEvent>;
518
+ writeLastPinMessage(channel_id: string, mode: number, message_id: string, timestamp: string): Promise<LastPinMessageEvent>;
507
519
  writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
508
520
  writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
509
521
  private pingPong;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.7.65",
3
+ "version": "2.7.67",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -88,6 +88,18 @@ interface ChannelLeave {
88
88
  };
89
89
  }
90
90
 
91
+ /** Last seen message by user */
92
+ export interface LastPinMessageEvent {
93
+ /** The channel this message belongs to. */
94
+ channel_id:string;
95
+ // The mode
96
+ mode: number;
97
+ // The channel label
98
+ channel_label: string;
99
+ /** The unique ID of this message. */
100
+ message_id: string;
101
+ }
102
+
91
103
  /** Last seen message by user */
92
104
  export interface LastSeenMessageEvent {
93
105
  /** The channel this message belongs to. */
@@ -555,6 +567,9 @@ export interface Socket {
555
567
  /** Send last seen message */
556
568
  writeLastSeenMessage(channel_id: string, mode: number, message_id: string, timestamp: string) : Promise<LastSeenMessageEvent>;
557
569
 
570
+ /** Send last pin message */
571
+ writeLastPinMessage(channel_id: string, mode: number, message_id: string, timestamp: string) : Promise<LastPinMessageEvent>;
572
+
558
573
  /** send voice joined */
559
574
  writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string) : Promise<VoiceJoinedEvent>;
560
575
 
@@ -1054,6 +1069,11 @@ export class DefaultSocket implements Socket {
1054
1069
  return response.last_seen_message_event
1055
1070
  }
1056
1071
 
1072
+ async writeLastPinMessage(channel_id: string, mode: number, message_id: string, timestamp: string) : Promise<LastPinMessageEvent> {
1073
+ const response = await this.send({last_pin_message_event: {channel_id: channel_id, mode: mode, message_id: message_id, timestamp: timestamp}});
1074
+ return response.last_pin_message_event
1075
+ }
1076
+
1057
1077
  async writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string) : Promise<VoiceJoinedEvent> {
1058
1078
  const response = await this.send({voice_joined_event: {clan_id: clanId, clan_name: clanName, id: id, participant: participant, voice_channel_id: voiceChannelId, voice_channel_label: voiceChannelLabel, last_screenshot: lastScreenshot}});
1059
1079
  return response.voice_joined_event