@opexa/portal-sdk 0.59.75 → 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/README.md +1634 -1634
- package/dist/{chunk-UT6VBXJ4.js → chunk-3WS4U4B7.js} +40 -24
- package/dist/chunk-3WS4U4B7.js.map +1 -0
- package/dist/{chunk-5WRVWQBT.js → chunk-7APXFZ5G.js} +3 -3
- package/dist/chunk-7APXFZ5G.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 +263 -153
- 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 +229 -135
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +37 -21
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +5 -5
- package/dist/services/index.d.ts +5 -5
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gql, statusCodeToOperationError, callIfFn } from './chunk-
|
|
1
|
+
import { gql, statusCodeToOperationError, callIfFn } from './chunk-WVFSGB7Y.js';
|
|
2
2
|
import { Thumbmark } from '@thumbmarkjs/thumbmarkjs';
|
|
3
3
|
|
|
4
4
|
// src/services/queries.ts
|
|
@@ -4450,7 +4450,7 @@ var AuthService = class {
|
|
|
4450
4450
|
}
|
|
4451
4451
|
async createSession(input, version = 1) {
|
|
4452
4452
|
const headers = new Headers(this.headers);
|
|
4453
|
-
if (version === 3) {
|
|
4453
|
+
if (version === 3 || version === 4) {
|
|
4454
4454
|
const fingerprint = await getFingerPrint();
|
|
4455
4455
|
if (fingerprint) {
|
|
4456
4456
|
headers.append("Fingerprint", fingerprint);
|
|
@@ -4488,14 +4488,12 @@ var AuthService = class {
|
|
|
4488
4488
|
headers.set("test-pass", input.testPass);
|
|
4489
4489
|
}
|
|
4490
4490
|
try {
|
|
4491
|
-
const res = await fetch(
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
}
|
|
4498
|
-
);
|
|
4491
|
+
const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/sessions` : "/sessions"}`, {
|
|
4492
|
+
method: "POST",
|
|
4493
|
+
headers,
|
|
4494
|
+
body: JSON.stringify(input),
|
|
4495
|
+
...version === 4 && { credentials: "include" }
|
|
4496
|
+
});
|
|
4499
4497
|
const data = await res.json();
|
|
4500
4498
|
if (res.ok) {
|
|
4501
4499
|
return {
|
|
@@ -4576,14 +4574,26 @@ var AuthService = class {
|
|
|
4576
4574
|
}
|
|
4577
4575
|
throw new Error("Invalid input 'type'");
|
|
4578
4576
|
}
|
|
4579
|
-
async refreshSession(refreshToken) {
|
|
4577
|
+
async refreshSession(refreshToken, version = 1) {
|
|
4580
4578
|
const headers = new Headers(this.headers);
|
|
4581
|
-
|
|
4579
|
+
if (version !== 4) {
|
|
4580
|
+
headers.append("Authorization", `Bearer ${refreshToken}`);
|
|
4581
|
+
}
|
|
4582
|
+
if (version === 3 || version === 4) {
|
|
4583
|
+
const fingerprint = await getFingerPrint();
|
|
4584
|
+
if (fingerprint) {
|
|
4585
|
+
headers.append("Fingerprint", fingerprint);
|
|
4586
|
+
}
|
|
4587
|
+
}
|
|
4582
4588
|
try {
|
|
4583
|
-
const res = await fetch(
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4589
|
+
const res = await fetch(
|
|
4590
|
+
`${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}`,
|
|
4591
|
+
{
|
|
4592
|
+
method: "POST",
|
|
4593
|
+
headers,
|
|
4594
|
+
...version === 4 && { credentials: "include" }
|
|
4595
|
+
}
|
|
4596
|
+
);
|
|
4587
4597
|
const data = await res.json();
|
|
4588
4598
|
if (res.ok) {
|
|
4589
4599
|
return {
|
|
@@ -4620,14 +4630,20 @@ var AuthService = class {
|
|
|
4620
4630
|
};
|
|
4621
4631
|
}
|
|
4622
4632
|
}
|
|
4623
|
-
async destroySession(accessToken) {
|
|
4633
|
+
async destroySession(accessToken, version = 1) {
|
|
4624
4634
|
const headers = new Headers(this.headers);
|
|
4625
|
-
|
|
4635
|
+
if (version !== 4) {
|
|
4636
|
+
headers.append("Authorization", `Bearer ${accessToken}`);
|
|
4637
|
+
}
|
|
4626
4638
|
try {
|
|
4627
|
-
const res = await fetch(
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4639
|
+
const res = await fetch(
|
|
4640
|
+
`${this.url}${version !== 1 ? `/v${version}/session` : "/session"}`,
|
|
4641
|
+
{
|
|
4642
|
+
method: "DELETE",
|
|
4643
|
+
headers,
|
|
4644
|
+
...version === 4 && { credentials: "include" }
|
|
4645
|
+
}
|
|
4646
|
+
);
|
|
4631
4647
|
return res.ok ? { ok: true } : { ok: false, error: statusCodeToOperationError(res.status) };
|
|
4632
4648
|
} catch {
|
|
4633
4649
|
return { ok: false, error: statusCodeToOperationError(500) };
|
|
@@ -6497,5 +6513,5 @@ var ExtensionService = class {
|
|
|
6497
6513
|
};
|
|
6498
6514
|
|
|
6499
6515
|
export { AccountService, AuthService, CmsPortalService, ExtensionService, FileService, GameService, PortalService, ReportService, TriggerService, WalletService, getFingerPrint };
|
|
6500
|
-
//# sourceMappingURL=chunk-
|
|
6501
|
-
//# sourceMappingURL=chunk-
|
|
6516
|
+
//# sourceMappingURL=chunk-3WS4U4B7.js.map
|
|
6517
|
+
//# sourceMappingURL=chunk-3WS4U4B7.js.map
|