mezon-js 2.8.54 → 2.8.56

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. */
@@ -5058,15 +5058,15 @@ var _DefaultSocket = class _DefaultSocket {
5058
5058
  return response.message_typing_event;
5059
5059
  });
5060
5060
  }
5061
- writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp) {
5061
+ writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp_seconds) {
5062
5062
  return __async(this, null, function* () {
5063
- const response = yield this.send({ last_seen_message_event: { clan_id, channel_id, mode, message_id, timestamp } });
5063
+ const response = yield this.send({ last_seen_message_event: { clan_id, channel_id, mode, message_id, timestamp_seconds } });
5064
5064
  return response.last_seen_message_event;
5065
5065
  });
5066
5066
  }
5067
- writeLastPinMessage(clan_id, channel_id, mode, message_id, timestamp, operation) {
5067
+ writeLastPinMessage(clan_id, channel_id, mode, message_id, timestamp_seconds, operation) {
5068
5068
  return __async(this, null, function* () {
5069
- const response = yield this.send({ last_pin_message_event: { clan_id, channel_id, mode, message_id, timestamp, operation } });
5069
+ const response = yield this.send({ last_pin_message_event: { clan_id, channel_id, mode, message_id, timestamp_seconds, operation } });
5070
5070
  return response.last_pin_message_event;
5071
5071
  });
5072
5072
  }
@@ -5106,10 +5106,10 @@ var _DefaultSocket = class _DefaultSocket {
5106
5106
  return response.channel_desc_list_event;
5107
5107
  });
5108
5108
  }
5109
- ListUsersByUserId() {
5109
+ ListUserClansByUserId() {
5110
5110
  return __async(this, null, function* () {
5111
- const response = yield this.send({ list_user: {} });
5112
- return response.list_user;
5111
+ const response = yield this.send({ all_user_clans: {} });
5112
+ return response.all_user_clans;
5113
5113
  });
5114
5114
  }
5115
5115
  hashtagDMList(user_id, limit) {
@@ -5479,6 +5479,16 @@ var Client = class {
5479
5479
  });
5480
5480
  });
5481
5481
  }
5482
+ deleteApp(session, appId) {
5483
+ return __async(this, null, function* () {
5484
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
5485
+ yield this.sessionRefresh(session);
5486
+ }
5487
+ return this.apiClient.deleteApp(session.token, appId).then((response) => {
5488
+ return response !== void 0;
5489
+ });
5490
+ });
5491
+ }
5482
5492
  /** A socket created with the client's configuration. */
5483
5493
  createSocket(useSSL = false, verbose = false, adapter = new WebSocketAdapterText(), sendTimeoutMs = DefaultSocket.DefaultSendTimeoutMs) {
5484
5494
  return new DefaultSocket(this.host, this.port, useSSL, verbose, adapter, sendTimeoutMs);
@@ -5029,15 +5029,15 @@ var _DefaultSocket = class _DefaultSocket {
5029
5029
  return response.message_typing_event;
5030
5030
  });
5031
5031
  }
5032
- writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp) {
5032
+ writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp_seconds) {
5033
5033
  return __async(this, null, function* () {
5034
- const response = yield this.send({ last_seen_message_event: { clan_id, channel_id, mode, message_id, timestamp } });
5034
+ const response = yield this.send({ last_seen_message_event: { clan_id, channel_id, mode, message_id, timestamp_seconds } });
5035
5035
  return response.last_seen_message_event;
5036
5036
  });
5037
5037
  }
5038
- writeLastPinMessage(clan_id, channel_id, mode, message_id, timestamp, operation) {
5038
+ writeLastPinMessage(clan_id, channel_id, mode, message_id, timestamp_seconds, operation) {
5039
5039
  return __async(this, null, function* () {
5040
- const response = yield this.send({ last_pin_message_event: { clan_id, channel_id, mode, message_id, timestamp, operation } });
5040
+ const response = yield this.send({ last_pin_message_event: { clan_id, channel_id, mode, message_id, timestamp_seconds, operation } });
5041
5041
  return response.last_pin_message_event;
5042
5042
  });
5043
5043
  }
@@ -5077,10 +5077,10 @@ var _DefaultSocket = class _DefaultSocket {
5077
5077
  return response.channel_desc_list_event;
5078
5078
  });
