@opexa/portal-sdk 0.59.76 → 0.59.77
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-BDZPLMTL.js → chunk-3WS4U4B7.js} +22 -10
- package/dist/chunk-3WS4U4B7.js.map +1 -0
- package/dist/index.cjs +40 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +20 -8
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-BDZPLMTL.js.map +0 -1
package/dist/services/index.cjs
CHANGED
|
@@ -4479,7 +4479,7 @@ var AuthService = class {
|
|
|
4479
4479
|
}
|
|
4480
4480
|
async createSession(input, version = 1) {
|
|
4481
4481
|
const headers = new Headers(this.headers);
|
|
4482
|
-
if (version === 3) {
|
|
4482
|
+
if (version === 3 || version === 4) {
|
|
4483
4483
|
const fingerprint = await getFingerPrint();
|
|
4484
4484
|
if (fingerprint) {
|
|
4485
4485
|
headers.append("Fingerprint", fingerprint);
|
|
@@ -4608,9 +4608,15 @@ var AuthService = class {
|
|
|
4608
4608
|
if (version !== 4) {
|
|
4609
4609
|
headers.append("Authorization", `Bearer ${refreshToken}`);
|
|
4610
4610
|
}
|
|
4611
|
+
if (version === 3 || version === 4) {
|
|
4612
|
+
const fingerprint = await getFingerPrint();
|
|
4613
|
+
if (fingerprint) {
|
|
4614
|
+
headers.append("Fingerprint", fingerprint);
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4611
4617
|
try {
|
|
4612
4618
|
const res = await fetch(
|
|
4613
|
-
`${this.url}${version
|
|
4619
|
+
`${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}`,
|
|
4614
4620
|
{
|
|
4615
4621
|
method: "POST",
|
|
4616
4622
|
headers,
|
|
@@ -4653,14 +4659,20 @@ var AuthService = class {
|
|
|
4653
4659
|
};
|
|
4654
4660
|
}
|
|
4655
4661
|
}
|
|
4656
|
-
async destroySession(accessToken) {
|
|
4662
|
+
async destroySession(accessToken, version = 1) {
|
|
4657
4663
|
const headers = new Headers(this.headers);
|
|
4658
|
-
|
|
4664
|
+
if (version !== 4) {
|
|
4665
|
+
headers.append("Authorization", `Bearer ${accessToken}`);
|
|
4666
|
+
}
|
|
4659
4667
|
try {
|
|
4660
|
-
const res = await fetch(
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4668
|
+
const res = await fetch(
|
|
4669
|
+
`${this.url}${version !== 1 ? `/v${version}/session` : "/session"}`,
|
|
4670
|
+
{
|
|
4671
|
+
method: "DELETE",
|
|
4672
|
+
headers,
|
|
4673
|
+
...version === 4 && { credentials: "include" }
|
|
4674
|
+
}
|
|
4675
|
+
);
|
|
4664
4676
|
return res.ok ? { ok: true } : { ok: false, error: statusCodeToOperationError(res.status) };
|
|
4665
4677
|
} catch {
|
|
4666
4678
|
return { ok: false, error: statusCodeToOperationError(500) };
|