@opexa/portal-sdk 0.59.79 → 0.59.81
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-AIJL2W7N.js → chunk-443LKA6K.js} +18 -6
- package/dist/chunk-443LKA6K.js.map +1 -0
- package/dist/index.cjs +66 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +52 -9
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +16 -4
- 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-AIJL2W7N.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { gql, statusCodeToOperationError, callIfFn } from './chunk-WVFSGB7Y.js';
|
|
2
|
+
import { Capacitor } from '@capacitor/core';
|
|
2
3
|
import { Thumbmark } from '@thumbmarkjs/thumbmarkjs';
|
|
3
4
|
|
|
4
5
|
// src/services/queries.ts
|
|
@@ -4435,6 +4436,13 @@ async function getFingerPrint() {
|
|
|
4435
4436
|
}
|
|
4436
4437
|
|
|
4437
4438
|
// src/services/auth.service.ts
|
|
4439
|
+
function isWebPlatform() {
|
|
4440
|
+
try {
|
|
4441
|
+
return Capacitor.getPlatform() === "web";
|
|
4442
|
+
} catch {
|
|
4443
|
+
return false;
|
|
4444
|
+
}
|
|
4445
|
+
}
|
|
4438
4446
|
var AuthService = class {
|
|
4439
4447
|
url;
|
|
4440
4448
|
options;
|
|
@@ -4488,7 +4496,9 @@ var AuthService = class {
|
|
|
4488
4496
|
headers.set("test-pass", input.testPass);
|
|
4489
4497
|
}
|
|
4490
4498
|
try {
|
|
4491
|
-
const
|
|
4499
|
+
const isWeb = isWebPlatform();
|
|
4500
|
+
const queryParam = isWeb && version === 4 ? "?type=web" : "";
|
|
4501
|
+
const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/sessions` : "/sessions"}${queryParam}`, {
|
|
4492
4502
|
method: "POST",
|
|
4493
4503
|
headers,
|
|
4494
4504
|
body: JSON.stringify(input),
|
|
@@ -4586,8 +4596,10 @@ var AuthService = class {
|
|
|
4586
4596
|
}
|
|
4587
4597
|
}
|
|
4588
4598
|
try {
|
|
4599
|
+
const isWeb = isWebPlatform();
|
|
4600
|
+
const queryParam = isWeb && version === 4 ? "?type=web" : "";
|
|
4589
4601
|
const res = await fetch(
|
|
4590
|
-
`${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}`,
|
|
4602
|
+
`${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}${queryParam}`,
|
|
4591
4603
|
{
|
|
4592
4604
|
method: "POST",
|
|
4593
4605
|
headers,
|
|
@@ -4666,7 +4678,7 @@ var AuthService = class {
|
|
|
4666
4678
|
return true;
|
|
4667
4679
|
}
|
|
4668
4680
|
}
|
|
4669
|
-
async sendVerificationCode(input) {
|
|
4681
|
+
async sendVerificationCode(input, version = 1) {
|
|
4670
4682
|
if (input.channel === "EMAIL")
|
|
4671
4683
|
throw new Error("Email channel is not yet supported");
|
|
4672
4684
|
function getErrorCode(message) {
|
|
@@ -4682,7 +4694,7 @@ var AuthService = class {
|
|
|
4682
4694
|
}
|
|
4683
4695
|
}
|
|
4684
4696
|
try {
|
|
4685
|
-
const res = await fetch(`${this.url}/otps`, {
|
|
4697
|
+
const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/otps` : "/otps"}`, {
|
|
4686
4698
|
method: "POST",
|
|
4687
4699
|
headers: this.headers,
|
|
4688
4700
|
body: JSON.stringify(input)
|
|
@@ -6517,5 +6529,5 @@ var ExtensionService = class {
|
|
|
6517
6529
|
};
|
|
6518
6530
|
|
|
6519
6531
|
export { AccountService, AuthService, CmsPortalService, ExtensionService, FileService, GameService, PortalService, ReportService, TriggerService, WalletService, getFingerPrint };
|
|
6520
|
-
//# sourceMappingURL=chunk-
|
|
6521
|
-
//# sourceMappingURL=chunk-
|
|
6532
|
+
//# sourceMappingURL=chunk-443LKA6K.js.map
|
|
6533
|
+
//# sourceMappingURL=chunk-443LKA6K.js.map
|