@opexa/portal-sdk 0.59.128 → 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/dist/{chunk-JPJWVATW.js → chunk-ROZQZKKD.js} +16 -5
- package/dist/chunk-ROZQZKKD.js.map +1 -0
- package/dist/index.cjs +277 -98
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +264 -96
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +14 -3
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +2 -2
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JPJWVATW.js.map +0 -1
package/dist/services/index.cjs
CHANGED
|
@@ -4855,6 +4855,15 @@ var ERROR_MAP = {
|
|
|
4855
4855
|
};
|
|
4856
4856
|
|
|
4857
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
|
+
}
|
|
4858
4867
|
var AuthService = class {
|
|
4859
4868
|
url;
|
|
4860
4869
|
graphqlClient;
|
|
@@ -5022,7 +5031,7 @@ var AuthService = class {
|
|
|
5022
5031
|
}
|
|
5023
5032
|
throw new Error("Invalid input 'type'");
|
|
5024
5033
|
}
|
|
5025
|
-
async refreshSession(refreshToken, version = 1) {
|
|
5034
|
+
async refreshSession(refreshToken, version = 1, signal) {
|
|
5026
5035
|
const headers = new Headers(this.headers);
|
|
5027
5036
|
if (version !== 4 || refreshToken) {
|
|
5028
5037
|
headers.append("Authorization", `Bearer ${refreshToken}`);
|
|
@@ -5041,6 +5050,7 @@ var AuthService = class {
|
|
|
5041
5050
|
{
|
|
5042
5051
|
method: "POST",
|
|
5043
5052
|
headers,
|
|
5053
|
+
signal: getCompatibleSignal(signal),
|
|
5044
5054
|
...version === 4 && { credentials: "include" }
|
|
5045
5055
|
}
|
|
5046
5056
|
);
|
|
@@ -5109,13 +5119,14 @@ var AuthService = class {
|
|
|
5109
5119
|
return { ok: false, error: statusCodeToOperationError(500) };
|
|
5110
5120
|
}
|
|
5111
5121
|
}
|
|
5112
|
-
async verifySession(accessToken) {
|
|
5122
|
+
async verifySession(accessToken, signal) {
|
|
5113
5123
|
const headers = new Headers(this.headers);
|
|
5114
5124
|
headers.append("Authorization", `Bearer ${accessToken}`);
|
|
5115
5125
|
try {
|
|
5116
5126
|
const res = await fetch(`${this.url}/session`, {
|
|
5117
5127
|
method: "GET",
|
|
5118
|
-
headers
|
|
5128
|
+
headers,
|
|
5129
|
+
signal: getCompatibleSignal(signal)
|
|
5119
5130
|
});
|
|
5120
5131
|
return res.ok;
|
|
5121
5132
|
} catch {
|