mezon-js 2.8.27 → 2.8.29
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/dist/mezon-js.cjs.js +26 -2
- package/dist/mezon-js.esm.mjs +26 -2
- package/dist/socket.d.ts +36 -3
- package/package.json +1 -1
- package/socket.ts +79 -4
package/dist/mezon-js.cjs.js
CHANGED
@@ -5127,9 +5127,9 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5127
5127
|
updateStatus(status) {
|
5128
5128
|
return this.send({ status_update: { status } });
|
5129
5129
|
}
|
5130
|
-
writeChatMessage(clan_id, channel_id, mode, content, mentions, attachments, references, anonymous_message, mention_everyone,
|
5130
|
+
writeChatMessage(clan_id, channel_id, mode, content, mentions, attachments, references, anonymous_message, mention_everyone, avatar) {
|
5131
5131
|
return __async(this, null, function* () {
|
5132
|
-
const response = yield this.send({ channel_message_send: { clan_id, channel_id, mode, content, mentions, attachments, references, anonymous_message, mention_everyone,
|
5132
|
+
const response = yield this.send({ channel_message_send: { clan_id, channel_id, mode, content, mentions, attachments, references, anonymous_message, mention_everyone, avatar } });
|
5133
5133
|
return response.channel_message_ack;
|
5134
5134
|
});
|
5135
5135
|
}
|
@@ -5205,6 +5205,30 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5205
5205
|
return response.sticker_listed_event;
|
5206
5206
|
});
|
5207
5207
|
}
|
5208
|
+
getNotificationChannelSetting(channel_id) {
|
5209
|
+
return __async(this, null, function* () {
|
5210
|
+
const response = yield this.send({ notification_channel_setting_event: { channel_id } });
|
5211
|
+
return response.notification_channel_setting_event;
|
5212
|
+
});
|
5213
|
+
}
|
5214
|
+
getNotificationCategorySetting(category_id) {
|
5215
|
+
return __async(this, null, function* () {
|
5216
|
+
const response = yield this.send({ notification_category_setting_event: { category_id } });
|
5217
|
+
return response.notification_category_setting_event;
|
5218
|
+
});
|
5219
|
+
}
|
5220
|
+
getNotificationClanSetting(clan_id) {
|
5221
|
+
return __async(this, null, function* () {
|
5222
|
+
const response = yield this.send({ notification_clan_setting_event: { clan_id } });
|
5223
|
+
return response.notification_clan_setting_event;
|
5224
|
+
});
|
5225
|
+
}
|
5226
|
+
getNotificationReactMessage(channel_id_req) {
|
5227
|
+
return __async(this, null, function* () {
|
5228
|
+
const response = yield this.send({ notifi_react_message_event: { channel_id_req } });
|
5229
|
+
return response.notifi_react_message_event;
|
5230
|
+
});
|
5231
|
+
}
|
5208
5232
|
pingPong() {
|
5209
5233
|
return __async(this, null, function* () {
|
5210
5234
|
if (!this.adapter.isOpen()) {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -5098,9 +5098,9 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5098
5098
|
updateStatus(status) {
|
5099
5099
|
return this.send({ status_update: { status } });
|
5100
5100
|
}
|
5101
|
-
writeChatMessage(clan_id, channel_id, mode, content, mentions, attachments, references, anonymous_message, mention_everyone,
|
5101
|
+
writeChatMessage(clan_id, channel_id, mode, content, mentions, attachments, references, anonymous_message, mention_everyone, avatar) {
|
5102
5102
|
return __async(this, null, function* () {
|
5103
|
-
const response = yield this.send({ channel_message_send: { clan_id, channel_id, mode, content, mentions, attachments, references, anonymous_message, mention_everyone,
|
5103
|
+
const response = yield this.send({ channel_message_send: { clan_id, channel_id, mode, content, mentions, attachments, references, anonymous_message, mention_everyone, avatar } });
|
5104
5104
|
return response.channel_message_ack;
|
5105
5105
|
});
|
5106
5106
|
}
|
@@ -5176,6 +5176,30 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5176
5176
|
return response.sticker_listed_event;
|
5177
5177
|
});
|
5178
5178
|
}
|
5179
|
+
getNotificationChannelSetting(channel_id) {
|
5180
|
+
return __async(this, null, function* () {
|
5181
|
+
const response = yield this.send({ notification_channel_setting_event: { channel_id } });
|
5182
|
+
return response.notification_channel_setting_event;
|
5183
|
+
});
|
5184
|
+
}
|
5185
|
+
getNotificationCategorySetting(category_id) {
|
5186
|
+
return __async(this, null, function* () {
|
5187
|
+
const response = yield this.send({ notification_category_setting_event: { category_id } });
|
5188
|
+
return response.notification_category_setting_event;
|
5189
|
+
});
|
5190
|
+
}
|
5191
|
+
getNotificationClanSetting(clan_id) {
|
5192
|
+
return __async(this, null, function* () {
|
5193
|
+
const response = yield this.send({ notification_clan_setting_event: { clan_id } });
|
5194
|
+
return response.notification_clan_setting_event;
|
5195
|
+
});
|
5196
|
+
}
|
5197
|
+
getNotificationReactMessage(channel_id_req) {
|
5198
|
+
return __async(this, null, function* () {
|
5199
|
+
const response = yield this.send({ notifi_react_message_event: { channel_id_req } });
|
5200
|
+
return response.notifi_react_message_event;
|
5201
|
+
});
|
5202
|
+
}
|
5179
5203
|
pingPong() {
|
5180
5204
|
return __async(this, null, function* () {
|
5181
5205
|
if (!this.adapter.isOpen()) {
|
package/dist/socket.d.ts
CHANGED
@@ -255,7 +255,7 @@ interface ChannelMessageSend {
|
|
255
255
|
attachments?: Array<MessageAttachmentEvent>;
|
256
256
|
anonymous_message?: boolean;
|
257
257
|
mention_everyone?: boolean;
|
258
|
-
|
258
|
+
avatar: string;
|
259
259
|
};
|
260
260
|
}
|
261
261
|
/** Update a message previously sent to a realtime chat channel. */
|
@@ -501,6 +501,31 @@ export interface HashtagDm {
|
|
501
501
|
channel_private?: number;
|
502
502
|
parrent_id?: string;
|
503
503
|
}
|
504
|
+
export interface NotificationChannelSettingEvent {
|
505
|
+
active?: number;
|
506
|
+
id?: string;
|
507
|
+
notification_setting_type?: number;
|
508
|
+
time_mute?: string;
|
509
|
+
channel_id?: string;
|
510
|
+
}
|
511
|
+
export interface NotificationCategorySettingEvent {
|
512
|
+
active?: number;
|
513
|
+
id?: string;
|
514
|
+
notification_setting_type?: number;
|
515
|
+
time_mute?: string;
|
516
|
+
category_id?: string;
|
517
|
+
}
|
518
|
+
export interface NotificationClanSettingEvent {
|
519
|
+
id?: string;
|
520
|
+
notification_setting_type?: number;
|
521
|
+
clan_id?: string;
|
522
|
+
}
|
523
|
+
export interface NotifiReactMessageEvent {
|
524
|
+
channel_id?: string;
|
525
|
+
id?: string;
|
526
|
+
user_id?: string;
|
527
|
+
channel_id_req?: string;
|
528
|
+
}
|
504
529
|
/** A socket connection to Mezon server. */
|
505
530
|
export interface Socket {
|
506
531
|
/** Connection is Open */
|
@@ -528,7 +553,7 @@ export interface Socket {
|
|
528
553
|
/** Update the status for the current user online. */
|
529
554
|
updateStatus(status?: string): Promise<void>;
|
530
555
|
/** Send a chat message to a chat channel on the server. */
|
531
|
-
writeChatMessage(clan_id: string, channel_id: string, mode: number, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean,
|
556
|
+
writeChatMessage(clan_id: string, channel_id: string, mode: number, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: boolean, avatar?: string): Promise<ChannelMessageAck>;
|
532
557
|
/** Send message typing */
|
533
558
|
writeMessageTyping(clan_id: string, channel_id: string, mode: number): Promise<MessageTypingEvent>;
|
534
559
|
/** Send message reaction */
|
@@ -597,6 +622,10 @@ export interface Socket {
|
|
597
622
|
listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
|
598
623
|
ListChannelByUserId(): Promise<ChannelDescListEvent>;
|
599
624
|
hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
|
625
|
+
getNotificationChannelSetting(channel_id: string): Promise<NotificationChannelSettingEvent>;
|
626
|
+
getNotificationCategorySetting(category_id: string): Promise<NotificationCategorySettingEvent>;
|
627
|
+
getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent>;
|
628
|
+
getNotificationReactMessage(channel_id_req: string): Promise<NotifiReactMessageEvent>;
|
600
629
|
}
|
601
630
|
/** Reports an error received from a socket message. */
|
602
631
|
export interface SocketError {
|
@@ -664,7 +693,7 @@ export declare class DefaultSocket implements Socket {
|
|
664
693
|
unfollowUsers(user_ids: string[]): Promise<void>;
|
665
694
|
updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>): Promise<ChannelMessageAck>;
|
666
695
|
updateStatus(status?: string): Promise<void>;
|
667
|
-
writeChatMessage(clan_id: string, channel_id: string, mode: number, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: Boolean,
|
696
|
+
writeChatMessage(clan_id: string, channel_id: string, mode: number, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: Boolean, avatar?: string): Promise<ChannelMessageAck>;
|
668
697
|
writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<MessageReactionEvent>;
|
669
698
|
writeMessageTyping(clan_id: string, channel_id: string, mode: number): Promise<MessageTypingEvent>;
|
670
699
|
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string): Promise<LastSeenMessageEvent>;
|
@@ -677,6 +706,10 @@ export declare class DefaultSocket implements Socket {
|
|
677
706
|
ListChannelByUserId(): Promise<ChannelDescListEvent>;
|
678
707
|
hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
|
679
708
|
listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
|
709
|
+
getNotificationChannelSetting(channel_id: string): Promise<NotificationChannelSettingEvent>;
|
710
|
+
getNotificationCategorySetting(category_id: string): Promise<NotificationCategorySettingEvent>;
|
711
|
+
getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent>;
|
712
|
+
getNotificationReactMessage(channel_id_req: string): Promise<NotifiReactMessageEvent>;
|
680
713
|
private pingPong;
|
681
714
|
}
|
682
715
|
export {};
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -364,7 +364,7 @@ interface ChannelMessageSend {
|
|
364
364
|
//
|
365
365
|
mention_everyone?: boolean;
|
366
366
|
//
|
367
|
-
|
367
|
+
avatar: string;
|
368
368
|
};
|
369
369
|
}
|
370
370
|
|
@@ -731,6 +731,52 @@ export interface HashtagDm {
|
|
731
731
|
parrent_id?: string;
|
732
732
|
}
|
733
733
|
|
734
|
+
export interface NotificationChannelSettingEvent {
|
735
|
+
//
|
736
|
+
active?: number;
|
737
|
+
//
|
738
|
+
id?: string;
|
739
|
+
//
|
740
|
+
notification_setting_type?: number;
|
741
|
+
//
|
742
|
+
time_mute?: string;
|
743
|
+
// The channel id.
|
744
|
+
channel_id?: string;
|
745
|
+
}
|
746
|
+
|
747
|
+
export interface NotificationCategorySettingEvent {
|
748
|
+
//
|
749
|
+
active?: number;
|
750
|
+
//
|
751
|
+
id?: string;
|
752
|
+
//
|
753
|
+
notification_setting_type?: number;
|
754
|
+
//
|
755
|
+
time_mute?: string;
|
756
|
+
//
|
757
|
+
category_id?: string;
|
758
|
+
}
|
759
|
+
|
760
|
+
export interface NotificationClanSettingEvent {
|
761
|
+
//
|
762
|
+
id?: string;
|
763
|
+
//
|
764
|
+
notification_setting_type?: number;
|
765
|
+
// The clan of this channel
|
766
|
+
clan_id?: string;
|
767
|
+
}
|
768
|
+
|
769
|
+
export interface NotifiReactMessageEvent {
|
770
|
+
//
|
771
|
+
channel_id?: string;
|
772
|
+
//
|
773
|
+
id?: string;
|
774
|
+
//
|
775
|
+
user_id?: string;
|
776
|
+
//
|
777
|
+
channel_id_req?: string;
|
778
|
+
}
|
779
|
+
|
734
780
|
/** A socket connection to Mezon server. */
|
735
781
|
export interface Socket {
|
736
782
|
/** Connection is Open */
|
@@ -770,7 +816,7 @@ export interface Socket {
|
|
770
816
|
updateStatus(status? : string) : Promise<void>;
|
771
817
|
|
772
818
|
/** Send a chat message to a chat channel on the server. */
|
773
|
-
writeChatMessage(clan_id: string, channel_id: string, mode: number, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?:boolean,
|
819
|
+
writeChatMessage(clan_id: string, channel_id: string, mode: number, content?: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?:boolean, avatar?: string) : Promise<ChannelMessageAck>;
|
774
820
|
|
775
821
|
/** Send message typing */
|
776
822
|
writeMessageTyping(clan_id: string, channel_id: string, mode: number) : Promise<MessageTypingEvent>;
|
@@ -890,6 +936,15 @@ export interface Socket {
|
|
890
936
|
ListChannelByUserId(): Promise<ChannelDescListEvent>;
|
891
937
|
|
892
938
|
hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
|
939
|
+
|
940
|
+
getNotificationChannelSetting(channel_id: string): Promise<NotificationChannelSettingEvent>;
|
941
|
+
|
942
|
+
getNotificationCategorySetting(category_id: string): Promise<NotificationCategorySettingEvent>;
|
943
|
+
|
944
|
+
getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent>;
|
945
|
+
|
946
|
+
getNotificationReactMessage(channel_id_req: string): Promise<NotifiReactMessageEvent>;
|
947
|
+
|
893
948
|
}
|
894
949
|
|
895
950
|
/** Reports an error received from a socket message. */
|
@@ -1383,8 +1438,8 @@ export class DefaultSocket implements Socket {
|
|
1383
1438
|
return this.send({status_update: {status: status}});
|
1384
1439
|
}
|
1385
1440
|
|
1386
|
-
async writeChatMessage(clan_id: string, channel_id: string, mode: number, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?:Boolean,
|
1387
|
-
const response = await this.send({channel_message_send: {clan_id: clan_id, channel_id: channel_id, mode: mode, content: content, mentions: mentions, attachments: attachments, references: references, anonymous_message: anonymous_message, mention_everyone:mention_everyone,
|
1441
|
+
async writeChatMessage(clan_id: string, channel_id: string, mode: number, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?:Boolean, avatar?: string ): Promise<ChannelMessageAck> {
|
1442
|
+
const response = await this.send({channel_message_send: {clan_id: clan_id, channel_id: channel_id, mode: mode, content: content, mentions: mentions, attachments: attachments, references: references, anonymous_message: anonymous_message, mention_everyone: mention_everyone, avatar: avatar}});
|
1388
1443
|
return response.channel_message_ack;
|
1389
1444
|
}
|
1390
1445
|
|
@@ -1448,6 +1503,26 @@ export class DefaultSocket implements Socket {
|
|
1448
1503
|
return response.sticker_listed_event
|
1449
1504
|
}
|
1450
1505
|
|
1506
|
+
async getNotificationChannelSetting(channel_id: string): Promise<NotificationChannelSettingEvent> {
|
1507
|
+
const response = await this.send({notification_channel_setting_event: {channel_id: channel_id}})
|
1508
|
+
return response.notification_channel_setting_event
|
1509
|
+
}
|
1510
|
+
|
1511
|
+
async getNotificationCategorySetting(category_id: string): Promise<NotificationCategorySettingEvent> {
|
1512
|
+
const response = await this.send({notification_category_setting_event: {category_id: category_id}})
|
1513
|
+
return response.notification_category_setting_event
|
1514
|
+
}
|
1515
|
+
|
1516
|
+
async getNotificationClanSetting(clan_id: string): Promise<NotificationClanSettingEvent> {
|
1517
|
+
const response = await this.send({notification_clan_setting_event: {clan_id: clan_id}})
|
1518
|
+
return response.notification_clan_setting_event
|
1519
|
+
}
|
1520
|
+
|
1521
|
+
async getNotificationReactMessage(channel_id_req: string): Promise<NotifiReactMessageEvent> {
|
1522
|
+
const response = await this.send({notifi_react_message_event: {channel_id_req: channel_id_req}})
|
1523
|
+
return response.notifi_react_message_event
|
1524
|
+
}
|
1525
|
+
|
1451
1526
|
private async pingPong(): Promise<void> {
|
1452
1527
|
if (!this.adapter.isOpen()) {
|
1453
1528
|
return;
|