mezon-js 2.10.77 → 2.10.79

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.
@@ -7820,7 +7820,7 @@ var _DefaultSocket = class _DefaultSocket {
7820
7820
  unfollowUsers(user_ids) {
7821
7821
  return this.send({ status_unfollow: { user_ids } });
7822
7822
  }
7823
- updateChatMessage(clan_id, channel_id, mode, is_public, message_id, content, mentions, attachments, hideEditted, topic_id, mess_topic_id) {
7823
+ updateChatMessage(clan_id, channel_id, mode, is_public, message_id, content, mentions, attachments, hideEditted, topic_id, is_update_msg_topic) {
7824
7824
  return __async(this, null, function* () {
7825
7825
  const response = yield this.send({
7826
7826
  channel_message_update: {
@@ -7834,7 +7834,7 @@ var _DefaultSocket = class _DefaultSocket {
7834
7834
  is_public,
7835
7835
  hide_editted: hideEditted,
7836
7836
  topic_id,
7837
- mess_topic_id
7837
+ is_update_msg_topic
7838
7838
  }
7839
7839
  });
7840
7840
  return response.channel_message_ack;
@@ -7786,7 +7786,7 @@ var _DefaultSocket = class _DefaultSocket {
7786
7786
  unfollowUsers(user_ids) {
7787
7787
  return this.send({ status_unfollow: { user_ids } });
7788
7788
  }
7789
- updateChatMessage(clan_id, channel_id, mode, is_public, message_id, content, mentions, attachments, hideEditted, topic_id, mess_topic_id) {
7789
+ updateChatMessage(clan_id, channel_id, mode, is_public, message_id, content, mentions, attachments, hideEditted, topic_id, is_update_msg_topic) {
7790
7790
  return __async(this, null, function* () {
7791
7791
  const response = yield this.send({
7792
7792
  channel_message_update: {
@@ -7800,7 +7800,7 @@ var _DefaultSocket = class _DefaultSocket {
7800
7800
  is_public,
7801
7801
  hide_editted: hideEditted,
7802
7802
  topic_id,
7803
- mess_topic_id
7803
+ is_update_msg_topic
7804
7804
  }
7805
7805
  });
7806
7806
  return response.channel_message_ack;
package/dist/socket.d.ts CHANGED
@@ -13,9 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiPermissionUpdate, ApiRole, ApiRpc, ApiTokenSentEvent, ApiUserActivity, ApiWebhook } from "./api.gen";
16
+ import { ApiChannelDescription, ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiPermissionUpdate, ApiRole, ApiRpc, ApiTokenSentEvent, ApiUserActivity, ApiWebhook } from "./api.gen";
17
17
  import { Session } from "./session";
18
- import { ChannelMessage, Notification } from "./client";
18
+ import { ChannelMessage } from "./client";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
20
20
  /** An object which represents a connected user in the server. */
21
21
  export interface Presence {
@@ -32,6 +32,25 @@ export interface Presence {
32
32
  is_mobile: boolean;
33
33
  metadata: string;
34
34
  }
35
+ export interface NotificationInfo {
36
+ /** Category code for this notification. */
37
+ code?: number;
38
+ /** Content of the notification in JSON. */
39
+ content?: {};
40
+ /** The UNIX time when the notification was created. */
41
+ create_time?: string;
42
+ /** ID of the Notification. */
43
+ id?: string;
44
+ /** True if this notification was persisted to the database. */
45
+ persistent?: boolean;
46
+ /** ID of the sender, if a user. Otherwise 'null'. */
47
+ sender_id?: string;
48
+ /** Subject of the notification. */
49
+ subject?: string;
50
+ channel_id?: string;
51
+ clan_id?: string;
52
+ channel?: ApiChannelDescription;
53
+ }
35
54
  /** A response from a channel join operation. */
36
55
  export interface Channel {
37
56
  /** The server-assigned channel id. */
@@ -221,7 +240,7 @@ interface ChannelMessageUpdate {
221
240
  mode: number;
222
241
  is_public: boolean;
223
242
  topic_id?: string;
224
- mess_topic_id?: string;
243
+ is_update_msg_topic?: boolean;
225
244
  };
226
245
  }
227
246
  /** Remove a message previously sent to a realtime chat channel. */
@@ -686,7 +705,7 @@ export interface Socket {
686
705
  /** Unfollow one or more users from their status updates. */
687
706
  unfollowUsers(user_ids: string[]): Promise<void>;
688
707
  /** Update a chat message on a chat channel in the server. */
689
- updateChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean, topic_id?: string, mess_topic_id?: string): Promise<ChannelMessageAck>;
708
+ updateChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean, topic_id?: string, is_update_msg_topic?: boolean): Promise<ChannelMessageAck>;
690
709
  /** Update the status for the current user online. */
691
710
  updateStatus(status?: string): Promise<void>;
692
711
  /** Send a chat message to a chat channel on the server. */
@@ -719,7 +738,7 @@ export interface Socket {
719
738
  /** Handle error events received from the socket. */
720
739
  onerror: (evt: Event) => void;
721
740
  /** Receive notifications from the socket. */
722
- onnotification: (notification: Notification) => void;
741
+ onnotification: (notification: NotificationInfo) => void;
723
742
  /** Receive status presence updates. */
724
743
  onstatuspresence: (statusPresence: StatusPresenceEvent) => void;
725
744
  /** Receive stream presence updates. */
@@ -832,7 +851,7 @@ export declare class DefaultSocket implements Socket {
832
851
  onuserchannelremoved(user: UserChannelRemovedEvent): void;
833
852
  onremovefriend(user: RemoveFriend): void;
834
853
  onuserclanremoved(user: UserClanRemovedEvent): void;
835
- onnotification(notification: Notification): void;
854
+ onnotification(notification: NotificationInfo): void;
836
855
  onstatuspresence(statusPresence: StatusPresenceEvent): void;
837
856
  onpinmessage(pin: LastPinMessageEvent): void;
838
857
  onvoiceended(voice: VoiceEndedEvent): void;
@@ -884,7 +903,7 @@ export declare class DefaultSocket implements Socket {
884
903
  removeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, has_attachment?: boolean, topic_id?: string): Promise<ChannelMessageAck>;
885
904
  rpc(id?: string, payload?: string, http_key?: string): Promise<ApiRpc>;
886
905
  unfollowUsers(user_ids: string[]): Promise<void>;
887
- updateChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean, topic_id?: string, mess_topic_id?: string): Promise<ChannelMessageAck>;
906
+ updateChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, hideEditted?: boolean, topic_id?: string, is_update_msg_topic?: boolean): Promise<ChannelMessageAck>;
888
907
  updateStatus(status?: string): Promise<void>;
889
908
  writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: Boolean, avatar?: string, code?: number, topic_id?: string): Promise<ChannelMessageAck>;
890
909
  writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean, topic_id?: string): Promise<ApiMessageReaction>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.10.77",
4
+ "version": "2.10.79",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import {
18
+ ApiChannelDescription,
18
19
  ApiChannelMessageHeader,
19
20
  ApiCreateEventRequest,
20
21
  ApiGiveCoffeeEvent,
@@ -31,7 +32,7 @@ import {
31
32
  ApiWebhook,
32
33
  } from "./api.gen";
33
34
  import { Session } from "./session";
34
- import { ChannelMessage, Notification } from "./client";
35
+ import { ChannelMessage } from "./client";
35
36
  import { WebSocketAdapter, WebSocketAdapterText } from "./web_socket_adapter";
36
37
  import { safeJSONParse } from "./utils";
37
38
 
@@ -58,6 +59,29 @@ export interface Presence {
58
59
  metadata: string;
59
60
  }
60
61
 
62
+ export interface NotificationInfo {
63
+ /** Category code for this notification. */
64
+ code?: number;
65
+ /** Content of the notification in JSON. */
66
+ content?: {};
67
+ /** The UNIX time when the notification was created. */
68
+ create_time?: string;
69
+ /** ID of the Notification. */
70
+ id?: string;
71
+ /** True if this notification was persisted to the database. */
72
+ persistent?: boolean;
73
+ /** ID of the sender, if a user. Otherwise 'null'. */
74
+ sender_id?: string;
75
+ /** Subject of the notification. */
76
+ subject?: string;
77
+ //
78
+ channel_id?: string;
79
+ //
80
+ clan_id?: string;
81
+ //
82
+ channel?: ApiChannelDescription;
83
+ }
84
+
61
85
  /** A response from a channel join operation. */
62
86
  export interface Channel {
63
87
  /** The server-assigned channel id. */
@@ -319,7 +343,7 @@ interface ChannelMessageUpdate {
319
343
  //
320
344
  topic_id?: string;
321
345
  //
322
- mess_topic_id?: string;
346
+ is_update_msg_topic?: boolean;
323
347
  };
324
348
  }
325
349
 
@@ -1000,7 +1024,7 @@ export interface Socket {
1000
1024
  attachments?: Array<ApiMessageAttachment>,
1001
1025
  hideEditted?: boolean,
1002
1026
  topic_id?: string,
1003
- mess_topic_id?: string
1027
+ is_update_msg_topic?: boolean
1004
1028
  ): Promise<ChannelMessageAck>;
1005
1029
 
1006
1030
  /** Update the status for the current user online. */
@@ -1160,7 +1184,7 @@ export interface Socket {
1160
1184
  onerror: (evt: Event) => void;
1161
1185
 
1162
1186
  /** Receive notifications from the socket. */
1163
- onnotification: (notification: Notification) => void;
1187
+ onnotification: (notification: NotificationInfo) => void;
1164
1188
 
1165
1189
  /** Receive status presence updates. */
1166
1190
  onstatuspresence: (statusPresence: StatusPresenceEvent) => void;
@@ -1716,7 +1740,7 @@ export class DefaultSocket implements Socket {
1716
1740
  }
1717
1741
  }
1718
1742
 
1719
- onnotification(notification: Notification) {
1743
+ onnotification(notification: NotificationInfo) {
1720
1744
  if (this.verbose && window && window.console) {
1721
1745
  console.log(notification);
1722
1746
  }
@@ -2133,7 +2157,7 @@ export class DefaultSocket implements Socket {
2133
2157
  attachments?: Array<ApiMessageAttachment>,
2134
2158
  hideEditted?: boolean,
2135
2159
  topic_id?: string,
2136
- mess_topic_id?: string
2160
+ is_update_msg_topic?: boolean
2137
2161
  ): Promise<ChannelMessageAck> {
2138
2162
  const response = await this.send({
2139
2163
  channel_message_update: {
@@ -2147,7 +2171,7 @@ export class DefaultSocket implements Socket {
2147
2171
  is_public: is_public,
2148
2172
  hide_editted: hideEditted,
2149
2173
  topic_id: topic_id,
2150
- mess_topic_id: mess_topic_id,
2174
+ is_update_msg_topic: is_update_msg_topic,
2151
2175
  },
2152
2176
  });
2153
2177
  return response.channel_message_ack;