mezon-js 2.10.4 → 2.10.6

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.
@@ -7327,6 +7327,8 @@ var _DefaultSocket = class _DefaultSocket {
7327
7327
  this.onpttchanneljoined(message.ptt_joined_event);
7328
7328
  } else if (message.ptt_leaved_event) {
7329
7329
  this.onpttchannelleaved(message.ptt_leaved_event);
7330
+ } else if (message.sd_topic_event) {
7331
+ this.onsdtopicevent(message.sd_topic_event);
7330
7332
  } else {
7331
7333
  if (this.verbose && window && window.console) {
7332
7334
  console.log("Unrecognized message received: %o", message);
@@ -7644,6 +7646,11 @@ var _DefaultSocket = class _DefaultSocket {
7644
7646
  console.log(talk_ptt_channel);
7645
7647
  }
7646
7648
  }
7649
+ onsdtopicevent(sd_topic_event) {
7650
+ if (this.verbose && window && window.console) {
7651
+ console.log(sd_topic_event);
7652
+ }
7653
+ }
7647
7654
  send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
7648
7655
  const untypedMessage = message;
7649
7656
  return new Promise((resolve, reject) => {
@@ -7962,14 +7969,11 @@ var _DefaultSocket = class _DefaultSocket {
7962
7969
  return response.join_ptt_channel;
7963
7970
  });
7964
7971
  }
7965
- talkPTTChannel(channelId, dataType, jsonData, state) {
7972
+ talkPTTChannel(channelId) {
7966
7973
  return __async(this, null, function* () {
7967
7974
  const response = yield this.send({
7968
7975
  talk_ptt_channel: {
7969
- channel_id: channelId,
7970
- data_type: dataType,
7971
- json_data: jsonData,
7972
- state
7976
+ channel_id: channelId
7973
7977
  }
7974
7978
  });
7975
7979
  return response.talk_ptt_channel;
@@ -7293,6 +7293,8 @@ var _DefaultSocket = class _DefaultSocket {
7293
7293
  this.onpttchanneljoined(message.ptt_joined_event);
7294
7294
  } else if (message.ptt_leaved_event) {
7295
7295
  this.onpttchannelleaved(message.ptt_leaved_event);
7296
+ } else if (message.sd_topic_event) {
7297
+ this.onsdtopicevent(message.sd_topic_event);
7296
7298
  } else {
7297
7299
  if (this.verbose && window && window.console) {
7298
7300
  console.log("Unrecognized message received: %o", message);
@@ -7610,6 +7612,11 @@ var _DefaultSocket = class _DefaultSocket {
7610
7612
  console.log(talk_ptt_channel);
7611
7613
  }
7612
7614
  }
7615
+ onsdtopicevent(sd_topic_event) {
7616
+ if (this.verbose && window && window.console) {
7617
+ console.log(sd_topic_event);
7618
+ }
7619
+ }
7613
7620
  send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
7614
7621
  const untypedMessage = message;
7615
7622
  return new Promise((resolve, reject) => {
@@ -7928,14 +7935,11 @@ var _DefaultSocket = class _DefaultSocket {
7928
7935
  return response.join_ptt_channel;
7929
7936
  });
7930
7937
  }
7931
- talkPTTChannel(channelId, dataType, jsonData, state) {
7938
+ talkPTTChannel(channelId) {
7932
7939
  return __async(this, null, function* () {
7933
7940
  const response = yield this.send({
7934
7941
  talk_ptt_channel: {
7935
- channel_id: channelId,
7936
- data_type: dataType,
7937
- json_data: jsonData,
7938
- state
7942
+ channel_id: channelId
7939
7943
  }
7940
7944
  });
7941
7945
  return response.talk_ptt_channel;
package/dist/socket.d.ts CHANGED
@@ -662,6 +662,12 @@ export interface PTTJoinedEvent {
662
662
  export interface ListActivity {
663
663
  acts: ApiUserActivity[];
664
664
  }
665
+ export interface SdTopicEvent {
666
+ id: string;
667
+ clan_id: string;
668
+ channel_id: string;
669
+ message_id: string;
670
+ }
665
671
  /** A socket connection to Mezon server. */
666
672
  export interface Socket {
667
673
  /** Connection is Open */
@@ -788,6 +794,7 @@ export interface Socket {
788
794
  ontalkpttchannel: (talk_ptt_channel: TalkPTTChannel) => void;
789
795
  onpttchanneljoined: (ptt_joined_event: PTTJoinedEvent) => void;
790
796
  onpttchannelleaved: (ptt_leaved_event: PTTLeavedEvent) => void;
797
+ onsdtopicevent: (sd_topic_event: SdTopicEvent) => void;
791
798
  }
792
799
  /** Reports an error received from a socket message. */
793
800
  export interface SocketError {
@@ -870,6 +877,7 @@ export declare class DefaultSocket implements Socket {
870
877
  onactivityupdated(list_activity: ListActivity): void;
871
878
  onjoinpttchannel(join_ptt_channel: JoinPTTChannel): void;
872
879
  ontalkpttchannel(talk_ptt_channel: TalkPTTChannel): void;
880
+ onsdtopicevent(sd_topic_event: SdTopicEvent): void;
873
881
  send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | JoinPTTChannel | TalkPTTChannel, sendTimeout?: number): Promise<any>;
874
882
  followUsers(userIds: string[]): Promise<Status>;
875
883
  joinClanChat(clan_id: string): Promise<ClanJoin>;
@@ -894,7 +902,7 @@ export declare class DefaultSocket implements Socket {
894
902
  handleDropdownBoxSelected(message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>): Promise<DropdownBoxSelected>;
895
903
  handleMessageButtonClick(message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string, extra_data: string): Promise<MessageButtonClicked>;
896
904
  joinPTTChannel(clanId: string, channelId: string, dataType: number, jsonData: string): Promise<JoinPTTChannel>;
897
- talkPTTChannel(channelId: string, dataType: number, jsonData: string, state: number): Promise<TalkPTTChannel>;
905
+ talkPTTChannel(channelId: string): Promise<TalkPTTChannel>;
898
906
  private pingPong;
899
907
  }
900
908
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.10.4",
4
+ "version": "2.10.6",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -924,6 +924,13 @@ export interface ListActivity {
924
924
  acts: ApiUserActivity[];
925
925
  }
926
926
 
927
+ export interface SdTopicEvent {
928
+ id: string;
929
+ clan_id: string;
930
+ channel_id: string;
931
+ message_id: string;
932
+ }
933
+
927
934
  /** A socket connection to Mezon server. */
928
935
  export interface Socket {
929
936
  /** Connection is Open */
@@ -1082,7 +1089,7 @@ export interface Socket {
1082
1089
  clanId: string,
1083
1090
  channelId: string,
1084
1091
  dataType: number,
1085
- jsonData: string,
1092
+ jsonData: string
1086
1093
  ): Promise<JoinPTTChannel>;
1087
1094
 
1088
1095
  talkPTTChannel(
@@ -1286,6 +1293,8 @@ export interface Socket {
1286
1293
  onpttchanneljoined: (ptt_joined_event: PTTJoinedEvent) => void;
1287
1294
 
1288
1295
  onpttchannelleaved: (ptt_leaved_event: PTTLeavedEvent) => void;
1296
+
1297
+ onsdtopicevent: (sd_topic_event: SdTopicEvent) => void;
1289
1298
  }
1290
1299
 
1291
1300
  /** Reports an error received from a socket message. */
@@ -1558,6 +1567,8 @@ export class DefaultSocket implements Socket {
1558
1567
  this.onpttchanneljoined(<PTTJoinedEvent>message.ptt_joined_event);
1559
1568
  } else if (message.ptt_leaved_event) {
1560
1569
  this.onpttchannelleaved(<PTTLeavedEvent>message.ptt_leaved_event);
1570
+ } else if (message.sd_topic_event) {
1571
+ this.onsdtopicevent(<SdTopicEvent>message.sd_topic_event);
1561
1572
  } else {
1562
1573
  if (this.verbose && window && window.console) {
1563
1574
  console.log("Unrecognized message received: %o", message);
@@ -1936,6 +1947,11 @@ export class DefaultSocket implements Socket {
1936
1947
  console.log(talk_ptt_channel);
1937
1948
  }
1938
1949
  }
1950
+ onsdtopicevent(sd_topic_event: SdTopicEvent) {
1951
+ if (this.verbose && window && window.console) {
1952
+ console.log(sd_topic_event);
1953
+ }
1954
+ }
1939
1955
  send(
1940
1956
  message:
1941
1957
  | ChannelJoin
@@ -2116,7 +2132,7 @@ export class DefaultSocket implements Socket {
2116
2132
  anonymous_message?: boolean,
2117
2133
  mention_everyone?: Boolean,
2118
2134
  avatar?: string,
2119
- code?: number,
2135
+ code?: number
2120
2136
  ): Promise<ChannelMessageAck> {
2121
2137
  const response = await this.send({
2122
2138
  channel_message_send: {
@@ -2326,7 +2342,7 @@ export class DefaultSocket implements Socket {
2326
2342
  },
2327
2343
  });
2328
2344
  return response.incoming_call_push;
2329
- }
2345
+ }
2330
2346
 
2331
2347
  async handleDropdownBoxSelected(
2332
2348
  message_id: string,
@@ -2364,7 +2380,7 @@ export class DefaultSocket implements Socket {
2364
2380
  button_id: button_id,
2365
2381
  sender_id: sender_id,
2366
2382
  user_id: user_id,
2367
- extra_data: extra_data
2383
+ extra_data: extra_data,
2368
2384
  },
2369
2385
  });
2370
2386
  return response.webrtc_signaling_fwd;
@@ -2374,7 +2390,7 @@ export class DefaultSocket implements Socket {
2374
2390
  clanId: string,
2375
2391
  channelId: string,
2376
2392
  dataType: number,
2377
- jsonData: string,
2393
+ jsonData: string
2378
2394
  ): Promise<JoinPTTChannel> {
2379
2395
  const response = await this.send({
2380
2396
  join_ptt_channel: {
@@ -2389,17 +2405,11 @@ export class DefaultSocket implements Socket {
2389
2405
  }
2390
2406
 
2391
2407
  async talkPTTChannel(
2392
- channelId: string,
2393
- dataType: number,
2394
- jsonData: string,
2395
- state: number
2408
+ channelId: string
2396
2409
  ): Promise<TalkPTTChannel> {
2397
2410
  const response = await this.send({
2398
2411
  talk_ptt_channel: {
2399
- channel_id: channelId,
2400
- data_type: dataType,
2401
- json_data: jsonData,
2402
- state: state,
2412
+ channel_id: channelId
2403
2413
  },
2404
2414
  });
2405
2415
  return response.talk_ptt_channel;