mezon-js 2.12.70 → 2.12.71

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
@@ -4698,38 +4698,37 @@ export class MezonApi {
4698
4698
  }
4699
4699
 
4700
4700
  /** List all attachment that are part of a channel. */
4701
- listChannelAttachment(
4702
- bearerToken: string,
4703
- channelId: string,
4704
- clanId?: string,
4705
- fileType?: string,
4706
- limit?: number,
4707
- state?: number,
4708
- cursor?: string,
4709
- options: any = {}
4710
- ): Promise<ApiChannelAttachmentList> {
4701
+ listChannelAttachment(bearerToken: string,
4702
+ channelId:string,
4703
+ clanId?:string,
4704
+ fileType?:string,
4705
+ limit?:number,
4706
+ state?:number,
4707
+ before?:number,
4708
+ after?:number,
4709
+ around?:number,
4710
+ options: any = {}): Promise<ApiChannelAttachmentList> {
4711
+
4711
4712
  if (channelId === null || channelId === undefined) {
4712
- throw new Error(
4713
- "'channelId' is a required parameter but is null or undefined."
4714
- );
4713
+ throw new Error("'channelId' is a required parameter but is null or undefined.");
4715
4714
  }
4716
- const urlPath = "/v2/channel/{channelId}/attachment".replace(
4717
- "{channelId}",
4718
- encodeURIComponent(String(channelId))
4719
- );
4715
+ const urlPath = "/v2/channel/{channelId}/attachment"
4716
+ .replace("{channelId}", encodeURIComponent(String(channelId)));
4720
4717
  const queryParams = new Map<string, any>();
4721
4718
  queryParams.set("clan_id", clanId);
4722
4719
  queryParams.set("file_type", fileType);
4723
4720
  queryParams.set("limit", limit);
4724
4721
  queryParams.set("state", state);
4725
- queryParams.set("cursor", cursor);
4722
+ queryParams.set("before", before);
4723
+ queryParams.set("after", after);
4724
+ queryParams.set("around", around);
4726
4725
 
4727
- let bodyJson: string = "";
4726
+ let bodyJson : string = "";
4728
4727
 
4729
4728
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4730
4729
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4731
4730
  if (bearerToken) {
4732
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4731
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4733
4732
  }
4734
4733
 
4735
4734
  return Promise.race([
package/client.ts CHANGED
@@ -1435,7 +1435,8 @@ export class Client {
1435
1435
  fileType: string,
1436
1436
  state?: number,
1437
1437
  limit?: number,
1438
- cursor?: string
1438
+ before?: number,
1439
+ after?: number,
1439
1440
  ): Promise<ApiChannelAttachmentList> {
1440
1441
  if (
1441
1442
  this.autoRefreshSession &&
@@ -1453,7 +1454,8 @@ export class Client {
1453
1454
  fileType,
1454
1455
  limit,
1455
1456
  state,
1456
- cursor
1457
+ before,
1458
+ after,
1457
1459
  )
1458
1460
  .then((response: ApiChannelAttachmentList) => {
1459
1461
  var result: ApiChannelAttachmentList = {
package/dist/api.gen.d.ts CHANGED
@@ -1977,7 +1977,7 @@ export declare class MezonApi {
1977
1977
  /** Add users to a channel. */
1978
1978
  addChannelUsers(bearerToken: string, channelId: string, userIds?: Array<string>, options?: any): Promise<any>;
1979
1979
  /** List all attachment that are part of a channel. */
1980
- listChannelAttachment(bearerToken: string, channelId: string, clanId?: string, fileType?: string, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiChannelAttachmentList>;
1980
+ listChannelAttachment(bearerToken: string, channelId: string, clanId?: string, fileType?: string, limit?: number, state?: number, before?: number, after?: number, around?: number, options?: any): Promise<ApiChannelAttachmentList>;
1981
1981
  /** get channel encryption method */
1982
1982
  getChanEncryptionMethod(bearerToken: string, channelId: string, method?: string, options?: any): Promise<ApiChanEncryptionMethod>;
1983
1983
  /** store channel encryption method */
package/dist/client.d.ts CHANGED
@@ -409,7 +409,7 @@ export declare class Client {
409
409
  /** List a channel's users. */
410
410
  listChannelUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ApiChannelUserList>;
411
411
  /** List a channel's attachment. */
412
- listChannelAttachments(session: Session, clanId: string, channelId: string, fileType: string, state?: number, limit?: number, cursor?: string): Promise<ApiChannelAttachmentList>;
412
+ listChannelAttachments(session: Session, clanId: string, channelId: string, fileType: string, state?: number, limit?: number, before?: number, after?: number): Promise<ApiChannelAttachmentList>;
413
413
  /** List a channel's users. */
414
414
  listClanUsers(session: Session, clanId: string): Promise<ApiClanUserList>;
415
415
  /** List channels. */
@@ -1813,22 +1813,19 @@ var MezonApi = class {
1813
1813
  ]);
1814
1814
  }
1815
1815
  /** List all attachment that are part of a channel. */
1816
- listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state, cursor, options = {}) {
1816
+ listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state, before, after, around, options = {}) {
1817
1817
  if (channelId === null || channelId === void 0) {
1818
- throw new Error(
1819
- "'channelId' is a required parameter but is null or undefined."
1820
- );
1818
+ throw new Error("'channelId' is a required parameter but is null or undefined.");
1821
1819
  }
1822
- const urlPath = "/v2/channel/{channelId}/attachment".replace(
1823
- "{channelId}",
1824
- encodeURIComponent(String(channelId))
1825
- );
1820
+ const urlPath = "/v2/channel/{channelId}/attachment".replace("{channelId}", encodeURIComponent(String(channelId)));
1826
1821
  const queryParams = /* @__PURE__ */ new Map();
1827
1822
  queryParams.set("clan_id", clanId);
1828
1823
  queryParams.set("file_type", fileType);
1829
1824
  queryParams.set("limit", limit);
1830
1825
  queryParams.set("state", state);
1831
- queryParams.set("cursor", cursor);
1826
+ queryParams.set("before", before);
1827
+ queryParams.set("after", after);
1828
+ queryParams.set("around", around);
1832
1829
  let bodyJson = "";
1833
1830
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1834
1831
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -8694,7 +8691,7 @@ var Client = class {
8694
8691
  });
8695
8692
  }
8696
8693
  /** List a channel's attachment. */
8697
- listChannelAttachments(session, clanId, channelId, fileType, state, limit, cursor) {
8694
+ listChannelAttachments(session, clanId, channelId, fileType, state, limit, before, after) {
8698
8695
  return __async(this, null, function* () {
8699
8696
  if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
8700
8697
  yield this.sessionRefresh(session);
@@ -8706,7 +8703,8 @@ var Client = class {
8706
8703
  fileType,
8707
8704
  limit,
8708
8705
  state,
8709
- cursor
8706
+ before,
8707
+ after
8710
8708
  ).then((response) => {
8711
8709
  var result = {
8712
8710
  attachments: []
@@ -1779,22 +1779,19 @@ var MezonApi = class {
1779
1779
  ]);
1780
1780
  }
1781
1781
  /** List all attachment that are part of a channel. */
1782
- listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state, cursor, options = {}) {
1782
+ listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state, before, after, around, options = {}) {
1783
1783
  if (channelId === null || channelId === void 0) {
1784
- throw new Error(
1785
- "'channelId' is a required parameter but is null or undefined."
1786
- );
1784
+ throw new Error("'channelId' is a required parameter but is null or undefined.");
1787
1785
  }
1788
- const urlPath = "/v2/channel/{channelId}/attachment".replace(
1789
- "{channelId}",
1790
- encodeURIComponent(String(channelId))
1791
- );
1786
+ const urlPath = "/v2/channel/{channelId}/attachment".replace("{channelId}", encodeURIComponent(String(channelId)));
1792
1787
  const queryParams = /* @__PURE__ */ new Map();
1793
1788
  queryParams.set("clan_id", clanId);
1794
1789
  queryParams.set("file_type", fileType);
1795
1790
  queryParams.set("limit", limit);
1796
1791
  queryParams.set("state", state);
1797
- queryParams.set("cursor", cursor);
1792
+ queryParams.set("before", before);
1793
+ queryParams.set("after", after);
1794
+ queryParams.set("around", around);
1798
1795
  let bodyJson = "";
1799
1796
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1800
1797
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -8660,7 +8657,7 @@ var Client = class {
8660
8657
  });
8661
8658
  }
8662
8659
  /** List a channel's attachment. */
8663
- listChannelAttachments(session, clanId, channelId, fileType, state, limit, cursor) {
8660
+ listChannelAttachments(session, clanId, channelId, fileType, state, limit, before, after) {
8664
8661
  return __async(this, null, function* () {
8665
8662
  if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
8666
8663
  yield this.sessionRefresh(session);
@@ -8672,7 +8669,8 @@ var Client = class {
8672
8669
  fileType,
8673
8670
  limit,
8674
8671
  state,
8675
- cursor
8672
+ before,
8673
+ after
8676
8674
  ).then((response) => {
8677
8675
  var result = {
8678
8676
  attachments: []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.12.70",
3
+ "version": "2.12.71",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },