mezon-js 2.7.9 → 2.7.11

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -213,7 +213,7 @@ export interface ApiChannelDescription {
213
213
  //
214
214
  category_name?: string;
215
215
  //
216
- channel_avatar?: string;
216
+ channel_avatar?: Array<string>;
217
217
  //The channel this message belongs to.
218
218
  channel_id?: string;
219
219
  //
@@ -233,7 +233,7 @@ export interface ApiChannelDescription {
233
233
  //The channel type.
234
234
  type?: number;
235
235
  //
236
- user_id?: string;
236
+ user_id?: Array<string>;
237
237
  }
238
238
 
239
239
  /** A message sent on a channel. */
@@ -671,6 +671,8 @@ export interface ApiRole {
671
671
  //
672
672
  allow_mention?: number;
673
673
  //
674
+ channel_ids?: Array<string>;
675
+ //
674
676
  clan_id?: string;
675
677
  //
676
678
  color?: string;
@@ -685,6 +687,8 @@ export interface ApiRole {
685
687
  //
686
688
  permission_list?: ApiPermissionList;
687
689
  //
690
+ role_channel_active?: number;
691
+ //
688
692
  role_icon?: string;
689
693
  //
690
694
  role_user_list?: ApiRoleUserList;
@@ -692,10 +696,6 @@ export interface ApiRole {
692
696
  slug?: string;
693
697
  //
694
698
  title?: string;
695
- //
696
- role_channel_active?: string;
697
- //
698
- channel_ids?: Array<string>;
699
699
  }
700
700
 
701
701
  /** A list of role description, usually a result of a list operation. */
@@ -3419,7 +3419,7 @@ return Promise.race([
3419
3419
  getListPermission(bearerToken: string,
3420
3420
  options: any = {}): Promise<ApiPermissionList> {
3421
3421
 
3422
- const urlPath = "/v2/listpermission";
3422
+ const urlPath = "/v2/permissions";
3423
3423
  const queryParams = new Map<string, any>();
3424
3424
 
3425
3425
  let bodyJson : string = "";
package/dist/api.gen.d.ts CHANGED
@@ -123,7 +123,7 @@ export interface ApiChannelDescList {
123
123
  export interface ApiChannelDescription {
124
124
  category_id?: string;
125
125
  category_name?: string;
126
- channel_avatar?: string;
126
+ channel_avatar?: Array<string>;
127
127
  channel_id?: string;
128
128
  channel_label?: string;
129
129
  channel_private?: number;
@@ -133,7 +133,7 @@ export interface ApiChannelDescription {
133
133
  last_sent_message?: ApiChannelMessageHeader;
134
134
  parrent_id?: string;
135
135
  type?: number;
136
- user_id?: string;
136
+ user_id?: Array<string>;
137
137
  }
138
138
  /** A message sent on a channel. */
139
139
  export interface ApiChannelMessage {
@@ -387,6 +387,7 @@ export interface ApiReadStorageObjectsRequest {
387
387
  export interface ApiRole {
388
388
  active?: number;
389
389
  allow_mention?: number;
390
+ channel_ids?: Array<string>;
390
391
  clan_id?: string;
391
392
  color?: string;
392
393
  creator_id?: string;
@@ -394,12 +395,11 @@ export interface ApiRole {
394
395
  display_online?: number;
395
396
  id?: string;
396
397
  permission_list?: ApiPermissionList;
398
+ role_channel_active?: number;
397
399
  role_icon?: string;
398
400
  role_user_list?: ApiRoleUserList;
399
401
  slug?: string;
400
402
  title?: string;
401
- role_channel_active?: string;
402
- channel_ids?: Array<string>;
403
403
  }
404
404
  /** A list of role description, usually a result of a list operation. */
405
405
  export interface ApiRoleList {
@@ -2572,7 +2572,7 @@ var MezonApi = class {
2572
2572
  }
2573
2573
  /** */
2574
2574
  getListPermission(bearerToken, options = {}) {
2575
- const urlPath = "/v2/listpermission";
2575
+ const urlPath = "/v2/permissions";
2576
2576
  const queryParams = /* @__PURE__ */ new Map();
2577
2577
  let bodyJson = "";
2578
2578
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -3592,8 +3592,6 @@ var _DefaultSocket = class _DefaultSocket {
3592
3592
  this.onmessagetyping(message.message_typing_event);
3593
3593
  } else if (message.message_reaction_event) {
3594
3594
  this.onmessagereaction(message.message_reaction_event);
3595
- } else if (message.message_deleted_event) {
3596
- this.onmessagedeleted(message.message_deleted_event);
3597
3595
  } else if (message.channel_presence_event) {
3598
3596
  this.onchannelpresence(message.channel_presence_event);
3599
3597
  } else if (message.party_data) {
@@ -3681,11 +3679,6 @@ var _DefaultSocket = class _DefaultSocket {
3681
3679
  console.log(messagereaction);
3682
3680
  }
3683
3681
  }
3684
- onmessagedeleted(messagedeleted) {
3685
- if (this.verbose && window && window.console) {
3686
- console.log(messagedeleted);
3687
- }
3688
- }
3689
3682
  onchannelmessage(channelMessage) {
3690
3683
  if (this.verbose && window && window.console) {
3691
3684
  console.log(channelMessage);
@@ -3938,12 +3931,6 @@ var _DefaultSocket = class _DefaultSocket {
3938
3931
  return response.message_reaction_event;
3939
3932
  });
3940
3933
  }
3941
- writeMessageDeleted(channel_id, channel_label, mode, message_id) {
3942
- return __async(this, null, function* () {
3943
- const response = yield this.send({ message_deleted_event: { channel_id, channel_label, mode, message_id } });
3944
- return response.message_deleted_event;
3945
- });
3946
- }
3947
3934
  writeMessageTyping(channel_id, channel_label, mode) {
3948
3935
  return __async(this, null, function* () {
3949
3936
  const response = yield this.send({ message_typing_event: { channel_id, channel_label, mode } });
@@ -2544,7 +2544,7 @@ var MezonApi = class {
2544
2544
  }
2545
2545
  /** */
2546
2546
  getListPermission(bearerToken, options = {}) {
2547
- const urlPath = "/v2/listpermission";
2547
+ const urlPath = "/v2/permissions";
2548
2548
  const queryParams = /* @__PURE__ */ new Map();
2549
2549
  let bodyJson = "";
2550
2550
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -3564,8 +3564,6 @@ var _DefaultSocket = class _DefaultSocket {
3564
3564
  this.onmessagetyping(message.message_typing_event);
3565
3565
  } else if (message.message_reaction_event) {
3566
3566
  this.onmessagereaction(message.message_reaction_event);
3567
- } else if (message.message_deleted_event) {
3568
- this.onmessagedeleted(message.message_deleted_event);
3569
3567
  } else if (message.channel_presence_event) {
3570
3568
  this.onchannelpresence(message.channel_presence_event);
3571
3569
  } else if (message.party_data) {
@@ -3653,11 +3651,6 @@ var _DefaultSocket = class _DefaultSocket {
3653
3651
  console.log(messagereaction);
3654
3652
  }
3655
3653
  }
3656
- onmessagedeleted(messagedeleted) {
3657
- if (this.verbose && window && window.console) {
3658
- console.log(messagedeleted);
3659
- }
3660
- }
3661
3654
  onchannelmessage(channelMessage) {
3662
3655
  if (this.verbose && window && window.console) {
3663
3656
  console.log(channelMessage);
@@ -3910,12 +3903,6 @@ var _DefaultSocket = class _DefaultSocket {
3910
3903
  return response.message_reaction_event;
3911
3904
  });
3912
3905
  }
3913
- writeMessageDeleted(channel_id, channel_label, mode, message_id) {
3914
- return __async(this, null, function* () {
3915
- const response = yield this.send({ message_deleted_event: { channel_id, channel_label, mode, message_id } });
3916
- return response.message_deleted_event;
3917
- });
3918
- }
3919
3906
  writeMessageTyping(channel_id, channel_label, mode) {
3920
3907
  return __async(this, null, function* () {
3921
3908
  const response = yield this.send({ message_typing_event: { channel_id, channel_label, mode } });
package/dist/socket.d.ts CHANGED
@@ -122,17 +122,6 @@ export interface MessageAttachmentEvent {
122
122
  height?: number;
123
123
  }
124
124
  /** User is delete to message */
125
- export interface MessageDeletedEvent {
126
- /** The channel this message belongs to. */
127
- channel_id: string;
128
- mode: number;
129
- channel_label: string;
130
- /** The message that user react */
131
- message_id: string;
132
- /** Message sender, usually a user ID. */
133
- deletor: string;
134
- }
135
- /** User is delete to message */
136
125
  export interface MessageRefEvent {
137
126
  /** The channel this message belongs to. */
138
127
  channel_id: string;
@@ -555,8 +544,6 @@ export interface Socket {
555
544
  writeMessageTyping(channel_id: string, channel_label: string, mode: number): Promise<MessageTypingEvent>;
556
545
  /** Send message reaction */
557
546
  writeMessageReaction(id: string, channel_id: string, channel_label: string, mode: number, message_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<MessageReactionEvent>;
558
- /** Send message mention */
559
- writeMessageDeleted(channel_id: string, channel_label: string, mode: number, message_id: string, deletor: string): Promise<MessageDeletedEvent>;
560
547
  /** Send last seen message */
561
548
  writeLastSeenMessage(channel_id: string, channel_label: string, mode: number, message_id: string, timestamp: string): Promise<LastSeenMessageEvent>;
562
549
  /** send voice joined */
@@ -600,8 +587,6 @@ export interface Socket {
600
587
  onmessagetyping: (messageTypingEvent: MessageTypingEvent) => void;
601
588
  /** Receive reaction event */
602
589
  onmessagereaction: (messageReactionEvent: MessageReactionEvent) => void;
603
- /** Receive deleted message */
604
- onmessagedeleted: (messageDeletedEvent: MessageDeletedEvent) => void;
605
590
  /** Receive channel presence updates. */
606
591
  onchannelpresence: (channelPresence: ChannelPresenceEvent) => void;
607
592
  onvoicejoined: (voiceParticipant: VoiceJoinedEvent) => void;
@@ -642,7 +627,6 @@ export declare class DefaultSocket implements Socket {
642
627
  onerror(evt: Event): void;
643
628
  onmessagetyping(messagetyping: MessageTypingEvent): void;
644
629
  onmessagereaction(messagereaction: MessageReactionEvent): void;
645
- onmessagedeleted(messagedeleted: MessageDeletedEvent): void;
646
630
  onchannelmessage(channelMessage: ChannelMessageEvent): void;
647
631
  onchannelpresence(channelPresence: ChannelPresenceEvent): void;
648
632
  onnotification(notification: Notification): void;
@@ -682,7 +666,6 @@ export declare class DefaultSocket implements Socket {
682
666
  updateStatus(status?: string): Promise<void>;
683
667
  writeChatMessage(clan_id: string, channel_id: string, channel_label: string, mode: number, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>): Promise<ChannelMessageAck>;
684
668
  writeMessageReaction(id: string, channel_id: string, channel_label: string, mode: number, message_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<MessageReactionEvent>;
685
- writeMessageDeleted(channel_id: string, channel_label: string, mode: number, message_id: string): Promise<MessageDeletedEvent>;
686
669
  writeMessageTyping(channel_id: string, channel_label: string, mode: number): Promise<MessageTypingEvent>;
687
670
  writeLastSeenMessage(channel_id: string, channel_label: string, mode: number, message_id: string, timestamp: string): Promise<LastSeenMessageEvent>;
688
671
  writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.7.9",
3
+ "version": "2.7.11",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -164,21 +164,6 @@ export interface MessageAttachmentEvent {
164
164
  height?: number;
165
165
  }
166
166
 
167
- /** User is delete to message */
168
- export interface MessageDeletedEvent {
169
- /** The channel this message belongs to. */
170
- channel_id:string;
171
- // The mode
172
- mode: number;
173
- // The channel label
174
- channel_label: string;
175
- /** The message that user react */
176
- message_id: string;
177
- /** Message sender, usually a user ID. */
178
- deletor: string;
179
- }
180
-
181
-
182
167
  /** User is delete to message */
183
168
  export interface MessageRefEvent {
184
169
  /** The channel this message belongs to. */
@@ -715,9 +700,6 @@ export interface Socket {
715
700
  /** Send message reaction */
716
701
  writeMessageReaction(id: string, channel_id: string, channel_label: string, mode: number, message_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean) : Promise<MessageReactionEvent>;
717
702
 
718
- /** Send message mention */
719
- writeMessageDeleted(channel_id: string, channel_label: string, mode: number, message_id: string, deletor: string) : Promise<MessageDeletedEvent>;
720
-
721
703
  /** Send last seen message */
722
704
  writeLastSeenMessage(channel_id: string, channel_label: string, mode: number, message_id: string, timestamp: string) : Promise<LastSeenMessageEvent>;
723
705
 
@@ -780,9 +762,6 @@ export interface Socket {
780
762
  /** Receive reaction event */
781
763
  onmessagereaction: (messageReactionEvent: MessageReactionEvent) => void;
782
764
 
783
- /** Receive deleted message */
784
- onmessagedeleted: (messageDeletedEvent: MessageDeletedEvent) => void;
785
-
786
765
  /** Receive channel presence updates. */
787
766
  onchannelpresence: (channelPresence: ChannelPresenceEvent) => void;
788
767
 
@@ -920,8 +899,6 @@ export class DefaultSocket implements Socket {
920
899
  this.onmessagetyping(<MessageTypingEvent>message.message_typing_event);
921
900
  } else if (message.message_reaction_event) {
922
901
  this.onmessagereaction(<MessageReactionEvent>message.message_reaction_event);
923
- } else if (message.message_deleted_event) {
924
- this.onmessagedeleted(<MessageDeletedEvent>message.message_deleted_event);
925
902
  } else if (message.channel_presence_event) {
926
903
  this.onchannelpresence(<ChannelPresenceEvent>message.channel_presence_event);
927
904
  } else if (message.party_data) {
@@ -1023,12 +1000,6 @@ export class DefaultSocket implements Socket {
1023
1000
  }
1024
1001
  }
1025
1002
 
1026
- onmessagedeleted(messagedeleted: MessageDeletedEvent) {
1027
- if (this.verbose && window && window.console) {
1028
- console.log(messagedeleted);
1029
- }
1030
- }
1031
-
1032
1003
  onchannelmessage(channelMessage: ChannelMessageEvent) {
1033
1004
  if (this.verbose && window && window.console) {
1034
1005
  console.log(channelMessage);
@@ -1310,11 +1281,6 @@ export class DefaultSocket implements Socket {
1310
1281
  return response.message_reaction_event
1311
1282
  }
1312
1283
 
1313
- async writeMessageDeleted(channel_id: string, channel_label: string, mode: number, message_id: string) : Promise<MessageDeletedEvent> {
1314
- const response = await this.send({message_deleted_event: {channel_id: channel_id, channel_label: channel_label, mode: mode, message_id: message_id}});
1315
- return response.message_deleted_event
1316
- }
1317
-
1318
1284
  async writeMessageTyping(channel_id: string, channel_label: string, mode: number) : Promise<MessageTypingEvent> {
1319
1285
  const response = await this.send({message_typing_event: {channel_id: channel_id, channel_label: channel_label, mode:mode}});
1320
1286
  return response.message_typing_event