mezon-js 2.8.55 → 2.8.57

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -137,6 +137,8 @@ export interface MezonUpdateClanStickerByIdBody {
137
137
  //
138
138
  category?: string;
139
139
  //
140
+ clan_id?: string;
141
+ //
140
142
  shortname?: string;
141
143
  //
142
144
  source?: string;
@@ -645,7 +647,7 @@ export interface ApiClanEmojiCreateRequest {
645
647
  /** Get clan profile. */
646
648
  export interface ApiClanProfile {
647
649
  //
648
- avartar?: string;
650
+ avatar?: string;
649
651
  //
650
652
  clan_id?: string;
651
653
  //
package/client.ts CHANGED
@@ -769,6 +769,17 @@ export class Client {
769
769
  });
770
770
  }
771
771
 
772
+ async deleteApp(session: Session, appId: string): Promise<boolean> {
773
+ if (this.autoRefreshSession && session.refresh_token &&
774
+ session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
775
+ await this.sessionRefresh(session);
776
+ }
777
+
778
+ return this.apiClient.deleteApp(session.token, appId).then((response: any) => {
779
+ return response !== undefined;
780
+ });
781
+ }
782
+
772
783
  /** A socket created with the client's configuration. */
773
784
  createSocket(useSSL = false, verbose: boolean = false, adapter : WebSocketAdapter = new WebSocketAdapterText(), sendTimeoutMs : number = DefaultSocket.DefaultSendTimeoutMs): Socket {
774
785
  return new DefaultSocket(this.host, this.port, useSSL, verbose, adapter, sendTimeoutMs);
package/dist/api.gen.d.ts CHANGED
@@ -78,6 +78,7 @@ export interface MezonUpdateClanEmojiByIdBody {
78
78
  /** */
79
79
  export interface MezonUpdateClanStickerByIdBody {
80
80
  category?: string;
81
+ clan_id?: string;
81
82
  shortname?: string;
82
83
  source?: string;
83
84
  }
@@ -369,7 +370,7 @@ export interface ApiClanEmojiCreateRequest {
369
370
  }
370
371
  /** Get clan profile. */
371
372
  export interface ApiClanProfile {
372
- avartar?: string;
373
+ avatar?: string;
373
374
  clan_id?: string;
374
375
  nick_name?: string;
375
376
  user_id?: string;
package/dist/client.d.ts CHANGED
@@ -364,6 +364,7 @@ export declare class Client {
364
364
  addRolesChannelDesc(session: Session, request: ApiAddRoleChannelDescRequest): Promise<boolean>;
365
365
  /** Update action role when delete role */
366
366
  deleteRoleChannelDesc(session: Session, request: ApiDeleteRoleRequest): Promise<boolean>;
367
+ deleteApp(session: Session, appId: string): Promise<boolean>;
367
368
  /** A socket created with the client's configuration. */
368
369
  createSocket(useSSL?: boolean, verbose?: boolean, adapter?: WebSocketAdapter, sendTimeoutMs?: number): Socket;
369
370
  /** Delete one or more users by ID or username. */
@@ -4747,6 +4747,8 @@ var _DefaultSocket = class _DefaultSocket {
4747
4747
  this.onuserchannelremoved(message.user_channel_removed_event);
4748
4748
  } else if (message.user_clan_removed_event) {
4749
4749
  this.onuserclanremoved(message.user_clan_removed_event);
4750
+ } else if (message.clan_event_created) {
4751
+ this.oneventcreated(message.clan_event_created);
4750
4752
  } else {
4751
4753
  if (this.verbose && window && window.console) {
4752
4754
  console.log("Unrecognized message received: %o", message);
@@ -4934,6 +4936,11 @@ var _DefaultSocket = class _DefaultSocket {
4934
4936
  console.log(statusEvent);
4935
4937
  }
4936
4938
  }
4939
+ oneventcreated(clan_event_created) {
4940
+ if (this.verbose && window && window.console) {
4941
+ console.log(clan_event_created);
4942
+ }
4943
+ }
4937
4944
  send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
4938
4945
  const untypedMessage = message;
4939
4946
  return new Promise((resolve, reject) => {
@@ -5106,10 +5113,10 @@ var _DefaultSocket = class _DefaultSocket {
5106
5113
  return response.channel_desc_list_event;
5107
5114
  });
5108
5115
  }
5109
- ListUsersByUserId() {
5116
+ ListUserClansByUserId() {
5110
5117
  return __async(this, null, function* () {
5111
- const response = yield this.send({ list_user: {} });
5112
- return response.list_user;
5118
+ const response = yield this.send({ all_user_clans: {} });
5119
+ return response.all_user_clans;
5113
5120
  });
5114
5121
  }
5115
5122
  hashtagDMList(user_id, limit) {
@@ -5479,6 +5486,16 @@ var Client = class {
5479
5486
  });
5480
5487
  });
5481
5488
  }
5489
+ deleteApp(session, appId) {
5490
+ return __async(this, null, function* () {
5491
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
5492
+ yield this.sessionRefresh(session);
5493
+ }
5494
+ return this.apiClient.deleteApp(session.token, appId).then((response) => {
5495
+ return response !== void 0;
5496
+ });
5497
+ });
5498
+ }
5482
5499
  /** A socket created with the client's configuration. */
5483
5500
  createSocket(useSSL = false, verbose = false, adapter = new WebSocketAdapterText(), sendTimeoutMs = DefaultSocket.DefaultSendTimeoutMs) {
5484
5501
  return new DefaultSocket(this.host, this.port, useSSL, verbose, adapter, sendTimeoutMs);
@@ -4718,6 +4718,8 @@ var _DefaultSocket = class _DefaultSocket {
4718
4718
  this.onuserchannelremoved(message.user_channel_removed_event);
4719
4719
  } else if (message.user_clan_removed_event) {
4720
4720
  this.onuserclanremoved(message.user_clan_removed_event);
4721
+ } else if (message.clan_event_created) {
4722
+ this.oneventcreated(message.clan_event_created);
4721
4723
  } else {
4722
4724
  if (this.verbose && window && window.console) {
4723
4725
  console.log("Unrecognized message received: %o", message);
@@ -4905,6 +4907,11 @@ var _DefaultSocket = class _DefaultSocket {
4905
4907
  console.log(statusEvent);
4906
4908
  }
4907
4909
  }
4910
+ oneventcreated(clan_event_created) {
4911
+ if (this.verbose && window && window.console) {
4912
+ console.log(clan_event_created);
4913
+ }
4914
+ }
4908
4915
  send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
4909
4916
  const untypedMessage = message;
4910
4917
  return new Promise((resolve, reject) => {
@@ -5077,10 +5084,10 @@ var _DefaultSocket = class _DefaultSocket {
5077
5084
  return response.channel_desc_list_event;
5078
5085
  });
5079
5086
  }
5080
- ListUsersByUserId() {
5087
+ ListUserClansByUserId() {
5081
5088
  return __async(this, null, function* () {
5082
- const response = yield this.send({ list_user: {} });
5083
- return response.list_user;
5089
+ const response = yield this.send({ all_user_clans: {} });
5090
+ return response.all_user_clans;
5084
5091
  });
5085
5092
  }
5086
5093
  hashtagDMList(user_id, limit) {
@@ -5450,6 +5457,16 @@ var Client = class {
5450
5457
  });
5451
5458
  });
5452
5459
  }
5460
+ deleteApp(session, appId) {
5461
+ return __async(this, null, function* () {
5462
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
5463
+ yield this.sessionRefresh(session);
5464
+ }
5465
+ return this.apiClient.deleteApp(session.token, appId).then((response) => {
5466
+ return response !== void 0;
5467
+ });
5468
+ });
5469
+ }
5453
5470
  /** A socket created with the client's configuration. */
5454
5471
  createSocket(useSSL = false, verbose = false, adapter = new WebSocketAdapterText(), sendTimeoutMs = DefaultSocket.DefaultSendTimeoutMs) {
5455
5472
  return new DefaultSocket(this.host, this.port, useSSL, verbose, adapter, sendTimeoutMs);
package/dist/socket.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ApiChannelMessageHeader, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiRpc, ApiUser } from "./api.gen";
16
+ import { ApiChannelMessageHeader, ApiCreateEventRequest, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiRpc, ApiUser } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { ChannelMessage, Notification } from "./client";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -254,6 +254,7 @@ export interface ChannelUpdatedEvent {
254
254
  channel_label: string;
255
255
  channel_type: number;
256
256
  status: number;
257
+ meeting_code: string;
257
258
  }
258
259
  export interface ChannelCreatedEvent {
259
260
  clan_id: string;
@@ -400,7 +401,7 @@ export interface ChannelDescListEvent {
400
401
  channeldesc?: Array<ChannelDescription>;
401
402
  }
402
403
  /** */
403
- export interface ListUser {
404
+ export interface AllUserClans {
404
405
  user?: Array<ApiUser>;
405
406
  }
406
407
  /** */
@@ -568,7 +569,7 @@ export interface Socket {
568
569
  listClanEmojiByClanId(clan_id: string): Promise<EmojiListedEvent>;
569
570
  listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
570
571
  ListChannelByUserId(): Promise<ChannelDescListEvent>;
571
- ListUsersByUserId(): Promise<ListUser>;
572
+ ListUserClansByUserId(): Promise<AllUserClans>;
572
573
  hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
573
574
  getNotificationChannelSetting(channel_id: string): Promise<NotificationChannelSettingEvent>;
574
575
  getNotificationCategorySetting(category_id: string): Promise<NotificationCategorySettingEvent>;
@@ -576,6 +577,7 @@ export interface Socket {
576
577
  getNotificationReactMessage(channel_id_req: string): Promise<NotifiReactMessageEvent>;
577
578
  GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
578
579
  getNotificationChannelCategorySetting(clan_id: string): Promise<NotificationChannelCategorySettingEvent>;
580
+ oneventcreated: (clan_event_created: ApiCreateEventRequest) => void;
579
581
  }
580
582
  /** Reports an error received from a socket message. */
581
583
  export interface SocketError {
@@ -632,6 +634,7 @@ export declare class DefaultSocket implements Socket {
632
634
  onstreamdata(streamData: StreamData): void;
633
635
  onheartbeattimeout(): void;
634
636
  oncustomstatus(statusEvent: CustomStatusEvent): void;
637
+ oneventcreated(clan_event_created: ApiCreateEventRequest): void;
635
638
  send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping, sendTimeout?: number): Promise<any>;
636
639
  followUsers(userIds: string[]): Promise<Status>;
637
640
  joinClanChat(clan_id: string): Promise<ClanJoin>;
@@ -655,7 +658,7 @@ export declare class DefaultSocket implements Socket {
655
658
  checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
656
659
  listClanEmojiByClanId(clan_id: string): Promise<EmojiListedEvent>;
657
660
  ListChannelByUserId(): Promise<ChannelDescListEvent>;
658
- ListUsersByUserId(): Promise<ListUser>;
661
+ ListUserClansByUserId(): Promise<AllUserClans>;
659
662
  hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
660
663
  GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
661
664
  listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.55",
3
+ "version": "2.8.57",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { ApiChannelMessageHeader, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiRpc, ApiUser} from "./api.gen";
17
+ import { ApiChannelMessageHeader, ApiCreateEventRequest, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiRpc, ApiUser} from "./api.gen";
18
18
  import {Session} from "./session";
19
19
  import {ChannelMessage, Notification} from "./client";
20
20
  import {WebSocketAdapter, WebSocketAdapterText} from "./web_socket_adapter"
@@ -360,6 +360,8 @@ export interface ChannelUpdatedEvent {
360
360
  channel_type: number;
361
361
  // status
362
362
  status: number;
363
+ // meeting code
364
+ meeting_code: string;
363
365
  }
364
366
 
365
367
  export interface ChannelCreatedEvent {
@@ -569,7 +571,7 @@ export interface ChannelDescListEvent {
569
571
  }
570
572
 
571
573
  /** */
572
- export interface ListUser {
574
+ export interface AllUserClans {
573
575
  //
574
576
  user?: Array<ApiUser>;
575
577
  }
@@ -859,7 +861,7 @@ export interface Socket {
859
861
 
860
862
  ListChannelByUserId(): Promise<ChannelDescListEvent>;
861
863
 
862
- ListUsersByUserId(): Promise<ListUser>;
864
+ ListUserClansByUserId(): Promise<AllUserClans>;
863
865
 
864
866
  hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
865
867
 
@@ -874,6 +876,8 @@ export interface Socket {
874
876
  GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
875
877
 
876
878
  getNotificationChannelCategorySetting(clan_id : string): Promise<NotificationChannelCategorySettingEvent>;
879
+
880
+ oneventcreated: (clan_event_created: ApiCreateEventRequest) => void
877
881
  }
878
882
 
879
883
  /** Reports an error received from a socket message. */
@@ -1042,7 +1046,9 @@ export class DefaultSocket implements Socket {
1042
1046
  this.onuserchannelremoved(<UserChannelRemovedEvent>message.user_channel_removed_event);
1043
1047
  } else if (message.user_clan_removed_event) {
1044
1048
  this.onuserclanremoved(<UserClanRemovedEvent>message.user_clan_removed_event);
1045
- } else {
1049
+ } else if(message.clan_event_created){
1050
+ this.oneventcreated(message.clan_event_created);
1051
+ }else {
1046
1052
  if (this.verbose && window && window.console) {
1047
1053
  console.log("Unrecognized message received: %o", message);
1048
1054
  }
@@ -1265,6 +1271,12 @@ export class DefaultSocket implements Socket {
1265
1271
  }
1266
1272
  }
1267
1273
 
1274
+ oneventcreated(clan_event_created: ApiCreateEventRequest) {
1275
+ if (this.verbose && window && window.console) {
1276
+ console.log(clan_event_created);
1277
+ }
1278
+ }
1279
+
1268
1280
  send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent |
1269
1281
  ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping, sendTimeout = DefaultSocket.DefaultSendTimeoutMs): Promise<any> {
1270
1282
  const untypedMessage = message as any;
@@ -1434,9 +1446,9 @@ export class DefaultSocket implements Socket {
1434
1446
  return response.channel_desc_list_event
1435
1447
  }
1436
1448
 
1437
- async ListUsersByUserId(): Promise<ListUser> {
1438
- const response = await this.send({list_user: {}});
1439
- return response.list_user
1449
+ async ListUserClansByUserId(): Promise<AllUserClans> {
1450
+ const response = await this.send({all_user_clans: {}});
1451
+ return response.all_user_clans
1440
1452
  }
1441
1453
 
1442
1454
  async hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent> {