5079
5079
  }
5080
- ListUsersByUserId() {
5080
+ ListUserClansByUserId() {
5081
5081
  return __async(this, null, function* () {
5082
- const response = yield this.send({ list_user: {} });
5083
- return response.list_user;
5082
+ const response = yield this.send({ all_user_clans: {} });
5083
+ return response.all_user_clans;
5084
5084
  });
5085
5085
  }
5086
5086
  hashtagDMList(user_id, limit) {
@@ -5450,6 +5450,16 @@ var Client = class {
5450
5450
  });
5451
5451
  });
5452
5452
  }
5453
+ deleteApp(session, appId) {
5454
+ return __async(this, null, function* () {
5455
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
5456
+ yield this.sessionRefresh(session);
5457
+ }
5458
+ return this.apiClient.deleteApp(session.token, appId).then((response) => {
5459
+ return response !== void 0;
5460
+ });
5461
+ });
5462
+ }
5453
5463
  /** A socket created with the client's configuration. */
5454
5464
  createSocket(useSSL = false, verbose = false, adapter = new WebSocketAdapterText(), sendTimeoutMs = DefaultSocket.DefaultSendTimeoutMs) {
5455
5465
  return new DefaultSocket(this.host, this.port, useSSL, verbose, adapter, sendTimeoutMs);
package/dist/socket.d.ts CHANGED
@@ -400,7 +400,7 @@ export interface ChannelDescListEvent {
400
400
  channeldesc?: Array<ChannelDescription>;
401
401
  }
402
402
  /** */
403
- export interface ListUser {
403
+ export interface AllUserClans {
404
404
  user?: Array<ApiUser>;
405
405
  }
406
406
  /** */
@@ -504,9 +504,9 @@ export interface Socket {
504
504
  /** Send message reaction */
505
505
  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<ApiMessageReaction>;
506
506
  /** Send last seen message */
507
- writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string): Promise<LastSeenMessageEvent>;
507
+ writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number): Promise<LastSeenMessageEvent>;
508
508
  /** Send last pin message */
509
- writeLastPinMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string, operation: number): Promise<LastPinMessageEvent>;
509
+ writeLastPinMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
510
510
  /** Send custom user status */
511
511
  writeCustomStatus(clan_id: string, status: string): Promise<CustomStatusEvent>;
512
512
  /** send voice joined */
@@ -568,7 +568,7 @@ export interface Socket {
568
568
  listClanEmojiByClanId(clan_id: string): Promise<EmojiListedEvent>;
569
569
  listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
570
570
  ListChannelByUserId(): Promise<ChannelDescListEvent>;
571
- ListUsersByUserId(): Promise<ListUser>;
571
+ ListUserClansByUserId(): Promise<AllUserClans>;
572
572
  hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
573
573
  getNotificationChannelSetting(channel_id: string): Promise<NotificationChannelSettingEvent>;
574
574
  getNotificationCategorySetting(category_id: string): Promise<NotificationCategorySettingEvent>;
@@ -647,15 +647,15 @@ export declare class DefaultSocket implements Socket {
647
647
  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>;
648
648
  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<ApiMessageReaction>;
649
649
  writeMessageTyping(clan_id: string, channel_id: string, mode: number): Promise<MessageTypingEvent>;
650
- writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string): Promise<LastSeenMessageEvent>;
651
- writeLastPinMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string, operation: number): Promise<LastPinMessageEvent>;
650
+ writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number): Promise<LastSeenMessageEvent>;
651
+ writeLastPinMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
652
652
  writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
653
653
  writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
