@opexa/portal-sdk 0.59.127 → 0.59.129
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/README.md +1698 -1698
- package/dist/{chunk-5WRVWQBT.js → chunk-7APXFZ5G.js} +3 -3
- package/dist/chunk-7APXFZ5G.js.map +1 -0
- package/dist/{chunk-36U3QUDP.js → chunk-ROZQZKKD.js} +17 -10
- package/dist/chunk-ROZQZKKD.js.map +1 -0
- package/dist/{chunk-ROBGEUSE.js → chunk-WVFSGB7Y.js} +2 -2
- package/dist/chunk-WVFSGB7Y.js.map +1 -0
- package/dist/index.cjs +277 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +266 -98
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +14 -7
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.js +2 -2
- package/dist/{types-CO_xQd_7.d.cts → types-B-Y3xNfe.d.cts} +1 -1
- package/dist/{types-B2ydKuMW.d.ts → types-EDjOGXkh.d.ts} +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-36U3QUDP.js.map +0 -1
- package/dist/chunk-5WRVWQBT.js.map +0 -1
- package/dist/chunk-ROBGEUSE.js.map +0 -1
package/dist/services/index.cjs
CHANGED
|
@@ -324,9 +324,6 @@ var CREATE_GAME_SESSION_MUTATION = gql`
|
|
|
324
324
|
... on GameTypeNotEnabledError {
|
|
325
325
|
__typename
|
|
326
326
|
}
|
|
327
|
-
... on GameNotEnabledError {
|
|
328
|
-
__typename
|
|
329
|
-
}
|
|
330
327
|
}
|
|
331
328
|
}
|
|
332
329
|
`;
|
|
@@ -4077,7 +4074,6 @@ function createOperationError(code) {
|
|
|
4077
4074
|
FileNotReadyError: "File is not yet ready",
|
|
4078
4075
|
FileSizeTooBigError: "File size is too big",
|
|
4079
4076
|
GameDoesNotExistError: "Game does not exist",
|
|
4080
|
-
GameNotEnabledError: "Game is not enabled",
|
|
4081
4077
|
InsufficientPointsError: "Insufficient points",
|
|
4082
4078
|
InvalidPlatformError: "Invalid platform",
|
|
4083
4079
|
InvalidReCAPTCHAResponseError: "Invalid reCAPTCHA",
|
|
@@ -4859,6 +4855,15 @@ var ERROR_MAP = {
|
|
|
4859
4855
|
};
|
|
4860
4856
|
|
|
4861
4857
|
// src/services/auth.service.ts
|
|
4858
|
+
function getCompatibleSignal(signal) {
|
|
4859
|
+
if (!signal) return void 0;
|
|
4860
|
+
try {
|
|
4861
|
+
new Request("about:blank", { signal });
|
|
4862
|
+
return signal;
|
|
4863
|
+
} catch {
|
|
4864
|
+
return void 0;
|
|
4865
|
+
}
|
|
4866
|
+
}
|
|
4862
4867
|
var AuthService = class {
|
|
4863
4868
|
url;
|
|
4864
4869
|
graphqlClient;
|
|
@@ -5026,7 +5031,7 @@ var AuthService = class {
|
|
|
5026
5031
|
}
|
|
5027
5032
|
throw new Error("Invalid input 'type'");
|
|
5028
5033
|
}
|
|
5029
|
-
async refreshSession(refreshToken, version = 1) {
|
|
5034
|
+
async refreshSession(refreshToken, version = 1, signal) {
|
|
5030
5035
|
const headers = new Headers(this.headers);
|
|
5031
5036
|
if (version !== 4 || refreshToken) {
|
|
5032
5037
|
headers.append("Authorization", `Bearer ${refreshToken}`);
|
|
@@ -5045,6 +5050,7 @@ var AuthService = class {
|
|
|
5045
5050
|
{
|
|
5046
5051
|
method: "POST",
|
|
5047
5052
|
headers,
|
|
5053
|
+
signal: getCompatibleSignal(signal),
|
|
5048
5054
|
...version === 4 && { credentials: "include" }
|
|
5049
5055
|
}
|
|
5050
5056
|
);
|
|
@@ -5113,13 +5119,14 @@ var AuthService = class {
|
|
|
5113
5119
|
return { ok: false, error: statusCodeToOperationError(500) };
|
|
5114
5120
|
}
|
|
5115
5121
|
}
|
|
5116
|
-
async verifySession(accessToken) {
|
|
5122
|
+
async verifySession(accessToken, signal) {
|
|
5117
5123
|
const headers = new Headers(this.headers);
|
|
5118
5124
|
headers.append("Authorization", `Bearer ${accessToken}`);
|
|
5119
5125
|
try {
|
|
5120
5126
|
const res = await fetch(`${this.url}/session`, {
|
|
5121
5127
|
method: "GET",
|
|
5122
|
-
headers
|
|
5128
|
+
headers,
|
|
5129
|
+
signal: getCompatibleSignal(signal)
|
|
5123
5130
|
});
|
|
5124
5131
|
return res.ok;
|
|
5125
5132
|
} catch {
|