@opexa/portal-sdk 0.57.19 → 0.57.21
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/index.cjs +10 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.js +10 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8791,7 +8791,6 @@ var Sdk = class {
|
|
|
8791
8791
|
middlewares: [
|
|
8792
8792
|
/**/
|
|
8793
8793
|
this.authMiddleware,
|
|
8794
|
-
this.domainMiddleware,
|
|
8795
8794
|
this.fingerprintMiddleware,
|
|
8796
8795
|
this.miscMiddleware,
|
|
8797
8796
|
this.middleware
|
|
@@ -8876,7 +8875,6 @@ var Sdk = class {
|
|
|
8876
8875
|
}
|
|
8877
8876
|
_fetch = null;
|
|
8878
8877
|
_middleware;
|
|
8879
|
-
_domain = null;
|
|
8880
8878
|
/**
|
|
8881
8879
|
* @deprecated use `setFetch` instead
|
|
8882
8880
|
*/
|
|
@@ -8904,15 +8902,17 @@ var Sdk = class {
|
|
|
8904
8902
|
get middleware() {
|
|
8905
8903
|
return this._middleware;
|
|
8906
8904
|
}
|
|
8907
|
-
|
|
8908
|
-
this._domain = value;
|
|
8909
|
-
}
|
|
8910
|
-
get domain() {
|
|
8911
|
-
return this._domain;
|
|
8912
|
-
}
|
|
8913
|
-
initWebDomain() {
|
|
8905
|
+
initMarketDomain() {
|
|
8914
8906
|
if (typeof window === "undefined") return;
|
|
8915
|
-
if (core.Capacitor.isNativePlatform())
|
|
8907
|
+
if (core.Capacitor.isNativePlatform()) {
|
|
8908
|
+
const platform = core.Capacitor.getPlatform();
|
|
8909
|
+
if (platform === "ios") {
|
|
8910
|
+
sessionStorage.setItem("domain", "happybingo.ph/ios");
|
|
8911
|
+
} else {
|
|
8912
|
+
sessionStorage.setItem("domain", "happybingo.ph/android");
|
|
8913
|
+
}
|
|
8914
|
+
return;
|
|
8915
|
+
}
|
|
8916
8916
|
const searchParams = new URLSearchParams(window.location.search);
|
|
8917
8917
|
const hostname = window.location.hostname;
|
|
8918
8918
|
const market = searchParams.get("market");
|
|
@@ -8940,7 +8940,6 @@ var Sdk = class {
|
|
|
8940
8940
|
}
|
|
8941
8941
|
get marketDomain() {
|
|
8942
8942
|
if (typeof window === "undefined") return null;
|
|
8943
|
-
if (core.Capacitor.isNativePlatform()) return null;
|
|
8944
8943
|
return sessionStorage.getItem("domain");
|
|
8945
8944
|
}
|
|
8946
8945
|
/*
|
|
@@ -9022,30 +9021,6 @@ var Sdk = class {
|
|
|
9022
9021
|
async fingerprint() {
|
|
9023
9022
|
return await getFingerprint();
|
|
9024
9023
|
}
|
|
9025
|
-
/*
|
|
9026
|
-
*=============================================
|
|
9027
|
-
* DOMAIN MIDDLEWARE
|
|
9028
|
-
*=============================================
|
|
9029
|
-
*/
|
|
9030
|
-
get domainMiddleware() {
|
|
9031
|
-
return async (request) => {
|
|
9032
|
-
if (this._domain) {
|
|
9033
|
-
request.headers.set("Domain", this._domain);
|
|
9034
|
-
return request;
|
|
9035
|
-
}
|
|
9036
|
-
if (this.memberDomain?.includes("cabinet")) {
|
|
9037
|
-
request.headers.set("Domain", this.memberDomain);
|
|
9038
|
-
return request;
|
|
9039
|
-
}
|
|
9040
|
-
const domain = typeof window === "undefined" ? request.headers.get("Domain") : !core.Capacitor.isNativePlatform() ? request.headers.get("Domain") : core.Capacitor.getPlatform() === "ios" ? `ios/${this.config.platform}`.toLowerCase() : core.Capacitor.getPlatform() === "android" ? `android/${this.config.platform}`.toLowerCase() : request.headers.get("Domain");
|
|
9041
|
-
if (domain) {
|
|
9042
|
-
request.headers.set("Domain", domain);
|
|
9043
|
-
return request;
|
|
9044
|
-
}
|
|
9045
|
-
request.headers.delete("Domain");
|
|
9046
|
-
return request;
|
|
9047
|
-
};
|
|
9048
|
-
}
|
|
9049
9024
|
/*
|
|
9050
9025
|
*=============================================
|
|
9051
9026
|
* MISCELLANEOUS MIDDLEWARE
|