654
654
  writeCustomStatus(clan_id: string, status: string): Promise<CustomStatusEvent>;
655
655
  checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
656
656
  listClanEmojiByClanId(clan_id: string): Promise<EmojiListedEvent>;
657
657
  ListChannelByUserId(): Promise<ChannelDescListEvent>;
658
- ListUsersByUserId(): Promise<ListUser>;
658
+ ListUserClansByUserId(): Promise<AllUserClans>;
659
659
  hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
660
660
  GetPermissionByRoleIdChannelId(role_id: string, channel_id: string): Promise<PermissionRoleChannelListEvent>;
661
661
  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.54",
3
+ "version": "2.8.56",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -569,7 +569,7 @@ export interface ChannelDescListEvent {
569
569
  }
570
570
 
571
571
  /** */
572
- export interface ListUser {
572
+ export interface AllUserClans {
573
573
  //
574
574
  user?: Array<ApiUser>;
575
575
  }
@@ -746,10 +746,10 @@ export interface Socket {
746
746
  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<ApiMessageReaction>;
747
747
 
748
748
  /** Send last seen message */
749
- writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string) : Promise<LastSeenMessageEvent>;
749
+ writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number) : Promise<LastSeenMessageEvent>;
750
750
 
751
751
  /** Send last pin message */
752
- writeLastPinMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string, operation: number) : Promise<LastPinMessageEvent>;
752
+ writeLastPinMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, operation: number) : Promise<LastPinMessageEvent>;
753
753
 
754
754
  /** Send custom user status */
755
755
  writeCustomStatus(clan_id: string, status: string) : Promise<CustomStatusEvent>;
@@ -859,7 +859,7 @@ export interface Socket {
859
859
 
860
860
  ListChannelByUserId(): Promise<ChannelDescListEvent>;
861
861
 
862
- ListUsersByUserId(): Promise<ListUser>;
862
+ ListUserClansByUserId(): Promise<AllUserClans>;
863
863
 
864
864
  hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
865
865
 
@@ -1394,13 +1394,13 @@ export class DefaultSocket implements Socket {
1394
1394
  return response.message_typing_event
1395
1395
  }
1396
1396
 
1397
- async writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string): Promise<LastSeenMessageEvent> {
1398
- const response = await this.send({last_seen_message_event: {clan_id: clan_id, channel_id: channel_id, mode: mode, message_id: message_id, timestamp: timestamp}});
1397
+ async writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number): Promise<LastSeenMessageEvent> {
1398
+ const response = await this.send({last_seen_message_event: {clan_id: clan_id, channel_id: channel_id, mode: mode, message_id: message_id, timestamp_seconds: timestamp_seconds}});
1399
1399
  return response.last_seen_message_event
1400
1400
  }
1401
1401
 
1402
- async writeLastPinMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp: string, operation: number): Promise<LastPinMessageEvent> {
1403
- const response = await this.send({last_pin_message_event: {clan_id: clan_id, channel_id: channel_id, mode: mode, message_id: message_id, timestamp: timestamp, operation: operation}});
1402
+ async writeLastPinMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent> {
1403
+ const response = await this.send({last_pin_message_event: {clan_id: clan_id, channel_id: channel_id, mode: mode, message_id: message_id, timestamp_seconds: timestamp_seconds, operation: operation}});
1404
1404
  return response.last_pin_message_event
1405
1405
  }
1406
1406
 
@@ -1434,9 +1434,9 @@ export class DefaultSocket implements Socket {
1434
1434
  return response.channel_desc_list_event
1435
1435
  }
1436
1436
 
1437
- async ListUsersByUserId(): Promise<ListUser> {
1438
- const response = await this.send({list_user: {}});
1439
- return response.list_user
1437
+ async ListUserClansByUserId(): Promise<AllUserClans> {
1438
+ const response = await this.send({all_user_clans: {}});
1439
+ return response.all_user_clans
1440
1440
  }
1441
1441
 
1442
1442
  async hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent> {