mezon-js 2.9.96 → 2.9.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.gen.ts +699 -638
- package/client.ts +6 -37
- package/dist/api.gen.d.ts +4 -9
- package/dist/client.d.ts +1 -3
- package/dist/mezon-js.cjs.js +142 -123
- package/dist/mezon-js.esm.mjs +142 -123
- package/package.json +1 -1
- package/utils.ts +3 -3
package/dist/mezon-js.esm.mjs
CHANGED
@@ -686,10 +686,6 @@ function safeJSONParse(jsonString) {
|
|
686
686
|
switch (match) {
|
687
687
|
case '\\"':
|
688
688
|
return '"';
|
689
|
-
case "\\n":
|
690
|
-
return "\n";
|
691
|
-
case "\\t":
|
692
|
-
return " ";
|
693
689
|
default:
|
694
690
|
return match[1];
|
695
691
|
}
|
@@ -697,7 +693,7 @@ function safeJSONParse(jsonString) {
|
|
697
693
|
const parsedData = JSON.parse(unescapedJSON);
|
698
694
|
return parsedData;
|
699
695
|
} catch (error) {
|
700
|
-
console.error("Error parsing JSON:", error);
|
696
|
+
console.error("Error parsing JSON:", jsonString, error);
|
701
697
|
return null;
|
702
698
|
}
|
703
699
|
}
|
@@ -851,7 +847,9 @@ var MezonApi = class {
|
|
851
847
|
/** */
|
852
848
|
checkLoginRequest(basicAuthUsername, basicAuthPassword, body, options = {}) {
|
853
849
|
if (body === null || body === void 0) {
|
854
|
-
throw new Error(
|
850
|
+
throw new Error(
|
851
|
+
"'body' is a required parameter but is null or undefined."
|
852
|
+
);
|
855
853
|
}
|
856
854
|
const urlPath = "/v2/account/authenticate/checklogin";
|
857
855
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -880,7 +878,9 @@ var MezonApi = class {
|
|
880
878
|
/** */
|
881
879
|
confirmLogin(bearerToken, body, options = {}) {
|
882
880
|
if (body === null || body === void 0) {
|
883
|
-
throw new Error(
|
881
|
+
throw new Error(
|
882
|
+
"'body' is a required parameter but is null or undefined."
|
883
|
+
);
|
884
884
|
}
|
885
885
|
const urlPath = "/v2/account/authenticate/confirmlogin";
|
886
886
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -909,7 +909,9 @@ var MezonApi = class {
|
|
909
909
|
/** */
|
910
910
|
createQRLogin(basicAuthUsername, basicAuthPassword, body, options = {}) {
|
911
911
|
if (body === null || body === void 0) {
|
912
|
-
throw new Error(
|
912
|
+
throw new Error(
|
913
|
+
"'body' is a required parameter but is null or undefined."
|
914
|
+
);
|
913
915
|
}
|
914
916
|
const urlPath = "/v2/account/authenticate/createqrlogin";
|
915
917
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1849,7 +1851,9 @@ var MezonApi = class {
|
|
1849
1851
|
/** Create user activity */
|
1850
1852
|
createActiviy(bearerToken, body, options = {}) {
|
1851
1853
|
if (body === null || body === void 0) {
|
1852
|
-
throw new Error(
|
1854
|
+
throw new Error(
|
1855
|
+
"'body' is a required parameter but is null or undefined."
|
1856
|
+
);
|
1853
1857
|
}
|
1854
1858
|
const urlPath = "/v2/activity";
|
1855
1859
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2258,9 +2262,14 @@ var MezonApi = class {
|
|
2258
2262
|
/** */
|
2259
2263
|
getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
|
2260
2264
|
if (channelId === null || channelId === void 0) {
|
2261
|
-
throw new Error(
|
2265
|
+
throw new Error(
|
2266
|
+
"'channelId' is a required parameter but is null or undefined."
|
2267
|
+
);
|
2262
2268
|
}
|
2263
|
-
const urlPath = "/v2/channel-canvases/{channelId}".replace(
|
2269
|
+
const urlPath = "/v2/channel-canvases/{channelId}".replace(
|
2270
|
+
"{channelId}",
|
2271
|
+
encodeURIComponent(String(channelId))
|
2272
|
+
);
|
2264
2273
|
const queryParams = /* @__PURE__ */ new Map();
|
2265
2274
|
queryParams.set("clan_id", clanId);
|
2266
2275
|
queryParams.set("limit", limit);
|
@@ -2289,7 +2298,9 @@ var MezonApi = class {
|
|
2289
2298
|
/** */
|
2290
2299
|
addChannelFavorite(bearerToken, body, options = {}) {
|
2291
2300
|
if (body === null || body === void 0) {
|
2292
|
-
throw new Error(
|
2301
|
+
throw new Error(
|
2302
|
+
"'body' is a required parameter but is null or undefined."
|
2303
|
+
);
|
2293
2304
|
}
|
2294
2305
|
const urlPath = "/v2/channel/favorite";
|
2295
2306
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2318,9 +2329,14 @@ var MezonApi = class {
|
|
2318
2329
|
/** */
|
2319
2330
|
removeChannelFavorite(bearerToken, channelId, options = {}) {
|
2320
2331
|
if (channelId === null || channelId === void 0) {
|
2321
|
-
throw new Error(
|
2332
|
+
throw new Error(
|
2333
|
+
"'channelId' is a required parameter but is null or undefined."
|
2334
|
+
);
|
2322
2335
|
}
|
2323
|
-
const urlPath = "/v2/channel/favorite/{channelId}".replace(
|
2336
|
+
const urlPath = "/v2/channel/favorite/{channelId}".replace(
|
2337
|
+
"{channelId}",
|
2338
|
+
encodeURIComponent(String(channelId))
|
2339
|
+
);
|
2324
2340
|
const queryParams = /* @__PURE__ */ new Map();
|
2325
2341
|
let bodyJson = "";
|
2326
2342
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2346,9 +2362,14 @@ var MezonApi = class {
|
|
2346
2362
|
/** */
|
2347
2363
|
getListFavoriteChannel(bearerToken, clanId, options = {}) {
|
2348
2364
|
if (clanId === null || clanId === void 0) {
|
2349
|
-
throw new Error(
|
2365
|
+
throw new Error(
|
2366
|
+
"'clanId' is a required parameter but is null or undefined."
|
2367
|
+
);
|
2350
2368
|
}
|
2351
|
-
const urlPath = "/v2/channel/favorite/{clanId}".replace(
|
2369
|
+
const urlPath = "/v2/channel/favorite/{clanId}".replace(
|
2370
|
+
"{clanId}",
|
2371
|
+
encodeURIComponent(String(clanId))
|
2372
|
+
);
|
2352
2373
|
const queryParams = /* @__PURE__ */ new Map();
|
2353
2374
|
let bodyJson = "";
|
2354
2375
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2483,9 +2504,14 @@ var MezonApi = class {
|
|
2483
2504
|
/** get channel encryption method */
|
2484
2505
|
getChanEncryptionMethod(bearerToken, channelId, method, options = {}) {
|
2485
2506
|
if (channelId === null || channelId === void 0) {
|
2486
|
-
throw new Error(
|
2507
|
+
throw new Error(
|
2508
|
+
"'channelId' is a required parameter but is null or undefined."
|
2509
|
+
);
|
2487
2510
|
}
|
2488
|
-
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
|
2511
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
|
2512
|
+
"{channelId}",
|
2513
|
+
encodeURIComponent(String(channelId))
|
2514
|
+
);
|
2489
2515
|
const queryParams = /* @__PURE__ */ new Map();
|
2490
2516
|
queryParams.set("method", method);
|
2491
2517
|
let bodyJson = "";
|
@@ -2512,12 +2538,19 @@ var MezonApi = class {
|
|
2512
2538
|
/** store channel encryption method */
|
2513
2539
|
setChanEncryptionMethod(bearerToken, channelId, body, options = {}) {
|
2514
2540
|
if (channelId === null || channelId === void 0) {
|
2515
|
-
throw new Error(
|
2541
|
+
throw new Error(
|
2542
|
+
"'channelId' is a required parameter but is null or undefined."
|
2543
|
+
);
|
2516
2544
|
}
|
2517
2545
|
if (body === null || body === void 0) {
|
2518
|
-
throw new Error(
|
2546
|
+
throw new Error(
|
2547
|
+
"'body' is a required parameter but is null or undefined."
|
2548
|
+
);
|
2519
2549
|
}
|
2520
|
-
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
|
2550
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
|
2551
|
+
"{channelId}",
|
2552
|
+
encodeURIComponent(String(channelId))
|
2553
|
+
);
|
2521
2554
|
const queryParams = /* @__PURE__ */ new Map();
|
2522
2555
|
let bodyJson = "";
|
2523
2556
|
bodyJson = JSON.stringify(body || {});
|
@@ -2809,9 +2842,14 @@ var MezonApi = class {
|
|
2809
2842
|
/** List channel setting */
|
2810
2843
|
listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channelLabel, options = {}) {
|
2811
2844
|
if (clanId === null || clanId === void 0) {
|
2812
|
-
throw new Error(
|
2845
|
+
throw new Error(
|
2846
|
+
"'clanId' is a required parameter but is null or undefined."
|
2847
|
+
);
|
2813
2848
|
}
|
2814
|
-
const urlPath = "/v2/channelsetting/{clanId}".replace(
|
2849
|
+
const urlPath = "/v2/channelsetting/{clanId}".replace(
|
2850
|
+
"{clanId}",
|
2851
|
+
encodeURIComponent(String(clanId))
|
2852
|
+
);
|
2815
2853
|
const queryParams = /* @__PURE__ */ new Map();
|
2816
2854
|
queryParams.set("parent_id", parentId);
|
2817
2855
|
queryParams.set("category_id", categoryId);
|
@@ -3209,60 +3247,6 @@ var MezonApi = class {
|
|
3209
3247
|
]);
|
3210
3248
|
}
|
3211
3249
|
/** */
|
3212
|
-
getCustomDisplay(bearerToken, options = {}) {
|
3213
|
-
const urlPath = "/v2/customdisplay";
|
3214
|
-
const queryParams = /* @__PURE__ */ new Map();
|
3215
|
-
let bodyJson = "";
|
3216
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3217
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
3218
|
-
if (bearerToken) {
|
3219
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3220
|
-
}
|
3221
|
-
return Promise.race([
|
3222
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
3223
|
-
if (response.status == 204) {
|
3224
|
-
return response;
|
3225
|
-
} else if (response.status >= 200 && response.status < 300) {
|
3226
|
-
return response.json();
|
3227
|
-
} else {
|
3228
|
-
throw response;
|
3229
|
-
}
|
3230
|
-
}),
|
3231
|
-
new Promise(
|
3232
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3233
|
-
)
|
3234
|
-
]);
|
3235
|
-
}
|
3236
|
-
/** */
|
3237
|
-
updateCustomDisplay(bearerToken, body, options = {}) {
|
3238
|
-
if (body === null || body === void 0) {
|
3239
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
3240
|
-
}
|
3241
|
-
const urlPath = "/v2/customdisplay";
|
3242
|
-
const queryParams = /* @__PURE__ */ new Map();
|
3243
|
-
let bodyJson = "";
|
3244
|
-
bodyJson = JSON.stringify(body || {});
|
3245
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3246
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
3247
|
-
if (bearerToken) {
|
3248
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3249
|
-
}
|
3250
|
-
return Promise.race([
|
3251
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
3252
|
-
if (response.status == 204) {
|
3253
|
-
return response;
|
3254
|
-
} else if (response.status >= 200 && response.status < 300) {
|
3255
|
-
return response.json();
|
3256
|
-
} else {
|
3257
|
-
throw response;
|
3258
|
-
}
|
3259
|
-
}),
|
3260
|
-
new Promise(
|
3261
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3262
|
-
)
|
3263
|
-
]);
|
3264
|
-
}
|
3265
|
-
/** */
|
3266
3250
|
deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
|
3267
3251
|
if (categoryId === null || categoryId === void 0) {
|
3268
3252
|
throw new Error(
|
@@ -4313,7 +4297,9 @@ var MezonApi = class {
|
|
4313
4297
|
/** Mark as read */
|
4314
4298
|
markAsRead(bearerToken, body, options = {}) {
|
4315
4299
|
if (body === null || body === void 0) {
|
4316
|
-
throw new Error(
|
4300
|
+
throw new Error(
|
4301
|
+
"'body' is a required parameter but is null or undefined."
|
4302
|
+
);
|
4317
4303
|
}
|
4318
4304
|
const urlPath = "/v2/markasread";
|
4319
4305
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4829,7 +4815,9 @@ var MezonApi = class {
|
|
4829
4815
|
/** set notification user channel. */
|
4830
4816
|
createPinMessage(bearerToken, body, options = {}) {
|
4831
4817
|
if (body === null || body === void 0) {
|
4832
|
-
throw new Error(
|
4818
|
+
throw new Error(
|
4819
|
+
"'body' is a required parameter but is null or undefined."
|
4820
|
+
);
|
4833
4821
|
}
|
4834
4822
|
const urlPath = "/v2/pinmessage/set";
|
4835
4823
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4915,7 +4903,9 @@ var MezonApi = class {
|
|
4915
4903
|
/** store pubkey for e2ee */
|
4916
4904
|
pushPubKey(bearerToken, body, options = {}) {
|
4917
4905
|
if (body === null || body === void 0) {
|
4918
|
-
throw new Error(
|
4906
|
+
throw new Error(
|
4907
|
+
"'body' is a required parameter but is null or undefined."
|
4908
|
+
);
|
4919
4909
|
}
|
4920
4910
|
const urlPath = "/v2/pubkey/push";
|
4921
4911
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -5397,7 +5387,9 @@ var MezonApi = class {
|
|
5397
5387
|
/** UpdateWallets */
|
5398
5388
|
sendToken(bearerToken, body, options = {}) {
|
5399
5389
|
if (body === null || body === void 0) {
|
5400
|
-
throw new Error(
|
5390
|
+
throw new Error(
|
5391
|
+
"'body' is a required parameter but is null or undefined."
|
5392
|
+
);
|
5401
5393
|
}
|
5402
5394
|
const urlPath = "/v2/sendtoken";
|
5403
5395
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -5831,9 +5823,14 @@ var MezonApi = class {
|
|
5831
5823
|
/** List user channels */
|
5832
5824
|
listThreadDescs(bearerToken, channelId, limit, state, clanId, threadId, options = {}) {
|
5833
5825
|
if (channelId === null || channelId === void 0) {
|
5834
|
-
throw new Error(
|
5826
|
+
throw new Error(
|
5827
|
+
"'channelId' is a required parameter but is null or undefined."
|
5828
|
+
);
|
5835
5829
|
}
|
5836
|
-
const urlPath = "/v2/thread/{channelId}".replace(
|
5830
|
+
const urlPath = "/v2/thread/{channelId}".replace(
|
5831
|
+
"{channelId}",
|
5832
|
+
encodeURIComponent(String(channelId))
|
5833
|
+
);
|
5837
5834
|
const queryParams = /* @__PURE__ */ new Map();
|
5838
5835
|
queryParams.set("limit", limit);
|
5839
5836
|
queryParams.set("state", state);
|
@@ -6139,7 +6136,9 @@ var MezonApi = class {
|
|
6139
6136
|
/** Update user status */
|
6140
6137
|
updateUserStatus(bearerToken, body, options = {}) {
|
6141
6138
|
if (body === null || body === void 0) {
|
6142
|
-
throw new Error(
|
6139
|
+
throw new Error(
|
6140
|
+
"'body' is a required parameter but is null or undefined."
|
6141
|
+
);
|
6143
6142
|
}
|
6144
6143
|
const urlPath = "/v2/userstatus";
|
6145
6144
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -6301,9 +6300,14 @@ var MezonApi = class {
|
|
6301
6300
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6302
6301
|
}
|
6303
6302
|
if (body === null || body === void 0) {
|
6304
|
-
throw new Error(
|
6303
|
+
throw new Error(
|
6304
|
+
"'body' is a required parameter but is null or undefined."
|
6305
|
+
);
|
6305
6306
|
}
|
6306
|
-
const urlPath = "/v2/webhooks/{id}".replace(
|
6307
|
+
const urlPath = "/v2/webhooks/{id}".replace(
|
6308
|
+
"{id}",
|
6309
|
+
encodeURIComponent(String(id))
|
6310
|
+
);
|
6307
6311
|
const queryParams = /* @__PURE__ */ new Map();
|
6308
6312
|
let bodyJson = "";
|
6309
6313
|
bodyJson = JSON.stringify(body || {});
|
@@ -6376,7 +6380,9 @@ var MezonApi = class {
|
|
6376
6380
|
/** WithdrawToken */
|
6377
6381
|
withdrawToken(bearerToken, body, options = {}) {
|
6378
6382
|
if (body === null || body === void 0) {
|
6379
|
-
throw new Error(
|
6383
|
+
throw new Error(
|
6384
|
+
"'body' is a required parameter but is null or undefined."
|
6385
|
+
);
|
6380
6386
|
}
|
6381
6387
|
const urlPath = "/v2/withdrawtoken";
|
6382
6388
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -6502,7 +6508,9 @@ var MezonApi = class {
|
|
6502
6508
|
/** create onboarding. */
|
6503
6509
|
createOnboarding(bearerToken, body, options = {}) {
|
6504
6510
|
if (body === null || body === void 0) {
|
6505
|
-
throw new Error(
|
6511
|
+
throw new Error(
|
6512
|
+
"'body' is a required parameter but is null or undefined."
|
6513
|
+
);
|
6506
6514
|
}
|
6507
6515
|
const urlPath = "/v2/onboarding";
|
6508
6516
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -6533,7 +6541,10 @@ var MezonApi = class {
|
|
6533
6541
|
if (id === null || id === void 0) {
|
6534
6542
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6535
6543
|
}
|
6536
|
-
const urlPath = "/v2/onboarding/{id}".replace(
|
6544
|
+
const urlPath = "/v2/onboarding/{id}".replace(
|
6545
|
+
"{id}",
|
6546
|
+
encodeURIComponent(String(id))
|
6547
|
+
);
|
6537
6548
|
const queryParams = /* @__PURE__ */ new Map();
|
6538
6549
|
queryParams.set("clan_id", clanId);
|
6539
6550
|
let bodyJson = "";
|
@@ -6562,7 +6573,10 @@ var MezonApi = class {
|
|
6562
6573
|
if (id === null || id === void 0) {
|
6563
6574
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6564
6575
|
}
|
6565
|
-
const urlPath = "/v2/onboarding/{id}".replace(
|
6576
|
+
const urlPath = "/v2/onboarding/{id}".replace(
|
6577
|
+
"{id}",
|
6578
|
+
encodeURIComponent(String(id))
|
6579
|
+
);
|
6566
6580
|
const queryParams = /* @__PURE__ */ new Map();
|
6567
6581
|
queryParams.set("clan_id", clanId);
|
6568
6582
|
let bodyJson = "";
|
@@ -6592,9 +6606,14 @@ var MezonApi = class {
|
|
6592
6606
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6593
6607
|
}
|
6594
6608
|
if (body === null || body === void 0) {
|
6595
|
-
throw new Error(
|
6609
|
+
throw new Error(
|
6610
|
+
"'body' is a required parameter but is null or undefined."
|
6611
|
+
);
|
6596
6612
|
}
|
6597
|
-
const urlPath = "/v2/onboarding/{id}".replace(
|
6613
|
+
const urlPath = "/v2/onboarding/{id}".replace(
|
6614
|
+
"{id}",
|
6615
|
+
encodeURIComponent(String(id))
|
6616
|
+
);
|
6598
6617
|
const queryParams = /* @__PURE__ */ new Map();
|
6599
6618
|
let bodyJson = "";
|
6600
6619
|
bodyJson = JSON.stringify(body || {});
|
@@ -6621,7 +6640,9 @@ var MezonApi = class {
|
|
6621
6640
|
/** Generate clan webhook. */
|
6622
6641
|
generateClanWebhook(bearerToken, body, options = {}) {
|
6623
6642
|
if (body === null || body === void 0) {
|
6624
|
-
throw new Error(
|
6643
|
+
throw new Error(
|
6644
|
+
"'body' is a required parameter but is null or undefined."
|
6645
|
+
);
|
6625
6646
|
}
|
6626
6647
|
const urlPath = "/v2/clanwebhooks";
|
6627
6648
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -6650,9 +6671,14 @@ var MezonApi = class {
|
|
6650
6671
|
/** List clan webhook. */
|
6651
6672
|
listClanWebhook(bearerToken, clanId, options = {}) {
|
6652
6673
|
if (clanId === null || clanId === void 0) {
|
6653
|
-
throw new Error(
|
6674
|
+
throw new Error(
|
6675
|
+
"'clanId' is a required parameter but is null or undefined."
|
6676
|
+
);
|
6654
6677
|
}
|
6655
|
-
const urlPath = "/v2/clanwebhooks/{clanId}".replace(
|
6678
|
+
const urlPath = "/v2/clanwebhooks/{clanId}".replace(
|
6679
|
+
"{clanId}",
|
6680
|
+
encodeURIComponent(String(clanId))
|
6681
|
+
);
|
6656
6682
|
const queryParams = /* @__PURE__ */ new Map();
|
6657
6683
|
let bodyJson = "";
|
6658
6684
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -6680,7 +6706,10 @@ var MezonApi = class {
|
|
6680
6706
|
if (id === null || id === void 0) {
|
6681
6707
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6682
6708
|
}
|
6683
|
-
const urlPath = "/v2/clanwebhooks/{id}".replace(
|
6709
|
+
const urlPath = "/v2/clanwebhooks/{id}".replace(
|
6710
|
+
"{id}",
|
6711
|
+
encodeURIComponent(String(id))
|
6712
|
+
);
|
6684
6713
|
const queryParams = /* @__PURE__ */ new Map();
|
6685
6714
|
queryParams.set("clan_id", clanId);
|
6686
6715
|
let bodyJson = "";
|
@@ -6710,9 +6739,14 @@ var MezonApi = class {
|
|
6710
6739
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6711
6740
|
}
|
6712
6741
|
if (body === null || body === void 0) {
|
6713
|
-
throw new Error(
|
6742
|
+
throw new Error(
|
6743
|
+
"'body' is a required parameter but is null or undefined."
|
6744
|
+
);
|
6714
6745
|
}
|
6715
|
-
const urlPath = "/v2/clanwebhooks/{id}".replace(
|
6746
|
+
const urlPath = "/v2/clanwebhooks/{id}".replace(
|
6747
|
+
"{id}",
|
6748
|
+
encodeURIComponent(String(id))
|
6749
|
+
);
|
6716
6750
|
const queryParams = /* @__PURE__ */ new Map();
|
6717
6751
|
let bodyJson = "";
|
6718
6752
|
bodyJson = JSON.stringify(body || {});
|
@@ -6767,12 +6801,19 @@ var MezonApi = class {
|
|
6767
6801
|
/** Update onboarding step. */
|
6768
6802
|
updateOnboardingStepByClanId(bearerToken, clanId, body, options = {}) {
|
6769
6803
|
if (clanId === null || clanId === void 0) {
|
6770
|
-
throw new Error(
|
6804
|
+
throw new Error(
|
6805
|
+
"'clanId' is a required parameter but is null or undefined."
|
6806
|
+
);
|
6771
6807
|
}
|
6772
6808
|
if (body === null || body === void 0) {
|
6773
|
-
throw new Error(
|
6809
|
+
throw new Error(
|
6810
|
+
"'body' is a required parameter but is null or undefined."
|
6811
|
+
);
|
6774
6812
|
}
|
6775
|
-
const urlPath = "/v2/onboardingsteps/{clanId}".replace(
|
6813
|
+
const urlPath = "/v2/onboardingsteps/{clanId}".replace(
|
6814
|
+
"{clanId}",
|
6815
|
+
encodeURIComponent(String(clanId))
|
6816
|
+
);
|
6776
6817
|
const queryParams = /* @__PURE__ */ new Map();
|
6777
6818
|
let bodyJson = "";
|
6778
6819
|
bodyJson = JSON.stringify(body || {});
|
@@ -10414,28 +10455,6 @@ var Client = class {
|
|
10414
10455
|
});
|
10415
10456
|
});
|
10416
10457
|
}
|
10417
|
-
//**get custom display */
|
10418
|
-
getCustomDisplay(session) {
|
10419
|
-
return __async(this, null, function* () {
|
10420
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10421
|
-
yield this.sessionRefresh(session);
|
10422
|
-
}
|
10423
|
-
return this.apiClient.getCustomDisplay(session.token).then((response) => {
|
10424
|
-
return Promise.resolve(response);
|
10425
|
-
});
|
10426
|
-
});
|
10427
|
-
}
|
10428
|
-
//**update custom display */
|
10429
|
-
updateCustomDisplay(session, request) {
|
10430
|
-
return __async(this, null, function* () {
|
10431
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10432
|
-
yield this.sessionRefresh(session);
|
10433
|
-
}
|
10434
|
-
return this.apiClient.updateCustomDisplay(session.token, request).then((response) => {
|
10435
|
-
return response !== void 0;
|
10436
|
-
});
|
10437
|
-
});
|
10438
|
-
}
|
10439
10458
|
//**list wallet ledger */
|
10440
10459
|
listWalletLedger(session, limit, cursor, transactionId) {
|
10441
10460
|
return __async(this, null, function* () {
|
package/package.json
CHANGED
package/utils.ts
CHANGED
@@ -54,8 +54,8 @@ export function safeJSONParse(jsonString: string) {
|
|
54
54
|
const unescapedJSON = jsonString.replace(/\\./g, (match) => {
|
55
55
|
switch (match) {
|
56
56
|
case '\\"': return '"';
|
57
|
-
case '\\n': return '\n';
|
58
|
-
case '\\t': return '\t';
|
57
|
+
//case '\\n': return '\n';
|
58
|
+
//case '\\t': return '\t';
|
59
59
|
// Add more escape sequences as needed
|
60
60
|
default: return match[1]; // Remove the backslash
|
61
61
|
}
|
@@ -66,7 +66,7 @@ export function safeJSONParse(jsonString: string) {
|
|
66
66
|
|
67
67
|
return parsedData;
|
68
68
|
} catch (error) {
|
69
|
-
console.error('Error parsing JSON:', error);
|
69
|
+
console.error('Error parsing JSON:', jsonString, error);
|
70
70
|
return null; // Handle the error gracefully or throw an exception if necessary
|
71
71
|
}
|
72
72
|
}
|