mezon-js 2.11.40 → 2.11.42

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.
package/api.gen.ts CHANGED
@@ -4715,7 +4715,7 @@ export class MezonApi {
4715
4715
  bearerToken: string,
4716
4716
  body: ApiAddAppRequest,
4717
4717
  options: any = {}
4718
- ): Promise<any> {
4718
+ ): Promise<ApiApp> {
4719
4719
  if (body === null || body === undefined) {
4720
4720
  throw new Error(
4721
4721
  "'body' is a required parameter but is null or undefined."
package/client.ts CHANGED
@@ -3449,7 +3449,7 @@ export class Client {
3449
3449
  });
3450
3450
  }
3451
3451
 
3452
- async addApp(session: Session, request: ApiAddAppRequest): Promise<boolean> {
3452
+ async addApp(session: Session, request: ApiAddAppRequest): Promise<ApiApp> {
3453
3453
  if (
3454
3454
  this.autoRefreshSession &&
3455
3455
  session.refresh_token &&
@@ -3461,7 +3461,7 @@ export class Client {
3461
3461
  return this.apiClient
3462
3462
  .addApp(session.token, request)
3463
3463
  .then((response: any) => {
3464
- return response !== undefined;
3464
+ return Promise.resolve(response);
3465
3465
  });
3466
3466
  }
3467
3467
 
package/dist/api.gen.d.ts CHANGED
@@ -1922,7 +1922,7 @@ export declare class MezonApi {
1922
1922
  /** Create user activity */
1923
1923
  createActiviy(bearerToken: string, body: ApiCreateActivityRequest, options?: any): Promise<ApiUserActivity>;
1924
1924
  /** Add a new apps. */
1925
- addApp(bearerToken: string, body: ApiAddAppRequest, options?: any): Promise<any>;
1925
+ addApp(bearerToken: string, body: ApiAddAppRequest, options?: any): Promise<ApiApp>;
1926
1926
  /** List (and optionally filter) accounts. */
1927
1927
  listApps(bearerToken: string, filter?: string, tombstones?: boolean, cursor?: string, options?: any): Promise<ApiAppList>;
1928
1928
  /** Add an app to clan. */
package/dist/client.d.ts CHANGED
@@ -566,7 +566,7 @@ export declare class Client {
566
566
  changeChannelCategory(session: Session, id: string, request: MezonChangeChannelCategoryBody): Promise<boolean>;
567
567
  /** */
568
568
  setRoleChannelPermission(session: Session, request: ApiUpdateRoleChannelRequest): Promise<boolean>;
569
- addApp(session: Session, request: ApiAddAppRequest): Promise<boolean>;
569
+ addApp(session: Session, request: ApiAddAppRequest): Promise<ApiApp>;
570
570
  getApp(session: Session, id: string): Promise<ApiApp>;
571
571
  listApps(session: Session): Promise<ApiAppList>;
572
572
  addAppToClan(session: Session, appId: string, clanId: string): Promise<boolean>;
@@ -8371,22 +8371,6 @@ var _DefaultSocket = class _DefaultSocket {
8371
8371
  return response.last_pin_message_event;
8372
8372
  });
8373
8373
  }
8374
- writeVoiceJoined(id, clanId, clanName, voiceChannelId, voiceChannelLabel, participant, lastScreenshot) {
8375
- return __async(this, null, function* () {
8376
- const response = yield this.send({
8377
- voice_joined_event: {
8378
- clan_id: clanId,
8379
- clan_name: clanName,
8380
- id,
8381
- participant,
8382
- voice_channel_id: voiceChannelId,
8383
- voice_channel_label: voiceChannelLabel,
8384
- last_screenshot: lastScreenshot
8385
- }
8386
- });
8387
- return response.voice_joined_event;
8388
- });
8389
- }
8390
8374
  writeCustomStatus(clan_id, status, time_reset, no_clear) {
8391
8375
  return __async(this, null, function* () {
8392
8376
  const response = yield this.send({
@@ -10312,7 +10296,7 @@ var Client = class {
10312
10296
  yield this.sessionRefresh(session);
10313
10297
  }
10314
10298
  return this.apiClient.addApp(session.token, request).then((response) => {
10315
- return response !== void 0;
10299
+ return Promise.resolve(response);
10316
10300
  });
10317
10301
  });
10318
10302
  }
@@ -8337,22 +8337,6 @@ var _DefaultSocket = class _DefaultSocket {
8337
8337
  return response.last_pin_message_event;
8338
8338
  });
8339
8339
  }
8340
- writeVoiceJoined(id, clanId, clanName, voiceChannelId, voiceChannelLabel, participant, lastScreenshot) {
8341
- return __async(this, null, function* () {
8342
- const response = yield this.send({
8343
- voice_joined_event: {
8344
- clan_id: clanId,
8345
- clan_name: clanName,
8346
- id,
8347
- participant,
8348
- voice_channel_id: voiceChannelId,
8349
- voice_channel_label: voiceChannelLabel,
8350
- last_screenshot: lastScreenshot
8351
- }
8352
- });
8353
- return response.voice_joined_event;
8354
- });
8355
- }
8356
8340
  writeCustomStatus(clan_id, status, time_reset, no_clear) {
8357
8341
  return __async(this, null, function* () {
8358
8342
  const response = yield this.send({
@@ -10278,7 +10262,7 @@ var Client = class {
10278
10262
  yield this.sessionRefresh(session);
10279
10263
  }
10280
10264
  return this.apiClient.addApp(session.token, request).then((response) => {
10281
- return response !== void 0;
10265
+ return Promise.resolve(response);
10282
10266
  });
10283
10267
  });
10284
10268
  }
package/dist/socket.d.ts CHANGED
@@ -289,7 +289,7 @@ export interface VoiceStartedEvent {
289
289
  voice_channel_id: string;
290
290
  }
291
291
  export interface VoiceLeavedEvent {
292
- ids: Array<string>;
292
+ id: string;
293
293
  clan_id: string;
294
294
  voice_channel_id: string;
295
295
  voice_user_id: string;
@@ -783,8 +783,6 @@ export interface Socket {
783
783
  writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
784
784
  /** Send custom user status */
785
785
  writeCustomStatus(clan_id: string, status: string, time_reset: number, no_clear: boolean): Promise<CustomStatusEvent>;
786
- /** send voice joined */
787
- writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
788
786
  setHeartbeatTimeoutMs(ms: number): void;
789
787
  getHeartbeatTimeoutMs(): number;
790
788
  checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
@@ -984,7 +982,6 @@ export declare class DefaultSocket implements Socket {
984
982
  writeMessageTyping(clan_id: string, channel_id: string, mode: number, is_public: boolean, sender_display_name: string): Promise<MessageTypingEvent>;
985
983
  writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number, badge_count: number): Promise<LastSeenMessageEvent>;
986
984
  writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
987
- writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
988
985
  writeCustomStatus(clan_id: string, status: string, time_reset: number, no_clear: boolean): Promise<CustomStatusEvent>;
989
986
  checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
990
987
  forwardWebrtcSignaling(receiver_id: string, data_type: number, json_data: string, channel_id: string, caller_id: string): Promise<WebrtcSignalingFwd>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.11.40",
4
+ "version": "2.11.42",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -417,7 +417,7 @@ export interface VoiceStartedEvent {
417
417
 
418
418
  export interface VoiceLeavedEvent {
419
419
  // event id
420
- ids: Array<string>;
420
+ id: string;
421
421
  // clan id
422
422
  clan_id: string;
423
423
  // voice channel name
@@ -1207,17 +1207,6 @@ export interface Socket {
1207
1207
  no_clear: boolean
1208
1208
  ): Promise<CustomStatusEvent>;
1209
1209
 
1210
- /** send voice joined */
1211
- writeVoiceJoined(
1212
- id: string,
1213
- clanId: string,
1214
- clanName: string,
1215
- voiceChannelId: string,
1216
- voiceChannelLabel: string,
1217
- participant: string,
1218
- lastScreenshot: string
1219
- ): Promise<VoiceJoinedEvent>;
1220
-
1221
1210
  /* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
1222
1211
  setHeartbeatTimeoutMs(ms: number): void;
1223
1212
 
@@ -2498,29 +2487,6 @@ export class DefaultSocket implements Socket {
2498
2487
  return response.last_pin_message_event;
2499
2488
  }
2500
2489
 
2501
- async writeVoiceJoined(
2502
- id: string,
2503
- clanId: string,
2504
- clanName: string,
2505
- voiceChannelId: string,
2506
- voiceChannelLabel: string,
2507
- participant: string,
2508
- lastScreenshot: string
2509
- ): Promise<VoiceJoinedEvent> {
2510
- const response = await this.send({
2511
- voice_joined_event: {
2512
- clan_id: clanId,
2513
- clan_name: clanName,
2514
- id: id,
2515
- participant: participant,
2516
- voice_channel_id: voiceChannelId,
2517
- voice_channel_label: voiceChannelLabel,
2518
- last_screenshot: lastScreenshot,
2519
- },
2520
- });
2521
- return response.voice_joined_event;
2522
- }
2523
-
2524
2490
  async writeCustomStatus(
2525
2491
  clan_id: string,
2526
2492
  status: string,