mezon-js 2.9.19 → 2.9.21

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.
@@ -765,7 +765,9 @@ var MezonApi = class {
765
765
  /** Update fields in the current user's account. */
766
766
  updateAccount(bearerToken, body, options = {}) {
767
767
  if (body === null || body === void 0) {
768
- throw new Error("'body' is a required parameter but is null or undefined.");
768
+ throw new Error(
769
+ "'body' is a required parameter but is null or undefined."
770
+ );
769
771
  }
770
772
  const urlPath = "/v2/account";
771
773
  const queryParams = /* @__PURE__ */ new Map();
@@ -794,7 +796,9 @@ var MezonApi = class {
794
796
  /** Authenticate a user with an Apple ID against the server. */
795
797
  authenticateApple(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
796
798
  if (account === null || account === void 0) {
797
- throw new Error("'account' is a required parameter but is null or undefined.");
799
+ throw new Error(
800
+ "'account' is a required parameter but is null or undefined."
801
+ );
798
802
  }
799
803
  const urlPath = "/v2/account/authenticate/apple";
800
804
  const queryParams = /* @__PURE__ */ new Map();
@@ -825,7 +829,9 @@ var MezonApi = class {
825
829
  /** Authenticate a user with a custom id against the server. */
826
830
  authenticateCustom(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
827
831
  if (account === null || account === void 0) {
828
- throw new Error("'account' is a required parameter but is null or undefined.");
832
+ throw new Error(
833
+ "'account' is a required parameter but is null or undefined."
834
+ );
829
835
  }
830
836
  const urlPath = "/v2/account/authenticate/custom";
831
837
  const queryParams = /* @__PURE__ */ new Map();
@@ -856,7 +862,9 @@ var MezonApi = class {
856
862
  /** Authenticate a user with a device id against the server. */
857
863
  authenticateDevice(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
858
864
  if (account === null || account === void 0) {
859
- throw new Error("'account' is a required parameter but is null or undefined.");
865
+ throw new Error(
866
+ "'account' is a required parameter but is null or undefined."
867
+ );
860
868
  }
861
869
  const urlPath = "/v2/account/authenticate/device";
862
870
  const queryParams = /* @__PURE__ */ new Map();
@@ -887,7 +895,9 @@ var MezonApi = class {
887
895
  /** Authenticate a user with an email+password against the server. */
888
896
  authenticateEmail(basicAuthUsername, basicAuthPassword, account, username, options = {}) {
889
897
  if (account === null || account === void 0) {
890
- throw new Error("'account' is a required parameter but is null or undefined.");
898
+ throw new Error(
899
+ "'account' is a required parameter but is null or undefined."
900
+ );
891
901
  }
892
902
  const urlPath = "/v2/account/authenticate/email";
893
903
  const queryParams = /* @__PURE__ */ new Map();
@@ -917,7 +927,9 @@ var MezonApi = class {
917
927
  /** Authenticate a user with a Facebook OAuth token against the server. */
918
928
  authenticateFacebook(basicAuthUsername, basicAuthPassword, account, create, username, sync, options = {}) {
919
929
  if (account === null || account === void 0) {
920
- throw new Error("'account' is a required parameter but is null or undefined.");
930
+ throw new Error(
931
+ "'account' is a required parameter but is null or undefined."
932
+ );
921
933
  }
922
934
  const urlPath = "/v2/account/authenticate/facebook";
923
935
  const queryParams = /* @__PURE__ */ new Map();
@@ -949,7 +961,9 @@ var MezonApi = class {
949
961
  /** Authenticate a user with a Facebook Instant Game token against the server. */
950
962
  authenticateFacebookInstantGame(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
951
963
  if (account === null || account === void 0) {
952
- throw new Error("'account' is a required parameter but is null or undefined.");
964
+ throw new Error(
965
+ "'account' is a required parameter but is null or undefined."
966
+ );
953
967
  }
954
968
  const urlPath = "/v2/account/authenticate/facebookinstantgame";
955
969
  const queryParams = /* @__PURE__ */ new Map();
@@ -980,7 +994,9 @@ var MezonApi = class {
980
994
  /** Authenticate a user with Apple's GameCenter against the server. */
981
995
  authenticateGameCenter(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
982
996
  if (account === null || account === void 0) {
983
- throw new Error("'account' is a required parameter but is null or undefined.");
997
+ throw new Error(
998
+ "'account' is a required parameter but is null or undefined."
999
+ );
984
1000
  }
985
1001
  const urlPath = "/v2/account/authenticate/gamecenter";
986
1002
  const queryParams = /* @__PURE__ */ new Map();
@@ -1011,7 +1027,9 @@ var MezonApi = class {
1011
1027
  /** Authenticate a user with Google against the server. */
1012
1028
  authenticateGoogle(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
1013
1029
  if (account === null || account === void 0) {
1014
- throw new Error("'account' is a required parameter but is null or undefined.");
1030
+ throw new Error(
1031
+ "'account' is a required parameter but is null or undefined."
1032
+ );
1015
1033
  }
1016
1034
  const urlPath = "/v2/account/authenticate/google";
1017
1035
  const queryParams = /* @__PURE__ */ new Map();
@@ -1042,7 +1060,9 @@ var MezonApi = class {
1042
1060
  /** Authenticate a user with Steam against the server. */
1043
1061
  authenticateSteam(basicAuthUsername, basicAuthPassword, account, create, username, sync, options = {}) {
1044
1062
  if (account === null || account === void 0) {
1045
- throw new Error("'account' is a required parameter but is null or undefined.");
1063
+ throw new Error(
1064
+ "'account' is a required parameter but is null or undefined."
1065
+ );
1046
1066
  }
1047
1067
  const urlPath = "/v2/account/authenticate/steam";
1048
1068
  const queryParams = /* @__PURE__ */ new Map();
@@ -1074,7 +1094,9 @@ var MezonApi = class {
1074
1094
  /** Add an Apple ID to the social profiles on the current user's account. */
1075
1095
  linkApple(bearerToken, body, options = {}) {
1076
1096
  if (body === null || body === void 0) {
1077
- throw new Error("'body' is a required parameter but is null or undefined.");
1097
+ throw new Error(
1098
+ "'body' is a required parameter but is null or undefined."
1099
+ );
1078
1100
  }
1079
1101
  const urlPath = "/v2/account/link/apple";
1080
1102
  const queryParams = /* @__PURE__ */ new Map();
@@ -1103,7 +1125,9 @@ var MezonApi = class {
1103
1125
  /** Add a custom ID to the social profiles on the current user's account. */
1104
1126
  linkCustom(bearerToken, body, options = {}) {
1105
1127
  if (body === null || body === void 0) {
1106
- throw new Error("'body' is a required parameter but is null or undefined.");
1128
+ throw new Error(
1129
+ "'body' is a required parameter but is null or undefined."
1130
+ );
1107
1131
  }
1108
1132
  const urlPath = "/v2/account/link/custom";
1109
1133
  const queryParams = /* @__PURE__ */ new Map();
@@ -1132,7 +1156,9 @@ var MezonApi = class {
1132
1156
  /** Add a device ID to the social profiles on the current user's account. */
1133
1157
  linkDevice(bearerToken, body, options = {}) {
1134
1158
  if (body === null || body === void 0) {
1135
- throw new Error("'body' is a required parameter but is null or undefined.");
1159
+ throw new Error(
1160
+ "'body' is a required parameter but is null or undefined."
1161
+ );
1136
1162
  }
1137
1163
  const urlPath = "/v2/account/link/device";
1138
1164
  const queryParams = /* @__PURE__ */ new Map();
@@ -1161,7 +1187,9 @@ var MezonApi = class {
1161
1187
  /** Add an email+password to the social profiles on the current user's account. */
1162
1188
  linkEmail(bearerToken, body, options = {}) {
1163
1189
  if (body === null || body === void 0) {
1164
- throw new Error("'body' is a required parameter but is null or undefined.");
1190
+ throw new Error(
1191
+ "'body' is a required parameter but is null or undefined."
1192
+ );
1165
1193
  }
1166
1194
  const urlPath = "/v2/account/link/email";
1167
1195
  const queryParams = /* @__PURE__ */ new Map();
@@ -1190,7 +1218,9 @@ var MezonApi = class {
1190
1218
  /** Add Facebook to the social profiles on the current user's account. */
1191
1219
  linkFacebook(bearerToken, account, sync, options = {}) {
1192
1220
  if (account === null || account === void 0) {
1193
- throw new Error("'account' is a required parameter but is null or undefined.");
1221
+ throw new Error(
1222
+ "'account' is a required parameter but is null or undefined."
1223
+ );
1194
1224
  }
1195
1225
  const urlPath = "/v2/account/link/facebook";
1196
1226
  const queryParams = /* @__PURE__ */ new Map();
@@ -1220,7 +1250,9 @@ var MezonApi = class {
1220
1250
  /** Add Facebook Instant Game to the social profiles on the current user's account. */
1221
1251
  linkFacebookInstantGame(bearerToken, body, options = {}) {
1222
1252
  if (body === null || body === void 0) {
1223
- throw new Error("'body' is a required parameter but is null or undefined.");
1253
+ throw new Error(
1254
+ "'body' is a required parameter but is null or undefined."
1255
+ );
1224
1256
  }
1225
1257
  const urlPath = "/v2/account/link/facebookinstantgame";
1226
1258
  const queryParams = /* @__PURE__ */ new Map();
@@ -1249,7 +1281,9 @@ var MezonApi = class {
1249
1281
  /** Add Apple's GameCenter to the social profiles on the current user's account. */
1250
1282
  linkGameCenter(bearerToken, body, options = {}) {
1251
1283
  if (body === null || body === void 0) {
1252
- throw new Error("'body' is a required parameter but is null or undefined.");
1284
+ throw new Error(
1285
+ "'body' is a required parameter but is null or undefined."
1286
+ );
1253
1287
  }
1254
1288
  const urlPath = "/v2/account/link/gamecenter";
1255
1289
  const queryParams = /* @__PURE__ */ new Map();
@@ -1278,7 +1312,9 @@ var MezonApi = class {
1278
1312
  /** Add Google to the social profiles on the current user's account. */
1279
1313
  linkGoogle(bearerToken, body, options = {}) {
1280
1314
  if (body === null || body === void 0) {
1281
- throw new Error("'body' is a required parameter but is null or undefined.");
1315
+ throw new Error(
1316
+ "'body' is a required parameter but is null or undefined."
1317
+ );
1282
1318
  }
1283
1319
  const urlPath = "/v2/account/link/google";
1284
1320
  const queryParams = /* @__PURE__ */ new Map();
@@ -1307,7 +1343,9 @@ var MezonApi = class {
1307
1343
  /** Add Steam to the social profiles on the current user's account. */
1308
1344
  linkSteam(bearerToken, body, options = {}) {
1309
1345
  if (body === null || body === void 0) {
1310
- throw new Error("'body' is a required parameter but is null or undefined.");
1346
+ throw new Error(
1347
+ "'body' is a required parameter but is null or undefined."
1348
+ );
1311
1349
  }
1312
1350
  const urlPath = "/v2/account/link/steam";
1313
1351
  const queryParams = /* @__PURE__ */ new Map();
@@ -1336,7 +1374,9 @@ var MezonApi = class {
1336
1374
  /** Authenticate a user with an email+password against the server. */
1337
1375
  registrationEmail(bearerToken, body, options = {}) {
1338
1376
  if (body === null || body === void 0) {
1339
- throw new Error("'body' is a required parameter but is null or undefined.");
1377
+ throw new Error(
1378
+ "'body' is a required parameter but is null or undefined."
1379
+ );
1340
1380
  }
1341
1381
  const urlPath = "/v2/account/registry";
1342
1382
  const queryParams = /* @__PURE__ */ new Map();
@@ -1365,7 +1405,9 @@ var MezonApi = class {
1365
1405
  /** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
1366
1406
  sessionRefresh(basicAuthUsername, basicAuthPassword, body, options = {}) {
1367
1407
  if (body === null || body === void 0) {
1368
- throw new Error("'body' is a required parameter but is null or undefined.");
1408
+ throw new Error(
1409
+ "'body' is a required parameter but is null or undefined."
1410
+ );
1369
1411
  }
1370
1412
  const urlPath = "/v2/account/session/refresh";
1371
1413
  const queryParams = /* @__PURE__ */ new Map();
@@ -1394,7 +1436,9 @@ var MezonApi = class {
1394
1436
  /** Remove the Apple ID from the social profiles on the current user's account. */
1395
1437
  unlinkApple(bearerToken, body, options = {}) {
1396
1438
  if (body === null || body === void 0) {
1397
- throw new Error("'body' is a required parameter but is null or undefined.");
1439
+ throw new Error(
1440
+ "'body' is a required parameter but is null or undefined."
1441
+ );
1398
1442
  }
1399
1443
  const urlPath = "/v2/account/unlink/apple";
1400
1444
  const queryParams = /* @__PURE__ */ new Map();
@@ -1423,7 +1467,9 @@ var MezonApi = class {
1423
1467
  /** Remove the custom ID from the social profiles on the current user's account. */
1424
1468
  unlinkCustom(bearerToken, body, options = {}) {
1425
1469
  if (body === null || body === void 0) {
1426
- throw new Error("'body' is a required parameter but is null or undefined.");
1470
+ throw new Error(
1471
+ "'body' is a required parameter but is null or undefined."
1472
+ );
1427
1473
  }
1428
1474
  const urlPath = "/v2/account/unlink/custom";
1429
1475
  const queryParams = /* @__PURE__ */ new Map();
@@ -1452,7 +1498,9 @@ var MezonApi = class {
1452
1498
  /** Remove the device ID from the social profiles on the current user's account. */
1453
1499
  unlinkDevice(bearerToken, body, options = {}) {
1454
1500
  if (body === null || body === void 0) {
1455
- throw new Error("'body' is a required parameter but is null or undefined.");
1501
+ throw new Error(
1502
+ "'body' is a required parameter but is null or undefined."
1503
+ );
1456
1504
  }
1457
1505
  const urlPath = "/v2/account/unlink/device";
1458
1506
  const queryParams = /* @__PURE__ */ new Map();
@@ -1481,7 +1529,9 @@ var MezonApi = class {
1481
1529
  /** Remove the email+password from the social profiles on the current user's account. */
1482
1530
  unlinkEmail(bearerToken, body, options = {}) {
1483
1531
  if (body === null || body === void 0) {
1484
- throw new Error("'body' is a required parameter but is null or undefined.");
1532
+ throw new Error(
1533
+ "'body' is a required parameter but is null or undefined."
1534
+ );
1485
1535
  }
1486
1536
  const urlPath = "/v2/account/unlink/email";
1487
1537
  const queryParams = /* @__PURE__ */ new Map();
@@ -1510,7 +1560,9 @@ var MezonApi = class {
1510
1560
  /** Remove Facebook from the social profiles on the current user's account. */
1511
1561
  unlinkFacebook(bearerToken, body, options = {}) {
1512
1562
  if (body === null || body === void 0) {
1513
- throw new Error("'body' is a required parameter but is null or undefined.");
1563
+ throw new Error(
1564
+ "'body' is a required parameter but is null or undefined."
1565
+ );
1514
1566
  }
1515
1567
  const urlPath = "/v2/account/unlink/facebook";
1516
1568
  const queryParams = /* @__PURE__ */ new Map();
@@ -1539,7 +1591,9 @@ var MezonApi = class {
1539
1591
  /** Remove Facebook Instant Game profile from the social profiles on the current user's account. */
1540
1592
  unlinkFacebookInstantGame(bearerToken, body, options = {}) {
1541
1593
  if (body === null || body === void 0) {
1542
- throw new Error("'body' is a required parameter but is null or undefined.");
1594
+ throw new Error(
1595
+ "'body' is a required parameter but is null or undefined."
1596
+ );
1543
1597
  }
1544
1598
  const urlPath = "/v2/account/unlink/facebookinstantgame";
1545
1599
  const queryParams = /* @__PURE__ */ new Map();
@@ -1568,7 +1622,9 @@ var MezonApi = class {
1568
1622
  /** Remove Apple's GameCenter from the social profiles on the current user's account. */
1569
1623
  unlinkGameCenter(bearerToken, body, options = {}) {
1570
1624
  if (body === null || body === void 0) {
1571
- throw new Error("'body' is a required parameter but is null or undefined.");
1625
+ throw new Error(
1626
+ "'body' is a required parameter but is null or undefined."
1627
+ );
1572
1628
  }
1573
1629
  const urlPath = "/v2/account/unlink/gamecenter";
1574
1630
  const queryParams = /* @__PURE__ */ new Map();
@@ -1597,7 +1653,9 @@ var MezonApi = class {
1597
1653
  /** Remove Google from the social profiles on the current user's account. */
1598
1654
  unlinkGoogle(bearerToken, body, options = {}) {
1599
1655
  if (body === null || body === void 0) {
1600
- throw new Error("'body' is a required parameter but is null or undefined.");
1656
+ throw new Error(
1657
+ "'body' is a required parameter but is null or undefined."
1658
+ );
1601
1659
  }
1602
1660
  const urlPath = "/v2/account/unlink/google";
1603
1661
  const queryParams = /* @__PURE__ */ new Map();
@@ -1626,7 +1684,9 @@ var MezonApi = class {
1626
1684
  /** Remove Steam from the social profiles on the current user's account. */
1627
1685
  unlinkSteam(bearerToken, body, options = {}) {
1628
1686
  if (body === null || body === void 0) {
1629
- throw new Error("'body' is a required parameter but is null or undefined.");
1687
+ throw new Error(
1688
+ "'body' is a required parameter but is null or undefined."
1689
+ );
1630
1690
  }
1631
1691
  const urlPath = "/v2/account/unlink/steam";
1632
1692
  const queryParams = /* @__PURE__ */ new Map();
@@ -1655,7 +1715,9 @@ var MezonApi = class {
1655
1715
  /** Add a new apps. */
1656
1716
  addApp(bearerToken, body, options = {}) {
1657
1717
  if (body === null || body === void 0) {
1658
- throw new Error("'body' is a required parameter but is null or undefined.");
1718
+ throw new Error(
1719
+ "'body' is a required parameter but is null or undefined."
1720
+ );
1659
1721
  }
1660
1722
  const urlPath = "/v2/apps/add";
1661
1723
  const queryParams = /* @__PURE__ */ new Map();
@@ -1712,10 +1774,14 @@ var MezonApi = class {
1712
1774
  /** Add an app to clan. */
1713
1775
  addAppToClan(bearerToken, appId, clanId, options = {}) {
1714
1776
  if (appId === null || appId === void 0) {
1715
- throw new Error("'appId' is a required parameter but is null or undefined.");
1777
+ throw new Error(
1778
+ "'appId' is a required parameter but is null or undefined."
1779
+ );
1716
1780
  }
1717
1781
  if (clanId === null || clanId === void 0) {
1718
- throw new Error("'clanId' is a required parameter but is null or undefined.");
1782
+ throw new Error(
1783
+ "'clanId' is a required parameter but is null or undefined."
1784
+ );
1719
1785
  }
1720
1786
  const urlPath = "/v2/apps/app/{appId}/clan/{clanId}".replace("{appId}", encodeURIComponent(String(appId))).replace("{clanId}", encodeURIComponent(String(clanId)));
1721
1787
  const queryParams = /* @__PURE__ */ new Map();
@@ -1745,7 +1811,10 @@ var MezonApi = class {
1745
1811
  if (id === null || id === void 0) {
1746
1812
  throw new Error("'id' is a required parameter but is null or undefined.");
1747
1813
  }
1748
- const urlPath = "/v2/apps/app/{id}".replace("{id}", encodeURIComponent(String(id)));
1814
+ const urlPath = "/v2/apps/app/{id}".replace(
1815
+ "{id}",
1816
+ encodeURIComponent(String(id))
1817
+ );
1749
1818
  const queryParams = /* @__PURE__ */ new Map();
1750
1819
  queryParams.set("record_deletion", recordDeletion);
1751
1820
  let bodyJson = "";
@@ -1774,7 +1843,10 @@ var MezonApi = class {
1774
1843
  if (id === null || id === void 0) {
1775
1844
  throw new Error("'id' is a required parameter but is null or undefined.");
1776
1845
  }
1777
- const urlPath = "/v2/apps/app/{id}".replace("{id}", encodeURIComponent(String(id)));
1846
+ const urlPath = "/v2/apps/app/{id}".replace(
1847
+ "{id}",
1848
+ encodeURIComponent(String(id))
1849
+ );
1778
1850
  const queryParams = /* @__PURE__ */ new Map();
1779
1851
  let bodyJson = "";
1780
1852
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -1803,9 +1875,14 @@ var MezonApi = class {
1803
1875
  throw new Error("'id' is a required parameter but is null or undefined.");
1804
1876
  }
1805
1877
  if (body === null || body === void 0) {
1806
- throw new Error("'body' is a required parameter but is null or undefined.");
1878
+ throw new Error(
1879
+ "'body' is a required parameter but is null or undefined."
1880
+ );
1807
1881
  }
1808
- const urlPath = "/v2/apps/app/{id}".replace("{id}", encodeURIComponent(String(id)));
1882
+ const urlPath = "/v2/apps/app/{id}".replace(
1883
+ "{id}",
1884
+ encodeURIComponent(String(id))
1885
+ );
1809
1886
  const queryParams = /* @__PURE__ */ new Map();
1810
1887
  let bodyJson = "";
1811
1888
  bodyJson = JSON.stringify(body || {});
@@ -1834,7 +1911,10 @@ var MezonApi = class {
1834
1911
  if (id === null || id === void 0) {
1835
1912
  throw new Error("'id' is a required parameter but is null or undefined.");
1836
1913
  }
1837
- const urlPath = "/v2/apps/app/{id}/ban".replace("{id}", encodeURIComponent(String(id)));
1914
+ const urlPath = "/v2/apps/app/{id}/ban".replace(
1915
+ "{id}",
1916
+ encodeURIComponent(String(id))
1917
+ );
1838
1918
  const queryParams = /* @__PURE__ */ new Map();
1839
1919
  let bodyJson = "";
1840
1920
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -1862,7 +1942,10 @@ var MezonApi = class {
1862
1942
  if (id === null || id === void 0) {
1863
1943
  throw new Error("'id' is a required parameter but is null or undefined.");
1864
1944
  }
1865
- const urlPath = "/v2/apps/app/{id}/unban".replace("{id}", encodeURIComponent(String(id)));
1945
+ const urlPath = "/v2/apps/app/{id}/unban".replace(
1946
+ "{id}",
1947
+ encodeURIComponent(String(id))
1948
+ );
1866
1949
  const queryParams = /* @__PURE__ */ new Map();
1867
1950
  let bodyJson = "";
1868
1951
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -1885,35 +1968,12 @@ var MezonApi = class {
1885
1968
  )
1886
1969
  ]);
1887
1970
  }
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
- }
1913
1971
  /** */
1914
1972
  updateCategoryOrder(bearerToken, body, options = {}) {
1915
1973
  if (body === null || body === void 0) {
1916
- throw new Error("'body' is a required parameter but is null or undefined.");
1974
+ throw new Error(
1975
+ "'body' is a required parameter but is null or undefined."
1976
+ );
1917
1977
  }
1918
1978
  const urlPath = "/v2/category/orders";
1919
1979
  const queryParams = /* @__PURE__ */ new Map();
@@ -1942,9 +2002,14 @@ var MezonApi = class {
1942
2002
  /** */
1943
2003
  listCategoryDescs(bearerToken, clanId, creatorId, categoryName, categoryId, categoryOrder, options = {}) {
1944
2004
  if (clanId === null || clanId === void 0) {
1945
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2005
+ throw new Error(
2006
+ "'clanId' is a required parameter but is null or undefined."
2007
+ );
1946
2008
  }
1947
- const urlPath = "/v2/categorydesc/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2009
+ const urlPath = "/v2/categorydesc/{clanId}".replace(
2010
+ "{clanId}",
2011
+ encodeURIComponent(String(clanId))
2012
+ );
1948
2013
  const queryParams = /* @__PURE__ */ new Map();
1949
2014
  queryParams.set("creator_id", creatorId);
1950
2015
  queryParams.set("category_name", categoryName);
@@ -2000,9 +2065,14 @@ var MezonApi = class {
2000
2065
  /** List a channel's message history. */
2001
2066
  listChannelMessages(bearerToken, clanId, channelId, messageId, direction, limit, options = {}) {
2002
2067
  if (channelId === null || channelId === void 0) {
2003
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2068
+ throw new Error(
2069
+ "'channelId' is a required parameter but is null or undefined."
2070
+ );
2004
2071
  }
2005
- const urlPath = "/v2/channel/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
2072
+ const urlPath = "/v2/channel/{channelId}".replace(
2073
+ "{channelId}",
2074
+ encodeURIComponent(String(channelId))
2075
+ );
2006
2076
  const queryParams = /* @__PURE__ */ new Map();
2007
2077
  queryParams.set("clan_id", clanId);
2008
2078
  queryParams.set("message_id", messageId);
@@ -2032,9 +2102,14 @@ var MezonApi = class {
2032
2102
  /** Add users to a channel. */
2033
2103
  addChannelUsers(bearerToken, channelId, userIds, options = {}) {
2034
2104
  if (channelId === null || channelId === void 0) {
2035
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2105
+ throw new Error(
2106
+ "'channelId' is a required parameter but is null or undefined."
2107
+ );
2036
2108
  }
2037
- const urlPath = "/v2/channel/{channelId}/add".replace("{channelId}", encodeURIComponent(String(channelId)));
2109
+ const urlPath = "/v2/channel/{channelId}/add".replace(
2110
+ "{channelId}",
2111
+ encodeURIComponent(String(channelId))
2112
+ );
2038
2113
  const queryParams = /* @__PURE__ */ new Map();
2039
2114
  queryParams.set("user_ids", userIds);
2040
2115
  let bodyJson = "";
@@ -2061,9 +2136,14 @@ var MezonApi = class {
2061
2136
  /** List all attachment that are part of a channel. */
2062
2137
  listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state, cursor, options = {}) {
2063
2138
  if (channelId === null || channelId === void 0) {
2064
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2139
+ throw new Error(
2140
+ "'channelId' is a required parameter but is null or undefined."
2141
+ );
2065
2142
  }
2066
- const urlPath = "/v2/channel/{channelId}/attachment".replace("{channelId}", encodeURIComponent(String(channelId)));
2143
+ const urlPath = "/v2/channel/{channelId}/attachment".replace(
2144
+ "{channelId}",
2145
+ encodeURIComponent(String(channelId))
2146
+ );
2067
2147
  const queryParams = /* @__PURE__ */ new Map();
2068
2148
  queryParams.set("clan_id", clanId);
2069
2149
  queryParams.set("file_type", fileType);
@@ -2094,9 +2174,14 @@ var MezonApi = class {
2094
2174
  /** Leave a channel the user is a member of. */
2095
2175
  leaveChannel(bearerToken, channelId, options = {}) {
2096
2176
  if (channelId === null || channelId === void 0) {
2097
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2177
+ throw new Error(
2178
+ "'channelId' is a required parameter but is null or undefined."
2179
+ );
2098
2180
  }
2099
- const urlPath = "/v2/channel/{channelId}/leave".replace("{channelId}", encodeURIComponent(String(channelId)));
2181
+ const urlPath = "/v2/channel/{channelId}/leave".replace(
2182
+ "{channelId}",
2183
+ encodeURIComponent(String(channelId))
2184
+ );
2100
2185
  const queryParams = /* @__PURE__ */ new Map();
2101
2186
  let bodyJson = "";
2102
2187
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2122,9 +2207,14 @@ var MezonApi = class {
2122
2207
  /** Kick a set of users from a channel. */
2123
2208
  removeChannelUsers(bearerToken, channelId, userIds, options = {}) {
2124
2209
  if (channelId === null || channelId === void 0) {
2125
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2210
+ throw new Error(
2211
+ "'channelId' is a required parameter but is null or undefined."
2212
+ );
2126
2213
  }
2127
- const urlPath = "/v2/channel/{channelId}/remove".replace("{channelId}", encodeURIComponent(String(channelId)));
2214
+ const urlPath = "/v2/channel/{channelId}/remove".replace(
2215
+ "{channelId}",
2216
+ encodeURIComponent(String(channelId))
2217
+ );
2128
2218
  const queryParams = /* @__PURE__ */ new Map();
2129
2219
  queryParams.set("user_ids", userIds);
2130
2220
  let bodyJson = "";
@@ -2151,9 +2241,14 @@ var MezonApi = class {
2151
2241
  /** List all users that are part of a channel. */
2152
2242
  listChannelUsers(bearerToken, clanId, channelId, channelType, limit, state, cursor, options = {}) {
2153
2243
  if (channelId === null || channelId === void 0) {
2154
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2244
+ throw new Error(
2245
+ "'channelId' is a required parameter but is null or undefined."
2246
+ );
2155
2247
  }
2156
- const urlPath = "/v2/channel/{channelId}/user".replace("{channelId}", encodeURIComponent(String(channelId)));
2248
+ const urlPath = "/v2/channel/{channelId}/user".replace(
2249
+ "{channelId}",
2250
+ encodeURIComponent(String(channelId))
2251
+ );
2157
2252
  const queryParams = /* @__PURE__ */ new Map();
2158
2253
  queryParams.set("clan_id", clanId);
2159
2254
  queryParams.set("channel_type", channelType);
@@ -2214,7 +2309,9 @@ var MezonApi = class {
2214
2309
  /** Create a new channel with the current user as the owner. */
2215
2310
  createChannelDesc(bearerToken, body, options = {}) {
2216
2311
  if (body === null || body === void 0) {
2217
- throw new Error("'body' is a required parameter but is null or undefined.");
2312
+ throw new Error(
2313
+ "'body' is a required parameter but is null or undefined."
2314
+ );
2218
2315
  }
2219
2316
  const urlPath = "/v2/channeldesc";
2220
2317
  const queryParams = /* @__PURE__ */ new Map();
@@ -2270,9 +2367,14 @@ var MezonApi = class {
2270
2367
  /** Delete a channel by ID. */
2271
2368
  deleteChannelDesc(bearerToken, channelId, options = {}) {
2272
2369
  if (channelId === null || channelId === void 0) {
2273
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2370
+ throw new Error(
2371
+ "'channelId' is a required parameter but is null or undefined."
2372
+ );
2274
2373
  }
2275
- const urlPath = "/v2/channeldesc/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
2374
+ const urlPath = "/v2/channeldesc/{channelId}".replace(
2375
+ "{channelId}",
2376
+ encodeURIComponent(String(channelId))
2377
+ );
2276
2378
  const queryParams = /* @__PURE__ */ new Map();
2277
2379
  let bodyJson = "";
2278
2380
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2298,12 +2400,19 @@ var MezonApi = class {
2298
2400
  /** Update fields in a given channel. */
2299
2401
  updateChannelDesc(bearerToken, channelId, body, options = {}) {
2300
2402
  if (channelId === null || channelId === void 0) {
2301
- throw new Error("'channelId' is a required parameter but is null or undefined.");
2403
+ throw new Error(
2404
+ "'channelId' is a required parameter but is null or undefined."
2405
+ );
2302
2406
  }
2303
2407
  if (body === null || body === void 0) {
2304
- throw new Error("'body' is a required parameter but is null or undefined.");
2408
+ throw new Error(
2409
+ "'body' is a required parameter but is null or undefined."
2410
+ );
2305
2411
  }
2306
- const urlPath = "/v2/channeldesc/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
2412
+ const urlPath = "/v2/channeldesc/{channelId}".replace(
2413
+ "{channelId}",
2414
+ encodeURIComponent(String(channelId))
2415
+ );
2307
2416
  const queryParams = /* @__PURE__ */ new Map();
2308
2417
  let bodyJson = "";
2309
2418
  bodyJson = JSON.stringify(body || {});
@@ -2389,7 +2498,9 @@ var MezonApi = class {
2389
2498
  /** Create a clan */
2390
2499
  createClanDesc(bearerToken, body, options = {}) {
2391
2500
  if (body === null || body === void 0) {
2392
- throw new Error("'body' is a required parameter but is null or undefined.");
2501
+ throw new Error(
2502
+ "'body' is a required parameter but is null or undefined."
2503
+ );
2393
2504
  }
2394
2505
  const urlPath = "/v2/clandesc";
2395
2506
  const queryParams = /* @__PURE__ */ new Map();
@@ -2418,9 +2529,14 @@ var MezonApi = class {
2418
2529
  /** Delete a clan desc by ID. */
2419
2530
  deleteClanDesc(bearerToken, clanDescId, options = {}) {
2420
2531
  if (clanDescId === null || clanDescId === void 0) {
2421
- throw new Error("'clanDescId' is a required parameter but is null or undefined.");
2532
+ throw new Error(
2533
+ "'clanDescId' is a required parameter but is null or undefined."
2534
+ );
2422
2535
  }
2423
- const urlPath = "/v2/clandesc/{clanDescId}".replace("{clanDescId}", encodeURIComponent(String(clanDescId)));
2536
+ const urlPath = "/v2/clandesc/{clanDescId}".replace(
2537
+ "{clanDescId}",
2538
+ encodeURIComponent(String(clanDescId))
2539
+ );
2424
2540
  const queryParams = /* @__PURE__ */ new Map();
2425
2541
  let bodyJson = "";
2426
2542
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2446,12 +2562,19 @@ var MezonApi = class {
2446
2562
  /** Update fields in a given clan. */
2447
2563
  updateClanDesc(bearerToken, clanId, body, options = {}) {
2448
2564
  if (clanId === null || clanId === void 0) {
2449
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2565
+ throw new Error(
2566
+ "'clanId' is a required parameter but is null or undefined."
2567
+ );
2450
2568
  }
2451
2569
  if (body === null || body === void 0) {
2452
- throw new Error("'body' is a required parameter but is null or undefined.");
2570
+ throw new Error(
2571
+ "'body' is a required parameter but is null or undefined."
2572
+ );
2453
2573
  }
2454
- const urlPath = "/v2/clandesc/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2574
+ const urlPath = "/v2/clandesc/{clanId}".replace(
2575
+ "{clanId}",
2576
+ encodeURIComponent(String(clanId))
2577
+ );
2455
2578
  const queryParams = /* @__PURE__ */ new Map();
2456
2579
  let bodyJson = "";
2457
2580
  bodyJson = JSON.stringify(body || {});
@@ -2478,9 +2601,14 @@ var MezonApi = class {
2478
2601
  /** Kick a set of users from a clan. */
2479
2602
  removeClanUsers(bearerToken, clanId, userIds, options = {}) {
2480
2603
  if (clanId === null || clanId === void 0) {
2481
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2604
+ throw new Error(
2605
+ "'clanId' is a required parameter but is null or undefined."
2606
+ );
2482
2607
  }
2483
- const urlPath = "/v2/clandesc/{clanId}/kick".replace("{clanId}", encodeURIComponent(String(clanId)));
2608
+ const urlPath = "/v2/clandesc/{clanId}/kick".replace(
2609
+ "{clanId}",
2610
+ encodeURIComponent(String(clanId))
2611
+ );
2484
2612
  const queryParams = /* @__PURE__ */ new Map();
2485
2613
  queryParams.set("user_ids", userIds);
2486
2614
  let bodyJson = "";
@@ -2507,9 +2635,14 @@ var MezonApi = class {
2507
2635
  /** List all users that are part of a clan. */
2508
2636
  listClanUsers(bearerToken, clanId, options = {}) {
2509
2637
  if (clanId === null || clanId === void 0) {
2510
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2638
+ throw new Error(
2639
+ "'clanId' is a required parameter but is null or undefined."
2640
+ );
2511
2641
  }
2512
- const urlPath = "/v2/clandesc/{clanId}/user".replace("{clanId}", encodeURIComponent(String(clanId)));
2642
+ const urlPath = "/v2/clandesc/{clanId}/user".replace(
2643
+ "{clanId}",
2644
+ encodeURIComponent(String(clanId))
2645
+ );
2513
2646
  const queryParams = /* @__PURE__ */ new Map();
2514
2647
  let bodyJson = "";
2515
2648
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2535,9 +2668,14 @@ var MezonApi = class {
2535
2668
  /** check duplicate clan name */
2536
2669
  checkDuplicateClanName(bearerToken, clanName, options = {}) {
2537
2670
  if (clanName === null || clanName === void 0) {
2538
- throw new Error("'clanName' is a required parameter but is null or undefined.");
2671
+ throw new Error(
2672
+ "'clanName' is a required parameter but is null or undefined."
2673
+ );
2539
2674
  }
2540
- const urlPath = "/v2/clandesc/{clanName}".replace("{clanName}", encodeURIComponent(String(clanName)));
2675
+ const urlPath = "/v2/clandesc/{clanName}".replace(
2676
+ "{clanName}",
2677
+ encodeURIComponent(String(clanName))
2678
+ );
2541
2679
  const queryParams = /* @__PURE__ */ new Map();
2542
2680
  let bodyJson = "";
2543
2681
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2563,9 +2701,14 @@ var MezonApi = class {
2563
2701
  /** Get a clan desc profile */
2564
2702
  getClanDescProfile(bearerToken, clanId, options = {}) {
2565
2703
  if (clanId === null || clanId === void 0) {
2566
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2704
+ throw new Error(
2705
+ "'clanId' is a required parameter but is null or undefined."
2706
+ );
2567
2707
  }
2568
- const urlPath = "/v2/clandescprofile/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2708
+ const urlPath = "/v2/clandescprofile/{clanId}".replace(
2709
+ "{clanId}",
2710
+ encodeURIComponent(String(clanId))
2711
+ );
2569
2712
  const queryParams = /* @__PURE__ */ new Map();
2570
2713
  let bodyJson = "";
2571
2714
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2591,12 +2734,19 @@ var MezonApi = class {
2591
2734
  /** Update fields in a given clan profile. */
2592
2735
  updateClanDescProfile(bearerToken, clanId, body, options = {}) {
2593
2736
  if (clanId === null || clanId === void 0) {
2594
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2737
+ throw new Error(
2738
+ "'clanId' is a required parameter but is null or undefined."
2739
+ );
2595
2740
  }
2596
2741
  if (body === null || body === void 0) {
2597
- throw new Error("'body' is a required parameter but is null or undefined.");
2742
+ throw new Error(
2743
+ "'body' is a required parameter but is null or undefined."
2744
+ );
2598
2745
  }
2599
- const urlPath = "/v2/clandescprofile/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2746
+ const urlPath = "/v2/clandescprofile/{clanId}".replace(
2747
+ "{clanId}",
2748
+ encodeURIComponent(String(clanId))
2749
+ );
2600
2750
  const queryParams = /* @__PURE__ */ new Map();
2601
2751
  let bodyJson = "";
2602
2752
  bodyJson = JSON.stringify(body || {});
@@ -2623,7 +2773,9 @@ var MezonApi = class {
2623
2773
  /** */
2624
2774
  createCategoryDesc(bearerToken, body, options = {}) {
2625
2775
  if (body === null || body === void 0) {
2626
- throw new Error("'body' is a required parameter but is null or undefined.");
2776
+ throw new Error(
2777
+ "'body' is a required parameter but is null or undefined."
2778
+ );
2627
2779
  }
2628
2780
  const urlPath = "/v2/createcategory";
2629
2781
  const queryParams = /* @__PURE__ */ new Map();
@@ -2652,10 +2804,14 @@ var MezonApi = class {
2652
2804
  /** */
2653
2805
  deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
2654
2806
  if (categoryId === null || categoryId === void 0) {
2655
- throw new Error("'categoryId' is a required parameter but is null or undefined.");
2807
+ throw new Error(
2808
+ "'categoryId' is a required parameter but is null or undefined."
2809
+ );
2656
2810
  }
2657
2811
  if (clanId === null || clanId === void 0) {
2658
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2812
+ throw new Error(
2813
+ "'clanId' is a required parameter but is null or undefined."
2814
+ );
2659
2815
  }
2660
2816
  const urlPath = "/v2/deletecategory/category_id/{categoryId}/clan_id/{clanId}".replace("{categoryId}", encodeURIComponent(String(categoryId))).replace("{clanId}", encodeURIComponent(String(clanId)));
2661
2817
  const queryParams = /* @__PURE__ */ new Map();
@@ -2683,9 +2839,14 @@ var MezonApi = class {
2683
2839
  /** */
2684
2840
  deleteCategoryOrder(bearerToken, clanId, options = {}) {
2685
2841
  if (clanId === null || clanId === void 0) {
2686
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2842
+ throw new Error(
2843
+ "'clanId' is a required parameter but is null or undefined."
2844
+ );
2687
2845
  }
2688
- const urlPath = "/v2/deletecategoryorder/clan_id/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2846
+ const urlPath = "/v2/deletecategoryorder/clan_id/{clanId}".replace(
2847
+ "{clanId}",
2848
+ encodeURIComponent(String(clanId))
2849
+ );
2689
2850
  const queryParams = /* @__PURE__ */ new Map();
2690
2851
  let bodyJson = "";
2691
2852
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -2739,7 +2900,9 @@ var MezonApi = class {
2739
2900
  /** close direct message. */
2740
2901
  closeDirectMess(bearerToken, body, options = {}) {
2741
2902
  if (body === null || body === void 0) {
2742
- throw new Error("'body' is a required parameter but is null or undefined.");
2903
+ throw new Error(
2904
+ "'body' is a required parameter but is null or undefined."
2905
+ );
2743
2906
  }
2744
2907
  const urlPath = "/v2/direct/close";
2745
2908
  const queryParams = /* @__PURE__ */ new Map();
@@ -2768,7 +2931,9 @@ var MezonApi = class {
2768
2931
  /** open direct message. */
2769
2932
  openDirectMess(bearerToken, body, options = {}) {
2770
2933
  if (body === null || body === void 0) {
2771
- throw new Error("'body' is a required parameter but is null or undefined.");
2934
+ throw new Error(
2935
+ "'body' is a required parameter but is null or undefined."
2936
+ );
2772
2937
  }
2773
2938
  const urlPath = "/v2/direct/open";
2774
2939
  const queryParams = /* @__PURE__ */ new Map();
@@ -2797,7 +2962,9 @@ var MezonApi = class {
2797
2962
  /** Post clan Emoji /v2/emoji/create */
2798
2963
  createClanEmoji(bearerToken, body, options = {}) {
2799
2964
  if (body === null || body === void 0) {
2800
- throw new Error("'body' is a required parameter but is null or undefined.");
2965
+ throw new Error(
2966
+ "'body' is a required parameter but is null or undefined."
2967
+ );
2801
2968
  }
2802
2969
  const urlPath = "/v2/emoji/create";
2803
2970
  const queryParams = /* @__PURE__ */ new Map();
@@ -2828,7 +2995,10 @@ var MezonApi = class {
2828
2995
  if (id === null || id === void 0) {
2829
2996
  throw new Error("'id' is a required parameter but is null or undefined.");
2830
2997
  }
2831
- const urlPath = "/v2/emoji/{id}".replace("{id}", encodeURIComponent(String(id)));
2998
+ const urlPath = "/v2/emoji/{id}".replace(
2999
+ "{id}",
3000
+ encodeURIComponent(String(id))
3001
+ );
2832
3002
  const queryParams = /* @__PURE__ */ new Map();
2833
3003
  queryParams.set("clan_id", clanId);
2834
3004
  const body = { clan_id: clanId };
@@ -2859,9 +3029,14 @@ var MezonApi = class {
2859
3029
  throw new Error("'id' is a required parameter but is null or undefined.");
2860
3030
  }
2861
3031
  if (body === null || body === void 0) {
2862
- throw new Error("'body' is a required parameter but is null or undefined.");
3032
+ throw new Error(
3033
+ "'body' is a required parameter but is null or undefined."
3034
+ );
2863
3035
  }
2864
- const urlPath = "/v2/emoji/{id}".replace("{id}", encodeURIComponent(String(id)));
3036
+ const urlPath = "/v2/emoji/{id}".replace(
3037
+ "{id}",
3038
+ encodeURIComponent(String(id))
3039
+ );
2865
3040
  const queryParams = /* @__PURE__ */ new Map();
2866
3041
  let bodyJson = "";
2867
3042
  bodyJson = JSON.stringify(body || {});
@@ -2913,7 +3088,9 @@ var MezonApi = class {
2913
3088
  /** Search message from elasticsearch service. */
2914
3089
  searchMessage(bearerToken, body, options = {}) {
2915
3090
  if (body === null || body === void 0) {
2916
- throw new Error("'body' is a required parameter but is null or undefined.");
3091
+ throw new Error(
3092
+ "'body' is a required parameter but is null or undefined."
3093
+ );
2917
3094
  }
2918
3095
  const urlPath = "/v2/es/search";
2919
3096
  const queryParams = /* @__PURE__ */ new Map();
@@ -2942,7 +3119,9 @@ var MezonApi = class {
2942
3119
  /** Submit an event for processing in the server's registered runtime custom events handler. */
2943
3120
  event(bearerToken, body, options = {}) {
2944
3121
  if (body === null || body === void 0) {
2945
- throw new Error("'body' is a required parameter but is null or undefined.");
3122
+ throw new Error(
3123
+ "'body' is a required parameter but is null or undefined."
3124
+ );
2946
3125
  }
2947
3126
  const urlPath = "/v2/event";
2948
3127
  const queryParams = /* @__PURE__ */ new Map();
@@ -2997,7 +3176,9 @@ var MezonApi = class {
2997
3176
  /** Create a new event for clan. */
2998
3177
  createEvent(bearerToken, body, options = {}) {
2999
3178
  if (body === null || body === void 0) {
3000
- throw new Error("'body' is a required parameter but is null or undefined.");
3179
+ throw new Error(
3180
+ "'body' is a required parameter but is null or undefined."
3181
+ );
3001
3182
  }
3002
3183
  const urlPath = "/v2/eventmanagement/create";
3003
3184
  const queryParams = /* @__PURE__ */ new Map();
@@ -3026,7 +3207,9 @@ var MezonApi = class {
3026
3207
  /** Update fields in a given event. */
3027
3208
  updateEventUser(bearerToken, body, options = {}) {
3028
3209
  if (body === null || body === void 0) {
3029
- throw new Error("'body' is a required parameter but is null or undefined.");
3210
+ throw new Error(
3211
+ "'body' is a required parameter but is null or undefined."
3212
+ );
3030
3213
  }
3031
3214
  const urlPath = "/v2/eventmanagement/user";
3032
3215
  const queryParams = /* @__PURE__ */ new Map();
@@ -3055,9 +3238,14 @@ var MezonApi = class {
3055
3238
  /** Delete a event by ID. */
3056
3239
  deleteEvent(bearerToken, eventId, clanId, options = {}) {
3057
3240
  if (eventId === null || eventId === void 0) {
3058
- throw new Error("'eventId' is a required parameter but is null or undefined.");
3241
+ throw new Error(
3242
+ "'eventId' is a required parameter but is null or undefined."
3243
+ );
3059
3244
  }
3060
- const urlPath = "/v2/eventmanagement/{eventId}".replace("{eventId}", encodeURIComponent(String(eventId)));
3245
+ const urlPath = "/v2/eventmanagement/{eventId}".replace(
3246
+ "{eventId}",
3247
+ encodeURIComponent(String(eventId))
3248
+ );
3061
3249
  const queryParams = /* @__PURE__ */ new Map();
3062
3250
  queryParams.set("clan_id", clanId);
3063
3251
  let bodyJson = "";
@@ -3084,12 +3272,19 @@ var MezonApi = class {
3084
3272
  /** Update fields in a given event. */
3085
3273
  updateEvent(bearerToken, eventId, body, options = {}) {
3086
3274
  if (eventId === null || eventId === void 0) {
3087
- throw new Error("'eventId' is a required parameter but is null or undefined.");
3275
+ throw new Error(
3276
+ "'eventId' is a required parameter but is null or undefined."
3277
+ );
3088
3278
  }
3089
3279
  if (body === null || body === void 0) {
3090
- throw new Error("'body' is a required parameter but is null or undefined.");
3280
+ throw new Error(
3281
+ "'body' is a required parameter but is null or undefined."
3282
+ );
3091
3283
  }
3092
- const urlPath = "/v2/eventmanagement/{eventId}".replace("{eventId}", encodeURIComponent(String(eventId)));
3284
+ const urlPath = "/v2/eventmanagement/{eventId}".replace(
3285
+ "{eventId}",
3286
+ encodeURIComponent(String(eventId))
3287
+ );
3093
3288
  const queryParams = /* @__PURE__ */ new Map();
3094
3289
  let bodyJson = "";
3095
3290
  bodyJson = JSON.stringify(body || {});
@@ -3225,7 +3420,9 @@ var MezonApi = class {
3225
3420
  /** Import Facebook friends and add them to a user's account. */
3226
3421
  importFacebookFriends(bearerToken, account, reset, options = {}) {
3227
3422
  if (account === null || account === void 0) {
3228
- throw new Error("'account' is a required parameter but is null or undefined.");
3423
+ throw new Error(
3424
+ "'account' is a required parameter but is null or undefined."
3425
+ );
3229
3426
  }
3230
3427
  const urlPath = "/v2/friend/facebook";
3231
3428
  const queryParams = /* @__PURE__ */ new Map();
@@ -3255,7 +3452,9 @@ var MezonApi = class {
3255
3452
  /** Import Steam friends and add them to a user's account. */
3256
3453
  importSteamFriends(bearerToken, account, reset, options = {}) {
3257
3454
  if (account === null || account === void 0) {
3258
- throw new Error("'account' is a required parameter but is null or undefined.");
3455
+ throw new Error(
3456
+ "'account' is a required parameter but is null or undefined."
3457
+ );
3259
3458
  }
3260
3459
  const urlPath = "/v2/friend/steam";
3261
3460
  const queryParams = /* @__PURE__ */ new Map();
@@ -3311,9 +3510,14 @@ var MezonApi = class {
3311
3510
  /** */
3312
3511
  getUserProfileOnClan(bearerToken, clanId, options = {}) {
3313
3512
  if (clanId === null || clanId === void 0) {
3314
- throw new Error("'clanId' is a required parameter but is null or undefined.");
3513
+ throw new Error(
3514
+ "'clanId' is a required parameter but is null or undefined."
3515
+ );
3315
3516
  }
3316
- const urlPath = "/v2/getclanprofile/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
3517
+ const urlPath = "/v2/getclanprofile/{clanId}".replace(
3518
+ "{clanId}",
3519
+ encodeURIComponent(String(clanId))
3520
+ );
3317
3521
  const queryParams = /* @__PURE__ */ new Map();
3318
3522
  let bodyJson = "";
3319
3523
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -3443,7 +3647,9 @@ var MezonApi = class {
3443
3647
  /** Give a coffee */
3444
3648
  giveMeACoffee(bearerToken, body, options = {}) {
3445
3649
  if (body === null || body === void 0) {
3446
- throw new Error("'body' is a required parameter but is null or undefined.");
3650
+ throw new Error(
3651
+ "'body' is a required parameter but is null or undefined."
3652
+ );
3447
3653
  }
3448
3654
  const urlPath = "/v2/givecoffee";
3449
3655
  const queryParams = /* @__PURE__ */ new Map();
@@ -3499,7 +3705,9 @@ var MezonApi = class {
3499
3705
  /** Add users to a channel. */
3500
3706
  createLinkInviteUser(bearerToken, body, options = {}) {
3501
3707
  if (body === null || body === void 0) {
3502
- throw new Error("'body' is a required parameter but is null or undefined.");
3708
+ throw new Error(
3709
+ "'body' is a required parameter but is null or undefined."
3710
+ );
3503
3711
  }
3504
3712
  const urlPath = "/v2/invite";
3505
3713
  const queryParams = /* @__PURE__ */ new Map();
@@ -3528,9 +3736,14 @@ var MezonApi = class {
3528
3736
  /** Add users to a channel. */
3529
3737
  getLinkInvite(bearerToken, inviteId, options = {}) {
3530
3738
  if (inviteId === null || inviteId === void 0) {
3531
- throw new Error("'inviteId' is a required parameter but is null or undefined.");
3739
+ throw new Error(
3740
+ "'inviteId' is a required parameter but is null or undefined."
3741
+ );
3532
3742
  }
3533
- const urlPath = "/v2/invite/{inviteId}".replace("{inviteId}", encodeURIComponent(String(inviteId)));
3743
+ const urlPath = "/v2/invite/{inviteId}".replace(
3744
+ "{inviteId}",
3745
+ encodeURIComponent(String(inviteId))
3746
+ );
3534
3747
  const queryParams = /* @__PURE__ */ new Map();
3535
3748
  let bodyJson = "";
3536
3749
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -3556,9 +3769,14 @@ var MezonApi = class {
3556
3769
  /** Add users to a channel. */
3557
3770
  inviteUser(bearerToken, inviteId, options = {}) {
3558
3771
  if (inviteId === null || inviteId === void 0) {
3559
- throw new Error("'inviteId' is a required parameter but is null or undefined.");
3772
+ throw new Error(
3773
+ "'inviteId' is a required parameter but is null or undefined."
3774
+ );
3560
3775
  }
3561
- const urlPath = "/v2/invite/{inviteId}".replace("{inviteId}", encodeURIComponent(String(inviteId)));
3776
+ const urlPath = "/v2/invite/{inviteId}".replace(
3777
+ "{inviteId}",
3778
+ encodeURIComponent(String(inviteId))
3779
+ );
3562
3780
  const queryParams = /* @__PURE__ */ new Map();
3563
3781
  let bodyJson = "";
3564
3782
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -3609,7 +3827,9 @@ var MezonApi = class {
3609
3827
  /** set mute notification user channel. */
3610
3828
  setMuteNotificationCategory(bearerToken, body, options = {}) {
3611
3829
  if (body === null || body === void 0) {
3612
- throw new Error("'body' is a required parameter but is null or undefined.");
3830
+ throw new Error(
3831
+ "'body' is a required parameter but is null or undefined."
3832
+ );
3613
3833
  }
3614
3834
  const urlPath = "/v2/mutenotificationcategory/set";
3615
3835
  const queryParams = /* @__PURE__ */ new Map();
@@ -3638,7 +3858,9 @@ var MezonApi = class {
3638
3858
  /** set mute notification user channel. */
3639
3859
  setMuteNotificationChannel(bearerToken, body, options = {}) {
3640
3860
  if (body === null || body === void 0) {
3641
- throw new Error("'body' is a required parameter but is null or undefined.");
3861
+ throw new Error(
3862
+ "'body' is a required parameter but is null or undefined."
3863
+ );
3642
3864
  }
3643
3865
  const urlPath = "/v2/mutenotificationchannel/set";
3644
3866
  const queryParams = /* @__PURE__ */ new Map();
@@ -3721,7 +3943,9 @@ var MezonApi = class {
3721
3943
  /** set notification user channel. */
3722
3944
  setNotificationChannelSetting(bearerToken, body, options = {}) {
3723
3945
  if (body === null || body === void 0) {
3724
- throw new Error("'body' is a required parameter but is null or undefined.");
3946
+ throw new Error(
3947
+ "'body' is a required parameter but is null or undefined."
3948
+ );
3725
3949
  }
3726
3950
  const urlPath = "/v2/notificationchannel/set";
3727
3951
  const queryParams = /* @__PURE__ */ new Map();
@@ -3750,7 +3974,9 @@ var MezonApi = class {
3750
3974
  /** set notification user channel. */
3751
3975
  setNotificationClanSetting(bearerToken, body, options = {}) {
3752
3976
  if (body === null || body === void 0) {
3753
- throw new Error("'body' is a required parameter but is null or undefined.");
3977
+ throw new Error(
3978
+ "'body' is a required parameter but is null or undefined."
3979
+ );
3754
3980
  }
3755
3981
  const urlPath = "/v2/notificationclan/set";
3756
3982
  const queryParams = /* @__PURE__ */ new Map();
@@ -3779,7 +4005,9 @@ var MezonApi = class {
3779
4005
  /** set notification user channel. */
3780
4006
  setNotificationCategorySetting(bearerToken, body, options = {}) {
3781
4007
  if (body === null || body === void 0) {
3782
- throw new Error("'body' is a required parameter but is null or undefined.");
4008
+ throw new Error(
4009
+ "'body' is a required parameter but is null or undefined."
4010
+ );
3783
4011
  }
3784
4012
  const urlPath = "/v2/notificationucategory/set";
3785
4013
  const queryParams = /* @__PURE__ */ new Map();
@@ -3886,7 +4114,9 @@ var MezonApi = class {
3886
4114
  /** */
3887
4115
  setNotificationReactMessage(bearerToken, body, options = {}) {
3888
4116
  if (body === null || body === void 0) {
3889
- throw new Error("'body' is a required parameter but is null or undefined.");
4117
+ throw new Error(
4118
+ "'body' is a required parameter but is null or undefined."
4119
+ );
3890
4120
  }
3891
4121
  const urlPath = "/v2/notifireactmessage/set";
3892
4122
  const queryParams = /* @__PURE__ */ new Map();
@@ -3915,7 +4145,9 @@ var MezonApi = class {
3915
4145
  /** Ossrs http callback. */
3916
4146
  streamingServerCallback(bearerToken, body, options = {}) {
3917
4147
  if (body === null || body === void 0) {
3918
- throw new Error("'body' is a required parameter but is null or undefined.");
4148
+ throw new Error(
4149
+ "'body' is a required parameter but is null or undefined."
4150
+ );
3919
4151
  }
3920
4152
  const urlPath = "/v2/ossrs/callback";
3921
4153
  const queryParams = /* @__PURE__ */ new Map();
@@ -3944,7 +4176,9 @@ var MezonApi = class {
3944
4176
  /** set permission role channel. */
3945
4177
  setRoleChannelPermission(bearerToken, body, options = {}) {
3946
4178
  if (body === null || body === void 0) {
3947
- throw new Error("'body' is a required parameter but is null or undefined.");
4179
+ throw new Error(
4180
+ "'body' is a required parameter but is null or undefined."
4181
+ );
3948
4182
  }
3949
4183
  const urlPath = "/v2/permissionrolechannel/set";
3950
4184
  const queryParams = /* @__PURE__ */ new Map();
@@ -3995,6 +4229,34 @@ var MezonApi = class {
3995
4229
  )
3996
4230
  ]);
3997
4231
  }
4232
+ /** GetPermissionByRoleIdChannelId */
4233
+ getPermissionByRoleIdChannelId(bearerToken, roleId, channelId, userId, options = {}) {
4234
+ const urlPath = "/v2/permissions/roles/channels/users";
4235
+ const queryParams = /* @__PURE__ */ new Map();
4236
+ queryParams.set("role_id", roleId);
4237
+ queryParams.set("channel_id", channelId);
4238
+ queryParams.set("user_id", userId);
4239
+ let bodyJson = "";
4240
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4241
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4242
+ if (bearerToken) {
4243
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4244
+ }
4245
+ return Promise.race([
4246
+ fetch(fullUrl, fetchOptions).then((response) => {
4247
+ if (response.status == 204) {
4248
+ return response;
4249
+ } else if (response.status >= 200 && response.status < 300) {
4250
+ return response.json();
4251
+ } else {
4252
+ throw response;
4253
+ }
4254
+ }),
4255
+ new Promise(
4256
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4257
+ )
4258
+ ]);
4259
+ }
3998
4260
  /** */
3999
4261
  deletePinMessage(bearerToken, messageId, options = {}) {
4000
4262
  const urlPath = "/v2/pinmessage/delete";
@@ -4052,7 +4314,9 @@ var MezonApi = class {
4052
4314
  /** set notification user channel. */
4053
4315
  createPinMessage(bearerToken, body, options = {}) {
4054
4316
  if (body === null || body === void 0) {
4055
- throw new Error("'body' is a required parameter but is null or undefined.");
4317
+ throw new Error(
4318
+ "'body' is a required parameter but is null or undefined."
4319
+ );
4056
4320
  }
4057
4321
  const urlPath = "/v2/pinmessage/set";
4058
4322
  const queryParams = /* @__PURE__ */ new Map();
@@ -4081,7 +4345,9 @@ var MezonApi = class {
4081
4345
  /** */
4082
4346
  addRolesChannelDesc(bearerToken, body, options = {}) {
4083
4347
  if (body === null || body === void 0) {
4084
- throw new Error("'body' is a required parameter but is null or undefined.");
4348
+ throw new Error(
4349
+ "'body' is a required parameter but is null or undefined."
4350
+ );
4085
4351
  }
4086
4352
  const urlPath = "/v2/rolechannel/addrole";
4087
4353
  const queryParams = /* @__PURE__ */ new Map();
@@ -4110,12 +4376,19 @@ var MezonApi = class {
4110
4376
  /** update the category of a channel */
4111
4377
  changeChannelCategory(bearerToken, newCategoryId, body, options = {}) {
4112
4378
  if (newCategoryId === null || newCategoryId === void 0) {
4113
- throw new Error("'newCategoryId' is a required parameter but is null or undefined.");
4379
+ throw new Error(
4380
+ "'newCategoryId' is a required parameter but is null or undefined."
4381
+ );
4114
4382
  }
4115
4383
  if (body === null || body === void 0) {
4116
- throw new Error("'body' is a required parameter but is null or undefined.");
4384
+ throw new Error(
4385
+ "'body' is a required parameter but is null or undefined."
4386
+ );
4117
4387
  }
4118
- const urlPath = "/v2/rolechannel/category/{newCategoryId}".replace("{newCategoryId}", encodeURIComponent(String(newCategoryId)));
4388
+ const urlPath = "/v2/rolechannel/category/{newCategoryId}".replace(
4389
+ "{newCategoryId}",
4390
+ encodeURIComponent(String(newCategoryId))
4391
+ );
4119
4392
  const queryParams = /* @__PURE__ */ new Map();
4120
4393
  let bodyJson = "";
4121
4394
  bodyJson = JSON.stringify(body || {});
@@ -4142,7 +4415,9 @@ var MezonApi = class {
4142
4415
  /** Update a role when Delete a role by ID. */
4143
4416
  deleteRoleChannelDesc(bearerToken, body, options = {}) {
4144
4417
  if (body === null || body === void 0) {
4145
- throw new Error("'body' is a required parameter but is null or undefined.");
4418
+ throw new Error(
4419
+ "'body' is a required parameter but is null or undefined."
4420
+ );
4146
4421
  }
4147
4422
  const urlPath = "/v2/rolechannel/delete";
4148
4423
  const queryParams = /* @__PURE__ */ new Map();
@@ -4200,7 +4475,9 @@ var MezonApi = class {
4200
4475
  /** Create a new role for clan. */
4201
4476
  createRole(bearerToken, body, options = {}) {
4202
4477
  if (body === null || body === void 0) {
4203
- throw new Error("'body' is a required parameter but is null or undefined.");
4478
+ throw new Error(
4479
+ "'body' is a required parameter but is null or undefined."
4480
+ );
4204
4481
  }
4205
4482
  const urlPath = "/v2/roles";
4206
4483
  const queryParams = /* @__PURE__ */ new Map();
@@ -4229,12 +4506,19 @@ var MezonApi = class {
4229
4506
  /** Update a role when Delete a role by ID. */
4230
4507
  updateRoleDelete(bearerToken, roleId, body, options = {}) {
4231
4508
  if (roleId === null || roleId === void 0) {
4232
- throw new Error("'roleId' is a required parameter but is null or undefined.");
4509
+ throw new Error(
4510
+ "'roleId' is a required parameter but is null or undefined."
4511
+ );
4233
4512
  }
4234
4513
  if (body === null || body === void 0) {
4235
- throw new Error("'body' is a required parameter but is null or undefined.");
4514
+ throw new Error(
4515
+ "'body' is a required parameter but is null or undefined."
4516
+ );
4236
4517
  }
4237
- const urlPath = "/v2/roles/delete/{roleId}".replace("{roleId}", encodeURIComponent(String(roleId)));
4518
+ const urlPath = "/v2/roles/delete/{roleId}".replace(
4519
+ "{roleId}",
4520
+ encodeURIComponent(String(roleId))
4521
+ );
4238
4522
  const queryParams = /* @__PURE__ */ new Map();
4239
4523
  let bodyJson = "";
4240
4524
  bodyJson = JSON.stringify(body || {});
@@ -4261,9 +4545,14 @@ var MezonApi = class {
4261
4545
  /** Delete a role by ID. */
4262
4546
  deleteRole(bearerToken, roleId, channelId, clanId, options = {}) {
4263
4547
  if (roleId === null || roleId === void 0) {
4264
- throw new Error("'roleId' is a required parameter but is null or undefined.");
4548
+ throw new Error(
4549
+ "'roleId' is a required parameter but is null or undefined."
4550
+ );
4265
4551
  }
4266
- const urlPath = "/v2/roles/{roleId}".replace("{roleId}", encodeURIComponent(String(roleId)));
4552
+ const urlPath = "/v2/roles/{roleId}".replace(
4553
+ "{roleId}",
4554
+ encodeURIComponent(String(roleId))
4555
+ );
4267
4556
  const queryParams = /* @__PURE__ */ new Map();
4268
4557
  queryParams.set("channel_id", channelId);
4269
4558
  queryParams.set("clan_id", clanId);
@@ -4291,12 +4580,19 @@ var MezonApi = class {
4291
4580
  /** Update fields in a given role. */
4292
4581
  updateRole(bearerToken, roleId, body, options = {}) {
4293
4582
  if (roleId === null || roleId === void 0) {
4294
- throw new Error("'roleId' is a required parameter but is null or undefined.");
4583
+ throw new Error(
4584
+ "'roleId' is a required parameter but is null or undefined."
4585
+ );
4295
4586
  }
4296
4587
  if (body === null || body === void 0) {
4297
- throw new Error("'body' is a required parameter but is null or undefined.");
4588
+ throw new Error(
4589
+ "'body' is a required parameter but is null or undefined."
4590
+ );
4298
4591
  }
4299
- const urlPath = "/v2/roles/{roleId}".replace("{roleId}", encodeURIComponent(String(roleId)));
4592
+ const urlPath = "/v2/roles/{roleId}".replace(
4593
+ "{roleId}",
4594
+ encodeURIComponent(String(roleId))
4595
+ );
4300
4596
  const queryParams = /* @__PURE__ */ new Map();
4301
4597
  let bodyJson = "";
4302
4598
  bodyJson = JSON.stringify(body || {});
@@ -4323,9 +4619,14 @@ var MezonApi = class {
4323
4619
  /** List role permissions */
4324
4620
  listRolePermissions(bearerToken, roleId, options = {}) {
4325
4621
  if (roleId === null || roleId === void 0) {
4326
- throw new Error("'roleId' is a required parameter but is null or undefined.");
4622
+ throw new Error(
4623
+ "'roleId' is a required parameter but is null or undefined."
4624
+ );
4327
4625
  }
4328
- const urlPath = "/v2/roles/{roleId}/permissions".replace("{roleId}", encodeURIComponent(String(roleId)));
4626
+ const urlPath = "/v2/roles/{roleId}/permissions".replace(
4627
+ "{roleId}",
4628
+ encodeURIComponent(String(roleId))
4629
+ );
4329
4630
  const queryParams = /* @__PURE__ */ new Map();
4330
4631
  let bodyJson = "";
4331
4632
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -4351,9 +4652,14 @@ var MezonApi = class {
4351
4652
  /** List role permissions */
4352
4653
  listRoleUsers(bearerToken, roleId, limit, cursor, options = {}) {
4353
4654
  if (roleId === null || roleId === void 0) {
4354
- throw new Error("'roleId' is a required parameter but is null or undefined.");
4655
+ throw new Error(
4656
+ "'roleId' is a required parameter but is null or undefined."
4657
+ );
4355
4658
  }
4356
- const urlPath = "/v2/roles/{roleId}/users".replace("{roleId}", encodeURIComponent(String(roleId)));
4659
+ const urlPath = "/v2/roles/{roleId}/users".replace(
4660
+ "{roleId}",
4661
+ encodeURIComponent(String(roleId))
4662
+ );
4357
4663
  const queryParams = /* @__PURE__ */ new Map();
4358
4664
  queryParams.set("limit", limit);
4359
4665
  queryParams.set("cursor", cursor);
@@ -4381,9 +4687,14 @@ var MezonApi = class {
4381
4687
  /** */
4382
4688
  getRoleOfUserInTheClan(bearerToken, clanId, channelId, options = {}) {
4383
4689
  if (clanId === null || clanId === void 0) {
4384
- throw new Error("'clanId' is a required parameter but is null or undefined.");
4690
+ throw new Error(
4691
+ "'clanId' is a required parameter but is null or undefined."
4692
+ );
4385
4693
  }
4386
- const urlPath = "/v2/roleuserinclan/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
4694
+ const urlPath = "/v2/roleuserinclan/{clanId}".replace(
4695
+ "{clanId}",
4696
+ encodeURIComponent(String(clanId))
4697
+ );
4387
4698
  const queryParams = /* @__PURE__ */ new Map();
4388
4699
  queryParams.set("channel_id", channelId);
4389
4700
  let bodyJson = "";
@@ -4412,7 +4723,10 @@ var MezonApi = class {
4412
4723
  if (id === null || id === void 0) {
4413
4724
  throw new Error("'id' is a required parameter but is null or undefined.");
4414
4725
  }
4415
- const urlPath = "/v2/rpc/{id}".replace("{id}", encodeURIComponent(String(id)));
4726
+ const urlPath = "/v2/rpc/{id}".replace(
4727
+ "{id}",
4728
+ encodeURIComponent(String(id))
4729
+ );
4416
4730
  const queryParams = /* @__PURE__ */ new Map();
4417
4731
  queryParams.set("payload", payload);
4418
4732
  queryParams.set("http_key", httpKey);
@@ -4446,9 +4760,14 @@ var MezonApi = class {
4446
4760
  throw new Error("'id' is a required parameter but is null or undefined.");
4447
4761
  }
4448
4762
  if (payload === null || payload === void 0) {
4449
- throw new Error("'payload' is a required parameter but is null or undefined.");
4763
+ throw new Error(
4764
+ "'payload' is a required parameter but is null or undefined."
4765
+ );
4450
4766
  }
4451
- const urlPath = "/v2/rpc/{id}".replace("{id}", encodeURIComponent(String(id)));
4767
+ const urlPath = "/v2/rpc/{id}".replace(
4768
+ "{id}",
4769
+ encodeURIComponent(String(id))
4770
+ );
4452
4771
  const queryParams = /* @__PURE__ */ new Map();
4453
4772
  queryParams.set("http_key", httpKey);
4454
4773
  let bodyJson = "";
@@ -4479,7 +4798,9 @@ var MezonApi = class {
4479
4798
  /** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */
4480
4799
  sessionLogout(bearerToken, body, options = {}) {
4481
4800
  if (body === null || body === void 0) {
4482
- throw new Error("'body' is a required parameter but is null or undefined.");
4801
+ throw new Error(
4802
+ "'body' is a required parameter but is null or undefined."
4803
+ );
4483
4804
  }
4484
4805
  const urlPath = "/v2/session/logout";
4485
4806
  const queryParams = /* @__PURE__ */ new Map();
@@ -4508,7 +4829,9 @@ var MezonApi = class {
4508
4829
  /** Add a new sticker */
4509
4830
  addClanSticker(bearerToken, body, options = {}) {
4510
4831
  if (body === null || body === void 0) {
4511
- throw new Error("'body' is a required parameter but is null or undefined.");
4832
+ throw new Error(
4833
+ "'body' is a required parameter but is null or undefined."
4834
+ );
4512
4835
  }
4513
4836
  const urlPath = "/v2/sticker";
4514
4837
  const queryParams = /* @__PURE__ */ new Map();
@@ -4539,7 +4862,10 @@ var MezonApi = class {
4539
4862
  if (id === null || id === void 0) {
4540
4863
  throw new Error("'id' is a required parameter but is null or undefined.");
4541
4864
  }
4542
- const urlPath = "/v2/sticker/{id}".replace("{id}", encodeURIComponent(String(id)));
4865
+ const urlPath = "/v2/sticker/{id}".replace(
4866
+ "{id}",
4867
+ encodeURIComponent(String(id))
4868
+ );
4543
4869
  const queryParams = /* @__PURE__ */ new Map();
4544
4870
  queryParams.set("clan_id", clanId);
4545
4871
  let bodyJson = "";
@@ -4569,9 +4895,14 @@ var MezonApi = class {
4569
4895
  throw new Error("'id' is a required parameter but is null or undefined.");
4570
4896
  }
4571
4897
  if (body === null || body === void 0) {
4572
- throw new Error("'body' is a required parameter but is null or undefined.");
4898
+ throw new Error(
4899
+ "'body' is a required parameter but is null or undefined."
4900
+ );
4573
4901
  }
4574
- const urlPath = "/v2/sticker/{id}".replace("{id}", encodeURIComponent(String(id)));
4902
+ const urlPath = "/v2/sticker/{id}".replace(
4903
+ "{id}",
4904
+ encodeURIComponent(String(id))
4905
+ );
4575
4906
  const queryParams = /* @__PURE__ */ new Map();
4576
4907
  let bodyJson = "";
4577
4908
  bodyJson = JSON.stringify(body || {});
@@ -4649,7 +4980,9 @@ var MezonApi = class {
4649
4980
  /** Register streaming in channel ( for bot - get streaming key) */
4650
4981
  registerStreamingChannel(bearerToken, body, options = {}) {
4651
4982
  if (body === null || body === void 0) {
4652
- throw new Error("'body' is a required parameter but is null or undefined.");
4983
+ throw new Error(
4984
+ "'body' is a required parameter but is null or undefined."
4985
+ );
4653
4986
  }
4654
4987
  const urlPath = "/v2/streaming-channels";
4655
4988
  const queryParams = /* @__PURE__ */ new Map();
@@ -4734,7 +5067,9 @@ var MezonApi = class {
4734
5067
  /** Create a system messages. */
4735
5068
  createSystemMessage(bearerToken, body, options = {}) {
4736
5069
  if (body === null || body === void 0) {
4737
- throw new Error("'body' is a required parameter but is null or undefined.");
5070
+ throw new Error(
5071
+ "'body' is a required parameter but is null or undefined."
5072
+ );
4738
5073
  }
4739
5074
  const urlPath = "/v2/systemmessages";
4740
5075
  const queryParams = /* @__PURE__ */ new Map();
@@ -4763,9 +5098,14 @@ var MezonApi = class {
4763
5098
  /** Delete a specific system messages. */
4764
5099
  deleteSystemMessage(bearerToken, clanId, options = {}) {
4765
5100
  if (clanId === null || clanId === void 0) {
4766
- throw new Error("'clanId' is a required parameter but is null or undefined.");
5101
+ throw new Error(
5102
+ "'clanId' is a required parameter but is null or undefined."
5103
+ );
4767
5104
  }
4768
- const urlPath = "/v2/systemmessages/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
5105
+ const urlPath = "/v2/systemmessages/{clanId}".replace(
5106
+ "{clanId}",
5107
+ encodeURIComponent(String(clanId))
5108
+ );
4769
5109
  const queryParams = /* @__PURE__ */ new Map();
4770
5110
  let bodyJson = "";
4771
5111
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -4791,9 +5131,14 @@ var MezonApi = class {
4791
5131
  /** Get details of a specific system messages. */
4792
5132
  getSystemMessageByClanId(bearerToken, clanId, options = {}) {
4793
5133
  if (clanId === null || clanId === void 0) {
4794
- throw new Error("'clanId' is a required parameter but is null or undefined.");
5134
+ throw new Error(
5135
+ "'clanId' is a required parameter but is null or undefined."
5136
+ );
4795
5137
  }
4796
- const urlPath = "/v2/systemmessages/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
5138
+ const urlPath = "/v2/systemmessages/{clanId}".replace(
5139
+ "{clanId}",
5140
+ encodeURIComponent(String(clanId))
5141
+ );
4797
5142
  const queryParams = /* @__PURE__ */ new Map();
4798
5143
  let bodyJson = "";
4799
5144
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -4819,12 +5164,19 @@ var MezonApi = class {
4819
5164
  /** Update a system messages. */
4820
5165
  updateSystemMessage(bearerToken, clanId, body, options = {}) {
4821
5166
  if (clanId === null || clanId === void 0) {
4822
- throw new Error("'clanId' is a required parameter but is null or undefined.");
5167
+ throw new Error(
5168
+ "'clanId' is a required parameter but is null or undefined."
5169
+ );
4823
5170
  }
4824
5171
  if (body === null || body === void 0) {
4825
- throw new Error("'body' is a required parameter but is null or undefined.");
5172
+ throw new Error(
5173
+ "'body' is a required parameter but is null or undefined."
5174
+ );
4826
5175
  }
4827
- const urlPath = "/v2/systemmessages/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
5176
+ const urlPath = "/v2/systemmessages/{clanId}".replace(
5177
+ "{clanId}",
5178
+ encodeURIComponent(String(clanId))
5179
+ );
4828
5180
  const queryParams = /* @__PURE__ */ new Map();
4829
5181
  let bodyJson = "";
4830
5182
  bodyJson = JSON.stringify(body || {});
@@ -4851,12 +5203,19 @@ var MezonApi = class {
4851
5203
  /** Update fields in a given category. */
4852
5204
  updateCategory(bearerToken, clanId, body, options = {}) {
4853
5205
  if (clanId === null || clanId === void 0) {
4854
- throw new Error("'clanId' is a required parameter but is null or undefined.");
5206
+ throw new Error(
5207
+ "'clanId' is a required parameter but is null or undefined."
5208
+ );
4855
5209
  }
4856
5210
  if (body === null || body === void 0) {
4857
- throw new Error("'body' is a required parameter but is null or undefined.");
5211
+ throw new Error(
5212
+ "'body' is a required parameter but is null or undefined."
5213
+ );
4858
5214
  }
4859
- const urlPath = "/v2/updatecategory/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
5215
+ const urlPath = "/v2/updatecategory/{clanId}".replace(
5216
+ "{clanId}",
5217
+ encodeURIComponent(String(clanId))
5218
+ );
4860
5219
  const queryParams = /* @__PURE__ */ new Map();
4861
5220
  let bodyJson = "";
4862
5221
  bodyJson = JSON.stringify(body || {});
@@ -4883,7 +5242,9 @@ var MezonApi = class {
4883
5242
  /** Update channel private. */
4884
5243
  updateChannelPrivate(bearerToken, body, options = {}) {
4885
5244
  if (body === null || body === void 0) {
4886
- throw new Error("'body' is a required parameter but is null or undefined.");
5245
+ throw new Error(
5246
+ "'body' is a required parameter but is null or undefined."
5247
+ );
4887
5248
  }
4888
5249
  const urlPath = "/v2/updatechannelprivate";
4889
5250
  const queryParams = /* @__PURE__ */ new Map();
@@ -4912,12 +5273,19 @@ var MezonApi = class {
4912
5273
  /** */
4913
5274
  updateUserProfileByClan(bearerToken, clanId, body, options = {}) {
4914
5275
  if (clanId === null || clanId === void 0) {
4915
- throw new Error("'clanId' is a required parameter but is null or undefined.");
5276
+ throw new Error(
5277
+ "'clanId' is a required parameter but is null or undefined."
5278
+ );
4916
5279
  }
4917
5280
  if (body === null || body === void 0) {
4918
- throw new Error("'body' is a required parameter but is null or undefined.");
5281
+ throw new Error(
5282
+ "'body' is a required parameter but is null or undefined."
5283
+ );
4919
5284
  }
4920
- const urlPath = "/v2/updateclanprofile/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
5285
+ const urlPath = "/v2/updateclanprofile/{clanId}".replace(
5286
+ "{clanId}",
5287
+ encodeURIComponent(String(clanId))
5288
+ );
4921
5289
  const queryParams = /* @__PURE__ */ new Map();
4922
5290
  let bodyJson = "";
4923
5291
  bodyJson = JSON.stringify(body || {});
@@ -4944,7 +5312,9 @@ var MezonApi = class {
4944
5312
  /** Upload attachment */
4945
5313
  uploadAttachmentFile(bearerToken, body, options = {}) {
4946
5314
  if (body === null || body === void 0) {
4947
- throw new Error("'body' is a required parameter but is null or undefined.");
5315
+ throw new Error(
5316
+ "'body' is a required parameter but is null or undefined."
5317
+ );
4948
5318
  }
4949
5319
  const urlPath = "/v2/uploadattachmentfile";
4950
5320
  const queryParams = /* @__PURE__ */ new Map();
@@ -5001,7 +5371,9 @@ var MezonApi = class {
5001
5371
  /** */
5002
5372
  updateUser(bearerToken, body, options = {}) {
5003
5373
  if (body === null || body === void 0) {
5004
- throw new Error("'body' is a required parameter but is null or undefined.");
5374
+ throw new Error(
5375
+ "'body' is a required parameter but is null or undefined."
5376
+ );
5005
5377
  }
5006
5378
  const urlPath = "/v2/user/update";
5007
5379
  const queryParams = /* @__PURE__ */ new Map();
@@ -5052,10 +5424,39 @@ var MezonApi = class {
5052
5424
  )
5053
5425
  ]);
5054
5426
  }
5427
+ /** ListUserPermissionInChannel */
5428
+ listUserPermissionInChannel(bearerToken, clanId, channelId, options = {}) {
5429
+ const urlPath = "/v2/users/clans/channels";
5430
+ const queryParams = /* @__PURE__ */ new Map();
5431
+ queryParams.set("clan_id", clanId);
5432
+ queryParams.set("channel_id", channelId);
5433
+ let bodyJson = "";
5434
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5435
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
5436
+ if (bearerToken) {
5437
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5438
+ }
5439
+ return Promise.race([
5440
+ fetch(fullUrl, fetchOptions).then((response) => {
5441
+ if (response.status == 204) {
5442
+ return response;
5443
+ } else if (response.status >= 200 && response.status < 300) {
5444
+ return response.json();
5445
+ } else {
5446
+ throw response;
5447
+ }
5448
+ }),
5449
+ new Promise(
5450
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
5451
+ )
5452
+ ]);
5453
+ }
5055
5454
  /** create webhook */
5056
5455
  generateWebhook(bearerToken, body, options = {}) {
5057
5456
  if (body === null || body === void 0) {
5058
- throw new Error("'body' is a required parameter but is null or undefined.");
5457
+ throw new Error(
5458
+ "'body' is a required parameter but is null or undefined."
5459
+ );
5059
5460
  }
5060
5461
  const urlPath = "/v2/webhooks/generate";
5061
5462
  const queryParams = /* @__PURE__ */ new Map();
@@ -5087,9 +5488,14 @@ var MezonApi = class {
5087
5488
  throw new Error("'id' is a required parameter but is null or undefined.");
5088
5489
  }
5089
5490
  if (body === null || body === void 0) {
5090
- throw new Error("'body' is a required parameter but is null or undefined.");
5491
+ throw new Error(
5492
+ "'body' is a required parameter but is null or undefined."
5493
+ );
5091
5494
  }
5092
- const urlPath = "/v2/webhooks/update/{id}".replace("{id}", encodeURIComponent(String(id)));
5495
+ const urlPath = "/v2/webhooks/update/{id}".replace(
5496
+ "{id}",
5497
+ encodeURIComponent(String(id))
5498
+ );
5093
5499
  const queryParams = /* @__PURE__ */ new Map();
5094
5500
  let bodyJson = "";
5095
5501
  bodyJson = JSON.stringify(body || {});
@@ -5116,9 +5522,14 @@ var MezonApi = class {
5116
5522
  /** list webhook belong to the channel */
5117
5523
  listWebhookByChannelId(bearerToken, channelId, clanId, options = {}) {
5118
5524
  if (channelId === null || channelId === void 0) {
5119
- throw new Error("'channelId' is a required parameter but is null or undefined.");
5525
+ throw new Error(
5526
+ "'channelId' is a required parameter but is null or undefined."
5527
+ );
5120
5528
  }
5121
- const urlPath = "/v2/webhooks/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
5529
+ const urlPath = "/v2/webhooks/{channelId}".replace(
5530
+ "{channelId}",
5531
+ encodeURIComponent(String(channelId))
5532
+ );
5122
5533
  const queryParams = /* @__PURE__ */ new Map();
5123
5534
  queryParams.set("clan_id", clanId);
5124
5535
  let bodyJson = "";
@@ -5147,7 +5558,10 @@ var MezonApi = class {
5147
5558
  if (id === null || id === void 0) {
5148
5559
  throw new Error("'id' is a required parameter but is null or undefined.");
5149
5560
  }
5150
- const urlPath = "/v2/webhooks/{id}".replace("{id}", encodeURIComponent(String(id)));
5561
+ const urlPath = "/v2/webhooks/{id}".replace(
5562
+ "{id}",
5563
+ encodeURIComponent(String(id))
5564
+ );
5151
5565
  const queryParams = /* @__PURE__ */ new Map();
5152
5566
  let bodyJson = "";
5153
5567
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -8066,4 +8480,35 @@ var Client = class {
8066
8480
  });
8067
8481
  });
8068
8482
  }
8483
+ listUserPermissionInChannel(session, clanId, channelId) {
8484
+ return __async(this, null, function* () {
8485
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8486
+ yield this.sessionRefresh(session);
8487
+ }
8488
+ return this.apiClient.listUserPermissionInChannel(session.token, clanId, channelId).then((response) => {
8489
+ var result = {
8490
+ clan_id: clanId,
8491
+ channel_id: channelId,
8492
+ permissions: response.permissions
8493
+ };
8494
+ return Promise.resolve(result);
8495
+ });
8496
+ });
8497
+ }
8498
+ getPermissionByRoleIdChannelId(session, roleId, channelId, userId) {
8499
+ return __async(this, null, function* () {
8500
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8501
+ yield this.sessionRefresh(session);
8502
+ }
8503
+ return this.apiClient.getPermissionByRoleIdChannelId(session.token, roleId, channelId, userId).then((response) => {
8504
+ var result = {
8505
+ role_id: roleId,
8506
+ channel_id: channelId,
8507
+ permission_role_channel: response.permission_role_channel,
8508
+ user_id: userId
8509
+ };
8510
+ return Promise.resolve(result);
8511
+ });
8512
+ });
8513
+ }
8069
8514
  };