@ranty/ranty-sdk 3.17.0-beta.3 → 3.17.0-beta.4
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.
|
@@ -925,7 +925,7 @@ function ie(t) {
|
|
|
925
925
|
*/
|
|
926
926
|
var ky;
|
|
927
927
|
((ky = window.HTMLSlotElement) === null || ky === void 0 ? void 0 : ky.prototype.assignedElements) != null;
|
|
928
|
-
const CI = "@ranty/ranty-sdk", BI = "3.17.0-beta.
|
|
928
|
+
const CI = "@ranty/ranty-sdk", BI = "3.17.0-beta.4", EI = "Ranty sdk", kI = "dist/index.js", SI = {
|
|
929
929
|
".": "./dist/index.js"
|
|
930
930
|
}, II = "types/index.d.ts", TI = [
|
|
931
931
|
"dist",
|
|
@@ -12603,10 +12603,16 @@ const pD = () => jt.getConfig().VITE_DATADOG_ENV !== "production", K = {
|
|
|
12603
12603
|
};
|
|
12604
12604
|
class hD {
|
|
12605
12605
|
constructor() {
|
|
12606
|
-
this._token = "", this._region = "", this.expirationTime = 0, this.key = "", this.lastTokenContext = {}, this.pendingRefresh = null;
|
|
12606
|
+
this._token = "", this._region = "", this.expirationTime = 0, this.key = "", this.lastTokenContext = {}, this.pendingRefresh = null, this.originalCreateTokenParams = null;
|
|
12607
12607
|
const e = sessionStorage.getItem("key");
|
|
12608
12608
|
e && (this.key = e);
|
|
12609
12609
|
}
|
|
12610
|
+
get token() {
|
|
12611
|
+
return this._token;
|
|
12612
|
+
}
|
|
12613
|
+
get region() {
|
|
12614
|
+
return this._region;
|
|
12615
|
+
}
|
|
12610
12616
|
createTokenCaptcha(e) {
|
|
12611
12617
|
return de(this, null, function* () {
|
|
12612
12618
|
if (jt.getConfig().VITE_ENV === "sandbox")
|
|
@@ -12669,6 +12675,7 @@ class hD {
|
|
|
12669
12675
|
createTokenWithAmplify(e, n, s, r) {
|
|
12670
12676
|
return de(this, null, function* () {
|
|
12671
12677
|
const i = jt.getConfig();
|
|
12678
|
+
sessionStorage.setItem("key", e);
|
|
12672
12679
|
let o = this._region;
|
|
12673
12680
|
o || (o = i.VITE_COGNITO_REGION_1);
|
|
12674
12681
|
const a = o === i.VITE_COGNITO_REGION_1 ? i.VITE_COGNITO_REGION_1 : i.VITE_COGNITO_REGION_2, d = a === i.VITE_COGNITO_REGION_1 ? i.VITE_IDENTITY_POOL_ID_1 : i.VITE_IDENTITY_POOL_ID_2;
|
|
@@ -12702,13 +12709,13 @@ class hD {
|
|
|
12702
12709
|
}
|
|
12703
12710
|
});
|
|
12704
12711
|
const { data: j } = yield wm.post(_, null, { headers: x });
|
|
12705
|
-
return j;
|
|
12712
|
+
return console.log(j), this._token = `${j.token_type} ${j.access_token}`, j;
|
|
12706
12713
|
});
|
|
12707
12714
|
}
|
|
12708
12715
|
createToken(e, n, s, r) {
|
|
12709
12716
|
return de(this, null, function* () {
|
|
12710
12717
|
try {
|
|
12711
|
-
this.key = e, this.lastTokenContext = { mode: n, isEmbedded: s, paymentRequestId: r };
|
|
12718
|
+
this.key = e, this.lastTokenContext = { mode: n, isEmbedded: s, paymentRequestId: r }, this.originalCreateTokenParams = { key: e, mode: n, isEmbedded: s, paymentRequestId: r };
|
|
12712
12719
|
let i, o;
|
|
12713
12720
|
try {
|
|
12714
12721
|
i = yield this.createTokenWithAmplify(e, n, s, r), o = this._region || jt.getConfig().VITE_COGNITO_REGION_1, K.info("createToken with Amplify success", {
|
|
@@ -12752,24 +12759,61 @@ class hD {
|
|
|
12752
12759
|
}
|
|
12753
12760
|
ensureValidToken() {
|
|
12754
12761
|
return de(this, null, function* () {
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
+
if (K.info("ensureValidToken called", {
|
|
12763
|
+
tag: "TOKEN_VALIDATION",
|
|
12764
|
+
contextObject: {
|
|
12765
|
+
hasToken: !!this._token,
|
|
12766
|
+
isExpired: Date.now() >= this.expirationTime,
|
|
12767
|
+
expirationTime: this.expirationTime,
|
|
12768
|
+
currentTime: Date.now(),
|
|
12769
|
+
hasKey: !!this.key,
|
|
12770
|
+
lastContext: this.lastTokenContext,
|
|
12771
|
+
hasOriginalParams: !!this.originalCreateTokenParams
|
|
12772
|
+
}
|
|
12773
|
+
}), Date.now() < this.expirationTime)
|
|
12774
|
+
return;
|
|
12775
|
+
const e = this.originalCreateTokenParams || {
|
|
12776
|
+
key: this.key,
|
|
12777
|
+
mode: this.lastTokenContext.mode,
|
|
12778
|
+
isEmbedded: this.lastTokenContext.isEmbedded,
|
|
12779
|
+
paymentRequestId: this.lastTokenContext.paymentRequestId
|
|
12780
|
+
};
|
|
12781
|
+
this.pendingRefresh || (K.info("Starting token refresh", {
|
|
12782
|
+
tag: "TOKEN_REFRESH_START",
|
|
12783
|
+
contextObject: {
|
|
12784
|
+
refreshParams: {
|
|
12785
|
+
hasKey: !!e.key,
|
|
12786
|
+
mode: e.mode,
|
|
12787
|
+
isEmbedded: e.isEmbedded,
|
|
12788
|
+
paymentRequestId: e.paymentRequestId
|
|
12789
|
+
}
|
|
12790
|
+
}
|
|
12791
|
+
}), this.pendingRefresh = this.createToken(
|
|
12792
|
+
e.key,
|
|
12793
|
+
e.mode,
|
|
12794
|
+
e.isEmbedded,
|
|
12795
|
+
e.paymentRequestId
|
|
12796
|
+
).catch((n) => {
|
|
12797
|
+
throw K.error(
|
|
12798
|
+
"Token refresh failed in ensureValidToken",
|
|
12799
|
+
{
|
|
12800
|
+
tag: "TOKEN_REFRESH_FAILED",
|
|
12801
|
+
contextObject: {
|
|
12802
|
+
error: n.message,
|
|
12803
|
+
refreshParams: e,
|
|
12804
|
+
lastContext: this.lastTokenContext
|
|
12805
|
+
}
|
|
12806
|
+
},
|
|
12807
|
+
n
|
|
12808
|
+
), this.pendingRefresh = null, n;
|
|
12762
12809
|
}).then(() => {
|
|
12763
|
-
|
|
12764
|
-
|
|
12810
|
+
K.info("Token refreshed successfully", {
|
|
12811
|
+
tag: "TOKEN_REFRESH_SUCCESS",
|
|
12812
|
+
contextObject: { newExpirationTime: this.expirationTime }
|
|
12813
|
+
}), this.pendingRefresh = null;
|
|
12814
|
+
})), yield this.pendingRefresh;
|
|
12765
12815
|
});
|
|
12766
12816
|
}
|
|
12767
|
-
get token() {
|
|
12768
|
-
return this._token;
|
|
12769
|
-
}
|
|
12770
|
-
get region() {
|
|
12771
|
-
return this._region;
|
|
12772
|
-
}
|
|
12773
12817
|
}
|
|
12774
12818
|
const IA = new hD(), qy = (t = !1, e, n) => {
|
|
12775
12819
|
const s = wm.create();
|
|
@@ -19526,10 +19570,10 @@ function GQ(t, e, n, s) {
|
|
|
19526
19570
|
}
|
|
19527
19571
|
const zp = mQ(GQ);
|
|
19528
19572
|
mL(Po(), "DD_LOGS", zp);
|
|
19529
|
-
const WQ = "@nx-ranty/ranty-sdk", YQ = "3.17.0-beta.
|
|
19573
|
+
const WQ = "@nx-ranty/ranty-sdk", YQ = "3.17.0-beta.4", JQ = 3, XQ = !0, ZQ = {
|
|
19530
19574
|
"": {
|
|
19531
19575
|
name: "@nx-ranty/ranty-sdk",
|
|
19532
|
-
version: "3.17.0-beta.
|
|
19576
|
+
version: "3.17.0-beta.4",
|
|
19533
19577
|
license: "ISC",
|
|
19534
19578
|
dependencies: {
|
|
19535
19579
|
"@datadog/browser-logs": "^6.17.0",
|
|
@@ -65455,7 +65499,7 @@ function(t) {
|
|
|
65455
65499
|
*/
|
|
65456
65500
|
function(t) {
|
|
65457
65501
|
function e() {
|
|
65458
|
-
return (yt.canvg ? Promise.resolve(yt.canvg) : import("./index.es-
|
|
65502
|
+
return (yt.canvg ? Promise.resolve(yt.canvg) : import("./index.es-cad1df1b.js")).catch(function(n) {
|
|
65459
65503
|
return Promise.reject(new Error("Could not load canvg: " + n));
|
|
65460
65504
|
}).then(function(n) {
|
|
65461
65505
|
return n.default ? n.default : n;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ar as o, an as t, aq as e, ag as n, au as r, as as C, at as i, ah as p, ae as A, am as m, al as l, af as u, ap as c, ao as d, ai as F, aj as S, ak as P, A as f, M as I, X as y, R as D, B as L, ad as O, a1 as k, Z as H, a6 as g, Y as M, a7 as v, a8 as b, a9 as x, h as E, f as h, ac as Q, ab as B, $ as j, a0 as q, a2 as w, a3 as N, a4 as z, C as G, j as J, w as K, a as R, d as T, aa as U, x as V, L as W, y as X, W as Y, K as Z, z as $, G as _, J as aa, D as sa, a5 as oa, E as ta, e as ea, l as na, b as ra, F as Ca, H as ia, I as pa, V as Aa, N as ma, k as la, T as ua, P as ca, m as da, O as Fa, U as Sa, Q as Pa, n as fa, i as Ia, o as ya, p as Da, q as La, S as Oa, u as ka, r as Ha, s as ga, t as Ma, v as va } from "./index-
|
|
1
|
+
import { ar as o, an as t, aq as e, ag as n, au as r, as as C, at as i, ah as p, ae as A, am as m, al as l, af as u, ap as c, ao as d, ai as F, aj as S, ak as P, A as f, M as I, X as y, R as D, B as L, ad as O, a1 as k, Z as H, a6 as g, Y as M, a7 as v, a8 as b, a9 as x, h as E, f as h, ac as Q, ab as B, $ as j, a0 as q, a2 as w, a3 as N, a4 as z, C as G, j as J, w as K, a as R, d as T, aa as U, x as V, L as W, y as X, W as Y, K as Z, z as $, G as _, J as aa, D as sa, a5 as oa, E as ta, e as ea, l as na, b as ra, F as Ca, H as ia, I as pa, V as Aa, N as ma, k as la, T as ua, P as ca, m as da, O as Fa, U as Sa, Q as Pa, n as fa, i as Ia, o as ya, p as Da, q as La, S as Oa, u as ka, r as Ha, s as ga, t as Ma, v as va } from "./index-889c7d9a.js";
|
|
2
2
|
export {
|
|
3
3
|
o as A2AAccountDetails,
|
|
4
4
|
t as A2AAccountList,
|