mezon-js 2.10.17 → 2.10.20

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
@@ -607,6 +607,8 @@ export interface ApiChannelAttachment {
607
607
  uploader?: string;
608
608
  //
609
609
  url?: string;
610
+ //message id.
611
+ message_id?: string;
610
612
  }
611
613
 
612
614
  /** */
@@ -4917,6 +4919,7 @@ export class MezonApi {
4917
4919
  messageId?: string,
4918
4920
  direction?: number,
4919
4921
  limit?: number,
4922
+ topicId?:string,
4920
4923
  options: any = {}
4921
4924
  ): Promise<ApiChannelMessageList> {
4922
4925
  if (channelId === null || channelId === undefined) {
@@ -4933,6 +4936,7 @@ export class MezonApi {
4933
4936
  queryParams.set("message_id", messageId);
4934
4937
  queryParams.set("limit", limit);
4935
4938
  queryParams.set("direction", direction);
4939
+ queryParams.set("topic_id", topicId);
4936
4940
 
4937
4941
  let bodyJson: string = "";
4938
4942
 
@@ -5360,23 +5364,22 @@ export class MezonApi {
5360
5364
  }
5361
5365
 
5362
5366
  /** list user add channel by channel ids */
5363
- listUsersAddChannelByChannelId(
5364
- bearerToken: string,
5365
- channelId?: string,
5366
- limit?: number,
5367
- options: any = {}
5368
- ): Promise<ApiAllUsersAddChannelResponse> {
5369
- const urlPath = "/v2/channeldesc/users/add";
5367
+ listChannelUsersUC(bearerToken: string,
5368
+ channelId?:string,
5369
+ limit?:number,
5370
+ options: any = {}): Promise<ApiAllUsersAddChannelResponse> {
5371
+
5372
+ const urlPath = "/v2/channeldesc/users";
5370
5373
  const queryParams = new Map<string, any>();
5371
5374
  queryParams.set("channel_id", channelId);
5372
5375
  queryParams.set("limit", limit);
5373
5376
 
5374
- let bodyJson: string = "";
5377
+ let bodyJson : string = "";
5375
5378
 
5376
5379
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5377
5380
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
5378
5381
  if (bearerToken) {
5379
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5382
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5380
5383
  }
5381
5384
 
5382
5385
  return Promise.race([
@@ -5393,7 +5396,7 @@ export class MezonApi {
5393
5396
  setTimeout(reject, this.timeoutMs, "Request timed out.")
5394
5397
  ),
5395
5398
  ]);
5396
- }
5399
+ }
5397
5400
 
5398
5401
  /** Delete a channel by ID. */
5399
5402
  deleteChannelDesc(
package/client.ts CHANGED
@@ -1408,7 +1408,8 @@ export class Client {
1408
1408
  channelId: string,
1409
1409
  messageId?: string,
1410
1410
  direction?: number,
1411
- limit?: number
1411
+ limit?: number,
1412
+ topicId?:string
1412
1413
  ): Promise<ChannelMessageList> {
1413
1414
  if (
1414
1415
  this.autoRefreshSession &&
@@ -1425,7 +1426,8 @@ export class Client {
1425
1426
  channelId,
1426
1427
  messageId,
1427
1428
  direction,
1428
- limit
1429
+ limit,
1430
+ topicId
1429
1431
  )
1430
1432
  .then((response: ApiChannelMessageList) => {
1431
1433
  var result: ChannelMessageList = {
@@ -3851,7 +3853,7 @@ export class Client {
3851
3853
  });
3852
3854
  }
3853
3855
 
3854
- async listUsersAddChannelByChannelId(
3856
+ async listChannelUsersUC(
3855
3857
  session: Session,
3856
3858
  channel_id: string,
3857
3859
  limit: number
@@ -3865,7 +3867,7 @@ export class Client {
3865
3867
  }
3866
3868
 
3867
3869
  return this.apiClient
3868
- .listUsersAddChannelByChannelId(session.token, channel_id, limit)
3870
+ .listChannelUsersUC(session.token, channel_id, limit)
3869
3871
  .then((response: any) => {
3870
3872
  return Promise.resolve(response);
3871
3873
  });
package/dist/api.gen.d.ts CHANGED
@@ -356,6 +356,7 @@ export interface ApiChannelAttachment {
356
356
  id?: string;
357
357
  uploader?: string;
358
358
  url?: string;
359
+ message_id?: string;
359
360
  }
360
361
  /** */
361
362
  export interface ApiChannelAttachmentList {
@@ -1711,7 +1712,7 @@ export declare class MezonApi {
1711
1712
  /** */
1712
1713
  getListFavoriteChannel(bearerToken: string, clanId: string, options?: any): Promise<ApiListFavoriteChannelResponse>;
1713
1714
  /** List a channel's message history. */
1714
- listChannelMessages(bearerToken: string, clanId: string, channelId: string, messageId?: string, direction?: number, limit?: number, options?: any): Promise<ApiChannelMessageList>;
1715
+ listChannelMessages(bearerToken: string, clanId: string, channelId: string, messageId?: string, direction?: number, limit?: number, topicId?: string, options?: any): Promise<ApiChannelMessageList>;
1715
1716
  /** Add users to a channel. */
1716
1717
  addChannelUsers(bearerToken: string, channelId: string, userIds?: Array<string>, options?: any): Promise<any>;
1717
1718
  /** List all attachment that are part of a channel. */
@@ -1731,7 +1732,7 @@ export declare class MezonApi {
1731
1732
  /** Create a new channel with the current user as the owner. */
1732
1733
  createChannelDesc(bearerToken: string, body: ApiCreateChannelDescRequest, options?: any): Promise<ApiChannelDescription>;
1733
1734
  /** list user add channel by channel ids */
1734
- listUsersAddChannelByChannelId(bearerToken: string, channelId?: string, limit?: number, options?: any): Promise<ApiAllUsersAddChannelResponse>;
1735
+ listChannelUsersUC(bearerToken: string, channelId?: string, limit?: number, options?: any): Promise<ApiAllUsersAddChannelResponse>;
1735
1736
  /** Delete a channel by ID. */
1736
1737
  deleteChannelDesc(bearerToken: string, channelId: string, options?: any): Promise<any>;
1737
1738
  /** Update fields in a given channel. */
package/dist/client.d.ts CHANGED
@@ -418,7 +418,7 @@ export declare class Client {
418
418
  /** Kick users from a channel, or decline their join requests. */
419
419
  removeChannelUsers(session: Session, channelId: string, ids?: Array<string>): Promise<boolean>;
420
420
  /** List a channel's message history. */
421
- listChannelMessages(session: Session, clanId: string, channelId: string, messageId?: string, direction?: number, limit?: number): Promise<ChannelMessageList>;
421
+ listChannelMessages(session: Session, clanId: string, channelId: string, messageId?: string, direction?: number, limit?: number, topicId?: string): Promise<ChannelMessageList>;
422
422
  /** List a channel's users. */
423
423
  listChannelVoiceUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ApiVoiceChannelUserList>;
424
424
  /** List a channel's users. */
@@ -585,7 +585,7 @@ export declare class Client {
585
585
  getNotificationReactMessage(session: Session, channelId: string): Promise<ApiNotifiReactMessage>;
586
586
  hashtagDMList(session: Session, userId: Array<string>, limit: number): Promise<ApiHashtagDmList>;
587
587
  listChannelByUserId(session: Session): Promise<ApiChannelDescList>;
588
- listUsersAddChannelByChannelId(session: Session, channel_id: string, limit: number): Promise<ApiAllUsersAddChannelResponse>;
588
+ listChannelUsersUC(session: Session, channel_id: string, limit: number): Promise<ApiAllUsersAddChannelResponse>;
589
589
  getListEmojisByUserId(session: Session): Promise<ApiEmojiListedResponse>;
590
590
  getListStickersByUserId(session: Session): Promise<ApiStickerListedResponse>;
591
591
  listUserClansByUserId(session: Session): Promise<ApiAllUserClans>;
@@ -2419,7 +2419,7 @@ var MezonApi = class {
2419
2419
  ]);
2420
2420
  }
2421
2421
  /** List a channel's message history. */
2422
- listChannelMessages(bearerToken, clanId, channelId, messageId, direction, limit, options = {}) {
2422
+ listChannelMessages(bearerToken, clanId, channelId, messageId, direction, limit, topicId, options = {}) {
2423
2423
  if (channelId === null || channelId === void 0) {
2424
2424
  throw new Error(
2425
2425
  "'channelId' is a required parameter but is null or undefined."
@@ -2434,6 +2434,7 @@ var MezonApi = class {
2434
2434
  queryParams.set("message_id", messageId);
2435
2435
  queryParams.set("limit", limit);
2436
2436
  queryParams.set("direction", direction);
2437
+ queryParams.set("topic_id", topicId);
2437
2438
  let bodyJson = "";
2438
2439
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2439
2440
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -2767,8 +2768,8 @@ var MezonApi = class {
2767
2768
  ]);
2768
2769
  }
2769
2770
  /** list user add channel by channel ids */
2770
- listUsersAddChannelByChannelId(bearerToken, channelId, limit, options = {}) {
2771
- const urlPath = "/v2/channeldesc/users/add";
2771
+ listChannelUsersUC(bearerToken, channelId, limit, options = {}) {
2772
+ const urlPath = "/v2/channeldesc/users";
2772
2773
  const queryParams = /* @__PURE__ */ new Map();
2773
2774
  queryParams.set("channel_id", channelId);
2774
2775
  queryParams.set("limit", limit);
@@ -7236,7 +7237,8 @@ var _DefaultSocket = class _DefaultSocket {
7236
7237
  hide_editted: message.channel_message.hide_editted,
7237
7238
  is_public: message.channel_message.is_public,
7238
7239
  create_time_seconds: message.channel_message.create_time_seconds,
7239
- update_time_seconds: message.channel_message.update_time_seconds
7240
+ update_time_seconds: message.channel_message.update_time_seconds,
7241
+ topic_id: message.channel_message.topic_id
7240
7242
  };
7241
7243
  this.onchannelmessage(e);
7242
7244
  } else if (message.message_typing_event) {
@@ -8568,7 +8570,7 @@ var Client = class {
8568
8570
  });
8569
8571
  }
8570
8572
  /** List a channel's message history. */
8571
- listChannelMessages(session, clanId, channelId, messageId, direction, limit) {
8573
+ listChannelMessages(session, clanId, channelId, messageId, direction, limit, topicId) {
8572
8574
  return __async(this, null, function* () {
8573
8575
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8574
8576
  yield this.sessionRefresh(session);
@@ -8579,7 +8581,8 @@ var Client = class {
8579
8581
  channelId,
8580
8582
  messageId,
8581
8583
  direction,
8582
- limit
8584
+ limit,
8585
+ topicId
8583
8586
  ).then((response) => {
8584
8587
  var result = {
8585
8588
  messages: [],
@@ -10027,12 +10030,12 @@ var Client = class {
10027
10030
  });
10028
10031
  });
10029
10032
  }
10030
- listUsersAddChannelByChannelId(session, channel_id, limit) {
10033
+ listChannelUsersUC(session, channel_id, limit) {
10031
10034
  return __async(this, null, function* () {
10032
10035
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10033
10036
  yield this.sessionRefresh(session);
10034
10037
  }
10035
- return this.apiClient.listUsersAddChannelByChannelId(session.token, channel_id, limit).then((response) => {
10038
+ return this.apiClient.listChannelUsersUC(session.token, channel_id, limit).then((response) => {
10036
10039
  return Promise.resolve(response);
10037
10040
  });
10038
10041
  });
@@ -2385,7 +2385,7 @@ var MezonApi = class {
2385
2385
  ]);
2386
2386
  }
2387
2387
  /** List a channel's message history. */
2388
- listChannelMessages(bearerToken, clanId, channelId, messageId, direction, limit, options = {}) {
2388
+ listChannelMessages(bearerToken, clanId, channelId, messageId, direction, limit, topicId, options = {}) {
2389
2389
  if (channelId === null || channelId === void 0) {
2390
2390
  throw new Error(
2391
2391
  "'channelId' is a required parameter but is null or undefined."
@@ -2400,6 +2400,7 @@ var MezonApi = class {
2400
2400
  queryParams.set("message_id", messageId);
2401
2401
  queryParams.set("limit", limit);
2402
2402
  queryParams.set("direction", direction);
2403
+ queryParams.set("topic_id", topicId);
2403
2404
  let bodyJson = "";
2404
2405
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2405
2406
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -2733,8 +2734,8 @@ var MezonApi = class {
2733
2734
  ]);
2734
2735
  }
2735
2736
  /** list user add channel by channel ids */
2736
- listUsersAddChannelByChannelId(bearerToken, channelId, limit, options = {}) {
2737
- const urlPath = "/v2/channeldesc/users/add";
2737
+ listChannelUsersUC(bearerToken, channelId, limit, options = {}) {
2738
+ const urlPath = "/v2/channeldesc/users";
2738
2739
  const queryParams = /* @__PURE__ */ new Map();
2739
2740
  queryParams.set("channel_id", channelId);
2740
2741
  queryParams.set("limit", limit);
@@ -7202,7 +7203,8 @@ var _DefaultSocket = class _DefaultSocket {
7202
7203
  hide_editted: message.channel_message.hide_editted,
7203
7204
  is_public: message.channel_message.is_public,
7204
7205
  create_time_seconds: message.channel_message.create_time_seconds,
7205
- update_time_seconds: message.channel_message.update_time_seconds
7206
+ update_time_seconds: message.channel_message.update_time_seconds,
7207
+ topic_id: message.channel_message.topic_id
7206
7208
  };
7207
7209
  this.onchannelmessage(e);
7208
7210
  } else if (message.message_typing_event) {
@@ -8534,7 +8536,7 @@ var Client = class {
8534
8536
  });
8535
8537
  }
8536
8538
  /** List a channel's message history. */
8537
- listChannelMessages(session, clanId, channelId, messageId, direction, limit) {
8539
+ listChannelMessages(session, clanId, channelId, messageId, direction, limit, topicId) {
8538
8540
  return __async(this, null, function* () {
8539
8541
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8540
8542
  yield this.sessionRefresh(session);
@@ -8545,7 +8547,8 @@ var Client = class {
8545
8547
  channelId,
8546
8548
  messageId,
8547
8549
  direction,
8548
- limit
8550
+ limit,
8551
+ topicId
8549
8552
  ).then((response) => {
8550
8553
  var result = {
8551
8554
  messages: [],
@@ -9993,12 +9996,12 @@ var Client = class {
9993
9996
  });
9994
9997
  });
9995
9998
  }
9996
- listUsersAddChannelByChannelId(session, channel_id, limit) {
9999
+ listChannelUsersUC(session, channel_id, limit) {
9997
10000
  return __async(this, null, function* () {
9998
10001
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
9999
10002
  yield this.sessionRefresh(session);
10000
10003
  }
10001
- return this.apiClient.listUsersAddChannelByChannelId(session.token, channel_id, limit).then((response) => {
10004
+ return this.apiClient.listChannelUsersUC(session.token, channel_id, limit).then((response) => {
10002
10005
  return Promise.resolve(response);
10003
10006
  });
10004
10007
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.10.17",
4
+ "version": "2.10.20",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -1472,6 +1472,7 @@ export class DefaultSocket implements Socket {
1472
1472
  is_public: message.channel_message.is_public,
1473
1473
  create_time_seconds: message.channel_message.create_time_seconds,
1474
1474
  update_time_seconds: message.channel_message.update_time_seconds,
1475
+ topic_id: message.channel_message.topic_id,
1475
1476
  };
1476
1477
  this.onchannelmessage(e);
1477
1478
  } else if (message.message_typing_event) {