mezon-js 2.8.7 → 2.8.10

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -971,9 +971,9 @@ export interface ApiMessageReaction {
971
971
  //
972
972
  action?: boolean;
973
973
  //
974
- emoji_id?: string;
974
+ emoji_id: string;
975
975
  //
976
- emoji?: string;
976
+ emoji: string;
977
977
  //
978
978
  id?: string;
979
979
  //
package/client.ts CHANGED
@@ -1234,7 +1234,8 @@ export class Client {
1234
1234
  metadata: gu.user!.metadata ? JSON.parse(gu.user!.metadata!) : undefined
1235
1235
  },
1236
1236
  role_id: gu!.role_id,
1237
- clan_nick: gu!.clan_nick
1237
+ clan_nick: gu!.clan_nick,
1238
+ clan_avatar: gu!.clan_avatar
1238
1239
  })
1239
1240
  });
1240
1241
  return Promise.resolve(result);
package/dist/api.gen.d.ts CHANGED
@@ -557,8 +557,8 @@ export interface ApiMessageMention {
557
557
  /** */
558
558
  export interface ApiMessageReaction {
559
559
  action?: boolean;
560
- emoji_id?: string;
561
- emoji?: string;
560
+ emoji_id: string;
561
+ emoji: string;
562
562
  id?: string;
563
563
  sender_id?: string;
564
564
  sender_name?: string;
@@ -5138,6 +5138,12 @@ var _DefaultSocket = class _DefaultSocket {
5138
5138
  return response.custom_status_event;
5139
5139
  });
5140
5140
  }
5141
+ checkDuplicateClanName(clan_name) {
5142
+ return __async(this, null, function* () {
5143
+ const response = yield this.send({ clan_name_existed_event: { clan_name } });
5144
+ return response.clan_name_existed_event;
5145
+ });
5146
+ }
5141
5147
  pingPong() {
5142
5148
  return __async(this, null, function* () {
5143
5149
  if (!this.adapter.isOpen()) {
@@ -5840,7 +5846,8 @@ var Client = class {
5840
5846
  metadata: gu.user.metadata ? JSON.parse(gu.user.metadata) : void 0
5841
5847
  },
5842
5848
  role_id: gu.role_id,
5843
- clan_nick: gu.clan_nick
5849
+ clan_nick: gu.clan_nick,
5850
+ clan_avatar: gu.clan_avatar
5844
5851
  });
5845
5852
  });
5846
5853
  return Promise.resolve(result);
@@ -5109,6 +5109,12 @@ var _DefaultSocket = class _DefaultSocket {
5109
5109
  return response.custom_status_event;
5110
5110
  });
5111
5111
  }
5112
+ checkDuplicateClanName(clan_name) {
5113
+ return __async(this, null, function* () {
5114
+ const response = yield this.send({ clan_name_existed_event: { clan_name } });
5115
+ return response.clan_name_existed_event;
5116
+ });
5117
+ }
5112
5118
  pingPong() {
5113
5119
  return __async(this, null, function* () {
5114
5120
  if (!this.adapter.isOpen()) {
@@ -5811,7 +5817,8 @@ var Client = class {
5811
5817
  metadata: gu.user.metadata ? JSON.parse(gu.user.metadata) : void 0
5812
5818
  },
5813
5819
  role_id: gu.role_id,
5814
- clan_nick: gu.clan_nick
5820
+ clan_nick: gu.clan_nick,
5821
+ clan_avatar: gu.clan_avatar
5815
5822
  });
5816
5823
  });
5817
5824
  return Promise.resolve(result);
package/dist/socket.d.ts CHANGED
@@ -434,6 +434,9 @@ interface StatusUpdate {
434
434
  status?: string;
435
435
  };
436
436
  }
437
+ export interface ClanNameExistedEvent {
438
+ clan_name: string;
439
+ }
437
440
  /** A socket connection to Mezon server. */
438
441
  export interface Socket {
439
442
  /** Connection is Open */
@@ -525,6 +528,7 @@ export interface Socket {
525
528
  onclanupdated: (clan: ClanUpdatedEvent) => void;
526
529
  setHeartbeatTimeoutMs(ms: number): void;
527
530
  getHeartbeatTimeoutMs(): number;
531
+ checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
528
532
  }
529
533
  /** Reports an error received from a socket message. */
530
534
  export interface SocketError {
@@ -600,6 +604,7 @@ export declare class DefaultSocket implements Socket {
600
604
  writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
601
605
  writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
602
606
  writeCustomStatus(clan_id: string, status: string): Promise<CustomStatusEvent>;
607
+ checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
603
608
  private pingPong;
604
609
  }
605
610
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.7",
3
+ "version": "2.8.10",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -614,7 +614,9 @@ interface StatusUpdate {
614
614
  /** Status string to set, if not present the user will appear offline. */
615
615
  status_update: {status?: string;};
616
616
  }
617
-
617
+ export interface ClanNameExistedEvent {
618
+ clan_name: string;
619
+ }
618
620
  /** A socket connection to Mezon server. */
619
621
  export interface Socket {
620
622
  /** Connection is Open */
@@ -764,6 +766,9 @@ export interface Socket {
764
766
 
765
767
  /* Get the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
766
768
  getHeartbeatTimeoutMs() : number;
769
+
770
+ checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>
771
+
767
772
  }
768
773
 
769
774
  /** Reports an error received from a socket message. */
@@ -1280,6 +1285,11 @@ export class DefaultSocket implements Socket {
1280
1285
  const response = await this.send({custom_status_event: {clan_id: clan_id, status: status}});
1281
1286
  return response.custom_status_event
1282
1287
  }
1288
+
1289
+ async checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent> {
1290
+ const response = await this.send({clan_name_existed_event: {clan_name: clan_name}});
1291
+ return response.clan_name_existed_event
1292
+ }
1283
1293
 
1284
1294
  private async pingPong() : Promise<void> {
1285
1295
  if (!this.adapter.isOpen()) {