@stytch/vanilla-js 4.10.1 → 4.11.1
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 +20 -0
- package/dist/b2b/index.esm.js +107 -51
- package/dist/b2b/index.headless.esm.js +44 -39
- package/dist/b2b/index.headless.js +18 -13
- package/dist/b2b/index.js +378 -322
- package/dist/index.esm.js +144 -156
- package/dist/index.headless.esm.js +1 -13
- package/dist/index.headless.js +1 -13
- package/dist/index.js +185 -197
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @stytch/vanilla-js
|
|
2
2
|
|
|
3
|
+
## 4.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2e33560: Loosen typings for various options to accept both string literals and TypeScript enums
|
|
8
|
+
- db67d12: Show error when slug is missing or no slug pattern matches during B2B Organization auth flow
|
|
9
|
+
- Updated dependencies [2e33560]
|
|
10
|
+
- @stytch/core@2.15.1
|
|
11
|
+
|
|
12
|
+
## 4.11.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- 5f4ba4a: Add `stytch.organization.getBySlug` method to B2B clients
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [5f4ba4a]
|
|
21
|
+
- @stytch/core@2.15.0
|
|
22
|
+
|
|
3
23
|
## 4.10.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/b2b/index.esm.js
CHANGED
|
@@ -2393,6 +2393,23 @@ var tt = Promise.resolve({
|
|
|
2393
2393
|
}
|
|
2394
2394
|
}, e, this);
|
|
2395
2395
|
}));
|
|
2396
|
+
}, this.getBySlug = function (e) {
|
|
2397
|
+
return xe(r, void 0, void 0, fe().mark(function t() {
|
|
2398
|
+
return fe().wrap(function (t) {
|
|
2399
|
+
for (;;) switch (t.prev = t.next) {
|
|
2400
|
+
case 0:
|
|
2401
|
+
return Ye("stytch.organization.getBySlug").isString("organization_slug", e.organization_slug), t.abrupt("return", this._networkClient.fetchSDK({
|
|
2402
|
+
url: "/b2b/organizations/search",
|
|
2403
|
+
errorMessage: "Failed to get organization by slug.",
|
|
2404
|
+
method: "POST",
|
|
2405
|
+
body: e
|
|
2406
|
+
}));
|
|
2407
|
+
case 2:
|
|
2408
|
+
case "end":
|
|
2409
|
+
return t.stop();
|
|
2410
|
+
}
|
|
2411
|
+
}, t, this);
|
|
2412
|
+
}));
|
|
2396
2413
|
}, this.members = {
|
|
2397
2414
|
create: function create(e) {
|
|
2398
2415
|
return xe(r, void 0, void 0, fe().mark(function t() {
|
|
@@ -3704,18 +3721,6 @@ var tt = Promise.resolve({
|
|
|
3704
3721
|
});
|
|
3705
3722
|
});
|
|
3706
3723
|
}
|
|
3707
|
-
}, {
|
|
3708
|
-
key: "searchOrganization",
|
|
3709
|
-
value: function value(e) {
|
|
3710
|
-
return this._networkClient.fetchSDK({
|
|
3711
|
-
url: "/b2b/organizations/search",
|
|
3712
|
-
method: "POST",
|
|
3713
|
-
body: {
|
|
3714
|
-
organization_slug: e
|
|
3715
|
-
},
|
|
3716
|
-
errorMessage: "Error searching slug"
|
|
3717
|
-
});
|
|
3718
|
-
}
|
|
3719
3724
|
}, {
|
|
3720
3725
|
key: "searchMember",
|
|
3721
3726
|
value: function value(e, t) {
|
|
@@ -4349,7 +4354,7 @@ var Nt = /*#__PURE__*/function () {
|
|
|
4349
4354
|
},
|
|
4350
4355
|
sdk: {
|
|
4351
4356
|
identifier: "Stytch.js Javascript SDK",
|
|
4352
|
-
version: "4.
|
|
4357
|
+
version: "4.11.1"
|
|
4353
4358
|
}
|
|
4354
4359
|
});
|
|
4355
4360
|
}
|
|
@@ -13779,6 +13784,17 @@ var Kp = cs.button(_templateObject45 || (_templateObject45 = _taggedTemplateLite
|
|
|
13779
13784
|
}),
|
|
13780
13785
|
th = cs.img(_templateObject51 || (_templateObject51 = _taggedTemplateLiteral(["\n width: 150px;\n"]))),
|
|
13781
13786
|
nh = function nh() {
|
|
13787
|
+
var e = new URL(window.location.href);
|
|
13788
|
+
return {
|
|
13789
|
+
tokenType: e.searchParams.get("stytch_token_type"),
|
|
13790
|
+
token: e.searchParams.get("token")
|
|
13791
|
+
};
|
|
13792
|
+
},
|
|
13793
|
+
rh = new Set(["discovery", "discovery_oauth", "oauth", "sso", "multi_tenant_magic_links"]),
|
|
13794
|
+
oh = function oh(e) {
|
|
13795
|
+
return !(!e || !rh.has(e));
|
|
13796
|
+
},
|
|
13797
|
+
ih = function ih() {
|
|
13782
13798
|
var _s5;
|
|
13783
13799
|
var _Es55 = Es(),
|
|
13784
13800
|
_Es56 = _slicedToArray(_Es55, 2),
|
|
@@ -13873,20 +13889,23 @@ var Kp = cs.button(_templateObject45 || (_templateObject45 = _taggedTemplateLite
|
|
|
13873
13889
|
}),
|
|
13874
13890
|
v = _u18.trigger,
|
|
13875
13891
|
b = _u18.isMutating,
|
|
13892
|
+
w = p || A || b || g || m,
|
|
13876
13893
|
_ref124 = function () {
|
|
13877
13894
|
var _Es57 = Es(),
|
|
13878
13895
|
_Es58 = _slicedToArray(_Es57, 2),
|
|
13879
13896
|
e = _Es58[0],
|
|
13880
13897
|
t = _Es58[1],
|
|
13881
|
-
_mr57 = mr(
|
|
13898
|
+
_mr57 = mr(),
|
|
13882
13899
|
_mr58 = _slicedToArray(_mr57, 2),
|
|
13883
13900
|
n = _mr58[0],
|
|
13884
13901
|
r = _mr58[1],
|
|
13885
13902
|
o = ks(),
|
|
13886
|
-
i = bu(n),
|
|
13887
|
-
_u19 = _u("
|
|
13903
|
+
i = bu(n || null),
|
|
13904
|
+
_u19 = _u("stytchClient.organization.getBySlug", function (e, _ref130) {
|
|
13888
13905
|
var t = _ref130.arg.slug;
|
|
13889
|
-
return
|
|
13906
|
+
return o.organization.getBySlug({
|
|
13907
|
+
organization_slug: t
|
|
13908
|
+
});
|
|
13890
13909
|
}, {
|
|
13891
13910
|
onSuccess: function onSuccess(_ref131) {
|
|
13892
13911
|
var e = _ref131.organization;
|
|
@@ -13911,27 +13930,64 @@ var Kp = cs.button(_templateObject45 || (_templateObject45 = _taggedTemplateLite
|
|
|
13911
13930
|
slug: i
|
|
13912
13931
|
});
|
|
13913
13932
|
}, [i, e.flowState, e.screen]), {
|
|
13914
|
-
isSearching: s
|
|
13933
|
+
isSearching: s,
|
|
13934
|
+
slug: i,
|
|
13935
|
+
pattern: n
|
|
13915
13936
|
};
|
|
13916
13937
|
}(),
|
|
13917
|
-
|
|
13938
|
+
k = _ref124.isSearching,
|
|
13939
|
+
E = _ref124.slug,
|
|
13940
|
+
S = _ref124.pattern;
|
|
13941
|
+
gr(function () {
|
|
13942
|
+
if (i) return;
|
|
13943
|
+
if (e.flowState.type == y.PasswordReset) return;
|
|
13944
|
+
var _nh = nh(),
|
|
13945
|
+
t = _nh.tokenType,
|
|
13946
|
+
n = _nh.token;
|
|
13947
|
+
if (n && oh(t) && !w) switch (t) {
|
|
13948
|
+
case "discovery":
|
|
13949
|
+
v({
|
|
13950
|
+
token: n
|
|
13951
|
+
});
|
|
13952
|
+
break;
|
|
13953
|
+
case "discovery_oauth":
|
|
13954
|
+
f({
|
|
13955
|
+
token: n
|
|
13956
|
+
});
|
|
13957
|
+
break;
|
|
13958
|
+
case "oauth":
|
|
13959
|
+
h({
|
|
13960
|
+
token: n
|
|
13961
|
+
});
|
|
13962
|
+
break;
|
|
13963
|
+
case "sso":
|
|
13964
|
+
_({
|
|
13965
|
+
token: n
|
|
13966
|
+
});
|
|
13967
|
+
break;
|
|
13968
|
+
case "multi_tenant_magic_links":
|
|
13969
|
+
d({
|
|
13970
|
+
token: n
|
|
13971
|
+
});
|
|
13972
|
+
break;
|
|
13973
|
+
default:
|
|
13974
|
+
return function () {
|
|
13975
|
+
throw new Error("Assertion failure");
|
|
13976
|
+
}();
|
|
13977
|
+
}
|
|
13978
|
+
}, []);
|
|
13979
|
+
var C = Cs();
|
|
13918
13980
|
return gr(function () {
|
|
13919
13981
|
if (i) return;
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
|
|
13926
|
-
|
|
13927
|
-
})
|
|
13928
|
-
|
|
13929
|
-
}) : "sso" === n ? _({
|
|
13930
|
-
token: r
|
|
13931
|
-
}) : "multi_tenant_magic_links" === n && d({
|
|
13932
|
-
token: r
|
|
13933
|
-
}));
|
|
13934
|
-
}, []), i ? Mo.createElement(hd, null) : p || A || b || g || m ? Mo.createElement(eh, null, Mo.createElement(Id, null)) : w ? Mo.createElement(eh, null, Mo.createElement(Bd, null)) : Mo.createElement(eh, null, s[a], Mo.createElement(rl, null), o && Mo.createElement(al, {
|
|
13982
|
+
if (w) return;
|
|
13983
|
+
var _nh2 = nh(),
|
|
13984
|
+
n = _nh2.tokenType,
|
|
13985
|
+
r = _nh2.token;
|
|
13986
|
+
r && oh(n) || E || void 0 === S || k || null !== e.flowState.organization || e.screen !== _s.Main || e.flowState.type != y.Organization || t({
|
|
13987
|
+
type: "transition",
|
|
13988
|
+
screen: _s.ErrorOrganization
|
|
13989
|
+
});
|
|
13990
|
+
}, [t, i, k, w, S, E, e.flowState.organization, e.flowState.type, e.screen, C]), i ? Mo.createElement(hd, null) : w ? Mo.createElement(eh, null, Mo.createElement(Id, null)) : k ? Mo.createElement(eh, null, Mo.createElement(Bd, null)) : Mo.createElement(eh, null, s[a], Mo.createElement(rl, null), o && Mo.createElement(al, {
|
|
13935
13991
|
justifyContent: "center",
|
|
13936
13992
|
marginTop: 24
|
|
13937
13993
|
}, Mo.createElement("a", {
|
|
@@ -13943,8 +13999,8 @@ var Kp = cs.button(_templateObject45 || (_templateObject45 = _taggedTemplateLite
|
|
|
13943
13999
|
src: "https://public-assets.stytch.com/et_powered_by_stytch_logo.png"
|
|
13944
14000
|
}))));
|
|
13945
14001
|
},
|
|
13946
|
-
|
|
13947
|
-
|
|
14002
|
+
ah = "stytch-b2b-ui",
|
|
14003
|
+
sh = (ch = function ch(_ref133) {
|
|
13948
14004
|
var e = _ref133.client,
|
|
13949
14005
|
t = _ref133.styles,
|
|
13950
14006
|
n = _ref133.callbacks,
|
|
@@ -13985,8 +14041,8 @@ var Kp = cs.button(_templateObject45 || (_templateObject45 = _taggedTemplateLite
|
|
|
13985
14041
|
initialState: a
|
|
13986
14042
|
}, Mo.createElement(ns, {
|
|
13987
14043
|
theme: s
|
|
13988
|
-
}, Mo.createElement(
|
|
13989
|
-
},
|
|
14044
|
+
}, Mo.createElement(ih, null)));
|
|
14045
|
+
}, lh = ah, "undefined" == typeof window ? function () {
|
|
13990
14046
|
return null;
|
|
13991
14047
|
} : function (e) {
|
|
13992
14048
|
if (e.config.enableShadowDOM) {
|
|
@@ -14036,7 +14092,7 @@ var Kp = cs.button(_templateObject45 || (_templateObject45 = _taggedTemplateLite
|
|
|
14036
14092
|
return r;
|
|
14037
14093
|
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
14038
14094
|
return customElements.define(t, r), r;
|
|
14039
|
-
}(
|
|
14095
|
+
}(ch, lh);
|
|
14040
14096
|
return new _t11(e);
|
|
14041
14097
|
}
|
|
14042
14098
|
{
|
|
@@ -14074,26 +14130,26 @@ var Kp = cs.button(_templateObject45 || (_templateObject45 = _taggedTemplateLite
|
|
|
14074
14130
|
return r;
|
|
14075
14131
|
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
14076
14132
|
return customElements.define(t, r), r;
|
|
14077
|
-
}(
|
|
14133
|
+
}(ch, lh);
|
|
14078
14134
|
return new _t12(e);
|
|
14079
14135
|
}
|
|
14080
14136
|
});
|
|
14081
|
-
var
|
|
14082
|
-
var
|
|
14083
|
-
_inherits(
|
|
14084
|
-
function
|
|
14137
|
+
var ch, lh;
|
|
14138
|
+
var uh = /*#__PURE__*/function (_mn) {
|
|
14139
|
+
_inherits(uh, _mn);
|
|
14140
|
+
function uh() {
|
|
14085
14141
|
var _this15;
|
|
14086
|
-
_classCallCheck(this,
|
|
14142
|
+
_classCallCheck(this, uh);
|
|
14087
14143
|
for (var _len6 = arguments.length, e = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
14088
14144
|
e[_key6] = arguments[_key6];
|
|
14089
14145
|
}
|
|
14090
14146
|
!function (e) {
|
|
14091
14147
|
var t = "StytchUIClient" === e ? "import { createStytchUIClient } from '@stytch/nextjs/ui';\n \nconst stytch = createStytchUIClient('public-token-...');\n" : "import { createStytchHeadlessClient } from '@stytch/nextjs/ui';\n \nconst stytch = createStytchHeadlessClient('public-token-...');\n";
|
|
14092
14148
|
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(t, "\n```\n"));
|
|
14093
|
-
}("StytchUIClient"), _this15 = _callSuper(this,
|
|
14149
|
+
}("StytchUIClient"), _this15 = _callSuper(this, uh, [].concat(e));
|
|
14094
14150
|
return _this15;
|
|
14095
14151
|
}
|
|
14096
|
-
_createClass(
|
|
14152
|
+
_createClass(uh, [{
|
|
14097
14153
|
key: "mount",
|
|
14098
14154
|
value: function mount(_ref135) {
|
|
14099
14155
|
var e = _ref135.elementId,
|
|
@@ -14105,7 +14161,7 @@ var sh = /*#__PURE__*/function (_mn) {
|
|
|
14105
14161
|
if (!i) {
|
|
14106
14162
|
throw new Error("The selector you specified (".concat(e, ") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin()."));
|
|
14107
14163
|
}
|
|
14108
|
-
if ((null === (o = i.firstChild) || void 0 === o ? void 0 : o.nodeName.toLowerCase()) ===
|
|
14164
|
+
if ((null === (o = i.firstChild) || void 0 === o ? void 0 : o.nodeName.toLowerCase()) === ah.toLowerCase()) {
|
|
14109
14165
|
return void i.firstChild.render({
|
|
14110
14166
|
client: this,
|
|
14111
14167
|
config: r,
|
|
@@ -14113,7 +14169,7 @@ var sh = /*#__PURE__*/function (_mn) {
|
|
|
14113
14169
|
styles: t
|
|
14114
14170
|
});
|
|
14115
14171
|
}
|
|
14116
|
-
var a =
|
|
14172
|
+
var a = sh({
|
|
14117
14173
|
client: this,
|
|
14118
14174
|
config: r,
|
|
14119
14175
|
callbacks: n,
|
|
@@ -14122,6 +14178,6 @@ var sh = /*#__PURE__*/function (_mn) {
|
|
|
14122
14178
|
i.appendChild(a);
|
|
14123
14179
|
}
|
|
14124
14180
|
}]);
|
|
14125
|
-
return
|
|
14181
|
+
return uh;
|
|
14126
14182
|
}(mn);
|
|
14127
|
-
export { y as AuthFlowType, b as B2BMFAProducts, w as B2BOAuthProviders, v as B2BProducts, ee as BiometricsFailedError, L as BiometricsUnavailableError, W as ChallengeSigningFailedError, Q as DeviceCredentialsNotAllowedError, J as FailedCodeChallengeError, X as FailedToDecryptDataError, M as InternalError, V as InvalidAuthorizationCredentialError, oe as InvalidCredentialTypeError, ne as InvalidRedirectSchemeError, te as InvalidStartUrlError, ae as JSONDataNotConvertibleToStringError, j as KeyInvalidatedError, z as KeystoreUnavailableError, ie as MissingAttestationObjectError, K as MissingAuthorizationCredentialIDTokenError, $ as MissingGoogleClientIDError, H as MissingPKCEError, G as MissingPublicKeyError, re as MissingUrlError, F as NoBiometricsEnrolledError, D as NoBiometricsRegistrationError, q as NoCredentialsPresentError, R as NoCurrentSessionError, h as OAuthProviders, g as OTPMethods, f as OneTapPositions, ce as PasskeysInvalidEncoding, le as PasskeysMisconfigured, Z as PasskeysUnsupportedError, p as Products, A as RNUIProducts, se as RandomNumberGenerationFailed, k as SDKAPIUnreachableError, Y as SDKNotConfiguredError, ue as SignInWithAppleMisconfigured, I as StytchAPIError, P as StytchAPISchemaError, T as StytchAPIUnreachableError,
|
|
14183
|
+
export { y as AuthFlowType, b as B2BMFAProducts, w as B2BOAuthProviders, v as B2BProducts, ee as BiometricsFailedError, L as BiometricsUnavailableError, W as ChallengeSigningFailedError, Q as DeviceCredentialsNotAllowedError, J as FailedCodeChallengeError, X as FailedToDecryptDataError, M as InternalError, V as InvalidAuthorizationCredentialError, oe as InvalidCredentialTypeError, ne as InvalidRedirectSchemeError, te as InvalidStartUrlError, ae as JSONDataNotConvertibleToStringError, j as KeyInvalidatedError, z as KeystoreUnavailableError, ie as MissingAttestationObjectError, K as MissingAuthorizationCredentialIDTokenError, $ as MissingGoogleClientIDError, H as MissingPKCEError, G as MissingPublicKeyError, re as MissingUrlError, F as NoBiometricsEnrolledError, D as NoBiometricsRegistrationError, q as NoCredentialsPresentError, R as NoCurrentSessionError, h as OAuthProviders, g as OTPMethods, f as OneTapPositions, ce as PasskeysInvalidEncoding, le as PasskeysMisconfigured, Z as PasskeysUnsupportedError, p as Products, A as RNUIProducts, se as RandomNumberGenerationFailed, k as SDKAPIUnreachableError, Y as SDKNotConfiguredError, ue as SignInWithAppleMisconfigured, I as StytchAPIError, P as StytchAPISchemaError, T as StytchAPIUnreachableError, uh as StytchB2BUIClient, x as StytchError, _ as StytchEventType, C as StytchSDKAPIError, B as StytchSDKError, S as StytchSDKSchemaError, E as StytchSDKUsageError, O as UNRECOVERABLE_ERROR_TYPES, N as UserCancellationError, U as UserLockedOutError, m as Wallets, de as errorToStytchError };
|
|
@@ -149,8 +149,8 @@ var h, p, _, f, m, v, g;
|
|
|
149
149
|
e[e.emailMagicLinks = 0] = "emailMagicLinks", e[e.oauth = 1] = "oauth", e[e.otp = 2] = "otp", e[e.passwords = 3] = "passwords";
|
|
150
150
|
}(g || (g = {}));
|
|
151
151
|
var b,
|
|
152
|
-
k,
|
|
153
152
|
y,
|
|
153
|
+
k,
|
|
154
154
|
w,
|
|
155
155
|
S = function (e) {
|
|
156
156
|
function t(e, r) {
|
|
@@ -629,14 +629,14 @@ function fe() {
|
|
|
629
629
|
function v() {}
|
|
630
630
|
function g() {}
|
|
631
631
|
function b() {}
|
|
632
|
-
var
|
|
633
|
-
u(
|
|
632
|
+
var y = {};
|
|
633
|
+
u(y, s, function () {
|
|
634
634
|
return this;
|
|
635
635
|
});
|
|
636
|
-
var
|
|
637
|
-
w =
|
|
638
|
-
w && w !== r && n.call(w, s) && (
|
|
639
|
-
var S = b.prototype = v.prototype = Object.create(
|
|
636
|
+
var k = Object.getPrototypeOf,
|
|
637
|
+
w = k && k(k(D([])));
|
|
638
|
+
w && w !== r && n.call(w, s) && (y = w);
|
|
639
|
+
var S = b.prototype = v.prototype = Object.create(y);
|
|
640
640
|
function T(e) {
|
|
641
641
|
["next", "throw", "return"].forEach(function (t) {
|
|
642
642
|
u(e, t, function (e) {
|
|
@@ -897,7 +897,7 @@ function ge(e) {
|
|
|
897
897
|
function be(e, t) {
|
|
898
898
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function ye(e, t, r) {
|
|
901
901
|
return t = Te(t), function (e, t) {
|
|
902
902
|
if (t && ("object" === _e(t) || "function" == typeof t)) return t;
|
|
903
903
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
@@ -907,9 +907,9 @@ function ke(e, t, r) {
|
|
|
907
907
|
}(e);
|
|
908
908
|
}(e, we() ? Reflect.construct(t, r || [], Te(e).constructor) : t.apply(e, r));
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function ke(e) {
|
|
911
911
|
var t = "function" == typeof Map ? new Map() : void 0;
|
|
912
|
-
return
|
|
912
|
+
return ke = function ke(e) {
|
|
913
913
|
if (null === e || !function (e) {
|
|
914
914
|
try {
|
|
915
915
|
return -1 !== Function.toString.call(e).indexOf("[native code]");
|
|
@@ -939,7 +939,7 @@ function ye(e) {
|
|
|
939
939
|
configurable: !0
|
|
940
940
|
}
|
|
941
941
|
}), Se(r, e);
|
|
942
|
-
},
|
|
942
|
+
}, ke(e);
|
|
943
943
|
}
|
|
944
944
|
function we() {
|
|
945
945
|
try {
|
|
@@ -963,9 +963,9 @@ function Te(e) {
|
|
|
963
963
|
e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
|
|
964
964
|
}(b || (b = {})), function (e) {
|
|
965
965
|
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
966
|
-
}(k || (k = {})), function (e) {
|
|
967
|
-
e.smsOtp = "smsOtp", e.totp = "totp";
|
|
968
966
|
}(y || (y = {})), function (e) {
|
|
967
|
+
e.smsOtp = "smsOtp", e.totp = "totp";
|
|
968
|
+
}(k || (k = {})), function (e) {
|
|
969
969
|
e.Google = "google", e.Microsoft = "microsoft";
|
|
970
970
|
}(w || (w = {}));
|
|
971
971
|
var Ce,
|
|
@@ -1001,7 +1001,7 @@ var Ae,
|
|
|
1001
1001
|
xe = function (e) {
|
|
1002
1002
|
function t(e) {
|
|
1003
1003
|
var r;
|
|
1004
|
-
return be(this, t), (r =
|
|
1004
|
+
return be(this, t), (r = ye(this, t, [e])).type = e, r;
|
|
1005
1005
|
}
|
|
1006
1006
|
return function (e, t) {
|
|
1007
1007
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
@@ -1014,7 +1014,7 @@ var Ae,
|
|
|
1014
1014
|
}), Object.defineProperty(e, "prototype", {
|
|
1015
1015
|
writable: !1
|
|
1016
1016
|
}), t && Se(e, t);
|
|
1017
|
-
}(t,
|
|
1017
|
+
}(t, ke(Error)), ve(t);
|
|
1018
1018
|
}();
|
|
1019
1019
|
function De(e) {
|
|
1020
1020
|
var t,
|
|
@@ -2269,6 +2269,23 @@ var et = Promise.resolve({
|
|
|
2269
2269
|
}
|
|
2270
2270
|
}, e, this);
|
|
2271
2271
|
}));
|
|
2272
|
+
}, this.getBySlug = function (e) {
|
|
2273
|
+
return Ee(n, void 0, void 0, fe().mark(function t() {
|
|
2274
|
+
return fe().wrap(function (t) {
|
|
2275
|
+
for (;;) switch (t.prev = t.next) {
|
|
2276
|
+
case 0:
|
|
2277
|
+
return Je("stytch.organization.getBySlug").isString("organization_slug", e.organization_slug), t.abrupt("return", this._networkClient.fetchSDK({
|
|
2278
|
+
url: "/b2b/organizations/search",
|
|
2279
|
+
errorMessage: "Failed to get organization by slug.",
|
|
2280
|
+
method: "POST",
|
|
2281
|
+
body: e
|
|
2282
|
+
}));
|
|
2283
|
+
case 2:
|
|
2284
|
+
case "end":
|
|
2285
|
+
return t.stop();
|
|
2286
|
+
}
|
|
2287
|
+
}, t, this);
|
|
2288
|
+
}));
|
|
2272
2289
|
}, this.members = {
|
|
2273
2290
|
create: function create(e) {
|
|
2274
2291
|
return Ee(n, void 0, void 0, fe().mark(function t() {
|
|
@@ -3580,18 +3597,6 @@ var et = Promise.resolve({
|
|
|
3580
3597
|
});
|
|
3581
3598
|
});
|
|
3582
3599
|
}
|
|
3583
|
-
}, {
|
|
3584
|
-
key: "searchOrganization",
|
|
3585
|
-
value: function value(e) {
|
|
3586
|
-
return this._networkClient.fetchSDK({
|
|
3587
|
-
url: "/b2b/organizations/search",
|
|
3588
|
-
method: "POST",
|
|
3589
|
-
body: {
|
|
3590
|
-
organization_slug: e
|
|
3591
|
-
},
|
|
3592
|
-
errorMessage: "Error searching slug"
|
|
3593
|
-
});
|
|
3594
|
-
}
|
|
3595
3600
|
}, {
|
|
3596
3601
|
key: "searchMember",
|
|
3597
3602
|
value: function value(e, t) {
|
|
@@ -3687,8 +3692,8 @@ mt.REFRESH_INTERVAL_MS = 18e4;
|
|
|
3687
3692
|
var vt,
|
|
3688
3693
|
gt,
|
|
3689
3694
|
bt,
|
|
3690
|
-
kt,
|
|
3691
3695
|
yt,
|
|
3696
|
+
kt,
|
|
3692
3697
|
wt,
|
|
3693
3698
|
St,
|
|
3694
3699
|
Tt,
|
|
@@ -3803,9 +3808,9 @@ function Rt(e, t, r, n) {
|
|
|
3803
3808
|
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";
|
|
3804
3809
|
}(bt || (bt = {})), function (e) {
|
|
3805
3810
|
e.embedded = "embedded", e.floating = "floating", e.embeddedOnly = "embeddedOnly", e.floatingOrEmbedded = "floatingOrEmbedded", e.forceLegacyEmbedded = "forceLegacyEmbedded";
|
|
3806
|
-
}(kt || (kt = {})), function (e) {
|
|
3807
|
-
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
3808
3811
|
}(yt || (yt = {})), function (e) {
|
|
3812
|
+
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
3813
|
+
}(kt || (kt = {})), function (e) {
|
|
3809
3814
|
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", e.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", e.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", e.B2BTOTPCreate = "B2B_TOTP_CREATE", e.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", e.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER";
|
|
3810
3815
|
}(wt || (wt = {})), function (e) {
|
|
3811
3816
|
e[e.emailMagicLinks = 0] = "emailMagicLinks", e[e.oauth = 1] = "oauth", e[e.otp = 2] = "otp", e[e.passwords = 3] = "passwords";
|
|
@@ -4225,7 +4230,7 @@ var Nt = /*#__PURE__*/function () {
|
|
|
4225
4230
|
},
|
|
4226
4231
|
sdk: {
|
|
4227
4232
|
identifier: "Stytch.js Javascript SDK",
|
|
4228
|
-
version: "4.
|
|
4233
|
+
version: "4.11.1"
|
|
4229
4234
|
}
|
|
4230
4235
|
});
|
|
4231
4236
|
}
|
|
@@ -5226,20 +5231,20 @@ var lr = /*#__PURE__*/_createClass(function lr(e, t) {
|
|
|
5226
5231
|
this._networkClient = new Nt(e, this._dataLayer, i.endpoints.sdkBackendURL, m), this._apiNetworkClient = new ur(e, this._dataLayer, i.endpoints.liveAPIURL, i.endpoints.testAPIURL, m);
|
|
5227
5232
|
var g = new Mt(e, this._networkClient, this._dataLayer),
|
|
5228
5233
|
b = new Ft(g.getAsync()),
|
|
5229
|
-
|
|
5230
|
-
|
|
5234
|
+
y = new $e(e, i.endpoints.dfpBackendURL, g.getAsync(), b.executeRecaptcha),
|
|
5235
|
+
k = new jt(i.endpoints.clientsideServicesIframeURL),
|
|
5231
5236
|
w = new Ut(this._dataLayer, "oauth"),
|
|
5232
5237
|
S = new cr(this._apiNetworkClient, w, g.getAsync());
|
|
5233
|
-
this.organization = new it(this._networkClient, this._subscriptionService), this.member = new rt(this._networkClient, this._subscriptionService), this.self = new rt(this._networkClient, this._subscriptionService), this.session = new st(this._networkClient, this._subscriptionService), this.magicLinks = new tt(this._networkClient, this._subscriptionService, new Ut(this._dataLayer, "magic_links"), v, g.getAsync(),
|
|
5238
|
+
this.organization = new it(this._networkClient, this._subscriptionService), this.member = new rt(this._networkClient, this._subscriptionService), this.self = new rt(this._networkClient, this._subscriptionService), this.session = new st(this._networkClient, this._subscriptionService), this.magicLinks = new tt(this._networkClient, this._subscriptionService, new Ut(this._dataLayer, "magic_links"), v, g.getAsync(), y), this.oauth = new Bt(this._networkClient, this._subscriptionService, w, g.getAsync(), {
|
|
5234
5239
|
publicToken: e,
|
|
5235
5240
|
testAPIURL: i.endpoints.testAPIURL,
|
|
5236
5241
|
liveAPIURL: i.endpoints.liveAPIURL
|
|
5237
|
-
},
|
|
5242
|
+
}, y, S), this.sso = new nt(this._networkClient, this._subscriptionService, new Ut(this._dataLayer, "sso"), g.getAsync(), {
|
|
5238
5243
|
publicToken: e,
|
|
5239
5244
|
testAPIURL: i.endpoints.testAPIURL,
|
|
5240
5245
|
liveAPIURL: i.endpoints.liveAPIURL
|
|
5241
|
-
}), this.discovery = new at(this._networkClient, this._subscriptionService), this.passwords = new ut(this._networkClient, this._subscriptionService, v, g.getAsync(),
|
|
5242
|
-
var T = new ft(this._networkClient,
|
|
5246
|
+
}), this.discovery = new at(this._networkClient, this._subscriptionService), this.passwords = new ut(this._networkClient, this._subscriptionService, v, g.getAsync(), y), this.otps = new lt(this._networkClient, this._subscriptionService, y), this.totp = new dt(this._networkClient, this._subscriptionService, y), this.recoveryCodes = new ht(this._networkClient, this._subscriptionService, y), this.rbac = new pt(g.getSync(), g.getAsync(), this._subscriptionService), this._sessionManager = new mt(this._subscriptionService, this.session);
|
|
5247
|
+
var T = new ft(this._networkClient, y);
|
|
5243
5248
|
this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
|
|
5244
5249
|
name: "b2b_sdk_instance_instantiated",
|
|
5245
5250
|
details: {
|
|
@@ -5252,7 +5257,7 @@ var lr = /*#__PURE__*/_createClass(function lr(e, t) {
|
|
|
5252
5257
|
Object.assign(e, _defineProperty({}, nr, t));
|
|
5253
5258
|
})(this, {
|
|
5254
5259
|
bootstrap: g,
|
|
5255
|
-
clientsideServices:
|
|
5260
|
+
clientsideServices: k,
|
|
5256
5261
|
publicToken: e,
|
|
5257
5262
|
searchManager: T,
|
|
5258
5263
|
dataLayer: this._dataLayer,
|
|
@@ -5260,4 +5265,4 @@ var lr = /*#__PURE__*/_createClass(function lr(e, t) {
|
|
|
5260
5265
|
oneTap: S
|
|
5261
5266
|
});
|
|
5262
5267
|
});
|
|
5263
|
-
export {
|
|
5268
|
+
export { y as AuthFlowType, k as B2BMFAProducts, w as B2BOAuthProviders, b as B2BProducts, ee as BiometricsFailedError, M as BiometricsUnavailableError, J as ChallengeSigningFailedError, z as DeviceCredentialsNotAllowedError, X as FailedCodeChallengeError, Q as FailedToDecryptDataError, B as InternalError, H as InvalidAuthorizationCredentialError, ie as InvalidCredentialTypeError, re as InvalidRedirectSchemeError, te as InvalidStartUrlError, se as JSONDataNotConvertibleToStringError, F as KeyInvalidatedError, j as KeystoreUnavailableError, oe as MissingAttestationObjectError, W as MissingAuthorizationCredentialIDTokenError, q as MissingGoogleClientIDError, G as MissingPKCEError, V as MissingPublicKeyError, ne as MissingUrlError, N as NoBiometricsEnrolledError, L as NoBiometricsRegistrationError, Y as NoCredentialsPresentError, I as NoCurrentSessionError, p as OAuthProviders, m as OTPMethods, f as OneTapPositions, ce as PasskeysInvalidEncoding, ue as PasskeysMisconfigured, Z as PasskeysUnsupportedError, h as Products, g as RNUIProducts, ae as RandomNumberGenerationFailed, S as SDKAPIUnreachableError, $ as SDKNotConfiguredError, le as SignInWithAppleMisconfigured, D as StytchAPIError, x as StytchAPISchemaError, A as StytchAPIUnreachableError, lr as StytchB2BHeadlessClient, E as StytchError, v as StytchEventType, P as StytchSDKAPIError, R as StytchSDKError, C as StytchSDKSchemaError, T as StytchSDKUsageError, O as UNRECOVERABLE_ERROR_TYPES, K as UserCancellationError, U as UserLockedOutError, _ as Wallets, de as errorToStytchError };
|
|
@@ -2195,6 +2195,23 @@ var ze = Promise.resolve({
|
|
|
2195
2195
|
}
|
|
2196
2196
|
}, e, this);
|
|
2197
2197
|
}));
|
|
2198
|
+
}, this.getBySlug = function (e) {
|
|
2199
|
+
return me(n, void 0, void 0, ne().mark(function t() {
|
|
2200
|
+
return ne().wrap(function (t) {
|
|
2201
|
+
for (;;) switch (t.prev = t.next) {
|
|
2202
|
+
case 0:
|
|
2203
|
+
return Fe("stytch.organization.getBySlug").isString("organization_slug", e.organization_slug), t.abrupt("return", this._networkClient.fetchSDK({
|
|
2204
|
+
url: "/b2b/organizations/search",
|
|
2205
|
+
errorMessage: "Failed to get organization by slug.",
|
|
2206
|
+
method: "POST",
|
|
2207
|
+
body: e
|
|
2208
|
+
}));
|
|
2209
|
+
case 2:
|
|
2210
|
+
case "end":
|
|
2211
|
+
return t.stop();
|
|
2212
|
+
}
|
|
2213
|
+
}, t, this);
|
|
2214
|
+
}));
|
|
2198
2215
|
}, this.members = {
|
|
2199
2216
|
create: function create(e) {
|
|
2200
2217
|
return me(n, void 0, void 0, ne().mark(function t() {
|
|
@@ -3506,18 +3523,6 @@ var ze = Promise.resolve({
|
|
|
3506
3523
|
});
|
|
3507
3524
|
});
|
|
3508
3525
|
}
|
|
3509
|
-
}, {
|
|
3510
|
-
key: "searchOrganization",
|
|
3511
|
-
value: function value(e) {
|
|
3512
|
-
return this._networkClient.fetchSDK({
|
|
3513
|
-
url: "/b2b/organizations/search",
|
|
3514
|
-
method: "POST",
|
|
3515
|
-
body: {
|
|
3516
|
-
organization_slug: e
|
|
3517
|
-
},
|
|
3518
|
-
errorMessage: "Error searching slug"
|
|
3519
|
-
});
|
|
3520
|
-
}
|
|
3521
3526
|
}, {
|
|
3522
3527
|
key: "searchMember",
|
|
3523
3528
|
value: function value(e, t) {
|
|
@@ -4151,7 +4156,7 @@ var Et = /*#__PURE__*/function () {
|
|
|
4151
4156
|
},
|
|
4152
4157
|
sdk: {
|
|
4153
4158
|
identifier: "Stytch.js Javascript SDK",
|
|
4154
|
-
version: "4.
|
|
4159
|
+
version: "4.11.1"
|
|
4155
4160
|
}
|
|
4156
4161
|
});
|
|
4157
4162
|
}
|