mezon-js 2.9.17 → 2.9.19

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -36,6 +36,14 @@ export interface ClanUserListClanUser {
36
36
  user?: ApiUser;
37
37
  }
38
38
 
39
+ /** */
40
+ export interface CountClanBadgeResponseBadge {
41
+ //
42
+ clan_id?: string;
43
+ //
44
+ count?: number;
45
+ }
46
+
39
47
  /** */
40
48
  export interface MezonChangeChannelCategoryBody {
41
49
  //
@@ -823,6 +831,12 @@ export interface ApiClanUserList {
823
831
  cursor?: string;
824
832
  }
825
833
 
834
+ /** */
835
+ export interface ApiCountClanBadgeResponse {
836
+ //
837
+ badges?: Array<CountClanBadgeResponseBadge>;
838
+ }
839
+
826
840
  /** */
827
841
  export interface ApiCreateCategoryDescRequest {
828
842
  //
@@ -1496,6 +1510,8 @@ export interface ApiPinMessageRequest {
1496
1510
  //
1497
1511
  channel_id?: string;
1498
1512
  //
1513
+ clan_id?: string;
1514
+ //
1499
1515
  message_id?: string;
1500
1516
  }
1501
1517
 
@@ -3568,6 +3584,37 @@ export class MezonApi {
3568
3584
  setTimeout(reject, this.timeoutMs, "Request timed out.")
3569
3585
  ),
3570
3586
  ]);
3587
+ }
3588
+
3589
+ /** count clan badge */
3590
+ countClanBadge(bearerToken: string,
3591
+ options: any = {}): Promise<ApiCountClanBadgeResponse> {
3592
+
3593
+ const urlPath = "/v2/badges";
3594
+ const queryParams = new Map<string, any>();
3595
+
3596
+ let bodyJson : string = "";
3597
+
3598
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3599
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3600
+ if (bearerToken) {
3601
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3602
+ }
3603
+
3604
+ return Promise.race([
3605
+ fetch(fullUrl, fetchOptions).then((response) => {
3606
+ if (response.status == 204) {
3607
+ return response;
3608
+ } else if (response.status >= 200 && response.status < 300) {
3609
+ return response.json();
3610
+ } else {
3611
+ throw response;
3612
+ }
3613
+ }),
3614
+ new Promise((_, reject) =>
3615
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
3616
+ ),
3617
+ ]);
3571
3618
  }
3572
3619
  /** */
