mezon-js 2.9.20 → 2.9.22
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +2073 -1515
- package/client.ts +45 -5
- package/dist/api.gen.d.ts +25 -6
- package/dist/client.d.ts +5 -2
- package/dist/mezon-js.cjs.js +631 -196
- package/dist/mezon-js.esm.mjs +631 -196
- package/dist/socket.d.ts +3 -0
- package/package.json +1 -1
- package/socket.ts +6 -0
package/dist/mezon-js.esm.mjs
CHANGED
@@ -736,7 +736,9 @@ var MezonApi = class {
|
|
736
736
|
/** Update fields in the current user's account. */
|
737
737
|
updateAccount(bearerToken, body, options = {}) {
|
738
738
|
if (body === null || body === void 0) {
|
739
|
-
throw new Error(
|
739
|
+
throw new Error(
|
740
|
+
"'body' is a required parameter but is null or undefined."
|
741
|
+
);
|
740
742
|
}
|
741
743
|
const urlPath = "/v2/account";
|
742
744
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -765,7 +767,9 @@ var MezonApi = class {
|
|
765
767
|
/** Authenticate a user with an Apple ID against the server. */
|
766
768
|
authenticateApple(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
767
769
|
if (account === null || account === void 0) {
|
768
|
-
throw new Error(
|
770
|
+
throw new Error(
|
771
|
+
"'account' is a required parameter but is null or undefined."
|
772
|
+
);
|
769
773
|
}
|
770
774
|
const urlPath = "/v2/account/authenticate/apple";
|
771
775
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -796,7 +800,9 @@ var MezonApi = class {
|
|
796
800
|
/** Authenticate a user with a custom id against the server. */
|
797
801
|
authenticateCustom(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
798
802
|
if (account === null || account === void 0) {
|
799
|
-
throw new Error(
|
803
|
+
throw new Error(
|
804
|
+
"'account' is a required parameter but is null or undefined."
|
805
|
+
);
|
800
806
|
}
|
801
807
|
const urlPath = "/v2/account/authenticate/custom";
|
802
808
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -827,7 +833,9 @@ var MezonApi = class {
|
|
827
833
|
/** Authenticate a user with a device id against the server. */
|
828
834
|
authenticateDevice(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
829
835
|
if (account === null || account === void 0) {
|
830
|
-
throw new Error(
|
836
|
+
throw new Error(
|
837
|
+
"'account' is a required parameter but is null or undefined."
|
838
|
+
);
|
831
839
|
}
|
832
840
|
const urlPath = "/v2/account/authenticate/device";
|
833
841
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -858,7 +866,9 @@ var MezonApi = class {
|
|
858
866
|
/** Authenticate a user with an email+password against the server. */
|
859
867
|
authenticateEmail(basicAuthUsername, basicAuthPassword, account, username, options = {}) {
|
860
868
|
if (account === null || account === void 0) {
|
861
|
-
throw new Error(
|
869
|
+
throw new Error(
|
870
|
+
"'account' is a required parameter but is null or undefined."
|
871
|
+
);
|
862
872
|
}
|
863
873
|
const urlPath = "/v2/account/authenticate/email";
|
864
874
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -888,7 +898,9 @@ var MezonApi = class {
|
|
888
898
|
/** Authenticate a user with a Facebook OAuth token against the server. */
|
889
899
|
authenticateFacebook(basicAuthUsername, basicAuthPassword, account, create, username, sync, options = {}) {
|
890
900
|
if (account === null || account === void 0) {
|
891
|
-
throw new Error(
|
901
|
+
throw new Error(
|
902
|
+
"'account' is a required parameter but is null or undefined."
|
903
|
+
);
|
892
904
|
}
|
893
905
|
const urlPath = "/v2/account/authenticate/facebook";
|
894
906
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -920,7 +932,9 @@ var MezonApi = class {
|
|
920
932
|
/** Authenticate a user with a Facebook Instant Game token against the server. */
|
921
933
|
authenticateFacebookInstantGame(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
922
934
|
if (account === null || account === void 0) {
|
923
|
-
throw new Error(
|
935
|
+
throw new Error(
|
936
|
+
"'account' is a required parameter but is null or undefined."
|
937
|
+
);
|
924
938
|
}
|
925
939
|
const urlPath = "/v2/account/authenticate/facebookinstantgame";
|
926
940
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -951,7 +965,9 @@ var MezonApi = class {
|
|
951
965
|
/** Authenticate a user with Apple's GameCenter against the server. */
|
952
966
|
authenticateGameCenter(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
953
967
|
if (account === null || account === void 0) {
|
954
|
-
throw new Error(
|
968
|
+
throw new Error(
|
969
|
+
"'account' is a required parameter but is null or undefined."
|
970
|
+
);
|
955
971
|
}
|
956
972
|
const urlPath = "/v2/account/authenticate/gamecenter";
|
957
973
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -982,7 +998,9 @@ var MezonApi = class {
|
|
982
998
|
/** Authenticate a user with Google against the server. */
|
983
999
|
authenticateGoogle(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
984
1000
|
if (account === null || account === void 0) {
|
985
|
-
throw new Error(
|
1001
|
+
throw new Error(
|
1002
|
+
"'account' is a required parameter but is null or undefined."
|
1003
|
+
);
|
986
1004
|
}
|
987
1005
|
const urlPath = "/v2/account/authenticate/google";
|
988
1006
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1013,7 +1031,9 @@ var MezonApi = class {
|
|
1013
1031
|
/** Authenticate a user with Steam against the server. */
|
1014
1032
|
authenticateSteam(basicAuthUsername, basicAuthPassword, account, create, username, sync, options = {}) {
|
1015
1033
|
if (account === null || account === void 0) {
|
1016
|
-
throw new Error(
|
1034
|
+
throw new Error(
|
1035
|
+
"'account' is a required parameter but is null or undefined."
|
1036
|
+
);
|
1017
1037
|
}
|
1018
1038
|
const urlPath = "/v2/account/authenticate/steam";
|
1019
1039
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1045,7 +1065,9 @@ var MezonApi = class {
|
|
1045
1065
|
/** Add an Apple ID to the social profiles on the current user's account. */
|
1046
1066
|
linkApple(bearerToken, body, options = {}) {
|
1047
1067
|
if (body === null || body === void 0) {
|
1048
|
-
throw new Error(
|
1068
|
+
throw new Error(
|
1069
|
+
"'body' is a required parameter but is null or undefined."
|
1070
|
+
);
|
1049
1071
|
}
|
1050
1072
|
const urlPath = "/v2/account/link/apple";
|
1051
1073
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1074,7 +1096,9 @@ var MezonApi = class {
|
|
1074
1096
|
/** Add a custom ID to the social profiles on the current user's account. */
|
1075
1097
|
linkCustom(bearerToken, body, options = {}) {
|
1076
1098
|
if (body === null || body === void 0) {
|
1077
|
-
throw new Error(
|
1099
|
+
throw new Error(
|
1100
|
+
"'body' is a required parameter but is null or undefined."
|
1101
|
+
);
|
1078
1102
|
}
|
1079
1103
|
const urlPath = "/v2/account/link/custom";
|
1080
1104
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1103,7 +1127,9 @@ var MezonApi = class {
|
|
1103
1127
|
/** Add a device ID to the social profiles on the current user's account. */
|
1104
1128
|
linkDevice(bearerToken, body, options = {}) {
|
1105
1129
|
if (body === null || body === void 0) {
|
1106
|
-
throw new Error(
|
1130
|
+
throw new Error(
|
1131
|
+
"'body' is a required parameter but is null or undefined."
|
1132
|
+
);
|
1107
1133
|
}
|
1108
1134
|
const urlPath = "/v2/account/link/device";
|
1109
1135
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1132,7 +1158,9 @@ var MezonApi = class {
|
|
1132
1158
|
/** Add an email+password to the social profiles on the current user's account. */
|
1133
1159
|
linkEmail(bearerToken, body, options = {}) {
|
1134
1160
|
if (body === null || body === void 0) {
|
1135
|
-
throw new Error(
|
1161
|
+
throw new Error(
|
1162
|
+
"'body' is a required parameter but is null or undefined."
|
1163
|
+
);
|
1136
1164
|
}
|
1137
1165
|
const urlPath = "/v2/account/link/email";
|
1138
1166
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1161,7 +1189,9 @@ var MezonApi = class {
|
|
1161
1189
|
/** Add Facebook to the social profiles on the current user's account. */
|
1162
1190
|
linkFacebook(bearerToken, account, sync, options = {}) {
|
1163
1191
|
if (account === null || account === void 0) {
|
1164
|
-
throw new Error(
|
1192
|
+
throw new Error(
|
1193
|
+
"'account' is a required parameter but is null or undefined."
|
1194
|
+
);
|
1165
1195
|
}
|
1166
1196
|
const urlPath = "/v2/account/link/facebook";
|
1167
1197
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1191,7 +1221,9 @@ var MezonApi = class {
|
|
1191
1221
|
/** Add Facebook Instant Game to the social profiles on the current user's account. */
|
1192
1222
|
linkFacebookInstantGame(bearerToken, body, options = {}) {
|
1193
1223
|
if (body === null || body === void 0) {
|
1194
|
-
throw new Error(
|
1224
|
+
throw new Error(
|
1225
|
+
"'body' is a required parameter but is null or undefined."
|
1226
|
+
);
|
1195
1227
|
}
|
1196
1228
|
const urlPath = "/v2/account/link/facebookinstantgame";
|
1197
1229
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1220,7 +1252,9 @@ var MezonApi = class {
|
|
1220
1252
|
/** Add Apple's GameCenter to the social profiles on the current user's account. */
|
1221
1253
|
linkGameCenter(bearerToken, body, options = {}) {
|
1222
1254
|
if (body === null || body === void 0) {
|
1223
|
-
throw new Error(
|
1255
|
+
throw new Error(
|
1256
|
+
"'body' is a required parameter but is null or undefined."
|
1257
|
+
);
|
1224
1258
|
}
|
1225
1259
|
const urlPath = "/v2/account/link/gamecenter";
|
1226
1260
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1249,7 +1283,9 @@ var MezonApi = class {
|
|
1249
1283
|
/** Add Google to the social profiles on the current user's account. */
|
1250
1284
|
linkGoogle(bearerToken, body, options = {}) {
|
1251
1285
|
if (body === null || body === void 0) {
|
1252
|
-
throw new Error(
|
1286
|
+
throw new Error(
|
1287
|
+
"'body' is a required parameter but is null or undefined."
|
1288
|
+
);
|
1253
1289
|
}
|
1254
1290
|
const urlPath = "/v2/account/link/google";
|
1255
1291
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1278,7 +1314,9 @@ var MezonApi = class {
|
|
1278
1314
|
/** Add Steam to the social profiles on the current user's account. */
|
1279
1315
|
linkSteam(bearerToken, body, options = {}) {
|
1280
1316
|
if (body === null || body === void 0) {
|
1281
|
-
throw new Error(
|
1317
|
+
throw new Error(
|
1318
|
+
"'body' is a required parameter but is null or undefined."
|
1319
|
+
);
|
1282
1320
|
}
|
1283
1321
|
const urlPath = "/v2/account/link/steam";
|
1284
1322
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1307,7 +1345,9 @@ var MezonApi = class {
|
|
1307
1345
|
/** Authenticate a user with an email+password against the server. */
|
1308
1346
|
registrationEmail(bearerToken, body, options = {}) {
|
1309
1347
|
if (body === null || body === void 0) {
|
1310
|
-
throw new Error(
|
1348
|
+
throw new Error(
|
1349
|
+
"'body' is a required parameter but is null or undefined."
|
1350
|
+
);
|
1311
1351
|
}
|
1312
1352
|
const urlPath = "/v2/account/registry";
|
1313
1353
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1336,7 +1376,9 @@ var MezonApi = class {
|
|
1336
1376
|
/** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
|
1337
1377
|
sessionRefresh(basicAuthUsername, basicAuthPassword, body, options = {}) {
|
1338
1378
|
if (body === null || body === void 0) {
|
1339
|
-
throw new Error(
|
1379
|
+
throw new Error(
|
1380
|
+
"'body' is a required parameter but is null or undefined."
|
1381
|
+
);
|
1340
1382
|
}
|
1341
1383
|
const urlPath = "/v2/account/session/refresh";
|
1342
1384
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1365,7 +1407,9 @@ var MezonApi = class {
|
|
1365
1407
|
/** Remove the Apple ID from the social profiles on the current user's account. */
|
1366
1408
|
unlinkApple(bearerToken, body, options = {}) {
|
1367
1409
|
if (body === null || body === void 0) {
|
1368
|
-
throw new Error(
|
1410
|
+
throw new Error(
|
1411
|
+
"'body' is a required parameter but is null or undefined."
|
1412
|
+
);
|
1369
1413
|
}
|
1370
1414
|
const urlPath = "/v2/account/unlink/apple";
|
1371
1415
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1394,7 +1438,9 @@ var MezonApi = class {
|
|
1394
1438
|
/** Remove the custom ID from the social profiles on the current user's account. */
|
1395
1439
|
unlinkCustom(bearerToken, body, options = {}) {
|
1396
1440
|
if (body === null || body === void 0) {
|
1397
|
-
throw new Error(
|
1441
|
+
throw new Error(
|
1442
|
+
"'body' is a required parameter but is null or undefined."
|
1443
|
+
);
|
1398
1444
|
}
|
1399
1445
|
const urlPath = "/v2/account/unlink/custom";
|
1400
1446
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1423,7 +1469,9 @@ var MezonApi = class {
|
|
1423
1469
|
/** Remove the device ID from the social profiles on the current user's account. */
|
1424
1470
|
unlinkDevice(bearerToken, body, options = {}) {
|
1425
1471
|
if (body === null || body === void 0) {
|
1426
|
-
throw new Error(
|
1472
|
+
throw new Error(
|
1473
|
+
"'body' is a required parameter but is null or undefined."
|
1474
|
+
);
|
1427
1475
|
}
|
1428
1476
|
const urlPath = "/v2/account/unlink/device";
|
1429
1477
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1452,7 +1500,9 @@ var MezonApi = class {
|
|
1452
1500
|
/** Remove the email+password from the social profiles on the current user's account. */
|
1453
1501
|
unlinkEmail(bearerToken, body, options = {}) {
|
1454
1502
|
if (body === null || body === void 0) {
|
1455
|
-
throw new Error(
|
1503
|
+
throw new Error(
|
1504
|
+
"'body' is a required parameter but is null or undefined."
|
1505
|
+
);
|
1456
1506
|
}
|
1457
1507
|
const urlPath = "/v2/account/unlink/email";
|
1458
1508
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1481,7 +1531,9 @@ var MezonApi = class {
|
|
1481
1531
|
/** Remove Facebook from the social profiles on the current user's account. */
|
1482
1532
|
unlinkFacebook(bearerToken, body, options = {}) {
|
1483
1533
|
if (body === null || body === void 0) {
|
1484
|
-
throw new Error(
|
1534
|
+
throw new Error(
|
1535
|
+
"'body' is a required parameter but is null or undefined."
|
1536
|
+
);
|
1485
1537
|
}
|
1486
1538
|
const urlPath = "/v2/account/unlink/facebook";
|
1487
1539
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1510,7 +1562,9 @@ var MezonApi = class {
|
|
1510
1562
|
/** Remove Facebook Instant Game profile from the social profiles on the current user's account. */
|
1511
1563
|
unlinkFacebookInstantGame(bearerToken, body, options = {}) {
|
1512
1564
|
if (body === null || body === void 0) {
|
1513
|
-
throw new Error(
|
1565
|
+
throw new Error(
|
1566
|
+
"'body' is a required parameter but is null or undefined."
|
1567
|
+
);
|
1514
1568
|
}
|
1515
1569
|
const urlPath = "/v2/account/unlink/facebookinstantgame";
|
1516
1570
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1539,7 +1593,9 @@ var MezonApi = class {
|
|
1539
1593
|
/** Remove Apple's GameCenter from the social profiles on the current user's account. */
|
1540
1594
|
unlinkGameCenter(bearerToken, body, options = {}) {
|
1541
1595
|
if (body === null || body === void 0) {
|
1542
|
-
throw new Error(
|
1596
|
+
throw new Error(
|
1597
|
+
"'body' is a required parameter but is null or undefined."
|
1598
|
+
);
|
1543
1599
|
}
|
1544
1600
|
const urlPath = "/v2/account/unlink/gamecenter";
|
1545
1601
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1568,7 +1624,9 @@ var MezonApi = class {
|
|
1568
1624
|
/** Remove Google from the social profiles on the current user's account. */
|
1569
1625
|
unlinkGoogle(bearerToken, body, options = {}) {
|
1570
1626
|
if (body === null || body === void 0) {
|
1571
|
-
throw new Error(
|
1627
|
+
throw new Error(
|
1628
|
+
"'body' is a required parameter but is null or undefined."
|
1629
|
+
);
|
1572
1630
|
}
|
1573
1631
|
const urlPath = "/v2/account/unlink/google";
|
1574
1632
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1597,7 +1655,9 @@ var MezonApi = class {
|
|
1597
1655
|
/** Remove Steam from the social profiles on the current user's account. */
|
1598
1656
|
unlinkSteam(bearerToken, body, options = {}) {
|
1599
1657
|
if (body === null || body === void 0) {
|
1600
|
-
throw new Error(
|
1658
|
+
throw new Error(
|
1659
|
+
"'body' is a required parameter but is null or undefined."
|
1660
|
+
);
|
1601
1661
|
}
|
1602
1662
|
const urlPath = "/v2/account/unlink/steam";
|
1603
1663
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1626,7 +1686,9 @@ var MezonApi = class {
|
|
1626
1686
|
/** Add a new apps. */
|
1627
1687
|
addApp(bearerToken, body, options = {}) {
|
1628
1688
|
if (body === null || body === void 0) {
|
1629
|
-
throw new Error(
|
1689
|
+
throw new Error(
|
1690
|
+
"'body' is a required parameter but is null or undefined."
|
1691
|
+
);
|
1630
1692
|
}
|
1631
1693
|
const urlPath = "/v2/apps/add";
|
1632
1694
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1683,10 +1745,14 @@ var MezonApi = class {
|
|
1683
1745
|
/** Add an app to clan. */
|
1684
1746
|
addAppToClan(bearerToken, appId, clanId, options = {}) {
|
1685
1747
|
if (appId === null || appId === void 0) {
|
1686
|
-
throw new Error(
|
1748
|
+
throw new Error(
|
1749
|
+
"'appId' is a required parameter but is null or undefined."
|
1750
|
+
);
|
1687
1751
|
}
|
1688
1752
|
if (clanId === null || clanId === void 0) {
|
1689
|
-
throw new Error(
|
1753
|
+
throw new Error(
|
1754
|
+
"'clanId' is a required parameter but is null or undefined."
|
1755
|
+
);
|
1690
1756
|
}
|
1691
1757
|
const urlPath = "/v2/apps/app/{appId}/clan/{clanId}".replace("{appId}", encodeURIComponent(String(appId))).replace("{clanId}", encodeURIComponent(String(clanId)));
|
1692
1758
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1716,7 +1782,10 @@ var MezonApi = class {
|
|
1716
1782
|
if (id === null || id === void 0) {
|
1717
1783
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
1718
1784
|
}
|
1719
|
-
const urlPath = "/v2/apps/app/{id}".replace(
|
1785
|
+
const urlPath = "/v2/apps/app/{id}".replace(
|
1786
|
+
"{id}",
|
1787
|
+
encodeURIComponent(String(id))
|
1788
|
+
);
|
1720
1789
|
const queryParams = /* @__PURE__ */ new Map();
|
1721
1790
|
queryParams.set("record_deletion", recordDeletion);
|
1722
1791
|
let bodyJson = "";
|
@@ -1745,7 +1814,10 @@ var MezonApi = class {
|
|
1745
1814
|
if (id === null || id === void 0) {
|
1746
1815
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
1747
1816
|
}
|
1748
|
-
const urlPath = "/v2/apps/app/{id}".replace(
|
1817
|
+
const urlPath = "/v2/apps/app/{id}".replace(
|
1818
|
+
"{id}",
|
1819
|
+
encodeURIComponent(String(id))
|
1820
|
+
);
|
1749
1821
|
const queryParams = /* @__PURE__ */ new Map();
|
1750
1822
|
let bodyJson = "";
|
1751
1823
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -1774,9 +1846,14 @@ var MezonApi = class {
|
|
1774
1846
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
1775
1847
|
}
|
1776
1848
|
if (body === null || body === void 0) {
|
1777
|
-
throw new Error(
|
1849
|
+
throw new Error(
|
1850
|
+
"'body' is a required parameter but is null or undefined."
|
1851
|
+
);
|
1778
1852
|
}
|
1779
|
-
const urlPath = "/v2/apps/app/{id}".replace(
|
1853
|
+
const urlPath = "/v2/apps/app/{id}".replace(
|
1854
|
+
"{id}",
|
1855
|
+
encodeURIComponent(String(id))
|
1856
|
+
);
|
1780
1857
|
const queryParams = /* @__PURE__ */ new Map();
|
1781
1858
|
let bodyJson = "";
|
1782
1859
|
bodyJson = JSON.stringify(body || {});
|
@@ -1805,7 +1882,10 @@ var MezonApi = class {
|
|
1805
1882
|
if (id === null || id === void 0) {
|
1806
1883
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
1807
1884
|
}
|
1808
|
-
const urlPath = "/v2/apps/app/{id}/ban".replace(
|
1885
|
+
const urlPath = "/v2/apps/app/{id}/ban".replace(
|
1886
|
+
"{id}",
|
1887
|
+
encodeURIComponent(String(id))
|
1888
|
+
);
|
1809
1889
|
const queryParams = /* @__PURE__ */ new Map();
|
1810
1890
|
let bodyJson = "";
|
1811
1891
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -1833,7 +1913,10 @@ var MezonApi = class {
|
|
1833
1913
|
if (id === null || id === void 0) {
|
1834
1914
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
1835
1915
|
}
|
1836
|
-
const urlPath = "/v2/apps/app/{id}/unban".replace(
|
1916
|
+
const urlPath = "/v2/apps/app/{id}/unban".replace(
|
1917
|
+
"{id}",
|
1918
|
+
encodeURIComponent(String(id))
|
1919
|
+
);
|
1837
1920
|
const queryParams = /* @__PURE__ */ new Map();
|
1838
1921
|
let bodyJson = "";
|
1839
1922
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -1856,35 +1939,12 @@ var MezonApi = class {
|
|
1856
1939
|
)
|
1857
1940
|
]);
|
1858
1941
|
}
|
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
|
-
}
|
1884
1942
|
/** */
|
1885
1943
|
updateCategoryOrder(bearerToken, body, options = {}) {
|
1886
1944
|
if (body === null || body === void 0) {
|
1887
|
-
throw new Error(
|
1945
|
+
throw new Error(
|
1946
|
+
"'body' is a required parameter but is null or undefined."
|
1947
|
+
);
|
1888
1948
|
}
|
1889
1949
|
const urlPath = "/v2/category/orders";
|
1890
1950
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1913,9 +1973,14 @@ var MezonApi = class {
|
|
1913
1973
|
/** */
|
1914
1974
|
listCategoryDescs(bearerToken, clanId, creatorId, categoryName, categoryId, categoryOrder, options = {}) {
|
1915
1975
|
if (clanId === null || clanId === void 0) {
|
1916
|
-
throw new Error(
|
1976
|
+
throw new Error(
|
1977
|
+
"'clanId' is a required parameter but is null or undefined."
|
1978
|
+
);
|
1917
1979
|
}
|
1918
|
-
const urlPath = "/v2/categorydesc/{clanId}".replace(
|
1980
|
+
const urlPath = "/v2/categorydesc/{clanId}".replace(
|
1981
|
+
"{clanId}",
|
1982
|
+
encodeURIComponent(String(clanId))
|
1983
|
+
);
|
1919
1984
|
const queryParams = /* @__PURE__ */ new Map();
|
1920
1985
|
queryParams.set("creator_id", creatorId);
|
1921
1986
|
queryParams.set("category_name", categoryName);
|
@@ -1971,9 +2036,14 @@ var MezonApi = class {
|
|
1971
2036
|
/** List a channel's message history. */
|
1972
2037
|
listChannelMessages(bearerToken, clanId, channelId, messageId, direction, limit, options = {}) {
|
1973
2038
|
if (channelId === null || channelId === void 0) {
|
1974
|
-
throw new Error(
|
2039
|
+
throw new Error(
|
2040
|
+
"'channelId' is a required parameter but is null or undefined."
|
2041
|
+
);
|
1975
2042
|
}
|
1976
|
-
const urlPath = "/v2/channel/{channelId}".replace(
|
2043
|
+
const urlPath = "/v2/channel/{channelId}".replace(
|
2044
|
+
"{channelId}",
|
2045
|
+
encodeURIComponent(String(channelId))
|
2046
|
+
);
|
1977
2047
|
const queryParams = /* @__PURE__ */ new Map();
|
1978
2048
|
queryParams.set("clan_id", clanId);
|
1979
2049
|
queryParams.set("message_id", messageId);
|
@@ -2003,9 +2073,14 @@ var MezonApi = class {
|
|
2003
2073
|
/** Add users to a channel. */
|
2004
2074
|
addChannelUsers(bearerToken, channelId, userIds, options = {}) {
|
2005
2075
|
if (channelId === null || channelId === void 0) {
|
2006
|
-
throw new Error(
|
2076
|
+
throw new Error(
|
2077
|
+
"'channelId' is a required parameter but is null or undefined."
|
2078
|
+
);
|
2007
2079
|
}
|
2008
|
-
const urlPath = "/v2/channel/{channelId}/add".replace(
|
2080
|
+
const urlPath = "/v2/channel/{channelId}/add".replace(
|
2081
|
+
"{channelId}",
|
2082
|
+
encodeURIComponent(String(channelId))
|
2083
|
+
);
|
2009
2084
|
const queryParams = /* @__PURE__ */ new Map();
|
2010
2085
|
queryParams.set("user_ids", userIds);
|
2011
2086
|
let bodyJson = "";
|
@@ -2032,9 +2107,14 @@ var MezonApi = class {
|
|
2032
2107
|
/** List all attachment that are part of a channel. */
|
2033
2108
|
listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state, cursor, options = {}) {
|
2034
2109
|
if (channelId === null || channelId === void 0) {
|
2035
|
-
throw new Error(
|
2110
|
+
throw new Error(
|
2111
|
+
"'channelId' is a required parameter but is null or undefined."
|
2112
|
+
);
|
2036
2113
|
}
|
2037
|
-
const urlPath = "/v2/channel/{channelId}/attachment".replace(
|
2114
|
+
const urlPath = "/v2/channel/{channelId}/attachment".replace(
|
2115
|
+
"{channelId}",
|
2116
|
+
encodeURIComponent(String(channelId))
|
2117
|
+
);
|
2038
2118
|
const queryParams = /* @__PURE__ */ new Map();
|
2039
2119
|
queryParams.set("clan_id", clanId);
|
2040
2120
|
queryParams.set("file_type", fileType);
|
@@ -2065,9 +2145,14 @@ var MezonApi = class {
|
|
2065
2145
|
/** Leave a channel the user is a member of. */
|
2066
2146
|
leaveChannel(bearerToken, channelId, options = {}) {
|
2067
2147
|
if (channelId === null || channelId === void 0) {
|
2068
|
-
throw new Error(
|
2148
|
+
throw new Error(
|
2149
|
+
"'channelId' is a required parameter but is null or undefined."
|
2150
|
+
);
|
2069
2151
|
}
|
2070
|
-
const urlPath = "/v2/channel/{channelId}/leave".replace(
|
2152
|
+
const urlPath = "/v2/channel/{channelId}/leave".replace(
|
2153
|
+
"{channelId}",
|
2154
|
+
encodeURIComponent(String(channelId))
|
2155
|
+
);
|
2071
2156
|
const queryParams = /* @__PURE__ */ new Map();
|
2072
2157
|
let bodyJson = "";
|
2073
2158
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2093,9 +2178,14 @@ var MezonApi = class {
|
|
2093
2178
|
/** Kick a set of users from a channel. */
|
2094
2179
|
removeChannelUsers(bearerToken, channelId, userIds, options = {}) {
|
2095
2180
|
if (channelId === null || channelId === void 0) {
|
2096
|
-
throw new Error(
|
2181
|
+
throw new Error(
|
2182
|
+
"'channelId' is a required parameter but is null or undefined."
|
2183
|
+
);
|
2097
2184
|
}
|
2098
|
-
const urlPath = "/v2/channel/{channelId}/remove".replace(
|
2185
|
+
const urlPath = "/v2/channel/{channelId}/remove".replace(
|
2186
|
+
"{channelId}",
|
2187
|
+
encodeURIComponent(String(channelId))
|
2188
|
+
);
|
2099
2189
|
const queryParams = /* @__PURE__ */ new Map();
|
2100
2190
|
queryParams.set("user_ids", userIds);
|
2101
2191
|
let bodyJson = "";
|
@@ -2122,9 +2212,14 @@ var MezonApi = class {
|
|
2122
2212
|
/** List all users that are part of a channel. */
|
2123
2213
|
listChannelUsers(bearerToken, clanId, channelId, channelType, limit, state, cursor, options = {}) {
|
2124
2214
|
if (channelId === null || channelId === void 0) {
|
2125
|
-
throw new Error(
|
2215
|
+
throw new Error(
|
2216
|
+
"'channelId' is a required parameter but is null or undefined."
|
2217
|
+
);
|
2126
2218
|
}
|
2127
|
-
const urlPath = "/v2/channel/{channelId}/user".replace(
|
2219
|
+
const urlPath = "/v2/channel/{channelId}/user".replace(
|
2220
|
+
"{channelId}",
|
2221
|
+
encodeURIComponent(String(channelId))
|
2222
|
+
);
|
2128
2223
|
const queryParams = /* @__PURE__ */ new Map();
|
2129
2224
|
queryParams.set("clan_id", clanId);
|
2130
2225
|
queryParams.set("channel_type", channelType);
|
@@ -2185,7 +2280,9 @@ var MezonApi = class {
|
|
2185
2280
|
/** Create a new channel with the current user as the owner. */
|
2186
2281
|
createChannelDesc(bearerToken, body, options = {}) {
|
2187
2282
|
if (body === null || body === void 0) {
|
2188
|
-
throw new Error(
|
2283
|
+
throw new Error(
|
2284
|
+
"'body' is a required parameter but is null or undefined."
|
2285
|
+
);
|
2189
2286
|
}
|
2190
2287
|
const urlPath = "/v2/channeldesc";
|
2191
2288
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2241,9 +2338,14 @@ var MezonApi = class {
|
|
2241
2338
|
/** Delete a channel by ID. */
|
2242
2339
|
deleteChannelDesc(bearerToken, channelId, options = {}) {
|
2243
2340
|
if (channelId === null || channelId === void 0) {
|
2244
|
-
throw new Error(
|
2341
|
+
throw new Error(
|
2342
|
+
"'channelId' is a required parameter but is null or undefined."
|
2343
|
+
);
|
2245
2344
|
}
|
2246
|
-
const urlPath = "/v2/channeldesc/{channelId}".replace(
|
2345
|
+
const urlPath = "/v2/channeldesc/{channelId}".replace(
|
2346
|
+
"{channelId}",
|
2347
|
+
encodeURIComponent(String(channelId))
|
2348
|
+
);
|
2247
2349
|
const queryParams = /* @__PURE__ */ new Map();
|
2248
2350
|
let bodyJson = "";
|
2249
2351
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2269,12 +2371,19 @@ var MezonApi = class {
|
|
2269
2371
|
/** Update fields in a given channel. */
|
2270
2372
|
updateChannelDesc(bearerToken, channelId, body, options = {}) {
|
2271
2373
|
if (channelId === null || channelId === void 0) {
|
2272
|
-
throw new Error(
|
2374
|
+
throw new Error(
|
2375
|
+
"'channelId' is a required parameter but is null or undefined."
|
2376
|
+
);
|
2273
2377
|
}
|
2274
2378
|
if (body === null || body === void 0) {
|
2275
|
-
throw new Error(
|
2379
|
+
throw new Error(
|
2380
|
+
"'body' is a required parameter but is null or undefined."
|
2381
|
+
);
|
2276
2382
|
}
|
2277
|
-
const urlPath = "/v2/channeldesc/{channelId}".replace(
|
2383
|
+
const urlPath = "/v2/channeldesc/{channelId}".replace(
|
2384
|
+
"{channelId}",
|
2385
|
+
encodeURIComponent(String(channelId))
|
2386
|
+
);
|
2278
2387
|
const queryParams = /* @__PURE__ */ new Map();
|
2279
2388
|
let bodyJson = "";
|
2280
2389
|
bodyJson = JSON.stringify(body || {});
|
@@ -2360,7 +2469,9 @@ var MezonApi = class {
|
|
2360
2469
|
/** Create a clan */
|
2361
2470
|
createClanDesc(bearerToken, body, options = {}) {
|
2362
2471
|
if (body === null || body === void 0) {
|
2363
|
-
throw new Error(
|
2472
|
+
throw new Error(
|
2473
|
+
"'body' is a required parameter but is null or undefined."
|
2474
|
+
);
|
2364
2475
|
}
|
2365
2476
|
const urlPath = "/v2/clandesc";
|
2366
2477
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2389,9 +2500,14 @@ var MezonApi = class {
|
|
2389
2500
|
/** Delete a clan desc by ID. */
|
2390
2501
|
deleteClanDesc(bearerToken, clanDescId, options = {}) {
|
2391
2502
|
if (clanDescId === null || clanDescId === void 0) {
|
2392
|
-
throw new Error(
|
2503
|
+
throw new Error(
|
2504
|
+
"'clanDescId' is a required parameter but is null or undefined."
|
2505
|
+
);
|
2393
2506
|
}
|
2394
|
-
const urlPath = "/v2/clandesc/{clanDescId}".replace(
|
2507
|
+
const urlPath = "/v2/clandesc/{clanDescId}".replace(
|
2508
|
+
"{clanDescId}",
|
2509
|
+
encodeURIComponent(String(clanDescId))
|
2510
|
+
);
|
2395
2511
|
const queryParams = /* @__PURE__ */ new Map();
|
2396
2512
|
let bodyJson = "";
|
2397
2513
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2417,12 +2533,19 @@ var MezonApi = class {
|
|
2417
2533
|
/** Update fields in a given clan. */
|
2418
2534
|
updateClanDesc(bearerToken, clanId, body, options = {}) {
|
2419
2535
|
if (clanId === null || clanId === void 0) {
|
2420
|
-
throw new Error(
|
2536
|
+
throw new Error(
|
2537
|
+
"'clanId' is a required parameter but is null or undefined."
|
2538
|
+
);
|
2421
2539
|
}
|
2422
2540
|
if (body === null || body === void 0) {
|
2423
|
-
throw new Error(
|
2541
|
+
throw new Error(
|
2542
|
+
"'body' is a required parameter but is null or undefined."
|
2543
|
+
);
|
2424
2544
|
}
|
2425
|
-
const urlPath = "/v2/clandesc/{clanId}".replace(
|
2545
|
+
const urlPath = "/v2/clandesc/{clanId}".replace(
|
2546
|
+
"{clanId}",
|
2547
|
+
encodeURIComponent(String(clanId))
|
2548
|
+
);
|
2426
2549
|
const queryParams = /* @__PURE__ */ new Map();
|
2427
2550
|
let bodyJson = "";
|
2428
2551
|
bodyJson = JSON.stringify(body || {});
|
@@ -2449,9 +2572,14 @@ var MezonApi = class {
|
|
2449
2572
|
/** Kick a set of users from a clan. */
|
2450
2573
|
removeClanUsers(bearerToken, clanId, userIds, options = {}) {
|
2451
2574
|
if (clanId === null || clanId === void 0) {
|
2452
|
-
throw new Error(
|
2575
|
+
throw new Error(
|
2576
|
+
"'clanId' is a required parameter but is null or undefined."
|
2577
|
+
);
|
2453
2578
|
}
|
2454
|
-
const urlPath = "/v2/clandesc/{clanId}/kick".replace(
|
2579
|
+
const urlPath = "/v2/clandesc/{clanId}/kick".replace(
|
2580
|
+
"{clanId}",
|
2581
|
+
encodeURIComponent(String(clanId))
|
2582
|
+
);
|
2455
2583
|
const queryParams = /* @__PURE__ */ new Map();
|
2456
2584
|
queryParams.set("user_ids", userIds);
|
2457
2585
|
let bodyJson = "";
|
@@ -2478,9 +2606,14 @@ var MezonApi = class {
|
|
2478
2606
|
/** List all users that are part of a clan. */
|
2479
2607
|
listClanUsers(bearerToken, clanId, options = {}) {
|
2480
2608
|
if (clanId === null || clanId === void 0) {
|
2481
|
-
throw new Error(
|
2609
|
+
throw new Error(
|
2610
|
+
"'clanId' is a required parameter but is null or undefined."
|
2611
|
+
);
|
2482
2612
|
}
|
2483
|
-
const urlPath = "/v2/clandesc/{clanId}/user".replace(
|
2613
|
+
const urlPath = "/v2/clandesc/{clanId}/user".replace(
|
2614
|
+
"{clanId}",
|
2615
|
+
encodeURIComponent(String(clanId))
|
2616
|
+
);
|
2484
2617
|
const queryParams = /* @__PURE__ */ new Map();
|
2485
2618
|
let bodyJson = "";
|
2486
2619
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2506,9 +2639,14 @@ var MezonApi = class {
|
|
2506
2639
|
/** check duplicate clan name */
|
2507
2640
|
checkDuplicateClanName(bearerToken, clanName, options = {}) {
|
2508
2641
|
if (clanName === null || clanName === void 0) {
|
2509
|
-
throw new Error(
|
2642
|
+
throw new Error(
|
2643
|
+
"'clanName' is a required parameter but is null or undefined."
|
2644
|
+
);
|
2510
2645
|
}
|
2511
|
-
const urlPath = "/v2/clandesc/{clanName}".replace(
|
2646
|
+
const urlPath = "/v2/clandesc/{clanName}".replace(
|
2647
|
+
"{clanName}",
|
2648
|
+
encodeURIComponent(String(clanName))
|
2649
|
+
);
|
2512
2650
|
const queryParams = /* @__PURE__ */ new Map();
|
2513
2651
|
let bodyJson = "";
|
2514
2652
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2534,9 +2672,14 @@ var MezonApi = class {
|
|
2534
2672
|
/** Get a clan desc profile */
|
2535
2673
|
getClanDescProfile(bearerToken, clanId, options = {}) {
|
2536
2674
|
if (clanId === null || clanId === void 0) {
|
2537
|
-
throw new Error(
|
2675
|
+
throw new Error(
|
2676
|
+
"'clanId' is a required parameter but is null or undefined."
|
2677
|
+
);
|
2538
2678
|
}
|
2539
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2679
|
+
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2680
|
+
"{clanId}",
|
2681
|
+
encodeURIComponent(String(clanId))
|
2682
|
+
);
|
2540
2683
|
const queryParams = /* @__PURE__ */ new Map();
|
2541
2684
|
let bodyJson = "";
|
2542
2685
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2562,12 +2705,19 @@ var MezonApi = class {
|
|
2562
2705
|
/** Update fields in a given clan profile. */
|
2563
2706
|
updateClanDescProfile(bearerToken, clanId, body, options = {}) {
|
2564
2707
|
if (clanId === null || clanId === void 0) {
|
2565
|
-
throw new Error(
|
2708
|
+
throw new Error(
|
2709
|
+
"'clanId' is a required parameter but is null or undefined."
|
2710
|
+
);
|
2566
2711
|
}
|
2567
2712
|
if (body === null || body === void 0) {
|
2568
|
-
throw new Error(
|
2713
|
+
throw new Error(
|
2714
|
+
"'body' is a required parameter but is null or undefined."
|
2715
|
+
);
|
2569
2716
|
}
|
2570
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2717
|
+
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2718
|
+
"{clanId}",
|
2719
|
+
encodeURIComponent(String(clanId))
|
2720
|
+
);
|
2571
2721
|
const queryParams = /* @__PURE__ */ new Map();
|
2572
2722
|
let bodyJson = "";
|
2573
2723
|
bodyJson = JSON.stringify(body || {});
|
@@ -2594,7 +2744,9 @@ var MezonApi = class {
|
|
2594
2744
|
/** */
|
2595
2745
|
createCategoryDesc(bearerToken, body, options = {}) {
|
2596
2746
|
if (body === null || body === void 0) {
|
2597
|
-
throw new Error(
|
2747
|
+
throw new Error(
|
2748
|
+
"'body' is a required parameter but is null or undefined."
|
2749
|
+
);
|
2598
2750
|
}
|
2599
2751
|
const urlPath = "/v2/createcategory";
|
2600
2752
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2623,10 +2775,14 @@ var MezonApi = class {
|
|
2623
2775
|
/** */
|
2624
2776
|
deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
|
2625
2777
|
if (categoryId === null || categoryId === void 0) {
|
2626
|
-
throw new Error(
|
2778
|
+
throw new Error(
|
2779
|
+
"'categoryId' is a required parameter but is null or undefined."
|
2780
|
+
);
|
2627
2781
|
}
|
2628
2782
|
if (clanId === null || clanId === void 0) {
|
2629
|
-
throw new Error(
|
2783
|
+
throw new Error(
|
2784
|
+
"'clanId' is a required parameter but is null or undefined."
|
2785
|
+
);
|
2630
2786
|
}
|
2631
2787
|
const urlPath = "/v2/deletecategory/category_id/{categoryId}/clan_id/{clanId}".replace("{categoryId}", encodeURIComponent(String(categoryId))).replace("{clanId}", encodeURIComponent(String(clanId)));
|
2632
2788
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2654,9 +2810,14 @@ var MezonApi = class {
|
|
2654
2810
|
/** */
|
2655
2811
|
deleteCategoryOrder(bearerToken, clanId, options = {}) {
|
2656
2812
|
if (clanId === null || clanId === void 0) {
|
2657
|
-
throw new Error(
|
2813
|
+
throw new Error(
|
2814
|
+
"'clanId' is a required parameter but is null or undefined."
|
2815
|
+
);
|
2658
2816
|
}
|
2659
|
-
const urlPath = "/v2/deletecategoryorder/clan_id/{clanId}".replace(
|
2817
|
+
const urlPath = "/v2/deletecategoryorder/clan_id/{clanId}".replace(
|
2818
|
+
"{clanId}",
|
2819
|
+
encodeURIComponent(String(clanId))
|
2820
|
+
);
|
2660
2821
|
const queryParams = /* @__PURE__ */ new Map();
|
2661
2822
|
let bodyJson = "";
|
2662
2823
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2710,7 +2871,9 @@ var MezonApi = class {
|
|
2710
2871
|
/** close direct message. */
|
2711
2872
|
closeDirectMess(bearerToken, body, options = {}) {
|
2712
2873
|
if (body === null || body === void 0) {
|
2713
|
-
throw new Error(
|
2874
|
+
throw new Error(
|
2875
|
+
"'body' is a required parameter but is null or undefined."
|
2876
|
+
);
|
2714
2877
|
}
|
2715
2878
|
const urlPath = "/v2/direct/close";
|
2716
2879
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2739,7 +2902,9 @@ var MezonApi = class {
|
|
2739
2902
|
/** open direct message. */
|
2740
2903
|
openDirectMess(bearerToken, body, options = {}) {
|
2741
2904
|
if (body === null || body === void 0) {
|
2742
|
-
throw new Error(
|
2905
|
+
throw new Error(
|
2906
|
+
"'body' is a required parameter but is null or undefined."
|
2907
|
+
);
|
2743
2908
|
}
|
2744
2909
|
const urlPath = "/v2/direct/open";
|
2745
2910
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2768,7 +2933,9 @@ var MezonApi = class {
|
|
2768
2933
|
/** Post clan Emoji /v2/emoji/create */
|
2769
2934
|
createClanEmoji(bearerToken, body, options = {}) {
|
2770
2935
|
if (body === null || body === void 0) {
|
2771
|
-
throw new Error(
|
2936
|
+
throw new Error(
|
2937
|
+
"'body' is a required parameter but is null or undefined."
|
2938
|
+
);
|
2772
2939
|
}
|
2773
2940
|
const urlPath = "/v2/emoji/create";
|
2774
2941
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2799,7 +2966,10 @@ var MezonApi = class {
|
|
2799
2966
|
if (id === null || id === void 0) {
|
2800
2967
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
2801
2968
|
}
|
2802
|
-
const urlPath = "/v2/emoji/{id}".replace(
|
2969
|
+
const urlPath = "/v2/emoji/{id}".replace(
|
2970
|
+
"{id}",
|
2971
|
+
encodeURIComponent(String(id))
|
2972
|
+
);
|
2803
2973
|
const queryParams = /* @__PURE__ */ new Map();
|
2804
2974
|
queryParams.set("clan_id", clanId);
|
2805
2975
|
const body = { clan_id: clanId };
|
@@ -2830,9 +3000,14 @@ var MezonApi = class {
|
|
2830
3000
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
2831
3001
|
}
|
2832
3002
|
if (body === null || body === void 0) {
|
2833
|
-
throw new Error(
|
3003
|
+
throw new Error(
|
3004
|
+
"'body' is a required parameter but is null or undefined."
|
3005
|
+
);
|
2834
3006
|
}
|
2835
|
-
const urlPath = "/v2/emoji/{id}".replace(
|
3007
|
+
const urlPath = "/v2/emoji/{id}".replace(
|
3008
|
+
"{id}",
|
3009
|
+
encodeURIComponent(String(id))
|
3010
|
+
);
|
2836
3011
|
const queryParams = /* @__PURE__ */ new Map();
|
2837
3012
|
let bodyJson = "";
|
2838
3013
|
bodyJson = JSON.stringify(body || {});
|
@@ -2884,7 +3059,9 @@ var MezonApi = class {
|
|
2884
3059
|
/** Search message from elasticsearch service. */
|
2885
3060
|
searchMessage(bearerToken, body, options = {}) {
|
2886
3061
|
if (body === null || body === void 0) {
|
2887
|
-
throw new Error(
|
3062
|
+
throw new Error(
|
3063
|
+
"'body' is a required parameter but is null or undefined."
|
3064
|
+
);
|
2888
3065
|
}
|
2889
3066
|
const urlPath = "/v2/es/search";
|
2890
3067
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2913,7 +3090,9 @@ var MezonApi = class {
|
|
2913
3090
|
/** Submit an event for processing in the server's registered runtime custom events handler. */
|
2914
3091
|
event(bearerToken, body, options = {}) {
|
2915
3092
|
if (body === null || body === void 0) {
|
2916
|
-
throw new Error(
|
3093
|
+
throw new Error(
|
3094
|
+
"'body' is a required parameter but is null or undefined."
|
3095
|
+
);
|
2917
3096
|
}
|
2918
3097
|
const urlPath = "/v2/event";
|
2919
3098
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2968,7 +3147,9 @@ var MezonApi = class {
|
|
2968
3147
|
/** Create a new event for clan. */
|
2969
3148
|
createEvent(bearerToken, body, options = {}) {
|
2970
3149
|
if (body === null || body === void 0) {
|
2971
|
-
throw new Error(
|
3150
|
+
throw new Error(
|
3151
|
+
"'body' is a required parameter but is null or undefined."
|
3152
|
+
);
|
2972
3153
|
}
|
2973
3154
|
const urlPath = "/v2/eventmanagement/create";
|
2974
3155
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2997,7 +3178,9 @@ var MezonApi = class {
|
|
2997
3178
|
/** Update fields in a given event. */
|
2998
3179
|
updateEventUser(bearerToken, body, options = {}) {
|
2999
3180
|
if (body === null || body === void 0) {
|
3000
|
-
throw new Error(
|
3181
|
+
throw new Error(
|
3182
|
+
"'body' is a required parameter but is null or undefined."
|
3183
|
+
);
|
3001
3184
|
}
|
3002
3185
|
const urlPath = "/v2/eventmanagement/user";
|
3003
3186
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3026,9 +3209,14 @@ var MezonApi = class {
|
|
3026
3209
|
/** Delete a event by ID. */
|
3027
3210
|
deleteEvent(bearerToken, eventId, clanId, options = {}) {
|
3028
3211
|
if (eventId === null || eventId === void 0) {
|
3029
|
-
throw new Error(
|
3212
|
+
throw new Error(
|
3213
|
+
"'eventId' is a required parameter but is null or undefined."
|
3214
|
+
);
|
3030
3215
|
}
|
3031
|
-
const urlPath = "/v2/eventmanagement/{eventId}".replace(
|
3216
|
+
const urlPath = "/v2/eventmanagement/{eventId}".replace(
|
3217
|
+
"{eventId}",
|
3218
|
+
encodeURIComponent(String(eventId))
|
3219
|
+
);
|
3032
3220
|
const queryParams = /* @__PURE__ */ new Map();
|
3033
3221
|
queryParams.set("clan_id", clanId);
|
3034
3222
|
let bodyJson = "";
|
@@ -3055,12 +3243,19 @@ var MezonApi = class {
|
|
3055
3243
|
/** Update fields in a given event. */
|
3056
3244
|
updateEvent(bearerToken, eventId, body, options = {}) {
|
3057
3245
|
if (eventId === null || eventId === void 0) {
|
3058
|
-
throw new Error(
|
3246
|
+
throw new Error(
|
3247
|
+
"'eventId' is a required parameter but is null or undefined."
|
3248
|
+
);
|
3059
3249
|
}
|
3060
3250
|
if (body === null || body === void 0) {
|
3061
|
-
throw new Error(
|
3251
|
+
throw new Error(
|
3252
|
+
"'body' is a required parameter but is null or undefined."
|
3253
|
+
);
|
3062
3254
|
}
|
3063
|
-
const urlPath = "/v2/eventmanagement/{eventId}".replace(
|
3255
|
+
const urlPath = "/v2/eventmanagement/{eventId}".replace(
|
3256
|
+
"{eventId}",
|
3257
|
+
encodeURIComponent(String(eventId))
|
3258
|
+
);
|
3064
3259
|
const queryParams = /* @__PURE__ */ new Map();
|
3065
3260
|
let bodyJson = "";
|
3066
3261
|
bodyJson = JSON.stringify(body || {});
|
@@ -3196,7 +3391,9 @@ var MezonApi = class {
|
|
3196
3391
|
/** Import Facebook friends and add them to a user's account. */
|
3197
3392
|
importFacebookFriends(bearerToken, account, reset, options = {}) {
|
3198
3393
|
if (account === null || account === void 0) {
|
3199
|
-
throw new Error(
|
3394
|
+
throw new Error(
|
3395
|
+
"'account' is a required parameter but is null or undefined."
|
3396
|
+
);
|
3200
3397
|
}
|
3201
3398
|
const urlPath = "/v2/friend/facebook";
|
3202
3399
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3226,7 +3423,9 @@ var MezonApi = class {
|
|
3226
3423
|
/** Import Steam friends and add them to a user's account. */
|
3227
3424
|
importSteamFriends(bearerToken, account, reset, options = {}) {
|
3228
3425
|
if (account === null || account === void 0) {
|
3229
|
-
throw new Error(
|
3426
|
+
throw new Error(
|
3427
|
+
"'account' is a required parameter but is null or undefined."
|
3428
|
+
);
|
3230
3429
|
}
|
3231
3430
|
const urlPath = "/v2/friend/steam";
|
3232
3431
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3282,9 +3481,14 @@ var MezonApi = class {
|
|
3282
3481
|
/** */
|
3283
3482
|
getUserProfileOnClan(bearerToken, clanId, options = {}) {
|
3284
3483
|
if (clanId === null || clanId === void 0) {
|
3285
|
-
throw new Error(
|
3484
|
+
throw new Error(
|
3485
|
+
"'clanId' is a required parameter but is null or undefined."
|
3486
|
+
);
|
3286
3487
|
}
|
3287
|
-
const urlPath = "/v2/getclanprofile/{clanId}".replace(
|
3488
|
+
const urlPath = "/v2/getclanprofile/{clanId}".replace(
|
3489
|
+
"{clanId}",
|
3490
|
+
encodeURIComponent(String(clanId))
|
3491
|
+
);
|
3288
3492
|
const queryParams = /* @__PURE__ */ new Map();
|
3289
3493
|
let bodyJson = "";
|
3290
3494
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -3414,7 +3618,9 @@ var MezonApi = class {
|
|
3414
3618
|
/** Give a coffee */
|
3415
3619
|
giveMeACoffee(bearerToken, body, options = {}) {
|
3416
3620
|
if (body === null || body === void 0) {
|
3417
|
-
throw new Error(
|
3621
|
+
throw new Error(
|
3622
|
+
"'body' is a required parameter but is null or undefined."
|
3623
|
+
);
|
3418
3624
|
}
|
3419
3625
|
const urlPath = "/v2/givecoffee";
|
3420
3626
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3470,7 +3676,9 @@ var MezonApi = class {
|
|
3470
3676
|
/** Add users to a channel. */
|
3471
3677
|
createLinkInviteUser(bearerToken, body, options = {}) {
|
3472
3678
|
if (body === null || body === void 0) {
|
3473
|
-
throw new Error(
|
3679
|
+
throw new Error(
|
3680
|
+
"'body' is a required parameter but is null or undefined."
|
3681
|
+
);
|
3474
3682
|
}
|
3475
3683
|
const urlPath = "/v2/invite";
|
3476
3684
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3499,9 +3707,14 @@ var MezonApi = class {
|
|
3499
3707
|
/** Add users to a channel. */
|
3500
3708
|
getLinkInvite(bearerToken, inviteId, options = {}) {
|
3501
3709
|
if (inviteId === null || inviteId === void 0) {
|
3502
|
-
throw new Error(
|
3710
|
+
throw new Error(
|
3711
|
+
"'inviteId' is a required parameter but is null or undefined."
|
3712
|
+
);
|
3503
3713
|
}
|
3504
|
-
const urlPath = "/v2/invite/{inviteId}".replace(
|
3714
|
+
const urlPath = "/v2/invite/{inviteId}".replace(
|
3715
|
+
"{inviteId}",
|
3716
|
+
encodeURIComponent(String(inviteId))
|
3717
|
+
);
|
3505
3718
|
const queryParams = /* @__PURE__ */ new Map();
|
3506
3719
|
let bodyJson = "";
|
3507
3720
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -3527,9 +3740,14 @@ var MezonApi = class {
|
|
3527
3740
|
/** Add users to a channel. */
|
3528
3741
|
inviteUser(bearerToken, inviteId, options = {}) {
|
3529
3742
|
if (inviteId === null || inviteId === void 0) {
|
3530
|
-
throw new Error(
|
3743
|
+
throw new Error(
|
3744
|
+
"'inviteId' is a required parameter but is null or undefined."
|
3745
|
+
);
|
3531
3746
|
}
|
3532
|
-
const urlPath = "/v2/invite/{inviteId}".replace(
|
3747
|
+
const urlPath = "/v2/invite/{inviteId}".replace(
|
3748
|
+
"{inviteId}",
|
3749
|
+
encodeURIComponent(String(inviteId))
|
3750
|
+
);
|
3533
3751
|
const queryParams = /* @__PURE__ */ new Map();
|
3534
3752
|
let bodyJson = "";
|
3535
3753
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -3580,7 +3798,9 @@ var MezonApi = class {
|
|
3580
3798
|
/** set mute notification user channel. */
|
3581
3799
|
setMuteNotificationCategory(bearerToken, body, options = {}) {
|
3582
3800
|
if (body === null || body === void 0) {
|
3583
|
-
throw new Error(
|
3801
|
+
throw new Error(
|
3802
|
+
"'body' is a required parameter but is null or undefined."
|
3803
|
+
);
|
3584
3804
|
}
|
3585
3805
|
const urlPath = "/v2/mutenotificationcategory/set";
|
3586
3806
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3609,7 +3829,9 @@ var MezonApi = class {
|
|
3609
3829
|
/** set mute notification user channel. */
|
3610
3830
|
setMuteNotificationChannel(bearerToken, body, options = {}) {
|
3611
3831
|
if (body === null || body === void 0) {
|
3612
|
-
throw new Error(
|
3832
|
+
throw new Error(
|
3833
|
+
"'body' is a required parameter but is null or undefined."
|
3834
|
+
);
|
3613
3835
|
}
|
3614
3836
|
const urlPath = "/v2/mutenotificationchannel/set";
|
3615
3837
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3692,7 +3914,9 @@ var MezonApi = class {
|
|
3692
3914
|
/** set notification user channel. */
|
3693
3915
|
setNotificationChannelSetting(bearerToken, body, options = {}) {
|
3694
3916
|
if (body === null || body === void 0) {
|
3695
|
-
throw new Error(
|
3917
|
+
throw new Error(
|
3918
|
+
"'body' is a required parameter but is null or undefined."
|
3919
|
+
);
|
3696
3920
|
}
|
3697
3921
|
const urlPath = "/v2/notificationchannel/set";
|
3698
3922
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3721,7 +3945,9 @@ var MezonApi = class {
|
|
3721
3945
|
/** set notification user channel. */
|
3722
3946
|
setNotificationClanSetting(bearerToken, body, options = {}) {
|
3723
3947
|
if (body === null || body === void 0) {
|
3724
|
-
throw new Error(
|
3948
|
+
throw new Error(
|
3949
|
+
"'body' is a required parameter but is null or undefined."
|
3950
|
+
);
|
3725
3951
|
}
|
3726
3952
|
const urlPath = "/v2/notificationclan/set";
|
3727
3953
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3750,7 +3976,9 @@ var MezonApi = class {
|
|
3750
3976
|
/** set notification user channel. */
|
3751
3977
|
setNotificationCategorySetting(bearerToken, body, options = {}) {
|
3752
3978
|
if (body === null || body === void 0) {
|
3753
|
-
throw new Error(
|
3979
|
+
throw new Error(
|
3980
|
+
"'body' is a required parameter but is null or undefined."
|
3981
|
+
);
|
3754
3982
|
}
|
3755
3983
|
const urlPath = "/v2/notificationucategory/set";
|
3756
3984
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3857,7 +4085,9 @@ var MezonApi = class {
|
|
3857
4085
|
/** */
|
3858
4086
|
setNotificationReactMessage(bearerToken, body, options = {}) {
|
3859
4087
|
if (body === null || body === void 0) {
|
3860
|
-
throw new Error(
|
4088
|
+
throw new Error(
|
4089
|
+
"'body' is a required parameter but is null or undefined."
|
4090
|
+
);
|
3861
4091
|
}
|
3862
4092
|
const urlPath = "/v2/notifireactmessage/set";
|
3863
4093
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3886,7 +4116,9 @@ var MezonApi = class {
|
|
3886
4116
|
/** Ossrs http callback. */
|
3887
4117
|
streamingServerCallback(bearerToken, body, options = {}) {
|
3888
4118
|
if (body === null || body === void 0) {
|
3889
|
-
throw new Error(
|
4119
|
+
throw new Error(
|
4120
|
+
"'body' is a required parameter but is null or undefined."
|
4121
|
+
);
|
3890
4122
|
}
|
3891
4123
|
const urlPath = "/v2/ossrs/callback";
|
3892
4124
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3915,7 +4147,9 @@ var MezonApi = class {
|
|
3915
4147
|
/** set permission role channel. */
|
3916
4148
|
setRoleChannelPermission(bearerToken, body, options = {}) {
|
3917
4149
|
if (body === null || body === void 0) {
|
3918
|
-
throw new Error(
|
4150
|
+
throw new Error(
|
4151
|
+
"'body' is a required parameter but is null or undefined."
|
4152
|
+
);
|
3919
4153
|
}
|
3920
4154
|
const urlPath = "/v2/permissionrolechannel/set";
|
3921
4155
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -3966,6 +4200,34 @@ var MezonApi = class {
|
|
3966
4200
|
)
|
3967
4201
|
]);
|
3968
4202
|
}
|
4203
|
+
/** GetPermissionByRoleIdChannelId */
|
4204
|
+
getPermissionByRoleIdChannelId(bearerToken, roleId, channelId, userId, options = {}) {
|
4205
|
+
const urlPath = "/v2/permissions/roles/channels/users";
|
4206
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4207
|
+
queryParams.set("role_id", roleId);
|
4208
|
+
queryParams.set("channel_id", channelId);
|
4209
|
+
queryParams.set("user_id", userId);
|
4210
|
+
let bodyJson = "";
|
4211
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4212
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4213
|
+
if (bearerToken) {
|
4214
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4215
|
+
}
|
4216
|
+
return Promise.race([
|
4217
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4218
|
+
if (response.status == 204) {
|
4219
|
+
return response;
|
4220
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4221
|
+
return response.json();
|
4222
|
+
} else {
|
4223
|
+
throw response;
|
4224
|
+
}
|
4225
|
+
}),
|
4226
|
+
new Promise(
|
4227
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4228
|
+
)
|
4229
|
+
]);
|
4230
|
+
}
|
3969
4231
|
/** */
|
3970
4232
|
deletePinMessage(bearerToken, messageId, options = {}) {
|
3971
4233
|
const urlPath = "/v2/pinmessage/delete";
|
@@ -4023,7 +4285,9 @@ var MezonApi = class {
|
|
4023
4285
|
/** set notification user channel. */
|
4024
4286
|
createPinMessage(bearerToken, body, options = {}) {
|
4025
4287
|
if (body === null || body === void 0) {
|
4026
|
-
throw new Error(
|
4288
|
+
throw new Error(
|
4289
|
+
"'body' is a required parameter but is null or undefined."
|
4290
|
+
);
|
4027
4291
|
}
|
4028
4292
|
const urlPath = "/v2/pinmessage/set";
|
4029
4293
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4052,7 +4316,9 @@ var MezonApi = class {
|
|
4052
4316
|
/** */
|
4053
4317
|
addRolesChannelDesc(bearerToken, body, options = {}) {
|
4054
4318
|
if (body === null || body === void 0) {
|
4055
|
-
throw new Error(
|
4319
|
+
throw new Error(
|
4320
|
+
"'body' is a required parameter but is null or undefined."
|
4321
|
+
);
|
4056
4322
|
}
|
4057
4323
|
const urlPath = "/v2/rolechannel/addrole";
|
4058
4324
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4081,12 +4347,19 @@ var MezonApi = class {
|
|
4081
4347
|
/** update the category of a channel */
|
4082
4348
|
changeChannelCategory(bearerToken, newCategoryId, body, options = {}) {
|
4083
4349
|
if (newCategoryId === null || newCategoryId === void 0) {
|
4084
|
-
throw new Error(
|
4350
|
+
throw new Error(
|
4351
|
+
"'newCategoryId' is a required parameter but is null or undefined."
|
4352
|
+
);
|
4085
4353
|
}
|
4086
4354
|
if (body === null || body === void 0) {
|
4087
|
-
throw new Error(
|
4355
|
+
throw new Error(
|
4356
|
+
"'body' is a required parameter but is null or undefined."
|
4357
|
+
);
|
4088
4358
|
}
|
4089
|
-
const urlPath = "/v2/rolechannel/category/{newCategoryId}".replace(
|
4359
|
+
const urlPath = "/v2/rolechannel/category/{newCategoryId}".replace(
|
4360
|
+
"{newCategoryId}",
|
4361
|
+
encodeURIComponent(String(newCategoryId))
|
4362
|
+
);
|
4090
4363
|
const queryParams = /* @__PURE__ */ new Map();
|
4091
4364
|
let bodyJson = "";
|
4092
4365
|
bodyJson = JSON.stringify(body || {});
|
@@ -4113,7 +4386,9 @@ var MezonApi = class {
|
|
4113
4386
|
/** Update a role when Delete a role by ID. */
|
4114
4387
|
deleteRoleChannelDesc(bearerToken, body, options = {}) {
|
4115
4388
|
if (body === null || body === void 0) {
|
4116
|
-
throw new Error(
|
4389
|
+
throw new Error(
|
4390
|
+
"'body' is a required parameter but is null or undefined."
|
4391
|
+
);
|
4117
4392
|
}
|
4118
4393
|
const urlPath = "/v2/rolechannel/delete";
|
4119
4394
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4171,7 +4446,9 @@ var MezonApi = class {
|
|
4171
4446
|
/** Create a new role for clan. */
|
4172
4447
|
createRole(bearerToken, body, options = {}) {
|
4173
4448
|
if (body === null || body === void 0) {
|
4174
|
-
throw new Error(
|
4449
|
+
throw new Error(
|
4450
|
+
"'body' is a required parameter but is null or undefined."
|
4451
|
+
);
|
4175
4452
|
}
|
4176
4453
|
const urlPath = "/v2/roles";
|
4177
4454
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4200,12 +4477,19 @@ var MezonApi = class {
|
|
4200
4477
|
/** Update a role when Delete a role by ID. */
|
4201
4478
|
updateRoleDelete(bearerToken, roleId, body, options = {}) {
|
4202
4479
|
if (roleId === null || roleId === void 0) {
|
4203
|
-
throw new Error(
|
4480
|
+
throw new Error(
|
4481
|
+
"'roleId' is a required parameter but is null or undefined."
|
4482
|
+
);
|
4204
4483
|
}
|
4205
4484
|
if (body === null || body === void 0) {
|
4206
|
-
throw new Error(
|
4485
|
+
throw new Error(
|
4486
|
+
"'body' is a required parameter but is null or undefined."
|
4487
|
+
);
|
4207
4488
|
}
|
4208
|
-
const urlPath = "/v2/roles/delete/{roleId}".replace(
|
4489
|
+
const urlPath = "/v2/roles/delete/{roleId}".replace(
|
4490
|
+
"{roleId}",
|
4491
|
+
encodeURIComponent(String(roleId))
|
4492
|
+
);
|
4209
4493
|
const queryParams = /* @__PURE__ */ new Map();
|
4210
4494
|
let bodyJson = "";
|
4211
4495
|
bodyJson = JSON.stringify(body || {});
|
@@ -4232,9 +4516,14 @@ var MezonApi = class {
|
|
4232
4516
|
/** Delete a role by ID. */
|
4233
4517
|
deleteRole(bearerToken, roleId, channelId, clanId, options = {}) {
|
4234
4518
|
if (roleId === null || roleId === void 0) {
|
4235
|
-
throw new Error(
|
4519
|
+
throw new Error(
|
4520
|
+
"'roleId' is a required parameter but is null or undefined."
|
4521
|
+
);
|
4236
4522
|
}
|
4237
|
-
const urlPath = "/v2/roles/{roleId}".replace(
|
4523
|
+
const urlPath = "/v2/roles/{roleId}".replace(
|
4524
|
+
"{roleId}",
|
4525
|
+
encodeURIComponent(String(roleId))
|
4526
|
+
);
|
4238
4527
|
const queryParams = /* @__PURE__ */ new Map();
|
4239
4528
|
queryParams.set("channel_id", channelId);
|
4240
4529
|
queryParams.set("clan_id", clanId);
|
@@ -4262,12 +4551,19 @@ var MezonApi = class {
|
|
4262
4551
|
/** Update fields in a given role. */
|
4263
4552
|
updateRole(bearerToken, roleId, body, options = {}) {
|
4264
4553
|
if (roleId === null || roleId === void 0) {
|
4265
|
-
throw new Error(
|
4554
|
+
throw new Error(
|
4555
|
+
"'roleId' is a required parameter but is null or undefined."
|
4556
|
+
);
|
4266
4557
|
}
|
4267
4558
|
if (body === null || body === void 0) {
|
4268
|
-
throw new Error(
|
4559
|
+
throw new Error(
|
4560
|
+
"'body' is a required parameter but is null or undefined."
|
4561
|
+
);
|
4269
4562
|
}
|
4270
|
-
const urlPath = "/v2/roles/{roleId}".replace(
|
4563
|
+
const urlPath = "/v2/roles/{roleId}".replace(
|
4564
|
+
"{roleId}",
|
4565
|
+
encodeURIComponent(String(roleId))
|
4566
|
+
);
|
4271
4567
|
const queryParams = /* @__PURE__ */ new Map();
|
4272
4568
|
let bodyJson = "";
|
4273
4569
|
bodyJson = JSON.stringify(body || {});
|
@@ -4294,9 +4590,14 @@ var MezonApi = class {
|
|
4294
4590
|
/** List role permissions */
|
4295
4591
|
listRolePermissions(bearerToken, roleId, options = {}) {
|
4296
4592
|
if (roleId === null || roleId === void 0) {
|
4297
|
-
throw new Error(
|
4593
|
+
throw new Error(
|
4594
|
+
"'roleId' is a required parameter but is null or undefined."
|
4595
|
+
);
|
4298
4596
|
}
|
4299
|
-
const urlPath = "/v2/roles/{roleId}/permissions".replace(
|
4597
|
+
const urlPath = "/v2/roles/{roleId}/permissions".replace(
|
4598
|
+
"{roleId}",
|
4599
|
+
encodeURIComponent(String(roleId))
|
4600
|
+
);
|
4300
4601
|
const queryParams = /* @__PURE__ */ new Map();
|
4301
4602
|
let bodyJson = "";
|
4302
4603
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -4322,9 +4623,14 @@ var MezonApi = class {
|
|
4322
4623
|
/** List role permissions */
|
4323
4624
|
listRoleUsers(bearerToken, roleId, limit, cursor, options = {}) {
|
4324
4625
|
if (roleId === null || roleId === void 0) {
|
4325
|
-
throw new Error(
|
4626
|
+
throw new Error(
|
4627
|
+
"'roleId' is a required parameter but is null or undefined."
|
4628
|
+
);
|
4326
4629
|
}
|
4327
|
-
const urlPath = "/v2/roles/{roleId}/users".replace(
|
4630
|
+
const urlPath = "/v2/roles/{roleId}/users".replace(
|
4631
|
+
"{roleId}",
|
4632
|
+
encodeURIComponent(String(roleId))
|
4633
|
+
);
|
4328
4634
|
const queryParams = /* @__PURE__ */ new Map();
|
4329
4635
|
queryParams.set("limit", limit);
|
4330
4636
|
queryParams.set("cursor", cursor);
|
@@ -4352,9 +4658,14 @@ var MezonApi = class {
|
|
4352
4658
|
/** */
|
4353
4659
|
getRoleOfUserInTheClan(bearerToken, clanId, channelId, options = {}) {
|
4354
4660
|
if (clanId === null || clanId === void 0) {
|
4355
|
-
throw new Error(
|
4661
|
+
throw new Error(
|
4662
|
+
"'clanId' is a required parameter but is null or undefined."
|
4663
|
+
);
|
4356
4664
|
}
|
4357
|
-
const urlPath = "/v2/roleuserinclan/{clanId}".replace(
|
4665
|
+
const urlPath = "/v2/roleuserinclan/{clanId}".replace(
|
4666
|
+
"{clanId}",
|
4667
|
+
encodeURIComponent(String(clanId))
|
4668
|
+
);
|
4358
4669
|
const queryParams = /* @__PURE__ */ new Map();
|
4359
4670
|
queryParams.set("channel_id", channelId);
|
4360
4671
|
let bodyJson = "";
|
@@ -4383,7 +4694,10 @@ var MezonApi = class {
|
|
4383
4694
|
if (id === null || id === void 0) {
|
4384
4695
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
4385
4696
|
}
|
4386
|
-
const urlPath = "/v2/rpc/{id}".replace(
|
4697
|
+
const urlPath = "/v2/rpc/{id}".replace(
|
4698
|
+
"{id}",
|
4699
|
+
encodeURIComponent(String(id))
|
4700
|
+
);
|
4387
4701
|
const queryParams = /* @__PURE__ */ new Map();
|
4388
4702
|
queryParams.set("payload", payload);
|
4389
4703
|
queryParams.set("http_key", httpKey);
|
@@ -4417,9 +4731,14 @@ var MezonApi = class {
|
|
4417
4731
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
4418
4732
|
}
|
4419
4733
|
if (payload === null || payload === void 0) {
|
4420
|
-
throw new Error(
|
4734
|
+
throw new Error(
|
4735
|
+
"'payload' is a required parameter but is null or undefined."
|
4736
|
+
);
|
4421
4737
|
}
|
4422
|
-
const urlPath = "/v2/rpc/{id}".replace(
|
4738
|
+
const urlPath = "/v2/rpc/{id}".replace(
|
4739
|
+
"{id}",
|
4740
|
+
encodeURIComponent(String(id))
|
4741
|
+
);
|
4423
4742
|
const queryParams = /* @__PURE__ */ new Map();
|
4424
4743
|
queryParams.set("http_key", httpKey);
|
4425
4744
|
let bodyJson = "";
|
@@ -4450,7 +4769,9 @@ var MezonApi = class {
|
|
4450
4769
|
/** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */
|
4451
4770
|
sessionLogout(bearerToken, body, options = {}) {
|
4452
4771
|
if (body === null || body === void 0) {
|
4453
|
-
throw new Error(
|
4772
|
+
throw new Error(
|
4773
|
+
"'body' is a required parameter but is null or undefined."
|
4774
|
+
);
|
4454
4775
|
}
|
4455
4776
|
const urlPath = "/v2/session/logout";
|
4456
4777
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4479,7 +4800,9 @@ var MezonApi = class {
|
|
4479
4800
|
/** Add a new sticker */
|
4480
4801
|
addClanSticker(bearerToken, body, options = {}) {
|
4481
4802
|
if (body === null || body === void 0) {
|
4482
|
-
throw new Error(
|
4803
|
+
throw new Error(
|
4804
|
+
"'body' is a required parameter but is null or undefined."
|
4805
|
+
);
|
4483
4806
|
}
|
4484
4807
|
const urlPath = "/v2/sticker";
|
4485
4808
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4510,7 +4833,10 @@ var MezonApi = class {
|
|
4510
4833
|
if (id === null || id === void 0) {
|
4511
4834
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
4512
4835
|
}
|
4513
|
-
const urlPath = "/v2/sticker/{id}".replace(
|
4836
|
+
const urlPath = "/v2/sticker/{id}".replace(
|
4837
|
+
"{id}",
|
4838
|
+
encodeURIComponent(String(id))
|
4839
|
+
);
|
4514
4840
|
const queryParams = /* @__PURE__ */ new Map();
|
4515
4841
|
queryParams.set("clan_id", clanId);
|
4516
4842
|
let bodyJson = "";
|
@@ -4540,9 +4866,14 @@ var MezonApi = class {
|
|
4540
4866
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
4541
4867
|
}
|
4542
4868
|
if (body === null || body === void 0) {
|
4543
|
-
throw new Error(
|
4869
|
+
throw new Error(
|
4870
|
+
"'body' is a required parameter but is null or undefined."
|
4871
|
+
);
|
4544
4872
|
}
|
4545
|
-
const urlPath = "/v2/sticker/{id}".replace(
|
4873
|
+
const urlPath = "/v2/sticker/{id}".replace(
|
4874
|
+
"{id}",
|
4875
|
+
encodeURIComponent(String(id))
|
4876
|
+
);
|
4546
4877
|
const queryParams = /* @__PURE__ */ new Map();
|
4547
4878
|
let bodyJson = "";
|
4548
4879
|
bodyJson = JSON.stringify(body || {});
|
@@ -4620,7 +4951,9 @@ var MezonApi = class {
|
|
4620
4951
|
/** Register streaming in channel ( for bot - get streaming key) */
|
4621
4952
|
registerStreamingChannel(bearerToken, body, options = {}) {
|
4622
4953
|
if (body === null || body === void 0) {
|
4623
|
-
throw new Error(
|
4954
|
+
throw new Error(
|
4955
|
+
"'body' is a required parameter but is null or undefined."
|
4956
|
+
);
|
4624
4957
|
}
|
4625
4958
|
const urlPath = "/v2/streaming-channels";
|
4626
4959
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4705,7 +5038,9 @@ var MezonApi = class {
|
|
4705
5038
|
/** Create a system messages. */
|
4706
5039
|
createSystemMessage(bearerToken, body, options = {}) {
|
4707
5040
|
if (body === null || body === void 0) {
|
4708
|
-
throw new Error(
|
5041
|
+
throw new Error(
|
5042
|
+
"'body' is a required parameter but is null or undefined."
|
5043
|
+
);
|
4709
5044
|
}
|
4710
5045
|
const urlPath = "/v2/systemmessages";
|
4711
5046
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4734,9 +5069,14 @@ var MezonApi = class {
|
|
4734
5069
|
/** Delete a specific system messages. */
|
4735
5070
|
deleteSystemMessage(bearerToken, clanId, options = {}) {
|
4736
5071
|
if (clanId === null || clanId === void 0) {
|
4737
|
-
throw new Error(
|
5072
|
+
throw new Error(
|
5073
|
+
"'clanId' is a required parameter but is null or undefined."
|
5074
|
+
);
|
4738
5075
|
}
|
4739
|
-
const urlPath = "/v2/systemmessages/{clanId}".replace(
|
5076
|
+
const urlPath = "/v2/systemmessages/{clanId}".replace(
|
5077
|
+
"{clanId}",
|
5078
|
+
encodeURIComponent(String(clanId))
|
5079
|
+
);
|
4740
5080
|
const queryParams = /* @__PURE__ */ new Map();
|
4741
5081
|
let bodyJson = "";
|
4742
5082
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -4762,9 +5102,14 @@ var MezonApi = class {
|
|
4762
5102
|
/** Get details of a specific system messages. */
|
4763
5103
|
getSystemMessageByClanId(bearerToken, clanId, options = {}) {
|
4764
5104
|
if (clanId === null || clanId === void 0) {
|
4765
|
-
throw new Error(
|
5105
|
+
throw new Error(
|
5106
|
+
"'clanId' is a required parameter but is null or undefined."
|
5107
|
+
);
|
4766
5108
|
}
|
4767
|
-
const urlPath = "/v2/systemmessages/{clanId}".replace(
|
5109
|
+
const urlPath = "/v2/systemmessages/{clanId}".replace(
|
5110
|
+
"{clanId}",
|
5111
|
+
encodeURIComponent(String(clanId))
|
5112
|
+
);
|
4768
5113
|
const queryParams = /* @__PURE__ */ new Map();
|
4769
5114
|
let bodyJson = "";
|
4770
5115
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -4790,12 +5135,19 @@ var MezonApi = class {
|
|
4790
5135
|
/** Update a system messages. */
|
4791
5136
|
updateSystemMessage(bearerToken, clanId, body, options = {}) {
|
4792
5137
|
if (clanId === null || clanId === void 0) {
|
4793
|
-
throw new Error(
|
5138
|
+
throw new Error(
|
5139
|
+
"'clanId' is a required parameter but is null or undefined."
|
5140
|
+
);
|
4794
5141
|
}
|
4795
5142
|
if (body === null || body === void 0) {
|
4796
|
-
throw new Error(
|
5143
|
+
throw new Error(
|
5144
|
+
"'body' is a required parameter but is null or undefined."
|
5145
|
+
);
|
4797
5146
|
}
|
4798
|
-
const urlPath = "/v2/systemmessages/{clanId}".replace(
|
5147
|
+
const urlPath = "/v2/systemmessages/{clanId}".replace(
|
5148
|
+
"{clanId}",
|
5149
|
+
encodeURIComponent(String(clanId))
|
5150
|
+
);
|
4799
5151
|
const queryParams = /* @__PURE__ */ new Map();
|
4800
5152
|
let bodyJson = "";
|
4801
5153
|
bodyJson = JSON.stringify(body || {});
|
@@ -4822,12 +5174,19 @@ var MezonApi = class {
|
|
4822
5174
|
/** Update fields in a given category. */
|
4823
5175
|
updateCategory(bearerToken, clanId, body, options = {}) {
|
4824
5176
|
if (clanId === null || clanId === void 0) {
|
4825
|
-
throw new Error(
|
5177
|
+
throw new Error(
|
5178
|
+
"'clanId' is a required parameter but is null or undefined."
|
5179
|
+
);
|
4826
5180
|
}
|
4827
5181
|
if (body === null || body === void 0) {
|
4828
|
-
throw new Error(
|
5182
|
+
throw new Error(
|
5183
|
+
"'body' is a required parameter but is null or undefined."
|
5184
|
+
);
|
4829
5185
|
}
|
4830
|
-
const urlPath = "/v2/updatecategory/{clanId}".replace(
|
5186
|
+
const urlPath = "/v2/updatecategory/{clanId}".replace(
|
5187
|
+
"{clanId}",
|
5188
|
+
encodeURIComponent(String(clanId))
|
5189
|
+
);
|
4831
5190
|
const queryParams = /* @__PURE__ */ new Map();
|
4832
5191
|
let bodyJson = "";
|
4833
5192
|
bodyJson = JSON.stringify(body || {});
|
@@ -4854,7 +5213,9 @@ var MezonApi = class {
|
|
4854
5213
|
/** Update channel private. */
|
4855
5214
|
updateChannelPrivate(bearerToken, body, options = {}) {
|
4856
5215
|
if (body === null || body === void 0) {
|
4857
|
-
throw new Error(
|
5216
|
+
throw new Error(
|
5217
|
+
"'body' is a required parameter but is null or undefined."
|
5218
|
+
);
|
4858
5219
|
}
|
4859
5220
|
const urlPath = "/v2/updatechannelprivate";
|
4860
5221
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4883,12 +5244,19 @@ var MezonApi = class {
|
|
4883
5244
|
/** */
|
4884
5245
|
updateUserProfileByClan(bearerToken, clanId, body, options = {}) {
|
4885
5246
|
if (clanId === null || clanId === void 0) {
|
4886
|
-
throw new Error(
|
5247
|
+
throw new Error(
|
5248
|
+
"'clanId' is a required parameter but is null or undefined."
|
5249
|
+
);
|
4887
5250
|
}
|
4888
5251
|
if (body === null || body === void 0) {
|
4889
|
-
throw new Error(
|
5252
|
+
throw new Error(
|
5253
|
+
"'body' is a required parameter but is null or undefined."
|
5254
|
+
);
|
4890
5255
|
}
|
4891
|
-
const urlPath = "/v2/updateclanprofile/{clanId}".replace(
|
5256
|
+
const urlPath = "/v2/updateclanprofile/{clanId}".replace(
|
5257
|
+
"{clanId}",
|
5258
|
+
encodeURIComponent(String(clanId))
|
5259
|
+
);
|
4892
5260
|
const queryParams = /* @__PURE__ */ new Map();
|
4893
5261
|
let bodyJson = "";
|
4894
5262
|
bodyJson = JSON.stringify(body || {});
|
@@ -4915,7 +5283,9 @@ var MezonApi = class {
|
|
4915
5283
|
/** Upload attachment */
|
4916
5284
|
uploadAttachmentFile(bearerToken, body, options = {}) {
|
4917
5285
|
if (body === null || body === void 0) {
|
4918
|
-
throw new Error(
|
5286
|
+
throw new Error(
|
5287
|
+
"'body' is a required parameter but is null or undefined."
|
5288
|
+
);
|
4919
5289
|
}
|
4920
5290
|
const urlPath = "/v2/uploadattachmentfile";
|
4921
5291
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4972,7 +5342,9 @@ var MezonApi = class {
|
|
4972
5342
|
/** */
|
4973
5343
|
updateUser(bearerToken, body, options = {}) {
|
4974
5344
|
if (body === null || body === void 0) {
|
4975
|
-
throw new Error(
|
5345
|
+
throw new Error(
|
5346
|
+
"'body' is a required parameter but is null or undefined."
|
5347
|
+
);
|
4976
5348
|
}
|
4977
5349
|
const urlPath = "/v2/user/update";
|
4978
5350
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -5023,10 +5395,39 @@ var MezonApi = class {
|
|
5023
5395
|
)
|
5024
5396
|
]);
|
5025
5397
|
}
|
5398
|
+
/** ListUserPermissionInChannel */
|
5399
|
+
listUserPermissionInChannel(bearerToken, clanId, channelId, options = {}) {
|
5400
|
+
const urlPath = "/v2/users/clans/channels";
|
5401
|
+
const queryParams = /* @__PURE__ */ new Map();
|
5402
|
+
queryParams.set("clan_id", clanId);
|
5403
|
+
queryParams.set("channel_id", channelId);
|
5404
|
+
let bodyJson = "";
|
5405
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5406
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
5407
|
+
if (bearerToken) {
|
5408
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5409
|
+
}
|
5410
|
+
return Promise.race([
|
5411
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
5412
|
+
if (response.status == 204) {
|
5413
|
+
return response;
|
5414
|
+
} else if (response.status >= 200 && response.status < 300) {
|
5415
|
+
return response.json();
|
5416
|
+
} else {
|
5417
|
+
throw response;
|
5418
|
+
}
|
5419
|
+
}),
|
5420
|
+
new Promise(
|
5421
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5422
|
+
)
|
5423
|
+
]);
|
5424
|
+
}
|
5026
5425
|
/** create webhook */
|
5027
5426
|
generateWebhook(bearerToken, body, options = {}) {
|
5028
5427
|
if (body === null || body === void 0) {
|
5029
|
-
throw new Error(
|
5428
|
+
throw new Error(
|
5429
|
+
"'body' is a required parameter but is null or undefined."
|
5430
|
+
);
|
5030
5431
|
}
|
5031
5432
|
const urlPath = "/v2/webhooks/generate";
|
5032
5433
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -5058,9 +5459,14 @@ var MezonApi = class {
|
|
5058
5459
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
5059
5460
|
}
|
5060
5461
|
if (body === null || body === void 0) {
|
5061
|
-
throw new Error(
|
5462
|
+
throw new Error(
|
5463
|
+
"'body' is a required parameter but is null or undefined."
|
5464
|
+
);
|
5062
5465
|
}
|
5063
|
-
const urlPath = "/v2/webhooks/update/{id}".replace(
|
5466
|
+
const urlPath = "/v2/webhooks/update/{id}".replace(
|
5467
|
+
"{id}",
|
5468
|
+
encodeURIComponent(String(id))
|
5469
|
+
);
|
5064
5470
|
const queryParams = /* @__PURE__ */ new Map();
|
5065
5471
|
let bodyJson = "";
|
5066
5472
|
bodyJson = JSON.stringify(body || {});
|
@@ -5087,9 +5493,14 @@ var MezonApi = class {
|
|
5087
5493
|
/** list webhook belong to the channel */
|
5088
5494
|
listWebhookByChannelId(bearerToken, channelId, clanId, options = {}) {
|
5089
5495
|
if (channelId === null || channelId === void 0) {
|
5090
|
-
throw new Error(
|
5496
|
+
throw new Error(
|
5497
|
+
"'channelId' is a required parameter but is null or undefined."
|
5498
|
+
);
|
5091
5499
|
}
|
5092
|
-
const urlPath = "/v2/webhooks/{channelId}".replace(
|
5500
|
+
const urlPath = "/v2/webhooks/{channelId}".replace(
|
5501
|
+
"{channelId}",
|
5502
|
+
encodeURIComponent(String(channelId))
|
5503
|
+
);
|
5093
5504
|
const queryParams = /* @__PURE__ */ new Map();
|
5094
5505
|
queryParams.set("clan_id", clanId);
|
5095
5506
|
let bodyJson = "";
|
@@ -5118,7 +5529,10 @@ var MezonApi = class {
|
|
5118
5529
|
if (id === null || id === void 0) {
|
5119
5530
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
5120
5531
|
}
|
5121
|
-
const urlPath = "/v2/webhooks/{id}".replace(
|
5532
|
+
const urlPath = "/v2/webhooks/{id}".replace(
|
5533
|
+
"{id}",
|
5534
|
+
encodeURIComponent(String(id))
|
5535
|
+
);
|
5122
5536
|
const queryParams = /* @__PURE__ */ new Map();
|
5123
5537
|
let bodyJson = "";
|
5124
5538
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -8037,13 +8451,34 @@ var Client = class {
|
|
8037
8451
|
});
|
8038
8452
|
});
|
8039
8453
|
}
|
8040
|
-
|
8454
|
+
listUserPermissionInChannel(session, clanId, channelId) {
|
8041
8455
|
return __async(this, null, function* () {
|
8042
8456
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8043
8457
|
yield this.sessionRefresh(session);
|
8044
8458
|
}
|
8045
|
-
return this.apiClient.
|
8046
|
-
|
8459
|
+
return this.apiClient.listUserPermissionInChannel(session.token, clanId, channelId).then((response) => {
|
8460
|
+
var result = {
|
8461
|
+
clan_id: clanId,
|
8462
|
+
channel_id: channelId,
|
8463
|
+
permissions: response.permissions
|
8464
|
+
};
|
8465
|
+
return Promise.resolve(result);
|
8466
|
+
});
|
8467
|
+
});
|
8468
|
+
}
|
8469
|
+
getPermissionByRoleIdChannelId(session, roleId, channelId, userId) {
|
8470
|
+
return __async(this, null, function* () {
|
8471
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8472
|
+
yield this.sessionRefresh(session);
|
8473
|
+
}
|
8474
|
+
return this.apiClient.getPermissionByRoleIdChannelId(session.token, roleId, channelId, userId).then((response) => {
|
8475
|
+
var result = {
|
8476
|
+
role_id: roleId,
|
8477
|
+
channel_id: channelId,
|
8478
|
+
permission_role_channel: response.permission_role_channel,
|
8479
|
+
user_id: userId
|
8480
|
+
};
|
8481
|
+
return Promise.resolve(result);
|
8047
8482
|
});
|
8048
8483
|
});
|
8049
8484
|
}
|