mezon-js 2.8.97 → 2.8.98
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/mezon-js.cjs.js +35 -0
- package/dist/mezon-js.esm.mjs +35 -0
- package/dist/socket.d.ts +67 -0
- package/package.json +1 -1
- package/socket.ts +113 -1
package/dist/mezon-js.cjs.js
CHANGED
@@ -5091,6 +5091,16 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5091
5091
|
this.oneventcreated(message.clan_event_created);
|
5092
5092
|
} else if (message.give_coffee_event) {
|
5093
5093
|
this.oncoffeegiven(message.give_coffee_event);
|
5094
|
+
} else if (message.role_assign_event) {
|
5095
|
+
this.onroleassign(message.role_assign_event);
|
5096
|
+
} else if (message.streaming_started_event) {
|
5097
|
+
this.onstreamingchannelstarted(message.streaming_started_event);
|
5098
|
+
} else if (message.streaming_ended_event) {
|
5099
|
+
this.onstreamingchannelended(message.streaming_ended_event);
|
5100
|
+
} else if (message.streaming_joined_event) {
|
5101
|
+
this.onstreamingchanneljoined(message.streaming_joined_event);
|
5102
|
+
} else if (message.streaming_leaved_event) {
|
5103
|
+
this.onstreamingchannelleaved(message.streaming_leaved_event);
|
5094
5104
|
} else {
|
5095
5105
|
if (this.verbose && window && window.console) {
|
5096
5106
|
console.log("Unrecognized message received: %o", message);
|
@@ -5318,6 +5328,31 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5318
5328
|
console.log(give_coffee_event);
|
5319
5329
|
}
|
5320
5330
|
}
|
5331
|
+
onroleassign(role_assign_event) {
|
5332
|
+
if (this.verbose && window && window.console) {
|
5333
|
+
console.log(role_assign_event);
|
5334
|
+
}
|
5335
|
+
}
|
5336
|
+
onstreamingchannelstarted(streaming_started_event) {
|
5337
|
+
if (this.verbose && window && window.console) {
|
5338
|
+
console.log(streaming_started_event);
|
5339
|
+
}
|
5340
|
+
}
|
5341
|
+
onstreamingchannelended(streaming_ended_event) {
|
5342
|
+
if (this.verbose && window && window.console) {
|
5343
|
+
console.log(streaming_ended_event);
|
5344
|
+
}
|
5345
|
+
}
|
5346
|
+
onstreamingchanneljoined(streaming_joined_event) {
|
5347
|
+
if (this.verbose && window && window.console) {
|
5348
|
+
console.log(streaming_joined_event);
|
5349
|
+
}
|
5350
|
+
}
|
5351
|
+
onstreamingchannelleaved(streaming_leaved_event) {
|
5352
|
+
if (this.verbose && window && window.console) {
|
5353
|
+
console.log(streaming_leaved_event);
|
5354
|
+
}
|
5355
|
+
}
|
5321
5356
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
5322
5357
|
const untypedMessage = message;
|
5323
5358
|
return new Promise((resolve, reject) => {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -5062,6 +5062,16 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5062
5062
|
this.oneventcreated(message.clan_event_created);
|
5063
5063
|
} else if (message.give_coffee_event) {
|
5064
5064
|
this.oncoffeegiven(message.give_coffee_event);
|
5065
|
+
} else if (message.role_assign_event) {
|
5066
|
+
this.onroleassign(message.role_assign_event);
|
5067
|
+
} else if (message.streaming_started_event) {
|
5068
|
+
this.onstreamingchannelstarted(message.streaming_started_event);
|
5069
|
+
} else if (message.streaming_ended_event) {
|
5070
|
+
this.onstreamingchannelended(message.streaming_ended_event);
|
5071
|
+
} else if (message.streaming_joined_event) {
|
5072
|
+
this.onstreamingchanneljoined(message.streaming_joined_event);
|
5073
|
+
} else if (message.streaming_leaved_event) {
|
5074
|
+
this.onstreamingchannelleaved(message.streaming_leaved_event);
|
5065
5075
|
} else {
|
5066
5076
|
if (this.verbose && window && window.console) {
|
5067
5077
|
console.log("Unrecognized message received: %o", message);
|
@@ -5289,6 +5299,31 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5289
5299
|
console.log(give_coffee_event);
|
5290
5300
|
}
|
5291
5301
|
}
|
5302
|
+
onroleassign(role_assign_event) {
|
5303
|
+
if (this.verbose && window && window.console) {
|
5304
|
+
console.log(role_assign_event);
|
5305
|
+
}
|
5306
|
+
}
|
5307
|
+
onstreamingchannelstarted(streaming_started_event) {
|
5308
|
+
if (this.verbose && window && window.console) {
|
5309
|
+
console.log(streaming_started_event);
|
5310
|
+
}
|
5311
|
+
}
|
5312
|
+
onstreamingchannelended(streaming_ended_event) {
|
5313
|
+
if (this.verbose && window && window.console) {
|
5314
|
+
console.log(streaming_ended_event);
|
5315
|
+
}
|
5316
|
+
}
|
5317
|
+
onstreamingchanneljoined(streaming_joined_event) {
|
5318
|
+
if (this.verbose && window && window.console) {
|
5319
|
+
console.log(streaming_joined_event);
|
5320
|
+
}
|
5321
|
+
}
|
5322
|
+
onstreamingchannelleaved(streaming_leaved_event) {
|
5323
|
+
if (this.verbose && window && window.console) {
|
5324
|
+
console.log(streaming_leaved_event);
|
5325
|
+
}
|
5326
|
+
}
|
5292
5327
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
5293
5328
|
const untypedMessage = message;
|
5294
5329
|
return new Promise((resolve, reject) => {
|
package/dist/socket.d.ts
CHANGED
@@ -577,6 +577,63 @@ export interface GetUserEmojiUsageEvent {
|
|
577
577
|
clanId: string;
|
578
578
|
user_emoji_usage: Array<UserEmojiUsage>;
|
579
579
|
}
|
580
|
+
/** On role assign */
|
581
|
+
export interface RoleAssignedEvent {
|
582
|
+
/** The clan of this role */
|
583
|
+
ClanId: string;
|
584
|
+
/** Role ID */
|
585
|
+
role_id: string;
|
586
|
+
/** UserIds Assigned */
|
587
|
+
user_ids_assigned: string[];
|
588
|
+
/** UserIds Removed */
|
589
|
+
user_ids_removed: string[];
|
590
|
+
}
|
591
|
+
/** Streaming Joined event */
|
592
|
+
export interface StreamingLeavedEvent {
|
593
|
+
/** id */
|
594
|
+
id: string;
|
595
|
+
/** The unique identifier of the chat clan. */
|
596
|
+
clan_id: string;
|
597
|
+
/** streaming channel name */
|
598
|
+
streaming_channel_id: string;
|
599
|
+
/** streaming user_id */
|
600
|
+
streaming_user_id: string;
|
601
|
+
}
|
602
|
+
/** Streaming Joined event */
|
603
|
+
export interface StreamingJoinedEvent {
|
604
|
+
/** The unique identifier of the chat clan. */
|
605
|
+
clan_id: string;
|
606
|
+
/** The channel name */
|
607
|
+
clan_name: string;
|
608
|
+
/** id streaming */
|
609
|
+
id: string;
|
610
|
+
/** streaming participant */
|
611
|
+
participant: string;
|
612
|
+
/** user id */
|
613
|
+
user_id: string;
|
614
|
+
/** streaming channel label */
|
615
|
+
streaming_channel_label: string;
|
616
|
+
/** streaming channel id */
|
617
|
+
streaming_channel_id: string;
|
618
|
+
}
|
619
|
+
/** Streaming start event */
|
620
|
+
export interface StreamingStartedEvent {
|
621
|
+
/** clan id */
|
622
|
+
clan_id: string;
|
623
|
+
/** channel id */
|
624
|
+
channel_id: string;
|
625
|
+
/** stream url */
|
626
|
+
streaming_url: string;
|
627
|
+
/** status */
|
628
|
+
is_streaming: boolean;
|
629
|
+
}
|
630
|
+
/** Streaming start event */
|
631
|
+
export interface StreamingEndedEvent {
|
632
|
+
/** clan id */
|
633
|
+
clan_id: string;
|
634
|
+
/** channel id */
|
635
|
+
channel_id: string;
|
636
|
+
}
|
580
637
|
/** A socket connection to Mezon server. */
|
581
638
|
export interface Socket {
|
582
639
|
/** Connection is Open */
|
@@ -692,6 +749,11 @@ export interface Socket {
|
|
692
749
|
oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
|
693
750
|
oncoffeegiven: (give_coffee_event: ApiGiveCoffeeEvent) => void;
|
694
751
|
oneventemoji: (event_emoji: EventEmoji) => void;
|
752
|
+
onroleassign: (role_assign_event: RoleAssignedEvent) => void;
|
753
|
+
onstreamingchannelstarted: (streaming_started_event: StreamingStartedEvent) => void;
|
754
|
+
onstreamingchannelended: (streaming_ended_event: StreamingEndedEvent) => void;
|
755
|
+
onstreamingchanneljoined: (streaming_joined_event: StreamingJoinedEvent) => void;
|
756
|
+
onstreamingchannelleaved: (streaming_leaved_event: StreamingLeavedEvent) => void;
|
695
757
|
}
|
696
758
|
/** Reports an error received from a socket message. */
|
697
759
|
export interface SocketError {
|
@@ -756,6 +818,11 @@ export declare class DefaultSocket implements Socket {
|
|
756
818
|
oncustomstatus(statusEvent: CustomStatusEvent): void;
|
757
819
|
oneventcreated(clan_event_created: ApiCreateEventRequest): void;
|
758
820
|
oncoffeegiven(give_coffee_event: ApiGiveCoffeeEvent): void;
|
821
|
+
onroleassign(role_assign_event: RoleAssignedEvent): void;
|
822
|
+
onstreamingchannelstarted(streaming_started_event: StreamingStartedEvent): void;
|
823
|
+
onstreamingchannelended(streaming_ended_event: StreamingEndedEvent): void;
|
824
|
+
onstreamingchanneljoined(streaming_joined_event: StreamingJoinedEvent): void;
|
825
|
+
onstreamingchannelleaved(streaming_leaved_event: StreamingLeavedEvent): void;
|
759
826
|
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping, sendTimeout?: number): Promise<any>;
|
760
827
|
followUsers(userIds: string[]): Promise<Status>;
|
761
828
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -863,6 +863,68 @@ export interface GetUserEmojiUsageEvent {
|
|
863
863
|
user_emoji_usage: Array<UserEmojiUsage>;
|
864
864
|
}
|
865
865
|
|
866
|
+
/** On role assign */
|
867
|
+
export interface RoleAssignedEvent {
|
868
|
+
/** The clan of this role */
|
869
|
+
ClanId: string;
|
870
|
+
/** Role ID */
|
871
|
+
role_id: string;
|
872
|
+
/** UserIds Assigned */
|
873
|
+
user_ids_assigned: string[];
|
874
|
+
/** UserIds Removed */
|
875
|
+
user_ids_removed: string[];
|
876
|
+
}
|
877
|
+
|
878
|
+
/** Streaming Joined event */
|
879
|
+
export interface StreamingLeavedEvent {
|
880
|
+
/** id */
|
881
|
+
id: string;
|
882
|
+
/** The unique identifier of the chat clan. */
|
883
|
+
clan_id: string;
|
884
|
+
/** streaming channel name */
|
885
|
+
streaming_channel_id: string;
|
886
|
+
/** streaming user_id */
|
887
|
+
streaming_user_id: string;
|
888
|
+
}
|
889
|
+
|
890
|
+
/** Streaming Joined event */
|
891
|
+
export interface StreamingJoinedEvent {
|
892
|
+
/** The unique identifier of the chat clan. */
|
893
|
+
clan_id: string;
|
894
|
+
/** The channel name */
|
895
|
+
clan_name: string;
|
896
|
+
/** id streaming */
|
897
|
+
id: string;
|
898
|
+
/** streaming participant */
|
899
|
+
participant: string;
|
900
|
+
/** user id */
|
901
|
+
user_id: string;
|
902
|
+
/** streaming channel label */
|
903
|
+
streaming_channel_label: string;
|
904
|
+
/** streaming channel id */
|
905
|
+
streaming_channel_id: string;
|
906
|
+
}
|
907
|
+
|
908
|
+
/** Streaming start event */
|
909
|
+
export interface StreamingStartedEvent {
|
910
|
+
/** clan id */
|
911
|
+
clan_id: string;
|
912
|
+
/** channel id */
|
913
|
+
channel_id: string;
|
914
|
+
/** stream url */
|
915
|
+
streaming_url: string;
|
916
|
+
/** status */
|
917
|
+
is_streaming: boolean;
|
918
|
+
}
|
919
|
+
|
920
|
+
/** Streaming start event */
|
921
|
+
export interface StreamingEndedEvent {
|
922
|
+
/** clan id */
|
923
|
+
clan_id: string;
|
924
|
+
/** channel id */
|
925
|
+
channel_id: string;
|
926
|
+
}
|
927
|
+
|
866
928
|
/** A socket connection to Mezon server. */
|
867
929
|
export interface Socket {
|
868
930
|
/** Connection is Open */
|
@@ -1064,6 +1126,16 @@ export interface Socket {
|
|
1064
1126
|
|
1065
1127
|
oneventemoji: (event_emoji: EventEmoji) => void;
|
1066
1128
|
|
1129
|
+
onroleassign: (role_assign_event: RoleAssignedEvent) => void;
|
1130
|
+
|
1131
|
+
onstreamingchannelstarted: (streaming_started_event: StreamingStartedEvent) => void;
|
1132
|
+
|
1133
|
+
onstreamingchannelended: (streaming_ended_event: StreamingEndedEvent) => void;
|
1134
|
+
|
1135
|
+
onstreamingchanneljoined: (streaming_joined_event: StreamingJoinedEvent) => void;
|
1136
|
+
|
1137
|
+
onstreamingchannelleaved: (streaming_leaved_event: StreamingLeavedEvent) => void;
|
1138
|
+
|
1067
1139
|
}
|
1068
1140
|
|
1069
1141
|
/** Reports an error received from a socket message. */
|
@@ -1246,9 +1318,19 @@ export class DefaultSocket implements Socket {
|
|
1246
1318
|
} else if (message.user_clan_removed_event) {
|
1247
1319
|
this.onuserclanremoved(<UserClanRemovedEvent>message.user_clan_removed_event);
|
1248
1320
|
} else if(message.clan_event_created){
|
1249
|
-
|
1321
|
+
this.oneventcreated(message.clan_event_created);
|
1250
1322
|
} else if(message.give_coffee_event){
|
1251
1323
|
this.oncoffeegiven(<ApiGiveCoffeeEvent>message.give_coffee_event);
|
1324
|
+
} else if(message.role_assign_event){
|
1325
|
+
this.onroleassign(<RoleAssignedEvent>message.role_assign_event);
|
1326
|
+
} else if(message.streaming_started_event){
|
1327
|
+
this.onstreamingchannelstarted(<StreamingStartedEvent>message.streaming_started_event);
|
1328
|
+
} else if(message.streaming_ended_event){
|
1329
|
+
this.onstreamingchannelended(<StreamingEndedEvent>message.streaming_ended_event);
|
1330
|
+
} else if(message.streaming_joined_event){
|
1331
|
+
this.onstreamingchanneljoined(<StreamingJoinedEvent>message.streaming_joined_event);
|
1332
|
+
} else if(message.streaming_leaved_event){
|
1333
|
+
this.onstreamingchannelleaved(<StreamingLeavedEvent>message.streaming_leaved_event);
|
1252
1334
|
} else {
|
1253
1335
|
if (this.verbose && window && window.console) {
|
1254
1336
|
console.log("Unrecognized message received: %o", message);
|
@@ -1520,6 +1602,36 @@ export class DefaultSocket implements Socket {
|
|
1520
1602
|
console.log(give_coffee_event);
|
1521
1603
|
}
|
1522
1604
|
}
|
1605
|
+
|
1606
|
+
onroleassign(role_assign_event: RoleAssignedEvent) {
|
1607
|
+
if (this.verbose && window && window.console) {
|
1608
|
+
console.log(role_assign_event);
|
1609
|
+
}
|
1610
|
+
}
|
1611
|
+
|
1612
|
+
onstreamingchannelstarted(streaming_started_event: StreamingStartedEvent) {
|
1613
|
+
if (this.verbose && window && window.console) {
|
1614
|
+
console.log(streaming_started_event);
|
1615
|
+
}
|
1616
|
+
}
|
1617
|
+
|
1618
|
+
onstreamingchannelended(streaming_ended_event: StreamingEndedEvent) {
|
1619
|
+
if (this.verbose && window && window.console) {
|
1620
|
+
console.log(streaming_ended_event);
|
1621
|
+
}
|
1622
|
+
}
|
1623
|
+
|
1624
|
+
onstreamingchanneljoined(streaming_joined_event: StreamingJoinedEvent) {
|
1625
|
+
if (this.verbose && window && window.console) {
|
1626
|
+
console.log(streaming_joined_event);
|
1627
|
+
}
|
1628
|
+
}
|
1629
|
+
|
1630
|
+
onstreamingchannelleaved(streaming_leaved_event: StreamingLeavedEvent) {
|
1631
|
+
if (this.verbose && window && window.console) {
|
1632
|
+
console.log(streaming_leaved_event);
|
1633
|
+
}
|
1634
|
+
}
|
1523
1635
|
|
1524
1636
|
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent |
|
1525
1637
|
ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping, sendTimeout = DefaultSocket.DefaultSendTimeoutMs): Promise<any> {
|