60p82u21t54k 1.1.2 → 1.1.4
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/dist/60p82u21t54k.es.js
CHANGED
|
@@ -10300,9 +10300,21 @@ registerAllApiModels();
|
|
|
10300
10300
|
const get = (endpoint) => __async(void 0, null, function* () {
|
|
10301
10301
|
const response = yield fetchWithTimeout(`${endpoint}`, {
|
|
10302
10302
|
method: "GET",
|
|
10303
|
-
headers: authHeaders()
|
|
10303
|
+
headers: authHeaders(),
|
|
10304
|
+
credentials: "include"
|
|
10304
10305
|
});
|
|
10305
|
-
|
|
10306
|
+
if (!response.ok) {
|
|
10307
|
+
const errorResponse = yield getErrorMessage(response);
|
|
10308
|
+
return Promise.reject(errorResponse);
|
|
10309
|
+
}
|
|
10310
|
+
const data = yield safeJson(response);
|
|
10311
|
+
return {
|
|
10312
|
+
data,
|
|
10313
|
+
status: response.status,
|
|
10314
|
+
msg: response.statusText,
|
|
10315
|
+
headers: response.headers,
|
|
10316
|
+
ok: response.ok
|
|
10317
|
+
};
|
|
10306
10318
|
});
|
|
10307
10319
|
const post = (requests, requestPath = `/graph/jwt`) => __async(void 0, null, function* () {
|
|
10308
10320
|
const modifiedRequests = processRequestModifications(requests);
|
|
@@ -10314,17 +10326,70 @@ const post = (requests, requestPath = `/graph/jwt`) => __async(void 0, null, fun
|
|
|
10314
10326
|
const response = yield fetchWithTimeout(requestPath, {
|
|
10315
10327
|
method: "POST",
|
|
10316
10328
|
headers: authHeaders(),
|
|
10317
|
-
body: JSON.stringify(payload)
|
|
10329
|
+
body: JSON.stringify(payload),
|
|
10330
|
+
credentials: "include"
|
|
10318
10331
|
});
|
|
10319
|
-
|
|
10332
|
+
if (!response.ok) {
|
|
10333
|
+
const errorResponse = yield getErrorMessage(response);
|
|
10334
|
+
return Promise.reject(errorResponse);
|
|
10335
|
+
}
|
|
10336
|
+
const responseJSON = yield safeJson(response);
|
|
10337
|
+
const result = {
|
|
10338
|
+
status: 200,
|
|
10339
|
+
message: "",
|
|
10340
|
+
result: {}
|
|
10341
|
+
};
|
|
10342
|
+
for (const res of responseJSON.responses) {
|
|
10343
|
+
if (res.error != null && res.error.code != 200) {
|
|
10344
|
+
result.status = res.error.code;
|
|
10345
|
+
result.message = res.error.message;
|
|
10346
|
+
}
|
|
10347
|
+
const decodedData = res.attributes !== null && res.attributes !== void 0 ? base64Decode(res.attributes) : null;
|
|
10348
|
+
const name = res.name;
|
|
10349
|
+
const responseData = decodedData ? JSON.parse(decodedData) : null;
|
|
10350
|
+
if (!responseData) {
|
|
10351
|
+
result.result[name] = null;
|
|
10352
|
+
} else {
|
|
10353
|
+
result.result[name] = processApiTransformation(
|
|
10354
|
+
name,
|
|
10355
|
+
responseData
|
|
10356
|
+
);
|
|
10357
|
+
}
|
|
10358
|
+
}
|
|
10359
|
+
result.result = processResponseModifications(result.result);
|
|
10360
|
+
return result;
|
|
10320
10361
|
});
|
|
10321
10362
|
const customPost = (requestPath, request) => __async(void 0, null, function* () {
|
|
10322
10363
|
const response = yield fetchWithTimeout(requestPath, {
|
|
10323
10364
|
method: "POST",
|
|
10324
10365
|
headers: authHeaders(),
|
|
10325
|
-
body: JSON.stringify(request)
|
|
10366
|
+
body: JSON.stringify(request),
|
|
10367
|
+
credentials: "include"
|
|
10326
10368
|
});
|
|
10327
|
-
|
|
10369
|
+
if (!response.ok) {
|
|
10370
|
+
const errorResponse = yield getErrorMessage(response);
|
|
10371
|
+
return Promise.reject(errorResponse);
|
|
10372
|
+
}
|
|
10373
|
+
const data = yield safeJson(response);
|
|
10374
|
+
if (!data) {
|
|
10375
|
+
return {
|
|
10376
|
+
data: {},
|
|
10377
|
+
status: response.status,
|
|
10378
|
+
msg: response.statusText,
|
|
10379
|
+
headers: response.headers,
|
|
10380
|
+
ok: response.ok
|
|
10381
|
+
};
|
|
10382
|
+
}
|
|
10383
|
+
const responses = Array.isArray(data == null ? void 0 : data.responses) ? data.responses.filter((res) => res == null ? void 0 : res.attributes) : [];
|
|
10384
|
+
const firstResponse = responses[0];
|
|
10385
|
+
const finalData = firstResponse ? JSON.parse(base64Decode(firstResponse.attributes)) : data;
|
|
10386
|
+
return {
|
|
10387
|
+
data: finalData,
|
|
10388
|
+
status: response.status,
|
|
10389
|
+
msg: response.statusText,
|
|
10390
|
+
headers: response.headers,
|
|
10391
|
+
ok: response.ok
|
|
10392
|
+
};
|
|
10328
10393
|
});
|
|
10329
10394
|
const fetchWithTimeout = (url, options, timeout = 29e3) => __async(void 0, null, function* () {
|
|
10330
10395
|
const controller = new AbortController();
|
|
@@ -10340,10 +10405,16 @@ const fetchWithTimeout = (url, options, timeout = 29e3) => __async(void 0, null,
|
|
|
10340
10405
|
});
|
|
10341
10406
|
const authHeaders = () => {
|
|
10342
10407
|
const token = localStorage.getItem("token");
|
|
10408
|
+
const csrfToken = getCookie("XSRF-TOKEN");
|
|
10343
10409
|
return __spreadValues({
|
|
10344
|
-
"Content-Type": "application/json"
|
|
10410
|
+
"Content-Type": "application/json",
|
|
10411
|
+
"X-XSRF-TOKEN": csrfToken
|
|
10345
10412
|
}, token ? { Authorization: `Bearer ${token}` } : {});
|
|
10346
10413
|
};
|
|
10414
|
+
const getCookie = (name) => {
|
|
10415
|
+
const match2 = document.cookie.match(new RegExp("(^| )" + name + "=([^;]+)"));
|
|
10416
|
+
return match2 ? decodeURIComponent(match2[2]) : "";
|
|
10417
|
+
};
|
|
10347
10418
|
const safeJson = (response) => __async(void 0, null, function* () {
|
|
10348
10419
|
try {
|
|
10349
10420
|
if (response.status === 204 || response.headers.get("content-length") === "0") {
|
|
@@ -10370,66 +10441,6 @@ const getErrorMessage = (response) => __async(void 0, null, function* () {
|
|
|
10370
10441
|
}
|
|
10371
10442
|
return errorResponse;
|
|
10372
10443
|
});
|
|
10373
|
-
const handleGetResponse = (response) => __async(void 0, null, function* () {
|
|
10374
|
-
if (!response.ok) {
|
|
10375
|
-
const errorResponse = yield getErrorMessage(response);
|
|
10376
|
-
return Promise.reject(errorResponse);
|
|
10377
|
-
}
|
|
10378
|
-
const data = yield safeJson(response);
|
|
10379
|
-
return {
|
|
10380
|
-
data,
|
|
10381
|
-
status: response.status,
|
|
10382
|
-
msg: response.statusText,
|
|
10383
|
-
headers: response.headers,
|
|
10384
|
-
ok: response.ok
|
|
10385
|
-
};
|
|
10386
|
-
});
|
|
10387
|
-
const handlePostResponse = (response) => __async(void 0, null, function* () {
|
|
10388
|
-
const result = {
|
|
10389
|
-
status: 200,
|
|
10390
|
-
message: "",
|
|
10391
|
-
result: {}
|
|
10392
|
-
};
|
|
10393
|
-
if (!response.ok) {
|
|
10394
|
-
const errorResponse = yield getErrorMessage(response);
|
|
10395
|
-
return Promise.reject(errorResponse);
|
|
10396
|
-
}
|
|
10397
|
-
const responseJSON = yield safeJson(response);
|
|
10398
|
-
for (const res of responseJSON.responses) {
|
|
10399
|
-
if (res.error != null && res.error.code != 200) {
|
|
10400
|
-
result.status = res.error.code;
|
|
10401
|
-
result.message = res.error.message;
|
|
10402
|
-
}
|
|
10403
|
-
const decodedData = res.attributes !== null && res.attributes !== void 0 ? base64Decode(res.attributes) : null;
|
|
10404
|
-
const name = res.name;
|
|
10405
|
-
const responseData = decodedData ? JSON.parse(decodedData) : null;
|
|
10406
|
-
if (!responseData) {
|
|
10407
|
-
result.result[name] = null;
|
|
10408
|
-
} else {
|
|
10409
|
-
result.result[name] = processApiTransformation(
|
|
10410
|
-
name,
|
|
10411
|
-
responseData
|
|
10412
|
-
);
|
|
10413
|
-
}
|
|
10414
|
-
}
|
|
10415
|
-
result.result = processResponseModifications(result.result);
|
|
10416
|
-
return result;
|
|
10417
|
-
});
|
|
10418
|
-
const handleCustomPostResponse = (response) => __async(void 0, null, function* () {
|
|
10419
|
-
if (!response) return;
|
|
10420
|
-
if (!response.ok) {
|
|
10421
|
-
const errorResponse = yield getErrorMessage(response);
|
|
10422
|
-
return Promise.reject(errorResponse);
|
|
10423
|
-
}
|
|
10424
|
-
const data = yield safeJson(response);
|
|
10425
|
-
const responses = Array.isArray(data == null ? void 0 : data.responses) ? data.responses.filter((res) => res == null ? void 0 : res.attributes) : [];
|
|
10426
|
-
if (responses.length === 0) {
|
|
10427
|
-
return true;
|
|
10428
|
-
}
|
|
10429
|
-
const firstResponse = responses[0];
|
|
10430
|
-
const decodedData = base64Decode(firstResponse.attributes);
|
|
10431
|
-
return JSON.parse(decodedData);
|
|
10432
|
-
});
|
|
10433
10444
|
const api = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10434
10445
|
__proto__: null,
|
|
10435
10446
|
customPost,
|
|
@@ -10552,7 +10563,7 @@ const jackpotDataApi = () => __async(void 0, null, function* () {
|
|
|
10552
10563
|
return result;
|
|
10553
10564
|
});
|
|
10554
10565
|
const loadMatchApi = (gameId, stage, sportId, tagId, matchId) => __async(void 0, null, function* () {
|
|
10555
|
-
var _a, _b;
|
|
10566
|
+
var _a, _b, _c, _d;
|
|
10556
10567
|
let result = {
|
|
10557
10568
|
status: 200,
|
|
10558
10569
|
message: "",
|
|
@@ -10573,11 +10584,11 @@ const loadMatchApi = (gameId, stage, sportId, tagId, matchId) => __async(void 0,
|
|
|
10573
10584
|
});
|
|
10574
10585
|
const output = request.data;
|
|
10575
10586
|
result = {
|
|
10576
|
-
status: 200,
|
|
10577
|
-
message: "",
|
|
10587
|
+
status: (_a = output.code) != null ? _a : 200,
|
|
10588
|
+
message: (_b = output.message) != null ? _b : "",
|
|
10578
10589
|
data: {
|
|
10579
|
-
message: (
|
|
10580
|
-
urlLink: (
|
|
10590
|
+
message: (_c = output.msg) != null ? _c : "",
|
|
10591
|
+
urlLink: (_d = output.data) != null ? _d : ""
|
|
10581
10592
|
}
|
|
10582
10593
|
};
|
|
10583
10594
|
} catch (error) {
|
|
@@ -10677,7 +10688,7 @@ const setLocaleApi = (localeCode, udid) => __async(void 0, null, function* () {
|
|
|
10677
10688
|
language: localeCode,
|
|
10678
10689
|
udid: udid != null ? udid : ""
|
|
10679
10690
|
});
|
|
10680
|
-
const output = request;
|
|
10691
|
+
const output = request.data;
|
|
10681
10692
|
result.data = {
|
|
10682
10693
|
status: output.status == 1,
|
|
10683
10694
|
message: (_a = output.message) != null ? _a : ""
|