mezon-js 2.9.96 → 2.9.97
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 -119
- package/dist/mezon-js.esm.mjs +142 -119
- package/package.json +1 -1
- package/utils.ts +1 -1
package/dist/mezon-js.esm.mjs
CHANGED
@@ -697,7 +697,7 @@ function safeJSONParse(jsonString) {
|
|
697
697
|
const parsedData = JSON.parse(unescapedJSON);
|
698
698
|
return parsedData;
|
699
699
|
} catch (error) {
|
700
|
-
console.error("Error parsing JSON:", error);
|
700
|
+
console.error("Error parsing JSON:", jsonString, error);
|
701
701
|
return null;
|
702
702
|
}
|
703
703
|
}
|
@@ -851,7 +851,9 @@ var MezonApi = class {
|
|
851
851
|
/** */
|
852
852
|
checkLoginRequest(basicAuthUsername, basicAuthPassword, body, options = {}) {
|
853
853
|
if (body === null || body === void 0) {
|
854
|
-
throw new Error(
|
854
|
+
throw new Error(
|
855
|
+
"'body' is a required parameter but is null or undefined."
|
856
|
+
);
|
855
857
|
}
|
856
858
|
const urlPath = "/v2/account/authenticate/checklogin";
|
857
859
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -880,7 +882,9 @@ var MezonApi = class {
|
|
880
882
|
/** */
|
881
883
|
confirmLogin(bearerToken, body, options = {}) {
|
882
884
|
if (body === null || body === void 0) {
|
883
|
-
throw new Error(
|
885
|
+
throw new Error(
|
886
|
+
"'body' is a required parameter but is null or undefined."
|
887
|
+
);
|
884
888
|
}
|
885
889
|
const urlPath = "/v2/account/authenticate/confirmlogin";
|
886
890
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -909,7 +913,9 @@ var MezonApi = class {
|
|
909
913
|
/** */
|
910
914
|
createQRLogin(basicAuthUsername, basicAuthPassword, body, options = {}) {
|
911
915
|
if (body === null || body === void 0) {
|
912
|
-
throw new Error(
|
916
|
+
throw new Error(
|
917
|
+
"'body' is a required parameter but is null or undefined."
|
918
|
+
);
|
913
919
|
}
|
914
920
|
const urlPath = "/v2/account/authenticate/createqrlogin";
|
915
921
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -1849,7 +1855,9 @@ var MezonApi = class {
|
|
1849
1855
|
/** Create user activity */
|
1850
1856
|
createActiviy(bearerToken, body, options = {}) {
|
1851
1857
|
if (body === null || body === void 0) {
|
1852
|
-
throw new Error(
|
1858
|
+
throw new Error(
|
1859
|
+
"'body' is a required parameter but is null or undefined."
|
1860
|
+
);
|
1853
1861
|
}
|
1854
1862
|
const urlPath = "/v2/activity";
|
1855
1863
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2258,9 +2266,14 @@ var MezonApi = class {
|
|
2258
2266
|
/** */
|
2259
2267
|
getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
|
2260
2268
|
if (channelId === null || channelId === void 0) {
|
2261
|
-
throw new Error(
|
2269
|
+
throw new Error(
|
2270
|
+
"'channelId' is a required parameter but is null or undefined."
|
2271
|
+
);
|
2262
2272
|
}
|
2263
|
-
const urlPath = "/v2/channel-canvases/{channelId}".replace(
|
2273
|
+
const urlPath = "/v2/channel-canvases/{channelId}".replace(
|
2274
|
+
"{channelId}",
|
2275
|
+
encodeURIComponent(String(channelId))
|
2276
|
+
);
|
2264
2277
|
const queryParams = /* @__PURE__ */ new Map();
|
2265
2278
|
queryParams.set("clan_id", clanId);
|
2266
2279
|
queryParams.set("limit", limit);
|
@@ -2289,7 +2302,9 @@ var MezonApi = class {
|
|
2289
2302
|
/** */
|
2290
2303
|
addChannelFavorite(bearerToken, body, options = {}) {
|
2291
2304
|
if (body === null || body === void 0) {
|
2292
|
-
throw new Error(
|
2305
|
+
throw new Error(
|
2306
|
+
"'body' is a required parameter but is null or undefined."
|
2307
|
+
);
|
2293
2308
|
}
|
2294
2309
|
const urlPath = "/v2/channel/favorite";
|
2295
2310
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -2318,9 +2333,14 @@ var MezonApi = class {
|
|
2318
2333
|
/** */
|
2319
2334
|
removeChannelFavorite(bearerToken, channelId, options = {}) {
|
2320
2335
|
if (channelId === null || channelId === void 0) {
|
2321
|
-
throw new Error(
|
2336
|
+
throw new Error(
|
2337
|
+
"'channelId' is a required parameter but is null or undefined."
|
2338
|
+
);
|
2322
2339
|
}
|
2323
|
-
const urlPath = "/v2/channel/favorite/{channelId}".replace(
|
2340
|
+
const urlPath = "/v2/channel/favorite/{channelId}".replace(
|
2341
|
+
"{channelId}",
|
2342
|
+
encodeURIComponent(String(channelId))
|
2343
|
+
);
|
2324
2344
|
const queryParams = /* @__PURE__ */ new Map();
|
2325
2345
|
let bodyJson = "";
|
2326
2346
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2346,9 +2366,14 @@ var MezonApi = class {
|
|
2346
2366
|
/** */
|
2347
2367
|
getListFavoriteChannel(bearerToken, clanId, options = {}) {
|
2348
2368
|
if (clanId === null || clanId === void 0) {
|
2349
|
-
throw new Error(
|
2369
|
+
throw new Error(
|
2370
|
+
"'clanId' is a required parameter but is null or undefined."
|
2371
|
+
);
|
2350
2372
|
}
|
2351
|
-
const urlPath = "/v2/channel/favorite/{clanId}".replace(
|
2373
|
+
const urlPath = "/v2/channel/favorite/{clanId}".replace(
|
2374
|
+
"{clanId}",
|
2375
|
+
encodeURIComponent(String(clanId))
|
2376
|
+
);
|
2352
2377
|
const queryParams = /* @__PURE__ */ new Map();
|
2353
2378
|
let bodyJson = "";
|
2354
2379
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -2483,9 +2508,14 @@ var MezonApi = class {
|
|
2483
2508
|
/** get channel encryption method */
|
2484
2509
|
getChanEncryptionMethod(bearerToken, channelId, method, options = {}) {
|
2485
2510
|
if (channelId === null || channelId === void 0) {
|
2486
|
-
throw new Error(
|
2511
|
+
throw new Error(
|
2512
|
+
"'channelId' is a required parameter but is null or undefined."
|
2513
|
+
);
|
2487
2514
|
}
|
2488
|
-
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
|
2515
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
|
2516
|
+
"{channelId}",
|
2517
|
+
encodeURIComponent(String(channelId))
|
2518
|
+
);
|
2489
2519
|
const queryParams = /* @__PURE__ */ new Map();
|
2490
2520
|
queryParams.set("method", method);
|
2491
2521
|
let bodyJson = "";
|
@@ -2512,12 +2542,19 @@ var MezonApi = class {
|
|
2512
2542
|
/** store channel encryption method */
|
2513
2543
|
setChanEncryptionMethod(bearerToken, channelId, body, options = {}) {
|
2514
2544
|
if (channelId === null || channelId === void 0) {
|
2515
|
-
throw new Error(
|
2545
|
+
throw new Error(
|
2546
|
+
"'channelId' is a required parameter but is null or undefined."
|
2547
|
+
);
|
2516
2548
|
}
|
2517
2549
|
if (body === null || body === void 0) {
|
2518
|
-
throw new Error(
|
2550
|
+
throw new Error(
|
2551
|
+
"'body' is a required parameter but is null or undefined."
|
2552
|
+
);
|
2519
2553
|
}
|
2520
|
-
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
|
2554
|
+
const urlPath = "/v2/channel/{channelId}/encrypt_method".replace(
|
2555
|
+
"{channelId}",
|
2556
|
+
encodeURIComponent(String(channelId))
|
2557
|
+
);
|
2521
2558
|
const queryParams = /* @__PURE__ */ new Map();
|
2522
2559
|
let bodyJson = "";
|
2523
2560
|
bodyJson = JSON.stringify(body || {});
|
@@ -2809,9 +2846,14 @@ var MezonApi = class {
|
|
2809
2846
|
/** List channel setting */
|
2810
2847
|
listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channelLabel, options = {}) {
|
2811
2848
|
if (clanId === null || clanId === void 0) {
|
2812
|
-
throw new Error(
|
2849
|
+
throw new Error(
|
2850
|
+
"'clanId' is a required parameter but is null or undefined."
|
2851
|
+
);
|
2813
2852
|
}
|
2814
|
-
const urlPath = "/v2/channelsetting/{clanId}".replace(
|
2853
|
+
const urlPath = "/v2/channelsetting/{clanId}".replace(
|
2854
|
+
"{clanId}",
|
2855
|
+
encodeURIComponent(String(clanId))
|
2856
|
+
);
|
2815
2857
|
const queryParams = /* @__PURE__ */ new Map();
|
2816
2858
|
queryParams.set("parent_id", parentId);
|
2817
2859
|
queryParams.set("category_id", categoryId);
|
@@ -3209,60 +3251,6 @@ var MezonApi = class {
|
|
3209
3251
|
]);
|
3210
3252
|
}
|
3211
3253
|
/** */
|
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
3254
|
deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
|
3267
3255
|
if (categoryId === null || categoryId === void 0) {
|
3268
3256
|
throw new Error(
|
@@ -4313,7 +4301,9 @@ var MezonApi = class {
|
|
4313
4301
|
/** Mark as read */
|
4314
4302
|
markAsRead(bearerToken, body, options = {}) {
|
4315
4303
|
if (body === null || body === void 0) {
|
4316
|
-
throw new Error(
|
4304
|
+
throw new Error(
|
4305
|
+
"'body' is a required parameter but is null or undefined."
|
4306
|
+
);
|
4317
4307
|
}
|
4318
4308
|
const urlPath = "/v2/markasread";
|
4319
4309
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4829,7 +4819,9 @@ var MezonApi = class {
|
|
4829
4819
|
/** set notification user channel. */
|
4830
4820
|
createPinMessage(bearerToken, body, options = {}) {
|
4831
4821
|
if (body === null || body === void 0) {
|
4832
|
-
throw new Error(
|
4822
|
+
throw new Error(
|
4823
|
+
"'body' is a required parameter but is null or undefined."
|
4824
|
+
);
|
4833
4825
|
}
|
4834
4826
|
const urlPath = "/v2/pinmessage/set";
|
4835
4827
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -4915,7 +4907,9 @@ var MezonApi = class {
|
|
4915
4907
|
/** store pubkey for e2ee */
|
4916
4908
|
pushPubKey(bearerToken, body, options = {}) {
|
4917
4909
|
if (body === null || body === void 0) {
|
4918
|
-
throw new Error(
|
4910
|
+
throw new Error(
|
4911
|
+
"'body' is a required parameter but is null or undefined."
|
4912
|
+
);
|
4919
4913
|
}
|
4920
4914
|
const urlPath = "/v2/pubkey/push";
|
4921
4915
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -5397,7 +5391,9 @@ var MezonApi = class {
|
|
5397
5391
|
/** UpdateWallets */
|
5398
5392
|
sendToken(bearerToken, body, options = {}) {
|
5399
5393
|
if (body === null || body === void 0) {
|
5400
|
-
throw new Error(
|
5394
|
+
throw new Error(
|
5395
|
+
"'body' is a required parameter but is null or undefined."
|
5396
|
+
);
|
5401
5397
|
}
|
5402
5398
|
const urlPath = "/v2/sendtoken";
|
5403
5399
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -5831,9 +5827,14 @@ var MezonApi = class {
|
|
5831
5827
|
/** List user channels */
|
5832
5828
|
listThreadDescs(bearerToken, channelId, limit, state, clanId, threadId, options = {}) {
|
5833
5829
|
if (channelId === null || channelId === void 0) {
|
5834
|
-
throw new Error(
|
5830
|
+
throw new Error(
|
5831
|
+
"'channelId' is a required parameter but is null or undefined."
|
5832
|
+
);
|
5835
5833
|
}
|
5836
|
-
const urlPath = "/v2/thread/{channelId}".replace(
|
5834
|
+
const urlPath = "/v2/thread/{channelId}".replace(
|
5835
|
+
"{channelId}",
|
5836
|
+
encodeURIComponent(String(channelId))
|
5837
|
+
);
|
5837
5838
|
const queryParams = /* @__PURE__ */ new Map();
|
5838
5839
|
queryParams.set("limit", limit);
|
5839
5840
|
queryParams.set("state", state);
|
@@ -6139,7 +6140,9 @@ var MezonApi = class {
|
|
6139
6140
|
/** Update user status */
|
6140
6141
|
updateUserStatus(bearerToken, body, options = {}) {
|
6141
6142
|
if (body === null || body === void 0) {
|
6142
|
-
throw new Error(
|
6143
|
+
throw new Error(
|
6144
|
+
"'body' is a required parameter but is null or undefined."
|
6145
|
+
);
|
6143
6146
|
}
|
6144
6147
|
const urlPath = "/v2/userstatus";
|
6145
6148
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -6301,9 +6304,14 @@ var MezonApi = class {
|
|
6301
6304
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6302
6305
|
}
|
6303
6306
|
if (body === null || body === void 0) {
|
6304
|
-
throw new Error(
|
6307
|
+
throw new Error(
|
6308
|
+
"'body' is a required parameter but is null or undefined."
|
6309
|
+
);
|
6305
6310
|
}
|
6306
|
-
const urlPath = "/v2/webhooks/{id}".replace(
|
6311
|
+
const urlPath = "/v2/webhooks/{id}".replace(
|
6312
|
+
"{id}",
|
6313
|
+
encodeURIComponent(String(id))
|
6314
|
+
);
|
6307
6315
|
const queryParams = /* @__PURE__ */ new Map();
|
6308
6316
|
let bodyJson = "";
|
6309
6317
|
bodyJson = JSON.stringify(body || {});
|
@@ -6376,7 +6384,9 @@ var MezonApi = class {
|
|
6376
6384
|
/** WithdrawToken */
|
6377
6385
|
withdrawToken(bearerToken, body, options = {}) {
|
6378
6386
|
if (body === null || body === void 0) {
|
6379
|
-
throw new Error(
|
6387
|
+
throw new Error(
|
6388
|
+
"'body' is a required parameter but is null or undefined."
|
6389
|
+
);
|
6380
6390
|
}
|
6381
6391
|
const urlPath = "/v2/withdrawtoken";
|
6382
6392
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -6502,7 +6512,9 @@ var MezonApi = class {
|
|
6502
6512
|
/** create onboarding. */
|
6503
6513
|
createOnboarding(bearerToken, body, options = {}) {
|
6504
6514
|
if (body === null || body === void 0) {
|
6505
|
-
throw new Error(
|
6515
|
+
throw new Error(
|
6516
|
+
"'body' is a required parameter but is null or undefined."
|
6517
|
+
);
|
6506
6518
|
}
|
6507
6519
|
const urlPath = "/v2/onboarding";
|
6508
6520
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -6533,7 +6545,10 @@ var MezonApi = class {
|
|
6533
6545
|
if (id === null || id === void 0) {
|
6534
6546
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6535
6547
|
}
|
6536
|
-
const urlPath = "/v2/onboarding/{id}".replace(
|
6548
|
+
const urlPath = "/v2/onboarding/{id}".replace(
|
6549
|
+
"{id}",
|
6550
|
+
encodeURIComponent(String(id))
|
6551
|
+
);
|
6537
6552
|
const queryParams = /* @__PURE__ */ new Map();
|
6538
6553
|
queryParams.set("clan_id", clanId);
|
6539
6554
|
let bodyJson = "";
|
@@ -6562,7 +6577,10 @@ var MezonApi = class {
|
|
6562
6577
|
if (id === null || id === void 0) {
|
6563
6578
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6564
6579
|
}
|
6565
|
-
const urlPath = "/v2/onboarding/{id}".replace(
|
6580
|
+
const urlPath = "/v2/onboarding/{id}".replace(
|
6581
|
+
"{id}",
|
6582
|
+
encodeURIComponent(String(id))
|
6583
|
+
);
|
6566
6584
|
const queryParams = /* @__PURE__ */ new Map();
|
6567
6585
|
queryParams.set("clan_id", clanId);
|
6568
6586
|
let bodyJson = "";
|
@@ -6592,9 +6610,14 @@ var MezonApi = class {
|
|
6592
6610
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6593
6611
|
}
|
6594
6612
|
if (body === null || body === void 0) {
|
6595
|
-
throw new Error(
|
6613
|
+
throw new Error(
|
6614
|
+
"'body' is a required parameter but is null or undefined."
|
6615
|
+
);
|
6596
6616
|
}
|
6597
|
-
const urlPath = "/v2/onboarding/{id}".replace(
|
6617
|
+
const urlPath = "/v2/onboarding/{id}".replace(
|
6618
|
+
"{id}",
|
6619
|
+
encodeURIComponent(String(id))
|
6620
|
+
);
|
6598
6621
|
const queryParams = /* @__PURE__ */ new Map();
|
6599
6622
|
let bodyJson = "";
|
6600
6623
|
bodyJson = JSON.stringify(body || {});
|
@@ -6621,7 +6644,9 @@ var MezonApi = class {
|
|
6621
6644
|
/** Generate clan webhook. */
|
6622
6645
|
generateClanWebhook(bearerToken, body, options = {}) {
|
6623
6646
|
if (body === null || body === void 0) {
|
6624
|
-
throw new Error(
|
6647
|
+
throw new Error(
|
6648
|
+
"'body' is a required parameter but is null or undefined."
|
6649
|
+
);
|
6625
6650
|
}
|
6626
6651
|
const urlPath = "/v2/clanwebhooks";
|
6627
6652
|
const queryParams = /* @__PURE__ */ new Map();
|
@@ -6650,9 +6675,14 @@ var MezonApi = class {
|
|
6650
6675
|
/** List clan webhook. */
|
6651
6676
|
listClanWebhook(bearerToken, clanId, options = {}) {
|
6652
6677
|
if (clanId === null || clanId === void 0) {
|
6653
|
-
throw new Error(
|
6678
|
+
throw new Error(
|
6679
|
+
"'clanId' is a required parameter but is null or undefined."
|
6680
|
+
);
|
6654
6681
|
}
|
6655
|
-
const urlPath = "/v2/clanwebhooks/{clanId}".replace(
|
6682
|
+
const urlPath = "/v2/clanwebhooks/{clanId}".replace(
|
6683
|
+
"{clanId}",
|
6684
|
+
encodeURIComponent(String(clanId))
|
6685
|
+
);
|
6656
6686
|
const queryParams = /* @__PURE__ */ new Map();
|
6657
6687
|
let bodyJson = "";
|
6658
6688
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -6680,7 +6710,10 @@ var MezonApi = class {
|
|
6680
6710
|
if (id === null || id === void 0) {
|
6681
6711
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6682
6712
|
}
|
6683
|
-
const urlPath = "/v2/clanwebhooks/{id}".replace(
|
6713
|
+
const urlPath = "/v2/clanwebhooks/{id}".replace(
|
6714
|
+
"{id}",
|
6715
|
+
encodeURIComponent(String(id))
|
6716
|
+
);
|
6684
6717
|
const queryParams = /* @__PURE__ */ new Map();
|
6685
6718
|
queryParams.set("clan_id", clanId);
|
6686
6719
|
let bodyJson = "";
|
@@ -6710,9 +6743,14 @@ var MezonApi = class {
|
|
6710
6743
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
6711
6744
|
}
|
6712
6745
|
if (body === null || body === void 0) {
|
6713
|
-
throw new Error(
|
6746
|
+
throw new Error(
|
6747
|
+
"'body' is a required parameter but is null or undefined."
|
6748
|
+
);
|
6714
6749
|
}
|
6715
|
-
const urlPath = "/v2/clanwebhooks/{id}".replace(
|
6750
|
+
const urlPath = "/v2/clanwebhooks/{id}".replace(
|
6751
|
+
"{id}",
|
6752
|
+
encodeURIComponent(String(id))
|
6753
|
+
);
|
6716
6754
|
const queryParams = /* @__PURE__ */ new Map();
|
6717
6755
|
let bodyJson = "";
|
6718
6756
|
bodyJson = JSON.stringify(body || {});
|
@@ -6767,12 +6805,19 @@ var MezonApi = class {
|
|
6767
6805
|
/** Update onboarding step. */
|
6768
6806
|
updateOnboardingStepByClanId(bearerToken, clanId, body, options = {}) {
|
6769
6807
|
if (clanId === null || clanId === void 0) {
|
6770
|
-
throw new Error(
|
6808
|
+
throw new Error(
|
6809
|
+
"'clanId' is a required parameter but is null or undefined."
|
6810
|
+
);
|
6771
6811
|
}
|
6772
6812
|
if (body === null || body === void 0) {
|
6773
|
-
throw new Error(
|
6813
|
+
throw new Error(
|
6814
|
+
"'body' is a required parameter but is null or undefined."
|
6815
|
+
);
|
6774
6816
|
}
|
6775
|
-
const urlPath = "/v2/onboardingsteps/{clanId}".replace(
|
6817
|
+
const urlPath = "/v2/onboardingsteps/{clanId}".replace(
|
6818
|
+
"{clanId}",
|
6819
|
+
encodeURIComponent(String(clanId))
|
6820
|
+
);
|
6776
6821
|
const queryParams = /* @__PURE__ */ new Map();
|
6777
6822
|
let bodyJson = "";
|
6778
6823
|
bodyJson = JSON.stringify(body || {});
|
@@ -10414,28 +10459,6 @@ var Client = class {
|
|
10414
10459
|
});
|
10415
10460
|
});
|
10416
10461
|
}
|
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
10462
|
//**list wallet ledger */
|
10440
10463
|
listWalletLedger(session, limit, cursor, transactionId) {
|
10441
10464
|
return __async(this, null, function* () {
|
package/package.json
CHANGED
package/utils.ts
CHANGED
@@ -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
|
}
|