3573
3620
  updateCategoryOrder(bearerToken: string,
@@ -6277,12 +6324,16 @@ export class MezonApi {
6277
6324
 
6278
6325
  /** */
6279
6326
  getPinMessagesList(bearerToken: string,
6327
+ messageId?:string,
6280
6328
  channelId?:string,
6329
+ clanId?:string,
6281
6330
  options: any = {}): Promise<ApiPinMessagesList> {
6282
6331
 
6283
6332
  const urlPath = "/v2/pinmessage/get";
6284
6333
  const queryParams = new Map<string, any>();
6334
+ queryParams.set("message_id", messageId);
6285
6335
  queryParams.set("channel_id", channelId);
6336
+ queryParams.set("clan_id", clanId);
6286
6337
 
6287
6338
  let bodyJson : string = "";
6288
6339
 
package/client.ts CHANGED
@@ -2994,7 +2994,9 @@ export class Client {
2994
2994
 
2995
2995
  async pinMessagesList(
2996
2996
  session: Session,
2997
- channelId: string
2997
+ messageId: string,
2998
+ channelId: string,
2999
+ clanId: string,
2998
3000
  ): Promise<ApiPinMessagesList> {
2999
3001
  if (
3000
3002
  this.autoRefreshSession &&
@@ -3005,7 +3007,7 @@ export class Client {
3005
3007
  }
3006
3008
 
3007
3009
  return this.apiClient
3008
- .getPinMessagesList(session.token, channelId)
3010
+ .getPinMessagesList(session.token, messageId, channelId, clanId)
3009
3011
  .then((response: ApiPinMessagesList) => {
3010
3012
  return Promise.resolve(response);
3011
3013
  });
package/dist/api.gen.d.ts CHANGED
@@ -17,6 +17,11 @@ export interface ClanUserListClanUser {
17
17
  user?: ApiUser;
18
18
  }
19
19
  /** */
20
+ export interface CountClanBadgeResponseBadge {
21
+ clan_id?: string;
22
+ count?: number;
23
+ }
24
+ /** */
20
25
  export interface MezonChangeChannelCategoryBody {
21
26
  channel_id?: string;
22
27
  }
@@ -473,6 +478,10 @@ export interface ApiClanUserList {
473
478
  cursor?: string;
474
479
  }
475
480
  /** */
481
+ export interface ApiCountClanBadgeResponse {
482
+ badges?: Array<CountClanBadgeResponseBadge>;
483
+ }
484
+ /** */
476
485
  export interface ApiCreateCategoryDescRequest {
477
486
  category_name?: string;
478
487
  clan_id?: string;
@@ -866,6 +875,7 @@ export interface ApiPinMessage {
866
875
  /** */
867
876
  export interface ApiPinMessageRequest {
868
877
  channel_id?: string;
878
+ clan_id?: string;
869
879
  message_id?: string;
870
880
  }
871
881
  /** */
@@ -1271,6 +1281,8 @@ export declare class MezonApi {
1271
1281
  banApp(bearerToken: string, id: string, options?: any): Promise<any>;
1272
1282
  /** Unban an app. */
1273
1283
  unbanApp(bearerToken: string, id: string, options?: any): Promise<any>;
1284
+ /** count clan badge */
1285
+ countClanBadge(bearerToken: string, options?: any): Promise<ApiCountClanBadgeResponse>;
1274
1286
  /** */
1275
1287
  updateCategoryOrder(bearerToken: string, body: ApiUpdateCategoryOrderRequest, options?: any): Promise<any>;
1276
1288
  /** */
@@ -1420,7 +1432,7 @@ export declare class MezonApi {
1420
1432
  /** */
1421
1433
  deletePinMessage(bearerToken: string, messageId?: string, options?: any): Promise<any>;
1422
1434
  /** */
1423
- getPinMessagesList(bearerToken: string, channelId?: string, options?: any): Promise<ApiPinMessagesList>;
1435
+ getPinMessagesList(bearerToken: string, messageId?: string, channelId?: string, clanId?: string, options?: any): Promise<ApiPinMessagesList>;
1424
1436
  /** set notification user channel. */
1425
1437
  createPinMessage(bearerToken: string, body: ApiPinMessageRequest, options?: any): Promise<any>;
1426
1438
  /** */
package/dist/client.d.ts CHANGED
@@ -525,7 +525,7 @@ export declare class Client {
525
525
  searchMessage(session: Session, request: ApiSearchMessageRequest): Promise<ApiSearchMessageResponse>;
526
526
  /** */
527
527
  createPinMessage(session: Session, request: ApiPinMessageRequest): Promise<boolean>;
528
- pinMessagesList(session: Session, channelId: string): Promise<ApiPinMessagesList>;
528
+ pinMessagesList(session: Session, messageId: string, channelId: string, clanId: string): Promise<ApiPinMessagesList>;
529
529
  deletePinMessage(session: Session, message_id: string): Promise<boolean>;
530
530
  /** create clan emoji */
531
531
  createClanEmoji(session: Session, request: ApiClanEmojiCreateRequest): Promise<boolean>;
@@ -1885,6 +1885,31 @@ var MezonApi = class {
1885
1885
  )
1886
1886
  ]);
1887
1887
  }
1888
+ /** count clan badge */
1889
+ countClanBadge(bearerToken, options = {}) {
1890
+ const urlPath = "/v2/badges";
1891
+ const queryParams = /* @__PURE__ */ new Map();
1892
+ let bodyJson = "";
1893
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1894
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
1895
+ if (bearerToken) {
1896
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
1897
+ }
1898
+ return Promise.race([
1899
+ fetch(fullUrl, fetchOptions).then((response) => {
1900
+ if (response.status == 204) {
1901
+ return response;
1902
+ } else if (response.status >= 200 && response.status < 300) {
1903
+ return response.json();
1904
+ } else {
1905
+ throw response;
1906
+ }
1907
+ }),
1908
+ new Promise(
1909
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
1910
+ )
1911
+ ]);
1912
+ }
1888
1913
  /** */
1889
1914
  updateCategoryOrder(bearerToken, body, options = {}) {
1890
1915
  if (body === null || body === void 0) {
@@ -3997,10 +4022,12 @@ var MezonApi = class {
3997
4022
  ]);
3998
4023
  }
3999
4024
  /** */
4000
- getPinMessagesList(bearerToken, channelId, options = {}) {
4025
+ getPinMessagesList(bearerToken, messageId, channelId, clanId, options = {}) {
4001
4026
  const urlPath = "/v2/pinmessage/get";
4002
4027
  const queryParams = /* @__PURE__ */ new Map();
4028
+ queryParams.set("message_id", messageId);
4003
4029
  queryParams.set("channel_id", channelId);
4030
+ queryParams.set("clan_id", clanId);
4004
4031
  let bodyJson = "";
4005
4032
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4006
4033
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -7552,12 +7579,12 @@ var Client = class {
7552
7579
  });
7553
7580
  });
7554
7581
  }
7555
- pinMessagesList(session, channelId) {
7582
+ pinMessagesList(session, messageId, channelId, clanId) {
7556
7583
  return __async(this, null, function* () {
7557
7584
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7558
7585
  yield this.sessionRefresh(session);
7559
7586
  }
7560
- return this.apiClient.getPinMessagesList(session.token, channelId).then((response) => {
7587
+ return this.apiClient.getPinMessagesList(session.token, messageId, channelId, clanId).then((response) => {
7561
7588
  return Promise.resolve(response);
7562
7589
  });
7563
7590
  });
@@ -1856,6 +1856,31 @@ var MezonApi = class {
1856
1856
  )
1857
1857
  ]);
1858
1858
  }
1859
+ /** count clan badge */
1860
+ countClanBadge(bearerToken, options = {}) {
1861
+ const urlPath = "/v2/badges";
1862
+ const queryParams = /* @__PURE__ */ new Map();
1863
+ let bodyJson = "";
1864
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1865
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
1866
+ if (bearerToken) {
1867
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
1868
+ }
1869
+ return Promise.race([
1870
+ fetch(fullUrl, fetchOptions).then((response) => {
1871
+ if (response.status == 204) {
1872
+ return response;
1873
+ } else if (response.status >= 200 && response.status < 300) {
1874
+ return response.json();
1875
+ } else {
1876
+ throw response;
1877
+ }
1878
+ }),
1879
+ new Promise(
1880
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
1881
+ )
1882
+ ]);
1883
+ }
1859
1884
  /** */
1860
1885
  updateCategoryOrder(bearerToken, body, options = {}) {
1861
1886
  if (body === null || body === void 0) {
@@ -3968,10 +3993,12 @@ var MezonApi = class {
3968
3993
  ]);
3969
3994
  }
3970
3995
  /** */
3971
- getPinMessagesList(bearerToken, channelId, options = {}) {
3996
+ getPinMessagesList(bearerToken, messageId, channelId, clanId, options = {}) {
3972
3997
  const urlPath = "/v2/pinmessage/get";
3973
3998
  const queryParams = /* @__PURE__ */ new Map();
3999
+ queryParams.set("message_id", messageId);
3974
4000
  queryParams.set("channel_id", channelId);
4001
+ queryParams.set("clan_id", clanId);
3975
4002
  let bodyJson = "";
3976
4003
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3977
4004
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -7523,12 +7550,12 @@ var Client = class {
7523
7550
  });
7524
7551
  });
7525
7552
  }
7526
- pinMessagesList(session, channelId) {
7553
+ pinMessagesList(session, messageId, channelId, clanId) {
7527
7554
  return __async(this, null, function* () {
7528
7555
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7529
7556
  yield this.sessionRefresh(session);
7530
7557
  }
7531
- return this.apiClient.getPinMessagesList(session.token, channelId).then((response) => {
7558
+ return this.apiClient.getPinMessagesList(session.token, messageId, channelId, clanId).then((response) => {
7532
7559
  return Promise.resolve(response);
7533
7560
  });
7534
7561
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.9.17",
4
+ "version": "2.9.19",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"