@stytch/vanilla-js 3.2.5 → 3.3.0
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/CHANGELOG.md +15 -0
- package/dist/b2b/index.d.ts +103 -5
- package/dist/b2b/index.esm.d.ts +103 -5
- package/dist/b2b/index.esm.js +3033 -2594
- package/dist/b2b/index.headless.d.ts +103 -5
- package/dist/b2b/index.headless.esm.d.ts +103 -5
- package/dist/b2b/index.headless.esm.js +830 -391
- package/dist/b2b/index.headless.js +802 -363
- package/dist/b2b/index.js +3367 -2928
- package/dist/index.esm.js +251 -215
- package/dist/index.headless.esm.js +119 -114
- package/dist/index.headless.js +131 -126
- package/dist/index.js +137 -101
- package/package.json +17 -18
|
@@ -135,8 +135,8 @@ function i() {
|
|
|
135
135
|
}
|
|
136
136
|
t.wrap = h;
|
|
137
137
|
var _ = "suspendedStart",
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
f = "suspendedYield",
|
|
139
|
+
m = "executing",
|
|
140
140
|
v = "completed",
|
|
141
141
|
b = {};
|
|
142
142
|
function g() {}
|
|
@@ -147,17 +147,17 @@ function i() {
|
|
|
147
147
|
return this;
|
|
148
148
|
});
|
|
149
149
|
var w = Object.getPrototypeOf,
|
|
150
|
-
A = w && w(w(
|
|
150
|
+
A = w && w(w(D([])));
|
|
151
151
|
A && A !== r && o.call(A, c) && (S = A);
|
|
152
152
|
var E = k.prototype = g.prototype = Object.create(S);
|
|
153
|
-
function
|
|
153
|
+
function P(e) {
|
|
154
154
|
["next", "throw", "return"].forEach(function (t) {
|
|
155
155
|
d(e, t, function (e) {
|
|
156
156
|
return this._invoke(t, e);
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function T(e, t) {
|
|
161
161
|
function r(i, s, a, c) {
|
|
162
162
|
var u = p(e[i], e, s);
|
|
163
163
|
if ("throw" !== u.type) {
|
|
@@ -190,7 +190,7 @@ function i() {
|
|
|
190
190
|
function O(t, r, n) {
|
|
191
191
|
var i = _;
|
|
192
192
|
return function (o, s) {
|
|
193
|
-
if (i ===
|
|
193
|
+
if (i === m) throw new Error("Generator is already running");
|
|
194
194
|
if (i === v) {
|
|
195
195
|
if ("throw" === o) throw s;
|
|
196
196
|
return {
|
|
@@ -211,10 +211,10 @@ function i() {
|
|
|
211
211
|
if (i === _) throw i = v, n.arg;
|
|
212
212
|
n.dispatchException(n.arg);
|
|
213
213
|
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
214
|
-
i =
|
|
214
|
+
i = m;
|
|
215
215
|
var u = p(t, r, n);
|
|
216
216
|
if ("normal" === u.type) {
|
|
217
|
-
if (i = n.done ? v :
|
|
217
|
+
if (i = n.done ? v : f, u.arg === b) continue;
|
|
218
218
|
return {
|
|
219
219
|
value: u.arg,
|
|
220
220
|
done: n.done
|
|
@@ -248,7 +248,7 @@ function i() {
|
|
|
248
248
|
tryLoc: "root"
|
|
249
249
|
}], e.forEach(x, this), this.reset(!0);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function D(t) {
|
|
252
252
|
if (t || "" === t) {
|
|
253
253
|
var r = t[c];
|
|
254
254
|
if (r) return r.call(t);
|
|
@@ -279,15 +279,15 @@ function i() {
|
|
|
279
279
|
return {
|
|
280
280
|
__await: e
|
|
281
281
|
};
|
|
282
|
-
}, T
|
|
282
|
+
}, P(T.prototype), d(T.prototype, u, function () {
|
|
283
283
|
return this;
|
|
284
|
-
}), t.AsyncIterator =
|
|
284
|
+
}), t.AsyncIterator = T, t.async = function (e, r, n, i, o) {
|
|
285
285
|
void 0 === o && (o = Promise);
|
|
286
|
-
var s = new
|
|
286
|
+
var s = new T(h(e, r, n, i), o);
|
|
287
287
|
return t.isGeneratorFunction(r) ? s : s.next().then(function (e) {
|
|
288
288
|
return e.done ? e.value : s.next();
|
|
289
289
|
});
|
|
290
|
-
},
|
|
290
|
+
}, P(E), d(E, l, "Generator"), d(E, c, function () {
|
|
291
291
|
return this;
|
|
292
292
|
}), d(E, "toString", function () {
|
|
293
293
|
return "[object Generator]";
|
|
@@ -302,7 +302,7 @@ function i() {
|
|
|
302
302
|
}
|
|
303
303
|
return e.done = !0, e;
|
|
304
304
|
};
|
|
305
|
-
}, t.values =
|
|
305
|
+
}, t.values = D, R.prototype = {
|
|
306
306
|
constructor: R,
|
|
307
307
|
reset: function reset(t) {
|
|
308
308
|
if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(B), !t) for (var r in this) "t" === r.charAt(0) && o.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
|
|
@@ -376,7 +376,7 @@ function i() {
|
|
|
376
376
|
},
|
|
377
377
|
delegateYield: function delegateYield(t, r, n) {
|
|
378
378
|
return this.delegate = {
|
|
379
|
-
iterator:
|
|
379
|
+
iterator: D(t),
|
|
380
380
|
resultName: r,
|
|
381
381
|
nextLoc: n
|
|
382
382
|
}, "next" === this.method && (this.arg = e), b;
|
|
@@ -423,9 +423,9 @@ function u(e) {
|
|
|
423
423
|
var t = p();
|
|
424
424
|
return function () {
|
|
425
425
|
var r,
|
|
426
|
-
i =
|
|
426
|
+
i = f(e);
|
|
427
427
|
if (t) {
|
|
428
|
-
var o =
|
|
428
|
+
var o = f(this).constructor;
|
|
429
429
|
r = Reflect.construct(i, arguments, o);
|
|
430
430
|
} else r = i.apply(this, arguments);
|
|
431
431
|
return function (e, t) {
|
|
@@ -455,7 +455,7 @@ function d(e) {
|
|
|
455
455
|
t.set(e, r);
|
|
456
456
|
}
|
|
457
457
|
function r() {
|
|
458
|
-
return h(e, arguments,
|
|
458
|
+
return h(e, arguments, f(this).constructor);
|
|
459
459
|
}
|
|
460
460
|
return r.prototype = Object.create(e.prototype, {
|
|
461
461
|
constructor: {
|
|
@@ -490,15 +490,15 @@ function _(e, t) {
|
|
|
490
490
|
return e.__proto__ = t, e;
|
|
491
491
|
}, _(e, t);
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
return
|
|
493
|
+
function f(e) {
|
|
494
|
+
return f = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
495
495
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
496
|
-
},
|
|
496
|
+
}, f(e);
|
|
497
497
|
}
|
|
498
498
|
Object.defineProperty(exports, "__esModule", {
|
|
499
499
|
value: !0
|
|
500
500
|
});
|
|
501
|
-
var
|
|
501
|
+
var m, v, b, g, y, k;
|
|
502
502
|
function S(e, t, r, n) {
|
|
503
503
|
return new (r || (r = Promise))(function (i, o) {
|
|
504
504
|
function s(e) {
|
|
@@ -526,7 +526,7 @@ function S(e, t, r, n) {
|
|
|
526
526
|
}
|
|
527
527
|
"function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
528
528
|
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
529
|
-
}(
|
|
529
|
+
}(m || (m = {})), function (e) {
|
|
530
530
|
e.Google = "google", e.Microsoft = "microsoft", e.Apple = "apple", e.Github = "github", e.GitLab = "gitlab", e.Facebook = "facebook", e.Discord = "discord", e.Salesforce = "salesforce", e.Slack = "slack", e.Amazon = "amazon", e.Bitbucket = "bitbucket", e.LinkedIn = "linkedin", e.Coinbase = "coinbase", e.Twitch = "twitch", e.Twitter = "twitter", e.TikTok = "tiktok", e.Snapchat = "snapchat", e.Figma = "figma", e.Yahoo = "yahoo";
|
|
531
531
|
}(v || (v = {})), function (e) {
|
|
532
532
|
e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
|
|
@@ -535,13 +535,13 @@ function S(e, t, r, n) {
|
|
|
535
535
|
}(g || (g = {})), function (e) {
|
|
536
536
|
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
537
537
|
}(y || (y = {})), function (e) {
|
|
538
|
-
e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "
|
|
538
|
+
e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", e.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", e.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", e.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", e.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", e.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", e.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", e.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION";
|
|
539
539
|
}(k || (k = {}));
|
|
540
540
|
var w,
|
|
541
541
|
A,
|
|
542
542
|
E,
|
|
543
|
-
T,
|
|
544
543
|
P,
|
|
544
|
+
T,
|
|
545
545
|
O = function (e) {
|
|
546
546
|
c(r, d(Error));
|
|
547
547
|
var t = u(r);
|
|
@@ -597,9 +597,9 @@ var w,
|
|
|
597
597
|
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
598
598
|
}(E || (E = {})), function (e) {
|
|
599
599
|
e.Google = "google", e.Microsoft = "microsoft";
|
|
600
|
-
}(
|
|
601
|
-
var
|
|
602
|
-
|
|
600
|
+
}(P || (P = {})), (T || (T = {})).RequiredCatcha = "Catcha Required";
|
|
601
|
+
var D,
|
|
602
|
+
I = function (e) {
|
|
603
603
|
c(r, d(Error));
|
|
604
604
|
var t = u(r);
|
|
605
605
|
function r(e) {
|
|
@@ -609,93 +609,94 @@ var I,
|
|
|
609
609
|
return s(r);
|
|
610
610
|
}();
|
|
611
611
|
function L(e) {
|
|
612
|
-
var t
|
|
613
|
-
r = e.
|
|
614
|
-
n = e.
|
|
615
|
-
o = e.
|
|
616
|
-
s = e.
|
|
617
|
-
a = e.
|
|
618
|
-
c = e.
|
|
612
|
+
var t,
|
|
613
|
+
r = e.method,
|
|
614
|
+
n = e.errorMessage,
|
|
615
|
+
o = e.finalURL,
|
|
616
|
+
s = e.basicAuthHeader,
|
|
617
|
+
a = e.xSDKClientHeader,
|
|
618
|
+
c = e.xSDKParentHostHeader,
|
|
619
|
+
u = e.body;
|
|
619
620
|
return S(this, void 0, void 0, i().mark(function e() {
|
|
620
|
-
var
|
|
621
|
+
var l, d, h, p, _, f;
|
|
621
622
|
return i().wrap(function (e) {
|
|
622
623
|
for (;;) switch (e.prev = e.next) {
|
|
623
624
|
case 0:
|
|
624
|
-
return
|
|
625
|
-
Authorization:
|
|
625
|
+
return l = {
|
|
626
|
+
Authorization: s,
|
|
626
627
|
"Content-Type": "application/json",
|
|
627
|
-
"X-SDK-Client":
|
|
628
|
-
},
|
|
629
|
-
method:
|
|
630
|
-
headers:
|
|
631
|
-
body:
|
|
632
|
-
}, e.prev = 3, e.next = 6, fetch(
|
|
628
|
+
"X-SDK-Client": a
|
|
629
|
+
}, c && (l["X-SDK-Parent-Host"] = c), d = {
|
|
630
|
+
method: r,
|
|
631
|
+
headers: l,
|
|
632
|
+
body: u && JSON.stringify(u)
|
|
633
|
+
}, e.prev = 3, e.next = 6, fetch(o, d);
|
|
633
634
|
case 6:
|
|
634
|
-
|
|
635
|
+
h = e.sent, e.next = 14;
|
|
635
636
|
break;
|
|
636
637
|
case 9:
|
|
637
638
|
if (e.prev = 9, e.t0 = e["catch"](3), "Failed to fetch" !== e.t0.message) {
|
|
638
639
|
e.next = 13;
|
|
639
640
|
break;
|
|
640
641
|
}
|
|
641
|
-
throw new O(
|
|
642
|
+
throw new O(n, "Unable to contact the Stytch servers. Are you online?");
|
|
642
643
|
case 13:
|
|
643
644
|
throw e.t0;
|
|
644
645
|
case 14:
|
|
645
|
-
if (
|
|
646
|
-
e.next =
|
|
646
|
+
if (!(h.status <= 299)) {
|
|
647
|
+
e.next = 25;
|
|
647
648
|
break;
|
|
648
649
|
}
|
|
649
|
-
return e.prev = 15, e.next = 18,
|
|
650
|
+
return e.prev = 15, e.next = 18, h.json();
|
|
650
651
|
case 18:
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
e.next = 26;
|
|
652
|
+
return p = e.sent, e.abrupt("return", p.data);
|
|
653
|
+
case 22:
|
|
654
|
+
throw e.prev = 22, e.t1 = e["catch"](15), new O(n, "Invalid JSON response from the Stytch servers.");
|
|
655
|
+
case 25:
|
|
656
|
+
if (200 === h.status || !(null === (t = h.headers.get("content-type")) || void 0 === t ? void 0 : t.includes("application/json"))) {
|
|
657
|
+
e.next = 38;
|
|
658
658
|
break;
|
|
659
659
|
}
|
|
660
|
-
|
|
661
|
-
case
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
660
|
+
return e.prev = 26, e.next = 29, h.json();
|
|
661
|
+
case 29:
|
|
662
|
+
_ = e.sent, e.next = 35;
|
|
663
|
+
break;
|
|
664
|
+
case 32:
|
|
665
|
+
throw e.prev = 32, e.t2 = e["catch"](26), new O(n, "Invalid or no response from server");
|
|
666
|
+
case 35:
|
|
667
|
+
if (!("body" in _ || "params" in _ || "query" in _)) {
|
|
668
|
+
e.next = 37;
|
|
666
669
|
break;
|
|
667
670
|
}
|
|
668
|
-
|
|
669
|
-
case 31:
|
|
670
|
-
p = e.sent, e.next = 37;
|
|
671
|
-
break;
|
|
672
|
-
case 34:
|
|
673
|
-
throw e.prev = 34, e.t2 = e["catch"](28), new O(r, "Invalid or no response from server");
|
|
671
|
+
throw new x(_);
|
|
674
672
|
case 37:
|
|
675
|
-
|
|
676
|
-
|
|
673
|
+
throw new B(_);
|
|
674
|
+
case 38:
|
|
675
|
+
return e.prev = 38, e.next = 41, h.text();
|
|
676
|
+
case 41:
|
|
677
|
+
f = e.sent, e.next = 47;
|
|
678
|
+
break;
|
|
679
|
+
case 44:
|
|
680
|
+
throw e.prev = 44, e.t3 = e["catch"](38), new O(n, "Invalid response from the Stytch servers.");
|
|
681
|
+
case 47:
|
|
682
|
+
if (!f.includes("Captcha required")) {
|
|
683
|
+
e.next = 49;
|
|
677
684
|
break;
|
|
678
685
|
}
|
|
679
|
-
throw new
|
|
680
|
-
case
|
|
681
|
-
throw new
|
|
682
|
-
case 40:
|
|
683
|
-
return e.prev = 40, e.next = 43, d.json();
|
|
684
|
-
case 43:
|
|
685
|
-
return _ = e.sent, e.abrupt("return", _.data);
|
|
686
|
-
case 47:
|
|
687
|
-
throw e.prev = 47, e.t3 = e["catch"](40), new O(r, "Invalid response from the Stytch servers.");
|
|
686
|
+
throw new I(T.RequiredCatcha);
|
|
687
|
+
case 49:
|
|
688
|
+
throw new O(n, "Invalid response from the Stytch servers.");
|
|
688
689
|
case 50:
|
|
689
690
|
case "end":
|
|
690
691
|
return e.stop();
|
|
691
692
|
}
|
|
692
|
-
}, e, null, [[3, 9], [15,
|
|
693
|
+
}, e, null, [[3, 9], [15, 22], [26, 32], [38, 44]]);
|
|
693
694
|
}));
|
|
694
695
|
}
|
|
695
696
|
var M = new Uint8Array(16);
|
|
696
697
|
function N() {
|
|
697
|
-
if (!
|
|
698
|
-
return
|
|
698
|
+
if (!D && !(D = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
699
|
+
return D(M);
|
|
699
700
|
}
|
|
700
701
|
var j = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
701
702
|
for (var F = [], K = 0; K < 256; ++K) F.push((K + 256).toString(16).substr(1));
|
|
@@ -707,7 +708,7 @@ function U(e) {
|
|
|
707
708
|
}(r)) throw TypeError("Stringified UUID is invalid");
|
|
708
709
|
return r;
|
|
709
710
|
}
|
|
710
|
-
function
|
|
711
|
+
function z(e, t, r) {
|
|
711
712
|
var n = (e = e || {}).random || (e.rng || N)();
|
|
712
713
|
if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
|
|
713
714
|
r = r || 0;
|
|
@@ -716,19 +717,19 @@ function W(e, t, r) {
|
|
|
716
717
|
}
|
|
717
718
|
return U(n);
|
|
718
719
|
}
|
|
719
|
-
var
|
|
720
|
-
function
|
|
720
|
+
var W = {};
|
|
721
|
+
function H(e, t) {
|
|
721
722
|
return S(this, void 0, void 0, i().mark(function r() {
|
|
722
723
|
return i().wrap(function (r) {
|
|
723
724
|
for (;;) switch (r.prev = r.next) {
|
|
724
725
|
case 0:
|
|
725
|
-
if (void 0 ===
|
|
726
|
+
if (void 0 === W[e]) {
|
|
726
727
|
r.next = 2;
|
|
727
728
|
break;
|
|
728
729
|
}
|
|
729
|
-
return r.abrupt("return",
|
|
730
|
+
return r.abrupt("return", W[e]);
|
|
730
731
|
case 2:
|
|
731
|
-
return
|
|
732
|
+
return W[e] = G(e, t), r.abrupt("return", W[e]);
|
|
732
733
|
case 4:
|
|
733
734
|
case "end":
|
|
734
735
|
return r.stop();
|
|
@@ -736,7 +737,7 @@ function G(e, t) {
|
|
|
736
737
|
}, r);
|
|
737
738
|
}));
|
|
738
739
|
}
|
|
739
|
-
function
|
|
740
|
+
function G(e, t) {
|
|
740
741
|
return new Promise(function (r, n) {
|
|
741
742
|
var i = function (e) {
|
|
742
743
|
var t = q(e);
|
|
@@ -768,11 +769,11 @@ var q = function q(e) {
|
|
|
768
769
|
};
|
|
769
770
|
var Y,
|
|
770
771
|
V = ["[Stytch]"],
|
|
771
|
-
|
|
772
|
+
J = function J() {
|
|
772
773
|
for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
|
|
773
774
|
return (e = console).warn.apply(e, V.concat(r));
|
|
774
775
|
},
|
|
775
|
-
|
|
776
|
+
$ = function $() {
|
|
776
777
|
for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
|
|
777
778
|
return (e = console).error.apply(e, V.concat(r));
|
|
778
779
|
},
|
|
@@ -974,7 +975,7 @@ var Y,
|
|
|
974
975
|
case 0:
|
|
975
976
|
return r.next = 2, this.state;
|
|
976
977
|
case 2:
|
|
977
|
-
if (n = r.sent, o = n.enabled, s = n.executeRecaptcha, e.type !==
|
|
978
|
+
if (n = r.sent, o = n.enabled, s = n.executeRecaptcha, e.type !== T.RequiredCatcha || !o) {
|
|
978
979
|
r.next = 14;
|
|
979
980
|
break;
|
|
980
981
|
}
|
|
@@ -1014,7 +1015,7 @@ var Y,
|
|
|
1014
1015
|
executeRecaptcha: s
|
|
1015
1016
|
});
|
|
1016
1017
|
case 2:
|
|
1017
|
-
return n.next = 4, void
|
|
1018
|
+
return n.next = 4, void H("".concat("https://elements.stytch.com", "/telemetry.js"), function () {
|
|
1018
1019
|
return window;
|
|
1019
1020
|
});
|
|
1020
1021
|
case 4:
|
|
@@ -1156,13 +1157,31 @@ var ne = Promise.resolve({
|
|
|
1156
1157
|
c = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : ne,
|
|
1157
1158
|
u = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : te();
|
|
1158
1159
|
a(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = o, this._config = c, this.dfpProtectedAuth = u, this.email = {
|
|
1160
|
+
invite: function invite(e) {
|
|
1161
|
+
return S(s, void 0, void 0, i().mark(function t() {
|
|
1162
|
+
return i().wrap(function (t) {
|
|
1163
|
+
for (;;) switch (t.prev = t.next) {
|
|
1164
|
+
case 0:
|
|
1165
|
+
return Q("stytch.magicLinks.email.loginOrSignup").isString("email_address", e.email_address).isOptionalString("invite_redirect_url", e.invite_redirect_url).isOptionalString("invite_template_id", e.invite_template_id).isOptionalString("name", e.name).isOptionalString("locale", e.locale).isOptionalStringArray("roles", e.roles), t.abrupt("return", this._networkClient.fetchSDK({
|
|
1166
|
+
url: "/b2b/magic_links/email/invite",
|
|
1167
|
+
body: e,
|
|
1168
|
+
errorMessage: "Failed to send invite.",
|
|
1169
|
+
method: "POST"
|
|
1170
|
+
}));
|
|
1171
|
+
case 2:
|
|
1172
|
+
case "end":
|
|
1173
|
+
return t.stop();
|
|
1174
|
+
}
|
|
1175
|
+
}, t, this);
|
|
1176
|
+
}));
|
|
1177
|
+
},
|
|
1159
1178
|
loginOrSignup: function loginOrSignup(e) {
|
|
1160
1179
|
return S(s, void 0, void 0, i().mark(function t() {
|
|
1161
1180
|
var r, n;
|
|
1162
1181
|
return i().wrap(function (t) {
|
|
1163
1182
|
for (;;) switch (t.prev = t.next) {
|
|
1164
1183
|
case 0:
|
|
1165
|
-
return Q("stytch.magicLinks.email.loginOrSignup").isString("
|
|
1184
|
+
return Q("stytch.magicLinks.email.loginOrSignup").isString("email_address", e.email_address).isString("organization_id", e.organization_id).isOptionalString("login_redirect_url", e.login_redirect_url).isOptionalString("login_template_id", e.login_template_id).isOptionalString("signup_redirect_url", e.signup_redirect_url).isOptionalString("signup_template_id", e.signup_template_id).isOptionalString("locale", e.locale), t.next = 3, this.getCodeChallenge();
|
|
1166
1185
|
case 3:
|
|
1167
1186
|
return r = t.sent, n = Object.assign(Object.assign({}, e), {
|
|
1168
1187
|
pkce_code_challenge: r
|
|
@@ -1398,7 +1417,7 @@ var ne = Promise.resolve({
|
|
|
1398
1417
|
return i().wrap(function (t) {
|
|
1399
1418
|
for (;;) switch (t.prev = t.next) {
|
|
1400
1419
|
case 0:
|
|
1401
|
-
return Q("stytch.
|
|
1420
|
+
return Q("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number), t.next = 3, this._networkClient.fetchSDK({
|
|
1402
1421
|
url: "/b2b/organizations/members/update",
|
|
1403
1422
|
body: e,
|
|
1404
1423
|
errorMessage: "Failed to update member.",
|
|
@@ -1431,12 +1450,153 @@ var ne = Promise.resolve({
|
|
|
1431
1450
|
}
|
|
1432
1451
|
}, e, this);
|
|
1433
1452
|
}));
|
|
1453
|
+
}, this.deletePassword = function (e) {
|
|
1454
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1455
|
+
var r;
|
|
1456
|
+
return i().wrap(function (t) {
|
|
1457
|
+
for (;;) switch (t.prev = t.next) {
|
|
1458
|
+
case 0:
|
|
1459
|
+
return t.next = 2, this._networkClient.fetchSDK({
|
|
1460
|
+
url: "/b2b/organizations/members/passwords/".concat(e),
|
|
1461
|
+
errorMessage: "Failed to delete member password.",
|
|
1462
|
+
method: "DELETE"
|
|
1463
|
+
});
|
|
1464
|
+
case 2:
|
|
1465
|
+
return r = t.sent, this._subscriptionService.updateMember(r.member), t.abrupt("return", r);
|
|
1466
|
+
case 5:
|
|
1467
|
+
case "end":
|
|
1468
|
+
return t.stop();
|
|
1469
|
+
}
|
|
1470
|
+
}, t, this);
|
|
1471
|
+
}));
|
|
1434
1472
|
};
|
|
1435
1473
|
}),
|
|
1436
1474
|
se = function () {
|
|
1437
|
-
function e(t, r, n,
|
|
1438
|
-
var
|
|
1439
|
-
|
|
1475
|
+
function e(t, r, n, o, s) {
|
|
1476
|
+
var c = this,
|
|
1477
|
+
u = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : te();
|
|
1478
|
+
a(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = o, this._config = s, this.dfpProtectedAuth = u, this.saml = {
|
|
1479
|
+
createConnection: function createConnection(e) {
|
|
1480
|
+
return S(c, void 0, void 0, i().mark(function t() {
|
|
1481
|
+
return i().wrap(function (t) {
|
|
1482
|
+
for (;;) switch (t.prev = t.next) {
|
|
1483
|
+
case 0:
|
|
1484
|
+
return t.next = 2, this._networkClient.fetchSDK({
|
|
1485
|
+
url: "/b2b/sso/saml",
|
|
1486
|
+
method: "POST",
|
|
1487
|
+
body: e,
|
|
1488
|
+
errorMessage: "Failed to create SAML Connection."
|
|
1489
|
+
});
|
|
1490
|
+
case 2:
|
|
1491
|
+
return t.abrupt("return", t.sent);
|
|
1492
|
+
case 3:
|
|
1493
|
+
case "end":
|
|
1494
|
+
return t.stop();
|
|
1495
|
+
}
|
|
1496
|
+
}, t, this);
|
|
1497
|
+
}));
|
|
1498
|
+
},
|
|
1499
|
+
updateConnection: function updateConnection(e) {
|
|
1500
|
+
return S(c, void 0, void 0, i().mark(function t() {
|
|
1501
|
+
return i().wrap(function (t) {
|
|
1502
|
+
for (;;) switch (t.prev = t.next) {
|
|
1503
|
+
case 0:
|
|
1504
|
+
return t.next = 2, this._networkClient.fetchSDK({
|
|
1505
|
+
url: "/b2b/sso/saml/".concat(e.connection_id),
|
|
1506
|
+
method: "PUT",
|
|
1507
|
+
body: e,
|
|
1508
|
+
errorMessage: "Failed to update SAML Connection."
|
|
1509
|
+
});
|
|
1510
|
+
case 2:
|
|
1511
|
+
return t.abrupt("return", t.sent);
|
|
1512
|
+
case 3:
|
|
1513
|
+
case "end":
|
|
1514
|
+
return t.stop();
|
|
1515
|
+
}
|
|
1516
|
+
}, t, this);
|
|
1517
|
+
}));
|
|
1518
|
+
},
|
|
1519
|
+
updateConnectionByURL: function updateConnectionByURL(e) {
|
|
1520
|
+
return S(c, void 0, void 0, i().mark(function t() {
|
|
1521
|
+
return i().wrap(function (t) {
|
|
1522
|
+
for (;;) switch (t.prev = t.next) {
|
|
1523
|
+
case 0:
|
|
1524
|
+
return t.next = 2, this._networkClient.fetchSDK({
|
|
1525
|
+
url: "/b2b/sso/saml/".concat(e.connection_id, "/url"),
|
|
1526
|
+
method: "PUT",
|
|
1527
|
+
body: e,
|
|
1528
|
+
errorMessage: "Failed to update SAML Connection."
|
|
1529
|
+
});
|
|
1530
|
+
case 2:
|
|
1531
|
+
return t.abrupt("return", t.sent);
|
|
1532
|
+
case 3:
|
|
1533
|
+
case "end":
|
|
1534
|
+
return t.stop();
|
|
1535
|
+
}
|
|
1536
|
+
}, t, this);
|
|
1537
|
+
}));
|
|
1538
|
+
},
|
|
1539
|
+
deleteVerificationCertificate: function deleteVerificationCertificate(e) {
|
|
1540
|
+
return S(c, void 0, void 0, i().mark(function t() {
|
|
1541
|
+
return i().wrap(function (t) {
|
|
1542
|
+
for (;;) switch (t.prev = t.next) {
|
|
1543
|
+
case 0:
|
|
1544
|
+
return t.next = 2, this._networkClient.fetchSDK({
|
|
1545
|
+
url: "/b2b/sso/saml/".concat(e.connection_id, "/verification_certificates/").concat(e.certificate_id),
|
|
1546
|
+
method: "DELETE",
|
|
1547
|
+
errorMessage: "Failed to delete SAML Verification Certificate."
|
|
1548
|
+
});
|
|
1549
|
+
case 2:
|
|
1550
|
+
return t.abrupt("return", t.sent);
|
|
1551
|
+
case 3:
|
|
1552
|
+
case "end":
|
|
1553
|
+
return t.stop();
|
|
1554
|
+
}
|
|
1555
|
+
}, t, this);
|
|
1556
|
+
}));
|
|
1557
|
+
}
|
|
1558
|
+
}, this.oidc = {
|
|
1559
|
+
createConnection: function createConnection(e) {
|
|
1560
|
+
return S(c, void 0, void 0, i().mark(function t() {
|
|
1561
|
+
return i().wrap(function (t) {
|
|
1562
|
+
for (;;) switch (t.prev = t.next) {
|
|
1563
|
+
case 0:
|
|
1564
|
+
return t.next = 2, this._networkClient.fetchSDK({
|
|
1565
|
+
url: "/b2b/sso/oidc",
|
|
1566
|
+
method: "POST",
|
|
1567
|
+
body: e,
|
|
1568
|
+
errorMessage: "Failed to create OIDC Connection."
|
|
1569
|
+
});
|
|
1570
|
+
case 2:
|
|
1571
|
+
return t.abrupt("return", t.sent);
|
|
1572
|
+
case 3:
|
|
1573
|
+
case "end":
|
|
1574
|
+
return t.stop();
|
|
1575
|
+
}
|
|
1576
|
+
}, t, this);
|
|
1577
|
+
}));
|
|
1578
|
+
},
|
|
1579
|
+
updateConnection: function updateConnection(e) {
|
|
1580
|
+
return S(c, void 0, void 0, i().mark(function t() {
|
|
1581
|
+
return i().wrap(function (t) {
|
|
1582
|
+
for (;;) switch (t.prev = t.next) {
|
|
1583
|
+
case 0:
|
|
1584
|
+
return t.next = 2, this._networkClient.fetchSDK({
|
|
1585
|
+
url: "/b2b/sso/oidc/".concat(e.connection_id),
|
|
1586
|
+
method: "PUT",
|
|
1587
|
+
body: e,
|
|
1588
|
+
errorMessage: "Failed to update OIDC Connection."
|
|
1589
|
+
});
|
|
1590
|
+
case 2:
|
|
1591
|
+
return t.abrupt("return", t.sent);
|
|
1592
|
+
case 3:
|
|
1593
|
+
case "end":
|
|
1594
|
+
return t.stop();
|
|
1595
|
+
}
|
|
1596
|
+
}, t, this);
|
|
1597
|
+
}));
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1440
1600
|
}
|
|
1441
1601
|
return s(e, [{
|
|
1442
1602
|
key: "authenticate",
|
|
@@ -1448,7 +1608,7 @@ var ne = Promise.resolve({
|
|
|
1448
1608
|
case 0:
|
|
1449
1609
|
return Q("stytch.sso.authenticate").isString("sso_token", e.sso_token).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale), t.next = 3, this._pkceManager.getPKPair();
|
|
1450
1610
|
case 3:
|
|
1451
|
-
return (r = t.sent) ||
|
|
1611
|
+
return (r = t.sent) || J("No code verifier found in local storage for SSO flow.\nConsider using stytch.sso.start() to add PKCE to your SSO flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information."), t.next = 7, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
1452
1612
|
case 7:
|
|
1453
1613
|
return n = t.sent, o = n.dfp_telemetry_id, s = n.captcha_token, t.next = 12, this._networkClient.retriableFetchSDK({
|
|
1454
1614
|
url: "/b2b/sso/authenticate",
|
|
@@ -1539,12 +1699,52 @@ var ne = Promise.resolve({
|
|
|
1539
1699
|
}, e, this);
|
|
1540
1700
|
}));
|
|
1541
1701
|
}
|
|
1702
|
+
}, {
|
|
1703
|
+
key: "getConnections",
|
|
1704
|
+
value: function value() {
|
|
1705
|
+
return S(this, void 0, void 0, i().mark(function e() {
|
|
1706
|
+
return i().wrap(function (e) {
|
|
1707
|
+
for (;;) switch (e.prev = e.next) {
|
|
1708
|
+
case 0:
|
|
1709
|
+
return e.next = 2, this._networkClient.fetchSDK({
|
|
1710
|
+
url: "/b2b/sso",
|
|
1711
|
+
method: "GET",
|
|
1712
|
+
errorMessage: "Failed to get SSO Connections."
|
|
1713
|
+
});
|
|
1714
|
+
case 2:
|
|
1715
|
+
return e.abrupt("return", e.sent);
|
|
1716
|
+
case 3:
|
|
1717
|
+
case "end":
|
|
1718
|
+
return e.stop();
|
|
1719
|
+
}
|
|
1720
|
+
}, e, this);
|
|
1721
|
+
}));
|
|
1722
|
+
}
|
|
1723
|
+
}, {
|
|
1724
|
+
key: "deleteConnection",
|
|
1725
|
+
value: function value(e) {
|
|
1726
|
+
return S(this, void 0, void 0, i().mark(function t() {
|
|
1727
|
+
return i().wrap(function (t) {
|
|
1728
|
+
for (;;) switch (t.prev = t.next) {
|
|
1729
|
+
case 0:
|
|
1730
|
+
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
1731
|
+
url: "/b2b/sso/".concat(e),
|
|
1732
|
+
method: "DELETE",
|
|
1733
|
+
errorMessage: "Failed to delete SSO Connection."
|
|
1734
|
+
}));
|
|
1735
|
+
case 1:
|
|
1736
|
+
case "end":
|
|
1737
|
+
return t.stop();
|
|
1738
|
+
}
|
|
1739
|
+
}, t, this);
|
|
1740
|
+
}));
|
|
1741
|
+
}
|
|
1542
1742
|
}]), e;
|
|
1543
1743
|
}(),
|
|
1544
|
-
ae = s(function e(t) {
|
|
1545
|
-
var
|
|
1546
|
-
a(this, e), this._networkClient = t, this.get = function () {
|
|
1547
|
-
return S(
|
|
1744
|
+
ae = s(function e(t, r) {
|
|
1745
|
+
var n = this;
|
|
1746
|
+
a(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
|
|
1747
|
+
return S(n, void 0, void 0, i().mark(function e() {
|
|
1548
1748
|
var t;
|
|
1549
1749
|
return i().wrap(function (e) {
|
|
1550
1750
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -1562,6 +1762,168 @@ var ne = Promise.resolve({
|
|
|
1562
1762
|
}
|
|
1563
1763
|
}, e, this);
|
|
1564
1764
|
}));
|
|
1765
|
+
}, this.update = function (e) {
|
|
1766
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1767
|
+
var r;
|
|
1768
|
+
return i().wrap(function (t) {
|
|
1769
|
+
for (;;) switch (t.prev = t.next) {
|
|
1770
|
+
case 0:
|
|
1771
|
+
return t.next = 2, this._networkClient.fetchSDK({
|
|
1772
|
+
url: "/b2b/organizations/me",
|
|
1773
|
+
errorMessage: "Failed to update organization info.",
|
|
1774
|
+
method: "PUT",
|
|
1775
|
+
body: e
|
|
1776
|
+
});
|
|
1777
|
+
case 2:
|
|
1778
|
+
return r = t.sent, t.abrupt("return", r);
|
|
1779
|
+
case 4:
|
|
1780
|
+
case "end":
|
|
1781
|
+
return t.stop();
|
|
1782
|
+
}
|
|
1783
|
+
}, t, this);
|
|
1784
|
+
}));
|
|
1785
|
+
}, this["delete"] = function () {
|
|
1786
|
+
return S(n, void 0, void 0, i().mark(function e() {
|
|
1787
|
+
var t;
|
|
1788
|
+
return i().wrap(function (e) {
|
|
1789
|
+
for (;;) switch (e.prev = e.next) {
|
|
1790
|
+
case 0:
|
|
1791
|
+
return e.next = 2, this._networkClient.fetchSDK({
|
|
1792
|
+
url: "/b2b/organizations/me",
|
|
1793
|
+
errorMessage: "Failed to delete organization.",
|
|
1794
|
+
method: "DELETE"
|
|
1795
|
+
});
|
|
1796
|
+
case 2:
|
|
1797
|
+
return t = e.sent, this._subscriptionService.destroyState(), e.abrupt("return", t);
|
|
1798
|
+
case 5:
|
|
1799
|
+
case "end":
|
|
1800
|
+
return e.stop();
|
|
1801
|
+
}
|
|
1802
|
+
}, e, this);
|
|
1803
|
+
}));
|
|
1804
|
+
}, this.members = {
|
|
1805
|
+
create: function create(e) {
|
|
1806
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1807
|
+
return i().wrap(function (t) {
|
|
1808
|
+
for (;;) switch (t.prev = t.next) {
|
|
1809
|
+
case 0:
|
|
1810
|
+
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
1811
|
+
url: "/b2b/organizations/members",
|
|
1812
|
+
errorMessage: "Failed to create member.",
|
|
1813
|
+
method: "POST",
|
|
1814
|
+
body: e
|
|
1815
|
+
}));
|
|
1816
|
+
case 1:
|
|
1817
|
+
case "end":
|
|
1818
|
+
return t.stop();
|
|
1819
|
+
}
|
|
1820
|
+
}, t, this);
|
|
1821
|
+
}));
|
|
1822
|
+
},
|
|
1823
|
+
search: function search(e) {
|
|
1824
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1825
|
+
return i().wrap(function (t) {
|
|
1826
|
+
for (;;) switch (t.prev = t.next) {
|
|
1827
|
+
case 0:
|
|
1828
|
+
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
1829
|
+
url: "/b2b/organizations/me/members/search",
|
|
1830
|
+
errorMessage: "Failed to search members.",
|
|
1831
|
+
method: "POST",
|
|
1832
|
+
body: e
|
|
1833
|
+
}));
|
|
1834
|
+
case 1:
|
|
1835
|
+
case "end":
|
|
1836
|
+
return t.stop();
|
|
1837
|
+
}
|
|
1838
|
+
}, t, this);
|
|
1839
|
+
}));
|
|
1840
|
+
},
|
|
1841
|
+
update: function update(e) {
|
|
1842
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1843
|
+
return i().wrap(function (t) {
|
|
1844
|
+
for (;;) switch (t.prev = t.next) {
|
|
1845
|
+
case 0:
|
|
1846
|
+
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
1847
|
+
url: "/b2b/organizations/members/".concat(e.member_id),
|
|
1848
|
+
errorMessage: "Failed to update member.",
|
|
1849
|
+
method: "PUT",
|
|
1850
|
+
body: e
|
|
1851
|
+
}));
|
|
1852
|
+
case 1:
|
|
1853
|
+
case "end":
|
|
1854
|
+
return t.stop();
|
|
1855
|
+
}
|
|
1856
|
+
}, t, this);
|
|
1857
|
+
}));
|
|
1858
|
+
},
|
|
1859
|
+
deletePassword: function deletePassword(e) {
|
|
1860
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1861
|
+
return i().wrap(function (t) {
|
|
1862
|
+
for (;;) switch (t.prev = t.next) {
|
|
1863
|
+
case 0:
|
|
1864
|
+
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
1865
|
+
url: "/b2b/organizations/members/passwords/".concat(e),
|
|
1866
|
+
errorMessage: "Failed to delete member password.",
|
|
1867
|
+
method: "DELETE"
|
|
1868
|
+
}));
|
|
1869
|
+
case 1:
|
|
1870
|
+
case "end":
|
|
1871
|
+
return t.stop();
|
|
1872
|
+
}
|
|
1873
|
+
}, t, this);
|
|
1874
|
+
}));
|
|
1875
|
+
},
|
|
1876
|
+
deleteMFAPhoneNumber: function deleteMFAPhoneNumber(e) {
|
|
1877
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1878
|
+
return i().wrap(function (t) {
|
|
1879
|
+
for (;;) switch (t.prev = t.next) {
|
|
1880
|
+
case 0:
|
|
1881
|
+
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
1882
|
+
url: "/b2b/organizations/members/mfa_phone_numbers/".concat(e),
|
|
1883
|
+
errorMessage: "Failed to delete member MFA Phone number.",
|
|
1884
|
+
method: "DELETE"
|
|
1885
|
+
}));
|
|
1886
|
+
case 1:
|
|
1887
|
+
case "end":
|
|
1888
|
+
return t.stop();
|
|
1889
|
+
}
|
|
1890
|
+
}, t, this);
|
|
1891
|
+
}));
|
|
1892
|
+
},
|
|
1893
|
+
"delete": function _delete(e) {
|
|
1894
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1895
|
+
return i().wrap(function (t) {
|
|
1896
|
+
for (;;) switch (t.prev = t.next) {
|
|
1897
|
+
case 0:
|
|
1898
|
+
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
1899
|
+
url: "/b2b/organizations/members/".concat(e),
|
|
1900
|
+
errorMessage: "Failed to delete member.",
|
|
1901
|
+
method: "DELETE"
|
|
1902
|
+
}));
|
|
1903
|
+
case 1:
|
|
1904
|
+
case "end":
|
|
1905
|
+
return t.stop();
|
|
1906
|
+
}
|
|
1907
|
+
}, t, this);
|
|
1908
|
+
}));
|
|
1909
|
+
},
|
|
1910
|
+
reactivate: function reactivate(e) {
|
|
1911
|
+
return S(n, void 0, void 0, i().mark(function t() {
|
|
1912
|
+
return i().wrap(function (t) {
|
|
1913
|
+
for (;;) switch (t.prev = t.next) {
|
|
1914
|
+
case 0:
|
|
1915
|
+
return t.abrupt("return", this._networkClient.fetchSDK({
|
|
1916
|
+
url: "/b2b/organizations/members/".concat(e, "/reactivate"),
|
|
1917
|
+
errorMessage: "Failed to reactivate member.",
|
|
1918
|
+
method: "PUT"
|
|
1919
|
+
}));
|
|
1920
|
+
case 1:
|
|
1921
|
+
case "end":
|
|
1922
|
+
return t.stop();
|
|
1923
|
+
}
|
|
1924
|
+
}, t, this);
|
|
1925
|
+
}));
|
|
1926
|
+
}
|
|
1565
1927
|
};
|
|
1566
1928
|
}),
|
|
1567
1929
|
ce = function () {
|
|
@@ -1605,14 +1967,14 @@ var ne = Promise.resolve({
|
|
|
1605
1967
|
}));
|
|
1606
1968
|
}
|
|
1607
1969
|
}, this.google = {
|
|
1608
|
-
start: this.startOAuthFlow(
|
|
1970
|
+
start: this.startOAuthFlow(P.Google),
|
|
1609
1971
|
discovery: {
|
|
1610
|
-
start: this.startDiscoveryOAuthFlow(
|
|
1972
|
+
start: this.startDiscoveryOAuthFlow(P.Google)
|
|
1611
1973
|
}
|
|
1612
1974
|
}, this.microsoft = {
|
|
1613
|
-
start: this.startOAuthFlow(
|
|
1975
|
+
start: this.startOAuthFlow(P.Microsoft),
|
|
1614
1976
|
discovery: {
|
|
1615
|
-
start: this.startDiscoveryOAuthFlow(
|
|
1977
|
+
start: this.startDiscoveryOAuthFlow(P.Microsoft)
|
|
1616
1978
|
}
|
|
1617
1979
|
};
|
|
1618
1980
|
}
|
|
@@ -1626,7 +1988,7 @@ var ne = Promise.resolve({
|
|
|
1626
1988
|
case 0:
|
|
1627
1989
|
return Q("stytch.oauth.authenticate").isString("oauth_token", e.oauth_token).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale), t.next = 3, this._pkceManager.getPKPair();
|
|
1628
1990
|
case 3:
|
|
1629
|
-
return (r = t.sent) ||
|
|
1991
|
+
return (r = t.sent) || J("No code verifier found in local storage for OAuth flow.\nConsider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information."), t.next = 7, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
1630
1992
|
case 7:
|
|
1631
1993
|
return n = t.sent, o = n.dfp_telemetry_id, s = n.captcha_token, t.next = 12, this._networkClient.retriableFetchSDK({
|
|
1632
1994
|
url: "/b2b/oauth/authenticate",
|
|
@@ -2004,18 +2366,7 @@ var ne = Promise.resolve({
|
|
|
2004
2366
|
Promise.resolve({
|
|
2005
2367
|
pkceRequiredForPasswordResets: !1
|
|
2006
2368
|
});
|
|
2007
|
-
var de,
|
|
2008
|
-
he,
|
|
2009
|
-
pe,
|
|
2010
|
-
_e,
|
|
2011
|
-
me,
|
|
2012
|
-
fe,
|
|
2013
|
-
ve,
|
|
2014
|
-
be,
|
|
2015
|
-
ge,
|
|
2016
|
-
ye,
|
|
2017
|
-
ke,
|
|
2018
|
-
Se = s(function e(t, r) {
|
|
2369
|
+
var de = s(function e(t, r) {
|
|
2019
2370
|
var n = this,
|
|
2020
2371
|
o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : te();
|
|
2021
2372
|
a(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = o, this.sms = {
|
|
@@ -2090,7 +2441,38 @@ var de,
|
|
|
2090
2441
|
}
|
|
2091
2442
|
};
|
|
2092
2443
|
}),
|
|
2093
|
-
|
|
2444
|
+
he = function () {
|
|
2445
|
+
function e(t, r, n) {
|
|
2446
|
+
var i = this;
|
|
2447
|
+
a(this, e), this._subscriptionService = n, this.isAuthorizedSync = function (e, t) {
|
|
2448
|
+
var r;
|
|
2449
|
+
return !!(null === (r = i.cachedPolicy) || void 0 === r ? void 0 : r.callerIsAuthorized(i.roleIds(), e, t));
|
|
2450
|
+
}, this.isAuthorized = function (e, t) {
|
|
2451
|
+
return i.policyPromise.then(function (r) {
|
|
2452
|
+
return r.callerIsAuthorized(i.roleIds(), e, t);
|
|
2453
|
+
});
|
|
2454
|
+
}, this.cachedPolicy = t.rbacPolicy ? Ee.fromJSON(t.rbacPolicy) : null, this.policyPromise = r.then(function (e) {
|
|
2455
|
+
return e.rbacPolicy ? (i.cachedPolicy = Ee.fromJSON(e.rbacPolicy), i.cachedPolicy) : ($("Unable to retrieve RBAC policy from servers. Assuming caller has no permissions."), new Ee([], []));
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
return s(e, [{
|
|
2459
|
+
key: "allPermissions",
|
|
2460
|
+
value: function value() {
|
|
2461
|
+
var e = this;
|
|
2462
|
+
return this.policyPromise.then(function (t) {
|
|
2463
|
+
return t.allPermissionsForCaller(e.roleIds());
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
}, {
|
|
2467
|
+
key: "roleIds",
|
|
2468
|
+
value: function value() {
|
|
2469
|
+
var e,
|
|
2470
|
+
t = this._subscriptionService.getSession();
|
|
2471
|
+
return t && null !== (e = t.roles) && void 0 !== e ? e : [];
|
|
2472
|
+
}
|
|
2473
|
+
}]), e;
|
|
2474
|
+
}(),
|
|
2475
|
+
pe = function () {
|
|
2094
2476
|
function e(t, r) {
|
|
2095
2477
|
var n = this;
|
|
2096
2478
|
a(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
|
|
@@ -2134,7 +2516,7 @@ var de,
|
|
|
2134
2516
|
this._reauthenticateWithBackoff().then(function () {
|
|
2135
2517
|
e.scheduleBackgroundRefresh();
|
|
2136
2518
|
})["catch"](function (t) {
|
|
2137
|
-
|
|
2519
|
+
J("Session background refresh failed. Signalling to app that user is logged out.", {
|
|
2138
2520
|
error: t
|
|
2139
2521
|
}), e._subscriptionService.destroyState();
|
|
2140
2522
|
});
|
|
@@ -2164,7 +2546,60 @@ var de,
|
|
|
2164
2546
|
}
|
|
2165
2547
|
}]), e;
|
|
2166
2548
|
}();
|
|
2167
|
-
|
|
2549
|
+
pe.REFRESH_INTERVAL_MS = 18e4;
|
|
2550
|
+
var _e,
|
|
2551
|
+
fe,
|
|
2552
|
+
me,
|
|
2553
|
+
ve,
|
|
2554
|
+
be,
|
|
2555
|
+
ge,
|
|
2556
|
+
ye,
|
|
2557
|
+
ke,
|
|
2558
|
+
Se,
|
|
2559
|
+
we,
|
|
2560
|
+
Ae,
|
|
2561
|
+
Ee = function () {
|
|
2562
|
+
function e(t, r) {
|
|
2563
|
+
var n = this;
|
|
2564
|
+
a(this, e), this.roles = t, this.resources = r, this.rolesByID = {}, t.forEach(function (e) {
|
|
2565
|
+
return n.rolesByID[e.role_id] = e;
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
return s(e, [{
|
|
2569
|
+
key: "callerIsAuthorized",
|
|
2570
|
+
value: function value(e, t, r) {
|
|
2571
|
+
var n = this;
|
|
2572
|
+
return !!e.map(function (e) {
|
|
2573
|
+
return n.rolesByID[e];
|
|
2574
|
+
}).filter(function (e) {
|
|
2575
|
+
return e;
|
|
2576
|
+
}).flatMap(function (e) {
|
|
2577
|
+
return e.permissions;
|
|
2578
|
+
}).filter(function (e) {
|
|
2579
|
+
return e.resource_id === t;
|
|
2580
|
+
}).find(function (e) {
|
|
2581
|
+
return e.actions.includes(r) || e.actions.includes("*");
|
|
2582
|
+
});
|
|
2583
|
+
}
|
|
2584
|
+
}, {
|
|
2585
|
+
key: "allPermissionsForCaller",
|
|
2586
|
+
value: function value(e) {
|
|
2587
|
+
var t = this,
|
|
2588
|
+
r = {};
|
|
2589
|
+
return this.resources.forEach(function (n) {
|
|
2590
|
+
r[n.resource_id] = {}, n.actions.forEach(function (i) {
|
|
2591
|
+
r[n.resource_id][i] = t.callerIsAuthorized(e, n.resource_id, i);
|
|
2592
|
+
});
|
|
2593
|
+
}), r;
|
|
2594
|
+
}
|
|
2595
|
+
}], [{
|
|
2596
|
+
key: "fromJSON",
|
|
2597
|
+
value: function value(t) {
|
|
2598
|
+
return new e(t.roles, t.resources);
|
|
2599
|
+
}
|
|
2600
|
+
}]), e;
|
|
2601
|
+
}();
|
|
2602
|
+
function Pe(e, t, r, n) {
|
|
2168
2603
|
return new (r || (r = Promise))(function (i, o) {
|
|
2169
2604
|
function s(e) {
|
|
2170
2605
|
try {
|
|
@@ -2189,65 +2624,65 @@ function Ae(e, t, r, n) {
|
|
|
2189
2624
|
c((n = n.apply(e, t || [])).next());
|
|
2190
2625
|
});
|
|
2191
2626
|
}
|
|
2192
|
-
|
|
2627
|
+
"function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
2193
2628
|
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
2194
|
-
}(
|
|
2629
|
+
}(_e || (_e = {})), function (e) {
|
|
2195
2630
|
e.Google = "google", e.Microsoft = "microsoft", e.Apple = "apple", e.Github = "github", e.GitLab = "gitlab", e.Facebook = "facebook", e.Discord = "discord", e.Salesforce = "salesforce", e.Slack = "slack", e.Amazon = "amazon", e.Bitbucket = "bitbucket", e.LinkedIn = "linkedin", e.Coinbase = "coinbase", e.Twitch = "twitch", e.Twitter = "twitter", e.TikTok = "tiktok", e.Snapchat = "snapchat", e.Figma = "figma", e.Yahoo = "yahoo";
|
|
2196
|
-
}(
|
|
2631
|
+
}(fe || (fe = {})), function (e) {
|
|
2197
2632
|
e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
|
|
2198
|
-
}(
|
|
2633
|
+
}(me || (me = {})), function (e) {
|
|
2199
2634
|
e.embedded = "embedded", e.floating = "floating";
|
|
2200
|
-
}(
|
|
2635
|
+
}(ve || (ve = {})), function (e) {
|
|
2201
2636
|
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
2202
|
-
}(
|
|
2203
|
-
e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "
|
|
2204
|
-
}(
|
|
2205
|
-
var
|
|
2206
|
-
_inherits(
|
|
2207
|
-
var _super = _createSuper(
|
|
2208
|
-
function
|
|
2637
|
+
}(be || (be = {})), function (e) {
|
|
2638
|
+
e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", e.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", e.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", e.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", e.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", e.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", e.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", e.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION";
|
|
2639
|
+
}(ge || (ge = {}));
|
|
2640
|
+
var Te = /*#__PURE__*/function (_Error) {
|
|
2641
|
+
_inherits(Te, _Error);
|
|
2642
|
+
var _super = _createSuper(Te);
|
|
2643
|
+
function Te(e, t) {
|
|
2209
2644
|
var _this;
|
|
2210
|
-
_classCallCheck(this,
|
|
2645
|
+
_classCallCheck(this, Te);
|
|
2211
2646
|
_this = _super.call(this), _this.name = "StytchSDKUsageError", _this.message = "Invalid call to ".concat(e, "\n") + t;
|
|
2212
2647
|
return _this;
|
|
2213
2648
|
}
|
|
2214
|
-
return _createClass(
|
|
2649
|
+
return _createClass(Te);
|
|
2215
2650
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
2216
2651
|
!function (e) {
|
|
2217
2652
|
e.BiometricsSensorError = "biometrics_sensor_error", e.DeviceCredentialsNotAllowed = "device_credentials_not_allowed", e.DeviceHardwareError = "device_hardware_error", e.InternalError = "internal_error", e.KeyInvalidated = "key_invalidated", e.KeystoreUnavailable = "keystore_unavailable", e.NoBiometricsEnrolled = "no_biometrics_enrolled", e.NoBiometricsRegistration = "no_biometrics_registration", e.SessionExpired = "session_expired", e.UserCancellation = "user_cancellation", e.UserLockedOut = "user_locked_out", e.BiometricsNotAvailable = "biometrics_not_available";
|
|
2218
|
-
}(
|
|
2653
|
+
}(ye || (ye = {})), function (e) {
|
|
2219
2654
|
e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
|
|
2220
|
-
}(
|
|
2655
|
+
}(ke || (ke = {})), function (e) {
|
|
2221
2656
|
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
2222
|
-
}(
|
|
2657
|
+
}(Se || (Se = {})), function (e) {
|
|
2223
2658
|
e.Google = "google", e.Microsoft = "microsoft";
|
|
2224
|
-
}(
|
|
2659
|
+
}(we || (we = {})), function (e) {
|
|
2225
2660
|
e.RequiredCatcha = "Catcha Required";
|
|
2226
|
-
}(
|
|
2227
|
-
var
|
|
2661
|
+
}(Ae || (Ae = {}));
|
|
2662
|
+
var Oe = function Oe(e) {
|
|
2228
2663
|
var t = {
|
|
2229
2664
|
isObject: function isObject(r, n) {
|
|
2230
|
-
if (!("object" == _typeof(n) && !Array.isArray(n) && null !== n)) throw new
|
|
2665
|
+
if (!("object" == _typeof(n) && !Array.isArray(n) && null !== n)) throw new Te(e, r + " must be an object.");
|
|
2231
2666
|
return t;
|
|
2232
2667
|
},
|
|
2233
2668
|
isOptionalObject: function isOptionalObject(e, r) {
|
|
2234
2669
|
return void 0 === r ? t : t.isObject(e, r);
|
|
2235
2670
|
},
|
|
2236
2671
|
isString: function isString(r, n) {
|
|
2237
|
-
if ("string" != typeof n) throw new
|
|
2672
|
+
if ("string" != typeof n) throw new Te(e, r + " must be a string.");
|
|
2238
2673
|
return t;
|
|
2239
2674
|
},
|
|
2240
2675
|
isOptionalString: function isOptionalString(e, r) {
|
|
2241
2676
|
return void 0 === r ? t : t.isString(e, r);
|
|
2242
2677
|
},
|
|
2243
2678
|
isStringArray: function isStringArray(r, n) {
|
|
2244
|
-
if (!Array.isArray(n)) throw new
|
|
2679
|
+
if (!Array.isArray(n)) throw new Te(e, r + " must be an array of strings.");
|
|
2245
2680
|
var _iterator = _createForOfIteratorHelper(n),
|
|
2246
2681
|
_step;
|
|
2247
2682
|
try {
|
|
2248
2683
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2249
|
-
var
|
|
2250
|
-
if ("string" != typeof
|
|
2684
|
+
var _t2 = _step.value;
|
|
2685
|
+
if ("string" != typeof _t2) throw new Te(e, r + " must be an array of strings.");
|
|
2251
2686
|
}
|
|
2252
2687
|
} catch (err) {
|
|
2253
2688
|
_iterator.e(err);
|
|
@@ -2260,14 +2695,14 @@ var Te = function Te(e) {
|
|
|
2260
2695
|
return void 0 === r ? t : t.isStringArray(e, r);
|
|
2261
2696
|
},
|
|
2262
2697
|
isNumber: function isNumber(r, n) {
|
|
2263
|
-
if ("number" != typeof n) throw new
|
|
2698
|
+
if ("number" != typeof n) throw new Te(e, r + " must be a number.");
|
|
2264
2699
|
return t;
|
|
2265
2700
|
},
|
|
2266
2701
|
isOptionalNumber: function isOptionalNumber(e, r) {
|
|
2267
2702
|
return void 0 === r ? t : t.isNumber(e, r);
|
|
2268
2703
|
},
|
|
2269
2704
|
isBoolean: function isBoolean(r, n) {
|
|
2270
|
-
if ("boolean" != typeof n) throw new
|
|
2705
|
+
if ("boolean" != typeof n) throw new Te(e, r + " must be a boolean.");
|
|
2271
2706
|
return t;
|
|
2272
2707
|
},
|
|
2273
2708
|
isOptionalBoolean: function isOptionalBoolean(e, r) {
|
|
@@ -2276,26 +2711,26 @@ var Te = function Te(e) {
|
|
|
2276
2711
|
};
|
|
2277
2712
|
return t;
|
|
2278
2713
|
};
|
|
2279
|
-
var
|
|
2714
|
+
var Ce;
|
|
2280
2715
|
!function (e) {
|
|
2281
2716
|
e.LoginOrCreateEML = "login_or_create_eml", e.LoginOrCreateOTP = "login_or_create_otp", e.ResetPassword = "reset_password";
|
|
2282
|
-
}(
|
|
2717
|
+
}(Ce || (Ce = {})), Promise.resolve({
|
|
2283
2718
|
pkceRequiredForEmailMagicLinks: !1
|
|
2284
2719
|
}), Promise.resolve({
|
|
2285
2720
|
pkceRequiredForPasswordResets: !1
|
|
2286
2721
|
}), Promise.resolve({
|
|
2287
2722
|
pkceRequiredForEmailMagicLinks: !1
|
|
2288
2723
|
});
|
|
2289
|
-
var
|
|
2724
|
+
var xe = Promise.resolve({
|
|
2290
2725
|
pkceRequiredForPasswordResets: !1
|
|
2291
2726
|
});
|
|
2292
|
-
var
|
|
2293
|
-
function
|
|
2294
|
-
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] :
|
|
2727
|
+
var Be = /*#__PURE__*/function () {
|
|
2728
|
+
function Be(e, t, r) {
|
|
2729
|
+
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : xe;
|
|
2295
2730
|
var i = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {
|
|
2296
2731
|
return {
|
|
2297
2732
|
isEnabled: function isEnabled() {
|
|
2298
|
-
return
|
|
2733
|
+
return Pe(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2299
2734
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2300
2735
|
while (1) switch (_context.prev = _context.next) {
|
|
2301
2736
|
case 0:
|
|
@@ -2308,7 +2743,7 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2308
2743
|
}));
|
|
2309
2744
|
},
|
|
2310
2745
|
getTelemetryID: function getTelemetryID() {
|
|
2311
|
-
return
|
|
2746
|
+
return Pe(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2312
2747
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2313
2748
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2314
2749
|
case 0:
|
|
@@ -2319,7 +2754,7 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2319
2754
|
}));
|
|
2320
2755
|
},
|
|
2321
2756
|
getDFPTelemetryIDAndCaptcha: function getDFPTelemetryIDAndCaptcha() {
|
|
2322
|
-
return
|
|
2757
|
+
return Pe(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
2323
2758
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2324
2759
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2325
2760
|
case 0:
|
|
@@ -2335,7 +2770,7 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2335
2770
|
}));
|
|
2336
2771
|
},
|
|
2337
2772
|
retryWithCaptchaAndDFP: function retryWithCaptchaAndDFP() {
|
|
2338
|
-
return
|
|
2773
|
+
return Pe(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
2339
2774
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2340
2775
|
while (1) switch (_context4.prev = _context4.next) {
|
|
2341
2776
|
case 0:
|
|
@@ -2349,13 +2784,13 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2349
2784
|
}
|
|
2350
2785
|
};
|
|
2351
2786
|
}();
|
|
2352
|
-
_classCallCheck(this,
|
|
2787
|
+
_classCallCheck(this, Be);
|
|
2353
2788
|
this._networkClient = e, this._subscriptionService = t, this._pkceManager = r, this._config = n, this.dfpProtectedAuth = i;
|
|
2354
2789
|
}
|
|
2355
|
-
_createClass(
|
|
2790
|
+
_createClass(Be, [{
|
|
2356
2791
|
key: "getCodeChallenge",
|
|
2357
2792
|
value: function getCodeChallenge() {
|
|
2358
|
-
return
|
|
2793
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
2359
2794
|
var _yield$this$_config, e, t;
|
|
2360
2795
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2361
2796
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -2396,12 +2831,12 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2396
2831
|
}, {
|
|
2397
2832
|
key: "authenticate",
|
|
2398
2833
|
value: function authenticate(e) {
|
|
2399
|
-
return
|
|
2834
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
2400
2835
|
var t, r, _yield$this$dfpProtec, n, i, o;
|
|
2401
2836
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
2402
2837
|
while (1) switch (_context6.prev = _context6.next) {
|
|
2403
2838
|
case 0:
|
|
2404
|
-
|
|
2839
|
+
Oe("stytch.passwords.authenticate").isString("org_id", e.organization_id).isString("password", e.password).isString("email_address", e.email_address).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale);
|
|
2405
2840
|
_context6.next = 3;
|
|
2406
2841
|
return this._pkceManager.getPKPair();
|
|
2407
2842
|
case 3:
|
|
@@ -2456,12 +2891,12 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2456
2891
|
}, {
|
|
2457
2892
|
key: "resetByEmailStart",
|
|
2458
2893
|
value: function resetByEmailStart(e) {
|
|
2459
|
-
return
|
|
2894
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
2460
2895
|
var t, _yield$this$dfpProtec2, r, n;
|
|
2461
2896
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
2462
2897
|
while (1) switch (_context7.prev = _context7.next) {
|
|
2463
2898
|
case 0:
|
|
2464
|
-
|
|
2899
|
+
Oe("stytch.passwords.resetByEmailStart").isString("email", e.email_address).isOptionalString("login_redirect_url", e.login_redirect_url).isOptionalString("reset_password_redirect_url", e.reset_password_redirect_url).isOptionalString("reset_password_template_id", e.reset_password_template_id).isOptionalNumber("reset_password_expiration_minutes", e.reset_password_expiration_minutes);
|
|
2465
2900
|
_context7.next = 3;
|
|
2466
2901
|
return this.getCodeChallenge();
|
|
2467
2902
|
case 3:
|
|
@@ -2499,12 +2934,12 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2499
2934
|
}, {
|
|
2500
2935
|
key: "resetByEmail",
|
|
2501
2936
|
value: function resetByEmail(e) {
|
|
2502
|
-
return
|
|
2937
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
2503
2938
|
var _yield$this$dfpProtec3, t, r, n, i, o;
|
|
2504
2939
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
2505
2940
|
while (1) switch (_context8.prev = _context8.next) {
|
|
2506
2941
|
case 0:
|
|
2507
|
-
|
|
2942
|
+
Oe("stytch.passwords.resetByEmail").isString("password_reset_token", e.password_reset_token).isString("password", e.password).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale);
|
|
2508
2943
|
_context8.next = 3;
|
|
2509
2944
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2510
2945
|
case 3:
|
|
@@ -2558,12 +2993,12 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2558
2993
|
}, {
|
|
2559
2994
|
key: "resetByExistingPassword",
|
|
2560
2995
|
value: function resetByExistingPassword(e) {
|
|
2561
|
-
return
|
|
2996
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
2562
2997
|
var _yield$this$dfpProtec4, t, r, n;
|
|
2563
2998
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
2564
2999
|
while (1) switch (_context9.prev = _context9.next) {
|
|
2565
3000
|
case 0:
|
|
2566
|
-
|
|
3001
|
+
Oe("stytch.passwords.resetByExistingPassword").isString("email", e.email_address).isString("existing_password", e.existing_password).isString("new_password", e.new_password).isOptionalString("locale", e.locale);
|
|
2567
3002
|
_context9.next = 3;
|
|
2568
3003
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2569
3004
|
case 3:
|
|
@@ -2612,12 +3047,12 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2612
3047
|
}, {
|
|
2613
3048
|
key: "resetBySession",
|
|
2614
3049
|
value: function resetBySession(e) {
|
|
2615
|
-
return
|
|
3050
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
2616
3051
|
var _yield$this$dfpProtec5, t, r, n;
|
|
2617
3052
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
2618
3053
|
while (1) switch (_context10.prev = _context10.next) {
|
|
2619
3054
|
case 0:
|
|
2620
|
-
|
|
3055
|
+
Oe("stytch.passwords.resetBySession").isString("password", e.password);
|
|
2621
3056
|
_context10.next = 3;
|
|
2622
3057
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2623
3058
|
case 3:
|
|
@@ -2657,11 +3092,11 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2657
3092
|
}, {
|
|
2658
3093
|
key: "strengthCheck",
|
|
2659
3094
|
value: function strengthCheck(e) {
|
|
2660
|
-
return
|
|
3095
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
2661
3096
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
2662
3097
|
while (1) switch (_context11.prev = _context11.next) {
|
|
2663
3098
|
case 0:
|
|
2664
|
-
return _context11.abrupt("return", (
|
|
3099
|
+
return _context11.abrupt("return", (Oe("stytch.passwords.strengthCheck").isOptionalString("email", e.email_address).isString("password", e.password), this._networkClient.fetchSDK({
|
|
2665
3100
|
url: "/b2b/passwords/strength_check",
|
|
2666
3101
|
method: "POST",
|
|
2667
3102
|
errorMessage: "Failed to check password strength.",
|
|
@@ -2678,21 +3113,21 @@ var Ce = /*#__PURE__*/function () {
|
|
|
2678
3113
|
}));
|
|
2679
3114
|
}
|
|
2680
3115
|
}]);
|
|
2681
|
-
return
|
|
3116
|
+
return Be;
|
|
2682
3117
|
}();
|
|
2683
|
-
var
|
|
2684
|
-
var
|
|
2685
|
-
function
|
|
3118
|
+
var Re = "bootstrap";
|
|
3119
|
+
var De = /*#__PURE__*/function () {
|
|
3120
|
+
function De(e, t, r) {
|
|
2686
3121
|
var _this2 = this;
|
|
2687
|
-
_classCallCheck(this,
|
|
3122
|
+
_classCallCheck(this, De);
|
|
2688
3123
|
this._publicToken = e, this._networkClient = t, this._dataLayer = r, this._bootstrapDataPromise = this._networkClient.fetchSDK({
|
|
2689
3124
|
url: "/projects/bootstrap/".concat(this._publicToken),
|
|
2690
3125
|
method: "GET",
|
|
2691
3126
|
errorMessage: "Error fetching bootstrap data for SDK for ".concat(this._publicToken)
|
|
2692
|
-
}).then(
|
|
2693
|
-
return _this2._dataLayer.setItem(
|
|
3127
|
+
}).then(De.mapBootstrapData).then(function (e) {
|
|
3128
|
+
return _this2._dataLayer.setItem(Re, JSON.stringify(e)), e;
|
|
2694
3129
|
})["catch"](function (e) {
|
|
2695
|
-
return
|
|
3130
|
+
return $(e), {
|
|
2696
3131
|
displayWatermark: !1,
|
|
2697
3132
|
cnameDomain: null,
|
|
2698
3133
|
emailDomains: ["stytch.com"],
|
|
@@ -2706,14 +3141,15 @@ var Be = /*#__PURE__*/function () {
|
|
|
2706
3141
|
slugPattern: null,
|
|
2707
3142
|
createOrganizationEnabled: !1,
|
|
2708
3143
|
passwordConfig: null,
|
|
2709
|
-
runDFPProtectedAuth: !1
|
|
3144
|
+
runDFPProtectedAuth: !1,
|
|
3145
|
+
rbacPolicy: null
|
|
2710
3146
|
};
|
|
2711
3147
|
});
|
|
2712
3148
|
}
|
|
2713
|
-
_createClass(
|
|
3149
|
+
_createClass(De, [{
|
|
2714
3150
|
key: "getSync",
|
|
2715
3151
|
value: function getSync() {
|
|
2716
|
-
var e = this._dataLayer.getItem(
|
|
3152
|
+
var e = this._dataLayer.getItem(Re);
|
|
2717
3153
|
if (null === e) return {
|
|
2718
3154
|
displayWatermark: !1,
|
|
2719
3155
|
cnameDomain: null,
|
|
@@ -2728,7 +3164,8 @@ var Be = /*#__PURE__*/function () {
|
|
|
2728
3164
|
slugPattern: null,
|
|
2729
3165
|
createOrganizationEnabled: !1,
|
|
2730
3166
|
passwordConfig: null,
|
|
2731
|
-
runDFPProtectedAuth: !1
|
|
3167
|
+
runDFPProtectedAuth: !1,
|
|
3168
|
+
rbacPolicy: null
|
|
2732
3169
|
};
|
|
2733
3170
|
try {
|
|
2734
3171
|
return JSON.parse(e);
|
|
@@ -2747,7 +3184,8 @@ var Be = /*#__PURE__*/function () {
|
|
|
2747
3184
|
slugPattern: null,
|
|
2748
3185
|
createOrganizationEnabled: !1,
|
|
2749
3186
|
passwordConfig: null,
|
|
2750
|
-
runDFPProtectedAuth: !1
|
|
3187
|
+
runDFPProtectedAuth: !1,
|
|
3188
|
+
rbacPolicy: null
|
|
2751
3189
|
};
|
|
2752
3190
|
}
|
|
2753
3191
|
}
|
|
@@ -2759,8 +3197,8 @@ var Be = /*#__PURE__*/function () {
|
|
|
2759
3197
|
}], [{
|
|
2760
3198
|
key: "mapBootstrapData",
|
|
2761
3199
|
value: function mapBootstrapData(e) {
|
|
2762
|
-
var t;
|
|
2763
|
-
var
|
|
3200
|
+
var t, r;
|
|
3201
|
+
var n = null !== e.password_config ? {
|
|
2764
3202
|
ludsComplexity: e.password_config.luds_complexity,
|
|
2765
3203
|
ludsMinimumCount: e.password_config.luds_minimum_count
|
|
2766
3204
|
} : null;
|
|
@@ -2775,19 +3213,20 @@ var Be = /*#__PURE__*/function () {
|
|
|
2775
3213
|
pkceRequiredForSso: e.pkce_required_for_sso,
|
|
2776
3214
|
slugPattern: e.slug_pattern,
|
|
2777
3215
|
createOrganizationEnabled: e.create_organization_enabled,
|
|
2778
|
-
passwordConfig:
|
|
3216
|
+
passwordConfig: n,
|
|
2779
3217
|
runDFPProtectedAuth: null !== (t = e.dfp_protected_auth_enabled) && void 0 !== t && t,
|
|
2780
|
-
dfpProtectedAuthMode: e.dfp_protected_auth_mode
|
|
3218
|
+
dfpProtectedAuthMode: e.dfp_protected_auth_mode,
|
|
3219
|
+
rbacPolicy: null !== (r = e.rbac_policy) && void 0 !== r ? r : null
|
|
2781
3220
|
};
|
|
2782
3221
|
}
|
|
2783
3222
|
}]);
|
|
2784
|
-
return
|
|
3223
|
+
return De;
|
|
2785
3224
|
}();
|
|
2786
|
-
var
|
|
3225
|
+
var Ie = /*#__PURE__*/_createClass(function Ie(e) {
|
|
2787
3226
|
var _this3 = this;
|
|
2788
|
-
_classCallCheck(this,
|
|
3227
|
+
_classCallCheck(this, Ie);
|
|
2789
3228
|
this.bootstrapPromise = e, this.executeRecaptcha = function () {
|
|
2790
|
-
return
|
|
3229
|
+
return Pe(_this3, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
2791
3230
|
var _yield$this$state, e, t, r;
|
|
2792
3231
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
2793
3232
|
while (1) switch (_context12.prev = _context12.next) {
|
|
@@ -2818,7 +3257,7 @@ var Re = /*#__PURE__*/_createClass(function Re(e) {
|
|
|
2818
3257
|
}, _callee12, this);
|
|
2819
3258
|
}));
|
|
2820
3259
|
}, this.state = e.then(function (e) {
|
|
2821
|
-
return
|
|
3260
|
+
return Pe(_this3, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
2822
3261
|
var t;
|
|
2823
3262
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
2824
3263
|
while (1) switch (_context13.prev = _context13.next) {
|
|
@@ -2829,7 +3268,7 @@ var Re = /*#__PURE__*/_createClass(function Re(e) {
|
|
|
2829
3268
|
}
|
|
2830
3269
|
_context13.t1 = !0;
|
|
2831
3270
|
_context13.next = 4;
|
|
2832
|
-
return t = e.captchaSettings.siteKey,
|
|
3271
|
+
return t = e.captchaSettings.siteKey, H("https://www.google.com/recaptcha/enterprise.js?render=".concat(t), function () {
|
|
2833
3272
|
return window.grecaptcha.enterprise;
|
|
2834
3273
|
});
|
|
2835
3274
|
case 4:
|
|
@@ -2856,9 +3295,9 @@ var Re = /*#__PURE__*/_createClass(function Re(e) {
|
|
|
2856
3295
|
}));
|
|
2857
3296
|
});
|
|
2858
3297
|
});
|
|
2859
|
-
var
|
|
2860
|
-
function
|
|
2861
|
-
_classCallCheck(this,
|
|
3298
|
+
var Le = /*#__PURE__*/function () {
|
|
3299
|
+
function Le(e, t, r, n) {
|
|
3300
|
+
_classCallCheck(this, Le);
|
|
2862
3301
|
this._publicToken = e, this._subscriptionDataLayer = t, this.baseURL = r, this.additionalTelemetryDataFn = n, this.updateSessionToken = function () {
|
|
2863
3302
|
return null;
|
|
2864
3303
|
}, this.eventLogger = new re({
|
|
@@ -2867,7 +3306,7 @@ var Ie = /*#__PURE__*/function () {
|
|
|
2867
3306
|
logEventURL: this.buildSDKUrl("/events")
|
|
2868
3307
|
});
|
|
2869
3308
|
}
|
|
2870
|
-
_createClass(
|
|
3309
|
+
_createClass(Le, [{
|
|
2871
3310
|
key: "logEvent",
|
|
2872
3311
|
value: function logEvent(_ref) {
|
|
2873
3312
|
var e = _ref.name,
|
|
@@ -2887,9 +3326,9 @@ var Ie = /*#__PURE__*/function () {
|
|
|
2887
3326
|
key: "createTelemetryBlob",
|
|
2888
3327
|
value: function createTelemetryBlob() {
|
|
2889
3328
|
return Object.assign(Object.assign({
|
|
2890
|
-
event_id: "event-id-".concat(
|
|
2891
|
-
app_session_id: "app-session-id-".concat(
|
|
2892
|
-
persistent_id: "persistent-id-".concat(
|
|
3329
|
+
event_id: "event-id-".concat(z()),
|
|
3330
|
+
app_session_id: "app-session-id-".concat(z()),
|
|
3331
|
+
persistent_id: "persistent-id-".concat(z()),
|
|
2893
3332
|
client_sent_at: new Date().toISOString(),
|
|
2894
3333
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
2895
3334
|
}, this.additionalTelemetryDataFn()), {
|
|
@@ -2898,7 +3337,7 @@ var Ie = /*#__PURE__*/function () {
|
|
|
2898
3337
|
},
|
|
2899
3338
|
sdk: {
|
|
2900
3339
|
identifier: "Stytch.js Javascript SDK",
|
|
2901
|
-
version: "3.
|
|
3340
|
+
version: "3.3.0"
|
|
2902
3341
|
}
|
|
2903
3342
|
});
|
|
2904
3343
|
}
|
|
@@ -2909,7 +3348,7 @@ var Ie = /*#__PURE__*/function () {
|
|
|
2909
3348
|
t = _ref2.body,
|
|
2910
3349
|
r = _ref2.errorMessage,
|
|
2911
3350
|
n = _ref2.method;
|
|
2912
|
-
return
|
|
3351
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
2913
3352
|
var i, o, s, a;
|
|
2914
3353
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
2915
3354
|
while (1) switch (_context14.prev = _context14.next) {
|
|
@@ -2939,7 +3378,7 @@ var Ie = /*#__PURE__*/function () {
|
|
|
2939
3378
|
r = _ref3.errorMessage,
|
|
2940
3379
|
n = _ref3.method,
|
|
2941
3380
|
o = _ref3.retryCallback;
|
|
2942
|
-
return
|
|
3381
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
2943
3382
|
var s, a, c, u;
|
|
2944
3383
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
2945
3384
|
while (1) switch (_context15.prev = _context15.next) {
|
|
@@ -2972,7 +3411,7 @@ var Ie = /*#__PURE__*/function () {
|
|
|
2972
3411
|
case 15:
|
|
2973
3412
|
return e.abrupt("return", e.sent);
|
|
2974
3413
|
case 7:
|
|
2975
|
-
if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof
|
|
3414
|
+
if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof I)) {
|
|
2976
3415
|
e.next = 16;
|
|
2977
3416
|
break;
|
|
2978
3417
|
}
|
|
@@ -3010,18 +3449,18 @@ var Ie = /*#__PURE__*/function () {
|
|
|
3010
3449
|
return "".concat(this.baseURL, "/sdk/v1").concat(e);
|
|
3011
3450
|
}
|
|
3012
3451
|
}]);
|
|
3013
|
-
return
|
|
3452
|
+
return Le;
|
|
3014
3453
|
}();
|
|
3015
|
-
function
|
|
3454
|
+
function Me(e) {
|
|
3016
3455
|
var t = e.toString(16);
|
|
3017
3456
|
return 1 === t.length && (t = "0" + t), t;
|
|
3018
3457
|
}
|
|
3019
|
-
var
|
|
3020
|
-
function
|
|
3021
|
-
_classCallCheck(this,
|
|
3458
|
+
var Ne = /*#__PURE__*/function () {
|
|
3459
|
+
function Ne(e, t) {
|
|
3460
|
+
_classCallCheck(this, Ne);
|
|
3022
3461
|
this._dataLayer = e, this.namespace = t;
|
|
3023
3462
|
}
|
|
3024
|
-
_createClass(
|
|
3463
|
+
_createClass(Ne, [{
|
|
3025
3464
|
key: "key",
|
|
3026
3465
|
value: function key() {
|
|
3027
3466
|
return "PKCE_VERIFIER:" + this.namespace;
|
|
@@ -3029,13 +3468,13 @@ var Le = /*#__PURE__*/function () {
|
|
|
3029
3468
|
}, {
|
|
3030
3469
|
key: "startPKCETransaction",
|
|
3031
3470
|
value: function startPKCETransaction() {
|
|
3032
|
-
return
|
|
3471
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
3033
3472
|
var e;
|
|
3034
3473
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
3035
3474
|
while (1) switch (_context16.prev = _context16.next) {
|
|
3036
3475
|
case 0:
|
|
3037
3476
|
_context16.next = 2;
|
|
3038
|
-
return
|
|
3477
|
+
return Ne.createProofkeyPair();
|
|
3039
3478
|
case 2:
|
|
3040
3479
|
e = _context16.sent;
|
|
3041
3480
|
return _context16.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
|
|
@@ -3053,7 +3492,7 @@ var Le = /*#__PURE__*/function () {
|
|
|
3053
3492
|
if (null !== e) try {
|
|
3054
3493
|
return JSON.parse(e);
|
|
3055
3494
|
} catch (e) {
|
|
3056
|
-
return void
|
|
3495
|
+
return void J("Found malformed Proof Key pair in localstorage.");
|
|
3057
3496
|
}
|
|
3058
3497
|
}
|
|
3059
3498
|
}, {
|
|
@@ -3064,7 +3503,7 @@ var Le = /*#__PURE__*/function () {
|
|
|
3064
3503
|
}], [{
|
|
3065
3504
|
key: "createProofkeyPair",
|
|
3066
3505
|
value: function createProofkeyPair() {
|
|
3067
|
-
return
|
|
3506
|
+
return Pe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
3068
3507
|
var _String$fromCharCode;
|
|
3069
3508
|
var e, t, r, n;
|
|
3070
3509
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
@@ -3072,7 +3511,7 @@ var Le = /*#__PURE__*/function () {
|
|
|
3072
3511
|
case 0:
|
|
3073
3512
|
e = new Uint32Array(16);
|
|
3074
3513
|
window.crypto.getRandomValues(e);
|
|
3075
|
-
t = Array.from(e).map(
|
|
3514
|
+
t = Array.from(e).map(Me).join("");
|
|
3076
3515
|
_context17.next = 5;
|
|
3077
3516
|
return window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
|
|
3078
3517
|
case 5:
|
|
@@ -3089,14 +3528,14 @@ var Le = /*#__PURE__*/function () {
|
|
|
3089
3528
|
}));
|
|
3090
3529
|
}
|
|
3091
3530
|
}]);
|
|
3092
|
-
return
|
|
3531
|
+
return Ne;
|
|
3093
3532
|
}();
|
|
3094
|
-
var
|
|
3095
|
-
function
|
|
3096
|
-
_classCallCheck(this,
|
|
3533
|
+
var je = /*#__PURE__*/function () {
|
|
3534
|
+
function je(e) {
|
|
3535
|
+
_classCallCheck(this, je);
|
|
3097
3536
|
this._networkClient = e;
|
|
3098
3537
|
}
|
|
3099
|
-
_createClass(
|
|
3538
|
+
_createClass(je, [{
|
|
3100
3539
|
key: "searchUser",
|
|
3101
3540
|
value: function searchUser(e) {
|
|
3102
3541
|
return this._networkClient.fetchSDK({
|
|
@@ -3134,9 +3573,9 @@ var Me = /*#__PURE__*/function () {
|
|
|
3134
3573
|
});
|
|
3135
3574
|
}
|
|
3136
3575
|
}]);
|
|
3137
|
-
return
|
|
3576
|
+
return je;
|
|
3138
3577
|
}();
|
|
3139
|
-
var
|
|
3578
|
+
var Fe = function Fe(e) {
|
|
3140
3579
|
return (document.cookie ? document.cookie.split("; ") : []).filter(function (t) {
|
|
3141
3580
|
var _t$split = t.split("="),
|
|
3142
3581
|
_t$split2 = _slicedToArray(_t$split, 1),
|
|
@@ -3145,17 +3584,17 @@ var Ne = function Ne(e) {
|
|
|
3145
3584
|
}).length > 1;
|
|
3146
3585
|
};
|
|
3147
3586
|
/*! js-cookie v3.0.1 | MIT */
|
|
3148
|
-
function
|
|
3587
|
+
function Ke(e) {
|
|
3149
3588
|
for (var t = 1; t < arguments.length; t++) {
|
|
3150
3589
|
var r = arguments[t];
|
|
3151
3590
|
for (var n in r) e[n] = r[n];
|
|
3152
3591
|
}
|
|
3153
3592
|
return e;
|
|
3154
3593
|
}
|
|
3155
|
-
var
|
|
3594
|
+
var Ue = function e(t, r) {
|
|
3156
3595
|
function n(e, n, i) {
|
|
3157
3596
|
if ("undefined" != typeof document) {
|
|
3158
|
-
"number" == typeof (i =
|
|
3597
|
+
"number" == typeof (i = Ke({}, r, i)).expires && (i.expires = new Date(Date.now() + 864e5 * i.expires)), i.expires && (i.expires = i.expires.toUTCString()), e = encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
3159
3598
|
var o = "";
|
|
3160
3599
|
for (var s in i) i[s] && (o += "; " + s, !0 !== i[s] && (o += "=" + i[s].split(";")[0]));
|
|
3161
3600
|
return document.cookie = e + "=" + t.write(n, e) + o;
|
|
@@ -3177,15 +3616,15 @@ var Fe = function e(t, r) {
|
|
|
3177
3616
|
}
|
|
3178
3617
|
},
|
|
3179
3618
|
remove: function remove(e, t) {
|
|
3180
|
-
n(e, "",
|
|
3619
|
+
n(e, "", Ke({}, t, {
|
|
3181
3620
|
expires: -1
|
|
3182
3621
|
}));
|
|
3183
3622
|
},
|
|
3184
3623
|
withAttributes: function withAttributes(t) {
|
|
3185
|
-
return e(this.converter,
|
|
3624
|
+
return e(this.converter, Ke({}, this.attributes, t));
|
|
3186
3625
|
},
|
|
3187
3626
|
withConverter: function withConverter(t) {
|
|
3188
|
-
return e(
|
|
3627
|
+
return e(Ke({}, this.converter, t), this.attributes);
|
|
3189
3628
|
}
|
|
3190
3629
|
}, {
|
|
3191
3630
|
attributes: {
|
|
@@ -3205,26 +3644,26 @@ var Fe = function e(t, r) {
|
|
|
3205
3644
|
}, {
|
|
3206
3645
|
path: "/"
|
|
3207
3646
|
});
|
|
3208
|
-
var
|
|
3647
|
+
var ze = function ze(e) {
|
|
3209
3648
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
3210
3649
|
return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
|
|
3211
3650
|
};
|
|
3212
|
-
var
|
|
3213
|
-
function
|
|
3651
|
+
var We = /*#__PURE__*/function () {
|
|
3652
|
+
function We(e, t) {
|
|
3214
3653
|
var _this4 = this;
|
|
3215
|
-
_classCallCheck(this,
|
|
3654
|
+
_classCallCheck(this, We);
|
|
3216
3655
|
this.browserSessionStorage = {
|
|
3217
3656
|
getItem: function getItem(e) {
|
|
3218
|
-
return sessionStorage.getItem(
|
|
3657
|
+
return sessionStorage.getItem(ze(_this4.publicToken, e));
|
|
3219
3658
|
},
|
|
3220
3659
|
setItem: function setItem(e, t) {
|
|
3221
|
-
return sessionStorage.setItem(
|
|
3660
|
+
return sessionStorage.setItem(ze(_this4.publicToken, e), t);
|
|
3222
3661
|
},
|
|
3223
3662
|
removeItem: function removeItem(e) {
|
|
3224
|
-
return sessionStorage.removeItem(
|
|
3663
|
+
return sessionStorage.removeItem(ze(_this4.publicToken, e));
|
|
3225
3664
|
}
|
|
3226
3665
|
}, this.publicToken = e, this.state = null, this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (Q("SubscriptionDataLayer").isOptionalString("cookieOptions.opaqueTokenCookieName", t.cookieOptions.opaqueTokenCookieName).isOptionalString("cookieOptions.jwtCookieName", t.cookieOptions.jwtCookieName).isOptionalString("cookieOptions.istCookieName", t.cookieOptions.istCookieName).isOptionalString("cookieOptions.path", t.cookieOptions.path).isOptionalString("cookieOptions.domain", t.cookieOptions.domain), this._jwtCookieName = t.cookieOptions.jwtCookieName || null, this._opaqueTokenCookieName = t.cookieOptions.opaqueTokenCookieName || null, this._cookiePath = t.cookieOptions.path || null, this._domain = t.cookieOptions.domain || null, this._cookieAvailableToSubdomains = t.cookieOptions.availableToSubdomains || !1, this._istCookieName = t.cookieOptions.istCookieName || null) : (this._opaqueTokenCookieName = null, this._jwtCookieName = null, this._cookiePath = null, this._domain = null, this._cookieAvailableToSubdomains = !1, this._istCookieName = null);
|
|
3227
|
-
var r = localStorage.getItem(
|
|
3666
|
+
var r = localStorage.getItem(ze(this.publicToken));
|
|
3228
3667
|
if (!r) return;
|
|
3229
3668
|
var n;
|
|
3230
3669
|
try {
|
|
@@ -3234,7 +3673,7 @@ var Ue = /*#__PURE__*/function () {
|
|
|
3234
3673
|
}
|
|
3235
3674
|
this.state = n;
|
|
3236
3675
|
}
|
|
3237
|
-
_createClass(
|
|
3676
|
+
_createClass(We, [{
|
|
3238
3677
|
key: "opaqueTokenCookieName",
|
|
3239
3678
|
get: function get() {
|
|
3240
3679
|
var e;
|
|
@@ -3256,14 +3695,14 @@ var Ue = /*#__PURE__*/function () {
|
|
|
3256
3695
|
key: "readSessionCookie",
|
|
3257
3696
|
value: function readSessionCookie() {
|
|
3258
3697
|
return {
|
|
3259
|
-
session_token:
|
|
3260
|
-
session_jwt:
|
|
3698
|
+
session_token: Ue.get(this.opaqueTokenCookieName),
|
|
3699
|
+
session_jwt: Ue.get(this.jwtCookieName)
|
|
3261
3700
|
};
|
|
3262
3701
|
}
|
|
3263
3702
|
}, {
|
|
3264
3703
|
key: "readIntermediateSessionTokenCookie",
|
|
3265
3704
|
value: function readIntermediateSessionTokenCookie() {
|
|
3266
|
-
return
|
|
3705
|
+
return Ue.get(this.istCookieName);
|
|
3267
3706
|
}
|
|
3268
3707
|
}, {
|
|
3269
3708
|
key: "writeSessionCookie",
|
|
@@ -3272,32 +3711,32 @@ var Ue = /*#__PURE__*/function () {
|
|
|
3272
3711
|
var o = e.state,
|
|
3273
3712
|
s = e.session_token,
|
|
3274
3713
|
a = e.session_jwt,
|
|
3275
|
-
c =
|
|
3714
|
+
c = We.generateCookieOpts({
|
|
3276
3715
|
expiresAt: null !== (r = null === (t = null == o ? void 0 : o.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
|
|
3277
3716
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
3278
3717
|
path: this._cookiePath,
|
|
3279
3718
|
domain: this._domain
|
|
3280
3719
|
});
|
|
3281
|
-
|
|
3282
|
-
var u =
|
|
3720
|
+
Ue.set(this.opaqueTokenCookieName, s, c), Ue.set(this.jwtCookieName, a, c);
|
|
3721
|
+
var u = We.generateCookieOpts({
|
|
3283
3722
|
expiresAt: null !== (i = null === (n = null == o ? void 0 : o.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
|
|
3284
3723
|
availableToSubdomains: !this._cookieAvailableToSubdomains,
|
|
3285
3724
|
path: this._cookiePath,
|
|
3286
3725
|
domain: this._domain
|
|
3287
3726
|
});
|
|
3288
|
-
|
|
3727
|
+
Fe(this.jwtCookieName) && Ue.remove(this.jwtCookieName, u), Fe(this.opaqueTokenCookieName) && Ue.remove(this.opaqueTokenCookieName, u), Fe(this.jwtCookieName) && J("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), Fe(this.opaqueTokenCookieName) && J("Could not remove extraneous opaque token cookie.");
|
|
3289
3728
|
}
|
|
3290
3729
|
}, {
|
|
3291
3730
|
key: "writeIntermediateSessionTokenCookie",
|
|
3292
3731
|
value: function writeIntermediateSessionTokenCookie(e) {
|
|
3293
3732
|
var t = new Date(Date.now() + 6e5),
|
|
3294
|
-
r =
|
|
3733
|
+
r = We.generateCookieOpts({
|
|
3295
3734
|
expiresAt: t.toString(),
|
|
3296
3735
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
3297
3736
|
path: this._cookiePath,
|
|
3298
3737
|
domain: this._domain
|
|
3299
3738
|
});
|
|
3300
|
-
|
|
3739
|
+
Ue.set(this.istCookieName, e, r);
|
|
3301
3740
|
}
|
|
3302
3741
|
}, {
|
|
3303
3742
|
key: "removeSessionCookie",
|
|
@@ -3316,14 +3755,14 @@ var Ue = /*#__PURE__*/function () {
|
|
|
3316
3755
|
[!0, !1].forEach(function (t) {
|
|
3317
3756
|
[_this5._cookiePath, null].forEach(function (r) {
|
|
3318
3757
|
[_this5._domain, null].forEach(function (n) {
|
|
3319
|
-
var i =
|
|
3758
|
+
var i = We.generateCookieOpts({
|
|
3320
3759
|
expiresAt: new Date(0).toString(),
|
|
3321
3760
|
availableToSubdomains: t,
|
|
3322
3761
|
path: r,
|
|
3323
3762
|
domain: n
|
|
3324
3763
|
});
|
|
3325
3764
|
e.forEach(function (e) {
|
|
3326
|
-
|
|
3765
|
+
Ue.remove(e, i);
|
|
3327
3766
|
});
|
|
3328
3767
|
});
|
|
3329
3768
|
});
|
|
@@ -3332,22 +3771,22 @@ var Ue = /*#__PURE__*/function () {
|
|
|
3332
3771
|
}, {
|
|
3333
3772
|
key: "syncToLocalStorage",
|
|
3334
3773
|
value: function syncToLocalStorage() {
|
|
3335
|
-
localStorage.setItem(
|
|
3774
|
+
localStorage.setItem(ze(this.publicToken), JSON.stringify(this.state));
|
|
3336
3775
|
}
|
|
3337
3776
|
}, {
|
|
3338
3777
|
key: "getItem",
|
|
3339
3778
|
value: function getItem(e) {
|
|
3340
|
-
return localStorage.getItem(
|
|
3779
|
+
return localStorage.getItem(ze(this.publicToken, e));
|
|
3341
3780
|
}
|
|
3342
3781
|
}, {
|
|
3343
3782
|
key: "setItem",
|
|
3344
3783
|
value: function setItem(e, t) {
|
|
3345
|
-
return localStorage.setItem(
|
|
3784
|
+
return localStorage.setItem(ze(this.publicToken, e), t);
|
|
3346
3785
|
}
|
|
3347
3786
|
}, {
|
|
3348
3787
|
key: "removeItem",
|
|
3349
3788
|
value: function removeItem(e) {
|
|
3350
|
-
return localStorage.removeItem(
|
|
3789
|
+
return localStorage.removeItem(ze(this.publicToken, e));
|
|
3351
3790
|
}
|
|
3352
3791
|
}], [{
|
|
3353
3792
|
key: "generateCookieOpts",
|
|
@@ -3363,31 +3802,31 @@ var Ue = /*#__PURE__*/function () {
|
|
|
3363
3802
|
return e && (i.path = e), Boolean("localhost" === window.location.hostname || "[::1]" === window.location.hostname || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) ? i.secure = !1 : (r && (i.domain = t || window.location.host), i.secure = !0), i;
|
|
3364
3803
|
}
|
|
3365
3804
|
}]);
|
|
3366
|
-
return
|
|
3805
|
+
return We;
|
|
3367
3806
|
}();
|
|
3368
|
-
var
|
|
3369
|
-
_inherits(
|
|
3370
|
-
var _super2 = _createSuper(
|
|
3371
|
-
function
|
|
3372
|
-
_classCallCheck(this,
|
|
3807
|
+
var He = /*#__PURE__*/function (_We) {
|
|
3808
|
+
_inherits(He, _We);
|
|
3809
|
+
var _super2 = _createSuper(He);
|
|
3810
|
+
function He() {
|
|
3811
|
+
_classCallCheck(this, He);
|
|
3373
3812
|
return _super2.apply(this, arguments);
|
|
3374
3813
|
}
|
|
3375
|
-
return _createClass(
|
|
3376
|
-
}(
|
|
3377
|
-
var
|
|
3378
|
-
|
|
3814
|
+
return _createClass(He);
|
|
3815
|
+
}(We);
|
|
3816
|
+
var Ge = Symbol["for"]("__stytch_b2b_DataLayer"),
|
|
3817
|
+
qe = function qe(e, t) {
|
|
3379
3818
|
var r = function () {
|
|
3380
3819
|
var e = window;
|
|
3381
|
-
return e[
|
|
3820
|
+
return e[Ge] || (e[Ge] = {}), e[Ge];
|
|
3382
3821
|
}();
|
|
3383
|
-
return r[e] || (r[e] = new
|
|
3822
|
+
return r[e] || (r[e] = new He(e, t)), r[e];
|
|
3384
3823
|
},
|
|
3385
|
-
|
|
3824
|
+
Ye = function Ye(e, t) {
|
|
3386
3825
|
Object.values(e).forEach(function (e) {
|
|
3387
3826
|
return e(t);
|
|
3388
3827
|
});
|
|
3389
3828
|
},
|
|
3390
|
-
|
|
3829
|
+
Ve = function () {
|
|
3391
3830
|
var t = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
|
|
3392
3831
|
r = void 0 === t ? [] : t;
|
|
3393
3832
|
return function t(i, o) {
|
|
@@ -3406,12 +3845,12 @@ var ze = Symbol["for"]("__stytch_b2b_DataLayer"),
|
|
|
3406
3845
|
}({
|
|
3407
3846
|
KEYS_TO_EXCLUDE: ["last_accessed_at"]
|
|
3408
3847
|
});
|
|
3409
|
-
var
|
|
3410
|
-
function
|
|
3848
|
+
var Je = /*#__PURE__*/function () {
|
|
3849
|
+
function Je(e, t) {
|
|
3411
3850
|
var _this6 = this;
|
|
3412
|
-
_classCallCheck(this,
|
|
3851
|
+
_classCallCheck(this, Je);
|
|
3413
3852
|
this._publicToken = e, this._datalayer = t, this._listen = function (e) {
|
|
3414
|
-
if (e.key !==
|
|
3853
|
+
if (e.key !== ze(_this6._publicToken)) return;
|
|
3415
3854
|
if (null === e.newValue || "null" === e.newValue) return void _this6.destroyState();
|
|
3416
3855
|
var t = JSON.parse(e.newValue);
|
|
3417
3856
|
_this6.updateState(t);
|
|
@@ -3420,7 +3859,7 @@ var Ye = /*#__PURE__*/function () {
|
|
|
3420
3859
|
r = _this$_datalayer$read.session_token;
|
|
3421
3860
|
r || this.destroyState();
|
|
3422
3861
|
}
|
|
3423
|
-
_createClass(
|
|
3862
|
+
_createClass(Je, [{
|
|
3424
3863
|
key: "getTokens",
|
|
3425
3864
|
value: function getTokens() {
|
|
3426
3865
|
var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
|
|
@@ -3451,7 +3890,7 @@ var Ye = /*#__PURE__*/function () {
|
|
|
3451
3890
|
value: function _updateStateAndTokensInternal(e) {
|
|
3452
3891
|
var t = this._datalayer.state,
|
|
3453
3892
|
r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
|
|
3454
|
-
this._datalayer.state = r,
|
|
3893
|
+
this._datalayer.state = r, Ve(t, r) || Ye(this._datalayer.subscriptions, r);
|
|
3455
3894
|
}
|
|
3456
3895
|
}, {
|
|
3457
3896
|
key: "updateStateAndTokens",
|
|
@@ -3463,7 +3902,7 @@ var Ye = /*#__PURE__*/function () {
|
|
|
3463
3902
|
value: function updateState(e) {
|
|
3464
3903
|
var t = this._datalayer.state,
|
|
3465
3904
|
r = null === e ? null : Object.assign(Object.assign({}, this._datalayer.state), e);
|
|
3466
|
-
this._datalayer.state = r,
|
|
3905
|
+
this._datalayer.state = r, Ve(t, r) || (Ye(this._datalayer.subscriptions, r), this._datalayer.syncToLocalStorage());
|
|
3467
3906
|
}
|
|
3468
3907
|
}, {
|
|
3469
3908
|
key: "updateTokens",
|
|
@@ -3503,14 +3942,14 @@ var Ye = /*#__PURE__*/function () {
|
|
|
3503
3942
|
return null;
|
|
3504
3943
|
}
|
|
3505
3944
|
}]);
|
|
3506
|
-
return
|
|
3945
|
+
return Je;
|
|
3507
3946
|
}();
|
|
3508
|
-
var
|
|
3509
|
-
_inherits(
|
|
3510
|
-
var _super3 = _createSuper(
|
|
3511
|
-
function
|
|
3947
|
+
var $e = /*#__PURE__*/function (_Je) {
|
|
3948
|
+
_inherits($e, _Je);
|
|
3949
|
+
var _super3 = _createSuper($e);
|
|
3950
|
+
function $e() {
|
|
3512
3951
|
var _this7;
|
|
3513
|
-
_classCallCheck(this,
|
|
3952
|
+
_classCallCheck(this, $e);
|
|
3514
3953
|
_this7 = _super3.apply(this, arguments), _this7.updateMember = function (e) {
|
|
3515
3954
|
return _this7.updateState({
|
|
3516
3955
|
member: e
|
|
@@ -3524,41 +3963,41 @@ var Ve = /*#__PURE__*/function (_Ye) {
|
|
|
3524
3963
|
};
|
|
3525
3964
|
return _this7;
|
|
3526
3965
|
}
|
|
3527
|
-
return _createClass(
|
|
3528
|
-
}(
|
|
3529
|
-
var
|
|
3530
|
-
function
|
|
3531
|
-
return
|
|
3966
|
+
return _createClass($e);
|
|
3967
|
+
}(Je);
|
|
3968
|
+
var Xe = Symbol["for"]("stytch__internal_b2b");
|
|
3969
|
+
function Ze(e) {
|
|
3970
|
+
return Ze = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
|
|
3532
3971
|
return _typeof(e);
|
|
3533
3972
|
} : function (e) {
|
|
3534
3973
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
|
|
3535
|
-
},
|
|
3974
|
+
}, Ze(e);
|
|
3536
3975
|
}
|
|
3537
|
-
function
|
|
3976
|
+
function Qe(e, t) {
|
|
3538
3977
|
for (var r = 0; r < t.length; r++) {
|
|
3539
3978
|
var n = t[r];
|
|
3540
3979
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (i = n.key, o = void 0, o = function (e, t) {
|
|
3541
|
-
if ("object" !==
|
|
3980
|
+
if ("object" !== Ze(e) || null === e) return e;
|
|
3542
3981
|
var r = e[Symbol.toPrimitive];
|
|
3543
3982
|
if (void 0 !== r) {
|
|
3544
3983
|
var n = r.call(e, t || "default");
|
|
3545
|
-
if ("object" !==
|
|
3984
|
+
if ("object" !== Ze(n)) return n;
|
|
3546
3985
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3547
3986
|
}
|
|
3548
3987
|
return ("string" === t ? String : Number)(e);
|
|
3549
|
-
}(i, "string"), "symbol" ===
|
|
3988
|
+
}(i, "string"), "symbol" === Ze(o) ? o : String(o)), n);
|
|
3550
3989
|
}
|
|
3551
3990
|
var i, o;
|
|
3552
3991
|
}
|
|
3553
|
-
function
|
|
3554
|
-
return t &&
|
|
3992
|
+
function et(e, t, r) {
|
|
3993
|
+
return t && Qe(e.prototype, t), r && Qe(e, r), Object.defineProperty(e, "prototype", {
|
|
3555
3994
|
writable: !1
|
|
3556
3995
|
}), e;
|
|
3557
3996
|
}
|
|
3558
|
-
function
|
|
3997
|
+
function tt(e, t) {
|
|
3559
3998
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
3560
3999
|
}
|
|
3561
|
-
function
|
|
4000
|
+
function rt(e, t) {
|
|
3562
4001
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
3563
4002
|
e.prototype = Object.create(t && t.prototype, {
|
|
3564
4003
|
constructor: {
|
|
@@ -3568,31 +4007,31 @@ function et(e, t) {
|
|
|
3568
4007
|
}
|
|
3569
4008
|
}), Object.defineProperty(e, "prototype", {
|
|
3570
4009
|
writable: !1
|
|
3571
|
-
}), t &&
|
|
4010
|
+
}), t && ct(e, t);
|
|
3572
4011
|
}
|
|
3573
|
-
function
|
|
3574
|
-
var t =
|
|
4012
|
+
function nt(e) {
|
|
4013
|
+
var t = at();
|
|
3575
4014
|
return function () {
|
|
3576
4015
|
var r,
|
|
3577
|
-
n =
|
|
4016
|
+
n = ut(e);
|
|
3578
4017
|
if (t) {
|
|
3579
|
-
var i =
|
|
4018
|
+
var i = ut(this).constructor;
|
|
3580
4019
|
r = Reflect.construct(n, arguments, i);
|
|
3581
4020
|
} else r = n.apply(this, arguments);
|
|
3582
4021
|
return function (e, t) {
|
|
3583
|
-
if (t && ("object" ===
|
|
4022
|
+
if (t && ("object" === Ze(t) || "function" == typeof t)) return t;
|
|
3584
4023
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
3585
|
-
return
|
|
4024
|
+
return it(e);
|
|
3586
4025
|
}(this, r);
|
|
3587
4026
|
};
|
|
3588
4027
|
}
|
|
3589
|
-
function
|
|
4028
|
+
function it(e) {
|
|
3590
4029
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3591
4030
|
return e;
|
|
3592
4031
|
}
|
|
3593
|
-
function
|
|
4032
|
+
function ot(e) {
|
|
3594
4033
|
var t = "function" == typeof Map ? new Map() : void 0;
|
|
3595
|
-
return
|
|
4034
|
+
return ot = function ot(e) {
|
|
3596
4035
|
if (null === e || !function (e) {
|
|
3597
4036
|
try {
|
|
3598
4037
|
return -1 !== Function.toString.call(e).indexOf("[native code]");
|
|
@@ -3606,7 +4045,7 @@ function nt(e) {
|
|
|
3606
4045
|
t.set(e, r);
|
|
3607
4046
|
}
|
|
3608
4047
|
function r() {
|
|
3609
|
-
return
|
|
4048
|
+
return st(e, arguments, ut(this).constructor);
|
|
3610
4049
|
}
|
|
3611
4050
|
return r.prototype = Object.create(e.prototype, {
|
|
3612
4051
|
constructor: {
|
|
@@ -3615,18 +4054,18 @@ function nt(e) {
|
|
|
3615
4054
|
writable: !0,
|
|
3616
4055
|
configurable: !0
|
|
3617
4056
|
}
|
|
3618
|
-
}),
|
|
3619
|
-
},
|
|
4057
|
+
}), ct(r, e);
|
|
4058
|
+
}, ot(e);
|
|
3620
4059
|
}
|
|
3621
|
-
function
|
|
3622
|
-
return
|
|
4060
|
+
function st(e, t, r) {
|
|
4061
|
+
return st = at() ? Reflect.construct.bind() : function (e, t, r) {
|
|
3623
4062
|
var n = [null];
|
|
3624
4063
|
n.push.apply(n, t);
|
|
3625
4064
|
var i = new (Function.bind.apply(e, n))();
|
|
3626
|
-
return r &&
|
|
3627
|
-
},
|
|
4065
|
+
return r && ct(i, r.prototype), i;
|
|
4066
|
+
}, st.apply(null, arguments);
|
|
3628
4067
|
}
|
|
3629
|
-
function
|
|
4068
|
+
function at() {
|
|
3630
4069
|
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
|
3631
4070
|
if (Reflect.construct.sham) return !1;
|
|
3632
4071
|
if ("function" == typeof Proxy) return !0;
|
|
@@ -3636,15 +4075,15 @@ function ot() {
|
|
|
3636
4075
|
return !1;
|
|
3637
4076
|
}
|
|
3638
4077
|
}
|
|
3639
|
-
function
|
|
3640
|
-
return
|
|
4078
|
+
function ct(e, t) {
|
|
4079
|
+
return ct = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
|
|
3641
4080
|
return e.__proto__ = t, e;
|
|
3642
|
-
},
|
|
4081
|
+
}, ct(e, t);
|
|
3643
4082
|
}
|
|
3644
|
-
function
|
|
3645
|
-
return
|
|
4083
|
+
function ut(e) {
|
|
4084
|
+
return ut = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
3646
4085
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
3647
|
-
},
|
|
4086
|
+
}, ut(e);
|
|
3648
4087
|
}
|
|
3649
4088
|
exports.Products = void 0, function (e) {
|
|
3650
4089
|
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
@@ -3657,45 +4096,45 @@ exports.Products = void 0, function (e) {
|
|
|
3657
4096
|
}(exports.OneTapPositions || (exports.OneTapPositions = {})), exports.OTPMethods = void 0, function (e) {
|
|
3658
4097
|
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
3659
4098
|
}(exports.OTPMethods || (exports.OTPMethods = {})), exports.StytchEventType = void 0, function (e) {
|
|
3660
|
-
e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "
|
|
4099
|
+
e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", e.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", e.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", e.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", e.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", e.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", e.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", e.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION";
|
|
3661
4100
|
}(exports.StytchEventType || (exports.StytchEventType = {}));
|
|
3662
|
-
var
|
|
3663
|
-
|
|
3664
|
-
var t =
|
|
4101
|
+
var lt = function (e) {
|
|
4102
|
+
rt(r, ot(Error));
|
|
4103
|
+
var t = nt(r);
|
|
3665
4104
|
function r(e, n) {
|
|
3666
4105
|
var i;
|
|
3667
|
-
return
|
|
4106
|
+
return tt(this, r), (i = t.call(this, e + "\n" + n)).message = e + "\n" + n, i.name = "SDKAPIUnreachableError", i.details = n, Object.setPrototypeOf(it(i), r.prototype), i;
|
|
3668
4107
|
}
|
|
3669
|
-
return
|
|
4108
|
+
return et(r);
|
|
3670
4109
|
}(),
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
var t =
|
|
4110
|
+
dt = function (e) {
|
|
4111
|
+
rt(r, ot(Error));
|
|
4112
|
+
var t = nt(r);
|
|
3674
4113
|
function r(e, n) {
|
|
3675
4114
|
var i;
|
|
3676
|
-
return
|
|
4115
|
+
return tt(this, r), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + n, i;
|
|
3677
4116
|
}
|
|
3678
|
-
return
|
|
4117
|
+
return et(r);
|
|
3679
4118
|
}(),
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
var t =
|
|
4119
|
+
ht = function (e) {
|
|
4120
|
+
rt(r, ot(Error));
|
|
4121
|
+
var t = nt(r);
|
|
3683
4122
|
function r(e) {
|
|
3684
4123
|
var n, i;
|
|
3685
|
-
|
|
4124
|
+
tt(this, r), (n = t.call(this)).name = "StytchSDKSchemaError";
|
|
3686
4125
|
var o = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
|
|
3687
4126
|
return "".concat(e.dataPath, ": ").concat(e.message);
|
|
3688
4127
|
}).join("\n");
|
|
3689
4128
|
return n.message = "[400] Request does not match expected schema\n".concat(o), n;
|
|
3690
4129
|
}
|
|
3691
|
-
return
|
|
4130
|
+
return et(r);
|
|
3692
4131
|
}(),
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
var t =
|
|
4132
|
+
pt = function (e) {
|
|
4133
|
+
rt(r, ot(Error));
|
|
4134
|
+
var t = nt(r);
|
|
3696
4135
|
function r(e) {
|
|
3697
4136
|
var n;
|
|
3698
|
-
|
|
4137
|
+
tt(this, r), (n = t.call(this)).name = "StytchSDKAPIError";
|
|
3699
4138
|
var i = e.status_code,
|
|
3700
4139
|
o = e.error_type,
|
|
3701
4140
|
s = e.error_message,
|
|
@@ -3703,16 +4142,16 @@ var ct = function (e) {
|
|
|
3703
4142
|
c = e.request_id;
|
|
3704
4143
|
return n.error_type = o, n.error_message = s, n.error_url = a, n.request_id = c, n.status_code = i, n.message = "[".concat(i, "] ").concat(o, "\n") + "".concat(s, "\n") + "See ".concat(a, " for more information.\n") + (c ? "request_id: ".concat(c, "\n") : ""), n;
|
|
3705
4144
|
}
|
|
3706
|
-
return
|
|
4145
|
+
return et(r);
|
|
3707
4146
|
}(),
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
var t =
|
|
4147
|
+
_t = function (e) {
|
|
4148
|
+
rt(r, ot(Error));
|
|
4149
|
+
var t = nt(r);
|
|
3711
4150
|
function r(e) {
|
|
3712
4151
|
var n;
|
|
3713
|
-
return
|
|
4152
|
+
return tt(this, r), (n = t.call(this)).name = "StytchSDKNativeError", n.error_type = e, n.message = "".concat(e), n;
|
|
3714
4153
|
}
|
|
3715
|
-
return
|
|
4154
|
+
return et(r);
|
|
3716
4155
|
}();
|
|
3717
4156
|
exports.BiometricsErrors = void 0, function (e) {
|
|
3718
4157
|
e.BiometricsSensorError = "biometrics_sensor_error", e.DeviceCredentialsNotAllowed = "device_credentials_not_allowed", e.DeviceHardwareError = "device_hardware_error", e.InternalError = "internal_error", e.KeyInvalidated = "key_invalidated", e.KeystoreUnavailable = "keystore_unavailable", e.NoBiometricsEnrolled = "no_biometrics_enrolled", e.NoBiometricsRegistration = "no_biometrics_registration", e.SessionExpired = "session_expired", e.UserCancellation = "user_cancellation", e.UserLockedOut = "user_locked_out", e.BiometricsNotAvailable = "biometrics_not_available";
|
|
@@ -3722,14 +4161,14 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
3722
4161
|
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
3723
4162
|
}(exports.AuthFlowType || (exports.AuthFlowType = {})), exports.B2BOAuthProviders = void 0, function (e) {
|
|
3724
4163
|
e.Google = "google", e.Microsoft = "microsoft";
|
|
3725
|
-
}(exports.B2BOAuthProviders || (exports.B2BOAuthProviders = {})), exports.SDKAPIUnreachableError =
|
|
4164
|
+
}(exports.B2BOAuthProviders || (exports.B2BOAuthProviders = {})), exports.SDKAPIUnreachableError = lt, exports.StytchB2BHeadlessClient = /*#__PURE__*/function () {
|
|
3726
4165
|
function _class(e, t) {
|
|
3727
4166
|
var _this8 = this;
|
|
3728
4167
|
_classCallCheck(this, _class);
|
|
3729
4168
|
var r;
|
|
3730
4169
|
!function (e) {
|
|
3731
4170
|
if ("undefined" == typeof window) throw new Error("The ".concat(e, " is not compatible with server-side environments.\nIf using nextjs, use the create").concat(e, " method instead.\n```\n").concat("import { createStytchB2BHeadlessClient } from '@stytch/nextjs/b2b';\n \n const stytch = createStytchB2BHeadlessClient('public-token-...');\n ", "\n```\n"));
|
|
3732
|
-
}("StytchB2BHeadlessClient"), "string" != typeof (r = e) ?
|
|
4171
|
+
}("StytchB2BHeadlessClient"), "string" != typeof (r = e) ? J("Public token is malformed. Expected a string, got ".concat(n(r), ".").concat(X)) : "" === r ? J('Public token is malformed. Expected "public-token-...", got an empty string.'.concat(X)) : r.startsWith("public-token-") || J('Public token is malformed. Expected "public-token-...", got '.concat(r, ".").concat(X));
|
|
3733
4172
|
var i = t,
|
|
3734
4173
|
o = {
|
|
3735
4174
|
cookieOptions: null == (s = i) ? void 0 : s.cookieOptions,
|
|
@@ -3738,32 +4177,32 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
3738
4177
|
testAPIURL: null !== (l = null === (u = null == s ? void 0 : s.endpoints) || void 0 === u ? void 0 : u.testAPIURL) && void 0 !== l ? l : "https://test.stytch.com",
|
|
3739
4178
|
liveAPIURL: null !== (h = null === (d = null == s ? void 0 : s.endpoints) || void 0 === d ? void 0 : d.liveAPIURL) && void 0 !== h ? h : "https://api.stytch.com",
|
|
3740
4179
|
dfpBackendURL: null !== (_ = null === (p = null == s ? void 0 : s.endpoints) || void 0 === p ? void 0 : p.dfpBackendURL) && void 0 !== _ ? _ : "https://telemetry.stytch.com",
|
|
3741
|
-
clientsideServicesIframeURL: null !== (
|
|
4180
|
+
clientsideServicesIframeURL: null !== (m = null === (f = null == s ? void 0 : s.endpoints) || void 0 === f ? void 0 : f.clientsideServicesIframeURL) && void 0 !== m ? m : "https://js.stytch.com/clientside-services/index.html"
|
|
3742
4181
|
}
|
|
3743
4182
|
};
|
|
3744
|
-
var s, a, c, u, l, d, h, p, _,
|
|
3745
|
-
this._dataLayer =
|
|
3746
|
-
var v = new
|
|
3747
|
-
this._networkClient = new
|
|
4183
|
+
var s, a, c, u, l, d, h, p, _, f, m;
|
|
4184
|
+
this._dataLayer = qe(e, i), this._subscriptionService = new $e(e, this._dataLayer);
|
|
4185
|
+
var v = new Ne(this._dataLayer, "passwords");
|
|
4186
|
+
this._networkClient = new Le(e, this._dataLayer, o.endpoints.sdkBackendURL, function () {
|
|
3748
4187
|
var e, t, r, n;
|
|
3749
4188
|
return {
|
|
3750
4189
|
stytch_member_id: null === (t = null === (e = _this8._dataLayer.state) || void 0 === e ? void 0 : e.member) || void 0 === t ? void 0 : t.member_id,
|
|
3751
4190
|
stytch_member_session_id: null === (n = null === (r = _this8._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.member_session_id
|
|
3752
4191
|
};
|
|
3753
4192
|
});
|
|
3754
|
-
var b = new
|
|
3755
|
-
g = new
|
|
4193
|
+
var b = new De(e, this._networkClient, this._dataLayer),
|
|
4194
|
+
g = new Ie(b.getAsync()),
|
|
3756
4195
|
y = new ee(e, o.endpoints.dfpBackendURL, b.getAsync(), g.executeRecaptcha);
|
|
3757
|
-
this.organization = new ae(this._networkClient), this.member = new oe(this._networkClient, this._subscriptionService), this.session = new ue(this._networkClient, this._subscriptionService), this.magicLinks = new ie(this._networkClient, this._subscriptionService, new
|
|
4196
|
+
this.organization = new ae(this._networkClient, this._subscriptionService), this.member = new oe(this._networkClient, this._subscriptionService), this.self = new oe(this._networkClient, this._subscriptionService), this.session = new ue(this._networkClient, this._subscriptionService), this.magicLinks = new ie(this._networkClient, this._subscriptionService, new Ne(this._dataLayer, "magic_links"), v, b.getAsync(), y), this.oauth = new ce(this._networkClient, this._subscriptionService, new Ne(this._dataLayer, "oauth"), b.getAsync(), {
|
|
3758
4197
|
publicToken: e,
|
|
3759
4198
|
testAPIURL: o.endpoints.testAPIURL,
|
|
3760
4199
|
liveAPIURL: o.endpoints.liveAPIURL
|
|
3761
|
-
}, y), this.sso = new se(this._networkClient, this._subscriptionService, new
|
|
4200
|
+
}, y), this.sso = new se(this._networkClient, this._subscriptionService, new Ne(this._dataLayer, "sso"), b.getAsync(), {
|
|
3762
4201
|
publicToken: e,
|
|
3763
4202
|
testAPIURL: o.endpoints.testAPIURL,
|
|
3764
4203
|
liveAPIURL: o.endpoints.liveAPIURL
|
|
3765
|
-
}), this.discovery = new le(this._networkClient, this._subscriptionService), this.passwords = new
|
|
3766
|
-
var k = new
|
|
4204
|
+
}), this.discovery = new le(this._networkClient, this._subscriptionService), this.passwords = new Be(this._networkClient, this._subscriptionService, v, b.getAsync(), y), this.otps = new de(this._networkClient, this._subscriptionService, y), this.rbac = new he(b.getSync(), b.getAsync(), this._subscriptionService), this._sessionManager = new pe(this._subscriptionService, this.session);
|
|
4205
|
+
var k = new je(this._networkClient);
|
|
3767
4206
|
this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
|
|
3768
4207
|
name: "b2b_sdk_instance_instantiated",
|
|
3769
4208
|
details: {
|
|
@@ -3773,7 +4212,7 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
3773
4212
|
}
|
|
3774
4213
|
});
|
|
3775
4214
|
(function (e, t) {
|
|
3776
|
-
Object.assign(e, _defineProperty({},
|
|
4215
|
+
Object.assign(e, _defineProperty({}, Xe, t));
|
|
3777
4216
|
})(this, {
|
|
3778
4217
|
bootstrap: b,
|
|
3779
4218
|
publicToken: e,
|
|
@@ -3783,4 +4222,4 @@ exports.BiometricsErrors = void 0, function (e) {
|
|
|
3783
4222
|
});
|
|
3784
4223
|
}
|
|
3785
4224
|
return _createClass(_class);
|
|
3786
|
-
}(), exports.StytchSDKAPIError =
|
|
4225
|
+
}(), exports.StytchSDKAPIError = pt, exports.StytchSDKNativeError = _t, exports.StytchSDKSchemaError = ht, exports.StytchSDKUsageError = dt, exports.UNRECOVERABLE_ERROR_TYPES = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
|