mezon-js 2.9.53 → 2.9.54

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
@@ -1870,7 +1870,7 @@ export interface ApiRpc {
1870
1870
  /** */
1871
1871
  export interface ApiSearchMessageDocument {
1872
1872
  //
1873
- attachment?: string;
1873
+ attachments?: Array<ApiMessageAttachment>;
1874
1874
  //
1875
1875
  avatar_url?: string;
1876
1876
  //The channel ID.
@@ -7409,15 +7409,12 @@ export class MezonApi {
7409
7409
  }
7410
7410
 
7411
7411
  /** set notification user channel. */
7412
- createPinMessage(
7413
- bearerToken: string,
7414
- body: ApiPinMessageRequest,
7415
- options: any = {}
7416
- ): Promise<any> {
7412
+ createPinMessage(bearerToken: string,
7413
+ body:ApiPinMessageRequest,
7414
+ options: any = {}): Promise<ApiChannelMessageHeader> {
7415
+
7417
7416
  if (body === null || body === undefined) {
7418
- throw new Error(
7419
- "'body' is a required parameter but is null or undefined."
7420
- );
7417
+ throw new Error("'body' is a required parameter but is null or undefined.");
7421
7418
  }
7422
7419
  const urlPath = "/v2/pinmessage/set";
7423
7420
  const queryParams = new Map<string, any>();
package/client.ts CHANGED
@@ -2998,7 +2998,7 @@ export class Client {
2998
2998
  async createPinMessage(
2999
2999
  session: Session,
3000
3000
  request: ApiPinMessageRequest
3001
- ): Promise<boolean> {
3001
+ ): Promise<ApiChannelMessageHeader> {
3002
3002
  if (
3003
3003
  this.autoRefreshSession &&
3004
3004
  session.refresh_token &&
@@ -3009,8 +3009,8 @@ export class Client {
3009
3009
 
3010
3010
  return this.apiClient
3011
3011
  .createPinMessage(session.token, request)
3012
- .then((response: any) => {
3013
- return response !== undefined;
3012
+ .then((response: ApiChannelMessageHeader) => {
3013
+ return Promise.resolve(response);
3014
3014
  });
3015
3015
  }
3016
3016
 
@@ -4119,11 +4119,10 @@ export class Client {
4119
4119
  });
4120
4120
  }
4121
4121
 
4122
-
4123
4122
  async addFavoriteChannel(
4124
4123
  session: Session,
4125
4124
  channelId: string,
4126
- clanId: string,
4125
+ clanId: string
4127
4126
  ): Promise<ApiAddFavoriteChannelResponse> {
4128
4127
  if (
4129
4128
  this.autoRefreshSession &&
@@ -4136,7 +4135,7 @@ export class Client {
4136
4135
  return this.apiClient
4137
4136
  .addChannelFavorite(session.token, {
4138
4137
  channel_id: channelId,
4139
- clan_id: clanId
4138
+ clan_id: clanId,
4140
4139
  })
4141
4140
  .then((response: ApiAddFavoriteChannelResponse) => {
4142
4141
  return response;
@@ -4162,10 +4161,7 @@ export class Client {
4162
4161
  });
4163
4162
  }
4164
4163
 
4165
- async getListFavoriteChannel(
4166
- session: Session,
4167
- clanId: string
4168
- ): Promise<any> {
4164
+ async getListFavoriteChannel(session: Session, clanId: string): Promise<any> {
4169
4165
  if (
4170
4166
  this.autoRefreshSession &&
4171
4167
  session.refresh_token &&
package/dist/api.gen.d.ts CHANGED
@@ -1087,7 +1087,7 @@ export interface ApiRpc {
1087
1087
  }
1088
1088
  /** */
1089
1089
  export interface ApiSearchMessageDocument {
1090
- attachment?: string;
1090
+ attachments?: Array<ApiMessageAttachment>;
1091
1091
  avatar_url?: string;
1092
1092
  channel_id?: string;
1093
1093
  channel_label?: string;
@@ -1614,7 +1614,7 @@ export declare class MezonApi {
1614
1614
  /** */
1615
1615
  getPinMessagesList(bearerToken: string, messageId?: string, channelId?: string, clanId?: string, options?: any): Promise<ApiPinMessagesList>;
1616
1616
  /** set notification user channel. */
1617
- createPinMessage(bearerToken: string, body: ApiPinMessageRequest, options?: any): Promise<any>;
1617
+ createPinMessage(bearerToken: string, body: ApiPinMessageRequest, options?: any): Promise<ApiChannelMessageHeader>;
1618
1618
  /** */
1619
1619
  addRolesChannelDesc(bearerToken: string, body: ApiAddRoleChannelDescRequest, options?: any): Promise<any>;
1620
1620
  /** update the category of a channel */
package/dist/client.d.ts CHANGED
@@ -529,7 +529,7 @@ export declare class Client {
529
529
  /** query message in elasticsearch */
530
530
  searchMessage(session: Session, request: ApiSearchMessageRequest): Promise<ApiSearchMessageResponse>;
531
531
  /** */
532
- createPinMessage(session: Session, request: ApiPinMessageRequest): Promise<boolean>;
532
+ createPinMessage(session: Session, request: ApiPinMessageRequest): Promise<ApiChannelMessageHeader>;
533
533
  pinMessagesList(session: Session, messageId: string, channelId: string, clanId: string): Promise<ApiPinMessagesList>;
534
534
  deletePinMessage(session: Session, message_id: string): Promise<boolean>;
535
535
  /** create clan emoji */
@@ -4662,9 +4662,7 @@ var MezonApi = class {
4662
4662
  /** set notification user channel. */
4663
4663
  createPinMessage(bearerToken, body, options = {}) {
4664
4664
  if (body === null || body === void 0) {
4665
- throw new Error(
4666
- "'body' is a required parameter but is null or undefined."
4667
- );
4665
+ throw new Error("'body' is a required parameter but is null or undefined.");
4668
4666
  }
4669
4667
  const urlPath = "/v2/pinmessage/set";
4670
4668
  const queryParams = /* @__PURE__ */ new Map();
@@ -8396,7 +8394,7 @@ var Client = class {
8396
8394
  yield this.sessionRefresh(session);
8397
8395
  }
8398
8396
  return this.apiClient.createPinMessage(session.token, request).then((response) => {
8399
- return response !== void 0;
8397
+ return Promise.resolve(response);
8400
8398
  });
8401
8399
  });
8402
8400
  }
@@ -4633,9 +4633,7 @@ var MezonApi = class {
4633
4633
  /** set notification user channel. */
4634
4634
  createPinMessage(bearerToken, body, options = {}) {
4635
4635
  if (body === null || body === void 0) {
4636
- throw new Error(
4637
- "'body' is a required parameter but is null or undefined."
4638
- );
4636
+ throw new Error("'body' is a required parameter but is null or undefined.");
4639
4637
  }
4640
4638
  const urlPath = "/v2/pinmessage/set";
4641
4639
  const queryParams = /* @__PURE__ */ new Map();
@@ -8367,7 +8365,7 @@ var Client = class {
8367
8365
  yield this.sessionRefresh(session);
8368
8366
  }
8369
8367
  return this.apiClient.createPinMessage(session.token, request).then((response) => {
8370
- return response !== void 0;
8368
+ return Promise.resolve(response);
8371
8369
  });
8372
8370
  });
8373
8371
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.9.53",
4
+ "version": "2.9.54",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"