@opexa/portal-sdk 0.59.75 → 0.59.76
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 +1634 -1634
- package/dist/{chunk-5WRVWQBT.js → chunk-7APXFZ5G.js} +3 -3
- package/dist/chunk-7APXFZ5G.js.map +1 -0
- package/dist/{chunk-UT6VBXJ4.js → chunk-BDZPLMTL.js} +21 -17
- package/dist/chunk-BDZPLMTL.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 +224 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +209 -133
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +18 -14
- 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-Dz4J_rhs.d.cts → types-kTe_j8tm.d.cts} +3 -3
- package/dist/{types-Cmawo0zW.d.ts → types-lZQpMvHU.d.ts} +3 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-5WRVWQBT.js.map +0 -1
- package/dist/chunk-ROBGEUSE.js.map +0 -1
- package/dist/chunk-UT6VBXJ4.js.map +0 -1
package/dist/services/index.cjs
CHANGED
|
@@ -4517,14 +4517,12 @@ var AuthService = class {
|
|
|
4517
4517
|
headers.set("test-pass", input.testPass);
|
|
4518
4518
|
}
|
|
4519
4519
|
try {
|
|
4520
|
-
const res = await fetch(
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
}
|
|
4527
|
-
);
|
|
4520
|
+
const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/sessions` : "/sessions"}`, {
|
|
4521
|
+
method: "POST",
|
|
4522
|
+
headers,
|
|
4523
|
+
body: JSON.stringify(input),
|
|
4524
|
+
...version === 4 && { credentials: "include" }
|
|
4525
|
+
});
|
|
4528
4526
|
const data = await res.json();
|
|
4529
4527
|
if (res.ok) {
|
|
4530
4528
|
return {
|
|
@@ -4605,14 +4603,20 @@ var AuthService = class {
|
|
|
4605
4603
|
}
|
|
4606
4604
|
throw new Error("Invalid input 'type'");
|
|
4607
4605
|
}
|
|
4608
|
-
async refreshSession(refreshToken) {
|
|
4606
|
+
async refreshSession(refreshToken, version = 1) {
|
|
4609
4607
|
const headers = new Headers(this.headers);
|
|
4610
|
-
|
|
4608
|
+
if (version !== 4) {
|
|
4609
|
+
headers.append("Authorization", `Bearer ${refreshToken}`);
|
|
4610
|
+
}
|
|
4611
4611
|
try {
|
|
4612
|
-
const res = await fetch(
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4612
|
+
const res = await fetch(
|
|
4613
|
+
`${this.url}${version === 4 ? "/v4/session/refresh" : "/session:refresh"}`,
|
|
4614
|
+
{
|
|
4615
|
+
method: "POST",
|
|
4616
|
+
headers,
|
|
4617
|
+
...version === 4 && { credentials: "include" }
|
|
4618
|
+
}
|
|
4619
|
+
);
|
|
4616
4620
|
const data = await res.json();
|
|
4617
4621
|
if (res.ok) {
|
|
4618
4622
|
return {
|