@authowl/core 0.19.0 → 0.21.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/dist/index.d.cts CHANGED
@@ -1,8 +1,10 @@
1
- export { A as AuthConfig, D as DecodedPublishableKey, H as HasParams, O as OrganizationMembership, R as ResolvedAuthConfig, a as ResolvedAuthTarget, T as TransportError, b as TransportErrorKind, c as createMembershipHas, d as decodePublishableKey, m as membershipHas, e as membershipHasPermission, f as membershipHasRole, g as membershipHasTeam, r as resolveAuthTarget, h as resolveConfig, s as sessionCookieName } from './organization-membership-B05mzhtA.cjs';
2
- import { P as PhoneOtpChallengeData, A as AkedlyShieldStartProof } from './client-CbTdWXNE.cjs';
3
- export { a as AUTH_CHALLENGE_HEADER, b as AcceptOrganizationInvitationData, c as AccountClient, d as AccountSession, e as AccountStatusData, f as ActionFetchOptions, g as AddOrganizationTeamMemberOptions, h as AddPasskeyOptions, i as AuthActionResult, j as AuthClientError, k as AuthErrorContext, l as AuthOwlClient, m as AuthOwlErrorCode, n as AuthPasskey, o as AuthRequestContext, p as AuthResponseContext, q as AuthSession, r as AuthUser, C as ChangeEmailOptions, s as ChangePasswordData, t as ChangePasswordOptions, u as ConsentAcceptResult, v as ConsentStatus, w as CreateOrganizationOptions, x as CreateOrganizationTeamOptions, D as DeleteAccountData, y as DeleteAccountOptions, z as DeleteOrganizationOptions, B as DeletePasskeyData, E as DeletePasskeyOptions, F as DisableTwoFactorOptions, G as EmailAuthData, H as EmailOtpAuthData, I as EmailOtpSignInOptions, J as EmailOtpType, K as EmailSignInOptions, L as EmailSignUpData, M as EmailSignUpOptions, N as EnableTwoFactorOptions, O as EnvironmentType, Q as GenerateBackupCodesOptions, R as GetOrganizationInvitationOptions, S as GetOrganizationOptions, T as GetToken, U as GetTokenOptions, V as INVITATION_CLAIM_MAX_AGE_MS, W as INVITATION_QUERY_PARAM, X as InvitationClaim, Y as InvitationRecipientHint, Z as InviteOrganizationMemberOptions, _ as JsonObject, $ as JsonPrimitive, a0 as JsonValue, a1 as LeaveOrganizationOptions, a2 as LinkSocialData, a3 as LinkSocialOptions, a4 as ListOrganizationInvitationsOptions, a5 as ListOrganizationMembersOptions, a6 as ListOrganizationRolesOptions, a7 as ListOrganizationTeamMembersOptions, a8 as ListOrganizationTeamsOptions, a9 as MagicLinkData, aa as MagicLinkSignInOptions, ab as Organization, ac as OrganizationClient, ad as OrganizationDetails, ae as OrganizationFilterOperator, af as OrganizationInvitation, ag as OrganizationInvitationActionOptions, ah as OrganizationInvitationDetails, ai as OrganizationInvitationStatus, aj as OrganizationMember, ak as OrganizationMemberUser, al as OrganizationMemberWithUser, am as OrganizationMembersData, an as OrganizationRoleSummary, ao as OrganizationSelector, ap as OrganizationTeam, aq as OrganizationTeamMember, ar as OrganizationUserInvitation, as as PasskeyAuthData, at as PasskeySignInOptions, au as PasswordResetData, av as PhoneAuthUser, aw as PhoneOtpStartData, ax as PhoneOtpStartOptions, ay as PhoneOtpVerifyData, az as PhoneOtpVerifyOptions, aA as ProjectCapabilities, aB as PublicConfig, aC as RejectOrganizationInvitationData, aD as RemoveOrganizationMemberData, aE as RemoveOrganizationMemberOptions, aF as RemoveOrganizationTeamData, aG as RemoveOrganizationTeamMemberData, aH as RemoveOrganizationTeamMemberOptions, aI as RemoveOrganizationTeamOptions, aJ as RequestPasswordResetOptions, aK as ResetPasswordOptions, aL as RevokeSessionOptions, aM as SendOtpData, aN as SendTwoFactorOtpData, aO as SendTwoFactorOtpOptions, aP as SendVerificationOtpOptions, aQ as SessionState, aR as SessionStore, aS as SetActiveOrganizationOptions, aT as SetActiveTeamOptions, aU as SignOutData, aV as SocialAccount, aW as SocialAuthData, aX as SocialIdTokenOptions, aY as SocialSignInOptions, aZ as TokenClient, a_ as TwoFactorBackupCodesData, a$ as TwoFactorEnableData, b0 as TwoFactorRedirectData, b1 as TwoFactorStatusData, b2 as TwoFactorVerifyData, b3 as UnlinkSocialOptions, b4 as UpdateOrganizationMemberRoleOptions, b5 as UpdateOrganizationOptions, b6 as UpdateOrganizationTeamOptions, b7 as UpdatePasskeyData, b8 as UpdatePasskeyOptions, b9 as UpdateProfileOptions, ba as UpdateUnsafeMetadataOptions, bb as UserMetadata, bc as UsernameSignInOptions, bd as VerifyBackupCodeOptions, be as VerifyEmailOtpData, bf as VerifyEmailOtpOptions, bg as VerifyTotpOptions, bh as VerifyTwoFactorOtpOptions, bi as WaitlistJoinData, bj as WaitlistJoinOptions, bk as acceptConsent, bl as captureInvitationClaim, bm as clearInvitationClaim, bn as createAuthOwlClient, bo as createTokenClient, bp as getConsentStatus, bq as getPublicConfig, br as readInvitationClaim, bs as resolveProjectCapabilities } from './client-CbTdWXNE.cjs';
1
+ export { A as AuthConfig, D as DecodedPublishableKey, H as HasParams, O as OrganizationMembership, R as ResolvedAuthConfig, a as ResolvedAuthTarget, T as TransportError, b as TransportErrorKind, c as createMembershipHas, d as decodePublishableKey, m as membershipHas, e as membershipHasPermission, f as membershipHasRole, g as membershipHasTeam, h as resolveAuthTarget, r as resolveConfig } from './organization-membership-DSqmZLkN.cjs';
2
+ export { s as sessionCookieName } from './cookie-BqcfagTw.cjs';
3
+ import { x as PhoneOtpChallengeData, y as AkedlyShieldStartProof } from './client-2xyOK_yb.cjs';
4
+ export { z as AcceptOrganizationInvitationData, B as AccountClient, D as AccountSession, E as AccountStatusData, A as ActionFetchOptions, F as AddOrganizationTeamMemberOptions, e as AddPasskeyOptions, a as AuthActionResult, g as AuthClientError, G as AuthErrorContext, b as AuthOwlClient, H as AuthOwlErrorCode, f as AuthPasskey, I as AuthRequestContext, J as AuthResponseContext, h as AuthSession, i as AuthUser, K as ChangeEmailOptions, L as ChangePasswordData, M as ChangePasswordOptions, N as ConsentAcceptResult, Q as ConsentStatus, T as CreateOrganizationOptions, U as CreateOrganizationTeamOptions, C as CreatePrivacyRightsRequestOptions, V as DeleteAccountData, W as DeleteAccountOptions, X as DeleteOrganizationOptions, Y as DeletePasskeyData, Z as DeletePasskeyOptions, _ as DisableTwoFactorOptions, $ as EmailAuthData, a0 as EmailOtpAuthData, a1 as EmailOtpSignInOptions, a2 as EmailOtpType, a3 as EmailSignInOptions, a4 as EmailSignUpData, a5 as EmailSignUpOptions, a6 as EnableTwoFactorOptions, a7 as EnvironmentType, a8 as GenerateBackupCodesOptions, a9 as GetOrganizationInvitationOptions, aa as GetOrganizationOptions, ab as GetToken, ac as GetTokenOptions, ad as INVITATION_CLAIM_MAX_AGE_MS, ae as INVITATION_QUERY_PARAM, af as InvitationClaim, ag as InvitationRecipientHint, ah as InviteOrganizationMemberOptions, ai as JsonObject, aj as JsonPrimitive, ak as JsonValue, al as LeaveOrganizationOptions, am as LinkSocialData, an as LinkSocialOptions, ao as ListOrganizationInvitationsOptions, ap as ListOrganizationMembersOptions, aq as ListOrganizationRolesOptions, ar as ListOrganizationTeamMembersOptions, as as ListOrganizationTeamsOptions, at as MagicLinkData, au as MagicLinkSignInOptions, O as Organization, j as OrganizationClient, k as OrganizationDetails, av as OrganizationFilterOperator, aw as OrganizationInvitation, ax as OrganizationInvitationActionOptions, ay as OrganizationInvitationDetails, az as OrganizationInvitationStatus, aA as OrganizationMember, aB as OrganizationMemberUser, aC as OrganizationMemberWithUser, aD as OrganizationMembersData, aE as OrganizationRoleSummary, aF as OrganizationSelector, aG as OrganizationTeam, aH as OrganizationTeamMember, aI as OrganizationUserInvitation, d as PasskeyAuthData, c as PasskeySignInOptions, aJ as PasswordResetData, aK as PhoneAuthUser, aL as PhoneOtpStartData, aM as PhoneOtpStartOptions, aN as PhoneOtpVerifyData, aO as PhoneOtpVerifyOptions, l as PrivacyClient, m as PrivacyConsentPreference, n as PrivacyConsentState, o as PrivacyLocale, p as PrivacyRightState, q as PrivacyRightType, r as PrivacyRightsRequest, P as PublicConfig, R as RecordPrivacyConsentOptions, aP as RejectOrganizationInvitationData, aQ as RemoveOrganizationMemberData, aR as RemoveOrganizationMemberOptions, aS as RemoveOrganizationTeamData, aT as RemoveOrganizationTeamMemberData, aU as RemoveOrganizationTeamMemberOptions, aV as RemoveOrganizationTeamOptions, aW as RequestPasswordResetOptions, aX as ResetPasswordOptions, aY as RevokeSessionOptions, aZ as SendOtpData, a_ as SendTwoFactorOtpData, a$ as SendTwoFactorOtpOptions, b0 as SendVerificationOtpOptions, s as SessionState, t as SessionStore, u as SetActiveOrganizationOptions, b1 as SetActiveTeamOptions, b2 as SignOutData, b3 as SocialAccount, v as SocialAuthData, S as SocialIdTokenOptions, b4 as SocialSignInOptions, b5 as TokenClient, b6 as TwoFactorBackupCodesData, b7 as TwoFactorEnableData, b8 as TwoFactorRedirectData, b9 as TwoFactorStatusData, ba as TwoFactorVerifyData, bb as UnlinkSocialOptions, bc as UpdateOrganizationMemberRoleOptions, bd as UpdateOrganizationOptions, be as UpdateOrganizationTeamOptions, bf as UpdatePasskeyData, bg as UpdatePasskeyOptions, bh as UpdateProfileOptions, bi as UpdateUnsafeMetadataOptions, bj as UserMetadata, bk as UsernameSignInOptions, bl as VerifyBackupCodeOptions, bm as VerifyEmailOtpData, bn as VerifyEmailOtpOptions, bo as VerifyTotpOptions, bp as VerifyTwoFactorOtpOptions, bq as WaitlistJoinData, br as WaitlistJoinOptions, bs as acceptConsent, bt as captureInvitationClaim, bu as clearInvitationClaim, bv as createAuthOwlClient, bw as createTokenClient, bx as getConsentStatus, w as getPublicConfig, by as readInvitationClaim } from './client-2xyOK_yb.cjs';
4
5
  export { S as SESSION_TOKEN_HEADER, a as SESSION_TRANSPORT_BEARER, b as SESSION_TRANSPORT_HEADER } from './session-transport-contract-HDPYRum8.cjs';
5
- export { L as LOCALES, a as Locale, d as directionFor, i as isLocale } from './index-hIdXOzRp.cjs';
6
+ export { b as AUTH_CHALLENGE_HEADER, d as AUTH_LOCALE_HEADER, P as ProjectCapabilities, a as createIdempotencyKey, r as resolveProjectCapabilities } from './idempotency-BWgUuHGa.cjs';
7
+ export { a as LOCALES, L as Locale, d as directionFor, i as isLocale } from './index-DgVPDEYx.cjs';
6
8
 
7
9
  /**
8
10
  * Read the session-only persistence signal carried by core's challenge transport.
@@ -10,6 +12,80 @@ export { L as LOCALES, a as Locale, d as directionFor, i as isLocale } from './i
10
12
  */
11
13
  declare function sessionChallengeIsEphemeral(headers: Headers): boolean;
12
14
 
15
+ /**
16
+ * Which sign-in method last worked IN THIS BROWSER.
17
+ *
18
+ * A returning user usually has one habit, and a form that shows five equal
19
+ * options makes them re-derive it every visit. Remembering it is a small thing
20
+ * that removes a real hesitation.
21
+ *
22
+ * WHY THIS IS NOT THE `last-login-method` PLUGIN. That plugin sets a
23
+ * non-httpOnly cookie and reads it from `document.cookie`. In AuthOwl's SPA
24
+ * architecture that cookie lands on the ENGINE's domain, invisible to the
25
+ * tenant's page; in the server architecture it lands on the tenant server's
26
+ * fetch, which the session bridge does not forward. Unreadable in both. The SDK
27
+ * does not need it told anyway - it executed the call, so it already knows.
28
+ *
29
+ * THE LINE THIS MUST NOT CROSS. What is stored is a property of this BROWSER,
30
+ * never of an address. Nothing here may be keyed by, derived from, or exposed
31
+ * alongside an email or username: "which method does a@b.com use" is an account
32
+ * enumeration and targeted-phishing surface, and answering it before
33
+ * authentication would hand an attacker the cheapest possible reconnaissance.
34
+ * The value is written only AFTER a method has already succeeded here, so it
35
+ * reveals nothing that this browser did not already do.
36
+ *
37
+ * Best-effort storage, deliberately: a browser refusing `localStorage` degrades
38
+ * to "no badge", which is invisible, rather than to a sign-in that throws.
39
+ */
40
+ /**
41
+ * The methods worth remembering, as a closed set.
42
+ *
43
+ * A closed set rather than a free string because this value is read back from
44
+ * storage a user can edit, and it decides what a form highlights. An unknown
45
+ * value is discarded rather than rendered.
46
+ *
47
+ * Social providers collapse to `social:<id>` so a returning Google user is
48
+ * pointed at the Google button rather than at "social" generally.
49
+ */
50
+ type LastUsedSignInMethod = 'password' | 'username' | 'magic-link' | 'email-otp' | 'phone-otp' | 'passkey' | 'sso' | `social:${string}`;
51
+ /**
52
+ * Read what last worked here, or null.
53
+ *
54
+ * Null covers every uncertainty identically - never used, storage refused,
55
+ * value unrecognised, value tampered with - because a caller has exactly one
56
+ * sensible response to all of them, which is to show no badge.
57
+ */
58
+ declare function readLastUsedSignInMethod(projectId: string): LastUsedSignInMethod | null;
59
+ /**
60
+ * Record a method that JUST SUCCEEDED.
61
+ *
62
+ * Never call this at the start of an attempt for a method that completes
63
+ * in-page: a failed password attempt would then teach the form to recommend
64
+ * the method that just did not work.
65
+ *
66
+ * Redirect methods are the exception and are handled by
67
+ * `rememberPendingSignInMethod`, because the page that would record success is
68
+ * one the browser leaves before reaching.
69
+ */
70
+ declare function recordLastUsedSignInMethod(projectId: string, method: LastUsedSignInMethod): void;
71
+ /**
72
+ * Note that a REDIRECT method is being attempted, without recording it as used.
73
+ *
74
+ * Social and SSO leave the page before anything can observe success, so the
75
+ * attempt is parked here and promoted only once the user comes back signed in.
76
+ * Kept separate from the recorded value on purpose: a user who bounces off a
77
+ * provider's consent screen and returns unauthenticated must not be told that
78
+ * provider is what worked last, because it did not.
79
+ */
80
+ declare function rememberPendingSignInMethod(projectId: string, method: LastUsedSignInMethod): void;
81
+ /**
82
+ * Settle a parked redirect attempt once the returning session has loaded.
83
+ *
84
+ * A signed-in return promotes it. A signed-out return clears it, so a cancelled
85
+ * redirect cannot be mistaken for an unrelated sign-in later.
86
+ */
87
+ declare function settlePendingSignInMethod(projectId: string, signedIn: boolean): void;
88
+
13
89
  /**
14
90
  * Complete Akedly Shield's browser-only proof ceremony. The provider package is
15
91
  * lazy-loaded only when the server-selected route requires it.
@@ -18,9 +94,6 @@ declare function solvePhoneOtpChallenge(challenge: Extract<PhoneOtpChallengeData
18
94
  kind: 'akedly_shield_v1_2';
19
95
  }>): Promise<AkedlyShieldStartProof>;
20
96
 
21
- /** Create a cryptographically random RFC 4122 v4 key for retry-safe write actions. */
22
- declare function createIdempotencyKey(): string;
23
-
24
97
  declare class AuthOwlError extends Error {
25
98
  readonly cause?: unknown | undefined;
26
99
  constructor(message: string, cause?: unknown | undefined);
@@ -40,4 +113,7 @@ declare class AuthOwlHttpError extends Error {
40
113
  constructor(label: string, response: Response, requestId?: string);
41
114
  }
42
115
 
43
- export { AkedlyShieldStartProof, AuthOwlError, AuthOwlHttpError, InvalidKeyError, PhoneOtpChallengeData, RateLimitedError, createIdempotencyKey, sessionChallengeIsEphemeral, solvePhoneOtpChallenge };
116
+ declare function setActiveLocale(projectId: string, locale: string | null): () => void;
117
+ declare function activeLocale(projectId: string): string | null;
118
+
119
+ export { AkedlyShieldStartProof, AuthOwlError, AuthOwlHttpError, InvalidKeyError, type LastUsedSignInMethod, PhoneOtpChallengeData, RateLimitedError, activeLocale, readLastUsedSignInMethod, recordLastUsedSignInMethod, rememberPendingSignInMethod, sessionChallengeIsEphemeral, setActiveLocale, settlePendingSignInMethod, solvePhoneOtpChallenge };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
- export { A as AuthConfig, D as DecodedPublishableKey, H as HasParams, O as OrganizationMembership, R as ResolvedAuthConfig, a as ResolvedAuthTarget, T as TransportError, b as TransportErrorKind, c as createMembershipHas, d as decodePublishableKey, m as membershipHas, e as membershipHasPermission, f as membershipHasRole, g as membershipHasTeam, r as resolveAuthTarget, h as resolveConfig, s as sessionCookieName } from './organization-membership-B05mzhtA.js';
2
- import { P as PhoneOtpChallengeData, A as AkedlyShieldStartProof } from './client-CgM5jSLp.js';
3
- export { a as AUTH_CHALLENGE_HEADER, b as AcceptOrganizationInvitationData, c as AccountClient, d as AccountSession, e as AccountStatusData, f as ActionFetchOptions, g as AddOrganizationTeamMemberOptions, h as AddPasskeyOptions, i as AuthActionResult, j as AuthClientError, k as AuthErrorContext, l as AuthOwlClient, m as AuthOwlErrorCode, n as AuthPasskey, o as AuthRequestContext, p as AuthResponseContext, q as AuthSession, r as AuthUser, C as ChangeEmailOptions, s as ChangePasswordData, t as ChangePasswordOptions, u as ConsentAcceptResult, v as ConsentStatus, w as CreateOrganizationOptions, x as CreateOrganizationTeamOptions, D as DeleteAccountData, y as DeleteAccountOptions, z as DeleteOrganizationOptions, B as DeletePasskeyData, E as DeletePasskeyOptions, F as DisableTwoFactorOptions, G as EmailAuthData, H as EmailOtpAuthData, I as EmailOtpSignInOptions, J as EmailOtpType, K as EmailSignInOptions, L as EmailSignUpData, M as EmailSignUpOptions, N as EnableTwoFactorOptions, O as EnvironmentType, Q as GenerateBackupCodesOptions, R as GetOrganizationInvitationOptions, S as GetOrganizationOptions, T as GetToken, U as GetTokenOptions, V as INVITATION_CLAIM_MAX_AGE_MS, W as INVITATION_QUERY_PARAM, X as InvitationClaim, Y as InvitationRecipientHint, Z as InviteOrganizationMemberOptions, _ as JsonObject, $ as JsonPrimitive, a0 as JsonValue, a1 as LeaveOrganizationOptions, a2 as LinkSocialData, a3 as LinkSocialOptions, a4 as ListOrganizationInvitationsOptions, a5 as ListOrganizationMembersOptions, a6 as ListOrganizationRolesOptions, a7 as ListOrganizationTeamMembersOptions, a8 as ListOrganizationTeamsOptions, a9 as MagicLinkData, aa as MagicLinkSignInOptions, ab as Organization, ac as OrganizationClient, ad as OrganizationDetails, ae as OrganizationFilterOperator, af as OrganizationInvitation, ag as OrganizationInvitationActionOptions, ah as OrganizationInvitationDetails, ai as OrganizationInvitationStatus, aj as OrganizationMember, ak as OrganizationMemberUser, al as OrganizationMemberWithUser, am as OrganizationMembersData, an as OrganizationRoleSummary, ao as OrganizationSelector, ap as OrganizationTeam, aq as OrganizationTeamMember, ar as OrganizationUserInvitation, as as PasskeyAuthData, at as PasskeySignInOptions, au as PasswordResetData, av as PhoneAuthUser, aw as PhoneOtpStartData, ax as PhoneOtpStartOptions, ay as PhoneOtpVerifyData, az as PhoneOtpVerifyOptions, aA as ProjectCapabilities, aB as PublicConfig, aC as RejectOrganizationInvitationData, aD as RemoveOrganizationMemberData, aE as RemoveOrganizationMemberOptions, aF as RemoveOrganizationTeamData, aG as RemoveOrganizationTeamMemberData, aH as RemoveOrganizationTeamMemberOptions, aI as RemoveOrganizationTeamOptions, aJ as RequestPasswordResetOptions, aK as ResetPasswordOptions, aL as RevokeSessionOptions, aM as SendOtpData, aN as SendTwoFactorOtpData, aO as SendTwoFactorOtpOptions, aP as SendVerificationOtpOptions, aQ as SessionState, aR as SessionStore, aS as SetActiveOrganizationOptions, aT as SetActiveTeamOptions, aU as SignOutData, aV as SocialAccount, aW as SocialAuthData, aX as SocialIdTokenOptions, aY as SocialSignInOptions, aZ as TokenClient, a_ as TwoFactorBackupCodesData, a$ as TwoFactorEnableData, b0 as TwoFactorRedirectData, b1 as TwoFactorStatusData, b2 as TwoFactorVerifyData, b3 as UnlinkSocialOptions, b4 as UpdateOrganizationMemberRoleOptions, b5 as UpdateOrganizationOptions, b6 as UpdateOrganizationTeamOptions, b7 as UpdatePasskeyData, b8 as UpdatePasskeyOptions, b9 as UpdateProfileOptions, ba as UpdateUnsafeMetadataOptions, bb as UserMetadata, bc as UsernameSignInOptions, bd as VerifyBackupCodeOptions, be as VerifyEmailOtpData, bf as VerifyEmailOtpOptions, bg as VerifyTotpOptions, bh as VerifyTwoFactorOtpOptions, bi as WaitlistJoinData, bj as WaitlistJoinOptions, bk as acceptConsent, bl as captureInvitationClaim, bm as clearInvitationClaim, bn as createAuthOwlClient, bo as createTokenClient, bp as getConsentStatus, bq as getPublicConfig, br as readInvitationClaim, bs as resolveProjectCapabilities } from './client-CgM5jSLp.js';
1
+ export { A as AuthConfig, D as DecodedPublishableKey, H as HasParams, O as OrganizationMembership, R as ResolvedAuthConfig, a as ResolvedAuthTarget, T as TransportError, b as TransportErrorKind, c as createMembershipHas, d as decodePublishableKey, m as membershipHas, e as membershipHasPermission, f as membershipHasRole, g as membershipHasTeam, h as resolveAuthTarget, r as resolveConfig } from './organization-membership-DSqmZLkN.js';
2
+ export { s as sessionCookieName } from './cookie-BqcfagTw.js';
3
+ import { x as PhoneOtpChallengeData, y as AkedlyShieldStartProof } from './client-Za31KAN3.js';
4
+ export { z as AcceptOrganizationInvitationData, B as AccountClient, D as AccountSession, E as AccountStatusData, A as ActionFetchOptions, F as AddOrganizationTeamMemberOptions, e as AddPasskeyOptions, a as AuthActionResult, g as AuthClientError, G as AuthErrorContext, b as AuthOwlClient, H as AuthOwlErrorCode, f as AuthPasskey, I as AuthRequestContext, J as AuthResponseContext, h as AuthSession, i as AuthUser, K as ChangeEmailOptions, L as ChangePasswordData, M as ChangePasswordOptions, N as ConsentAcceptResult, Q as ConsentStatus, T as CreateOrganizationOptions, U as CreateOrganizationTeamOptions, C as CreatePrivacyRightsRequestOptions, V as DeleteAccountData, W as DeleteAccountOptions, X as DeleteOrganizationOptions, Y as DeletePasskeyData, Z as DeletePasskeyOptions, _ as DisableTwoFactorOptions, $ as EmailAuthData, a0 as EmailOtpAuthData, a1 as EmailOtpSignInOptions, a2 as EmailOtpType, a3 as EmailSignInOptions, a4 as EmailSignUpData, a5 as EmailSignUpOptions, a6 as EnableTwoFactorOptions, a7 as EnvironmentType, a8 as GenerateBackupCodesOptions, a9 as GetOrganizationInvitationOptions, aa as GetOrganizationOptions, ab as GetToken, ac as GetTokenOptions, ad as INVITATION_CLAIM_MAX_AGE_MS, ae as INVITATION_QUERY_PARAM, af as InvitationClaim, ag as InvitationRecipientHint, ah as InviteOrganizationMemberOptions, ai as JsonObject, aj as JsonPrimitive, ak as JsonValue, al as LeaveOrganizationOptions, am as LinkSocialData, an as LinkSocialOptions, ao as ListOrganizationInvitationsOptions, ap as ListOrganizationMembersOptions, aq as ListOrganizationRolesOptions, ar as ListOrganizationTeamMembersOptions, as as ListOrganizationTeamsOptions, at as MagicLinkData, au as MagicLinkSignInOptions, O as Organization, j as OrganizationClient, k as OrganizationDetails, av as OrganizationFilterOperator, aw as OrganizationInvitation, ax as OrganizationInvitationActionOptions, ay as OrganizationInvitationDetails, az as OrganizationInvitationStatus, aA as OrganizationMember, aB as OrganizationMemberUser, aC as OrganizationMemberWithUser, aD as OrganizationMembersData, aE as OrganizationRoleSummary, aF as OrganizationSelector, aG as OrganizationTeam, aH as OrganizationTeamMember, aI as OrganizationUserInvitation, d as PasskeyAuthData, c as PasskeySignInOptions, aJ as PasswordResetData, aK as PhoneAuthUser, aL as PhoneOtpStartData, aM as PhoneOtpStartOptions, aN as PhoneOtpVerifyData, aO as PhoneOtpVerifyOptions, l as PrivacyClient, m as PrivacyConsentPreference, n as PrivacyConsentState, o as PrivacyLocale, p as PrivacyRightState, q as PrivacyRightType, r as PrivacyRightsRequest, P as PublicConfig, R as RecordPrivacyConsentOptions, aP as RejectOrganizationInvitationData, aQ as RemoveOrganizationMemberData, aR as RemoveOrganizationMemberOptions, aS as RemoveOrganizationTeamData, aT as RemoveOrganizationTeamMemberData, aU as RemoveOrganizationTeamMemberOptions, aV as RemoveOrganizationTeamOptions, aW as RequestPasswordResetOptions, aX as ResetPasswordOptions, aY as RevokeSessionOptions, aZ as SendOtpData, a_ as SendTwoFactorOtpData, a$ as SendTwoFactorOtpOptions, b0 as SendVerificationOtpOptions, s as SessionState, t as SessionStore, u as SetActiveOrganizationOptions, b1 as SetActiveTeamOptions, b2 as SignOutData, b3 as SocialAccount, v as SocialAuthData, S as SocialIdTokenOptions, b4 as SocialSignInOptions, b5 as TokenClient, b6 as TwoFactorBackupCodesData, b7 as TwoFactorEnableData, b8 as TwoFactorRedirectData, b9 as TwoFactorStatusData, ba as TwoFactorVerifyData, bb as UnlinkSocialOptions, bc as UpdateOrganizationMemberRoleOptions, bd as UpdateOrganizationOptions, be as UpdateOrganizationTeamOptions, bf as UpdatePasskeyData, bg as UpdatePasskeyOptions, bh as UpdateProfileOptions, bi as UpdateUnsafeMetadataOptions, bj as UserMetadata, bk as UsernameSignInOptions, bl as VerifyBackupCodeOptions, bm as VerifyEmailOtpData, bn as VerifyEmailOtpOptions, bo as VerifyTotpOptions, bp as VerifyTwoFactorOtpOptions, bq as WaitlistJoinData, br as WaitlistJoinOptions, bs as acceptConsent, bt as captureInvitationClaim, bu as clearInvitationClaim, bv as createAuthOwlClient, bw as createTokenClient, bx as getConsentStatus, w as getPublicConfig, by as readInvitationClaim } from './client-Za31KAN3.js';
4
5
  export { S as SESSION_TOKEN_HEADER, a as SESSION_TRANSPORT_BEARER, b as SESSION_TRANSPORT_HEADER } from './session-transport-contract-HDPYRum8.js';
5
- export { L as LOCALES, a as Locale, d as directionFor, i as isLocale } from './index-hIdXOzRp.js';
6
+ export { b as AUTH_CHALLENGE_HEADER, d as AUTH_LOCALE_HEADER, P as ProjectCapabilities, a as createIdempotencyKey, r as resolveProjectCapabilities } from './idempotency-BidZZuun.js';
7
+ export { a as LOCALES, L as Locale, d as directionFor, i as isLocale } from './index-DgVPDEYx.js';
6
8
 
7
9
  /**
8
10
  * Read the session-only persistence signal carried by core's challenge transport.
@@ -10,6 +12,80 @@ export { L as LOCALES, a as Locale, d as directionFor, i as isLocale } from './i
10
12
  */
11
13
  declare function sessionChallengeIsEphemeral(headers: Headers): boolean;
12
14
 
15
+ /**
16
+ * Which sign-in method last worked IN THIS BROWSER.
17
+ *
18
+ * A returning user usually has one habit, and a form that shows five equal
19
+ * options makes them re-derive it every visit. Remembering it is a small thing
20
+ * that removes a real hesitation.
21
+ *
22
+ * WHY THIS IS NOT THE `last-login-method` PLUGIN. That plugin sets a
23
+ * non-httpOnly cookie and reads it from `document.cookie`. In AuthOwl's SPA
24
+ * architecture that cookie lands on the ENGINE's domain, invisible to the
25
+ * tenant's page; in the server architecture it lands on the tenant server's
26
+ * fetch, which the session bridge does not forward. Unreadable in both. The SDK
27
+ * does not need it told anyway - it executed the call, so it already knows.
28
+ *
29
+ * THE LINE THIS MUST NOT CROSS. What is stored is a property of this BROWSER,
30
+ * never of an address. Nothing here may be keyed by, derived from, or exposed
31
+ * alongside an email or username: "which method does a@b.com use" is an account
32
+ * enumeration and targeted-phishing surface, and answering it before
33
+ * authentication would hand an attacker the cheapest possible reconnaissance.
34
+ * The value is written only AFTER a method has already succeeded here, so it
35
+ * reveals nothing that this browser did not already do.
36
+ *
37
+ * Best-effort storage, deliberately: a browser refusing `localStorage` degrades
38
+ * to "no badge", which is invisible, rather than to a sign-in that throws.
39
+ */
40
+ /**
41
+ * The methods worth remembering, as a closed set.
42
+ *
43
+ * A closed set rather than a free string because this value is read back from
44
+ * storage a user can edit, and it decides what a form highlights. An unknown
45
+ * value is discarded rather than rendered.
46
+ *
47
+ * Social providers collapse to `social:<id>` so a returning Google user is
48
+ * pointed at the Google button rather than at "social" generally.
49
+ */
50
+ type LastUsedSignInMethod = 'password' | 'username' | 'magic-link' | 'email-otp' | 'phone-otp' | 'passkey' | 'sso' | `social:${string}`;
51
+ /**
52
+ * Read what last worked here, or null.
53
+ *
54
+ * Null covers every uncertainty identically - never used, storage refused,
55
+ * value unrecognised, value tampered with - because a caller has exactly one
56
+ * sensible response to all of them, which is to show no badge.
57
+ */
58
+ declare function readLastUsedSignInMethod(projectId: string): LastUsedSignInMethod | null;
59
+ /**
60
+ * Record a method that JUST SUCCEEDED.
61
+ *
62
+ * Never call this at the start of an attempt for a method that completes
63
+ * in-page: a failed password attempt would then teach the form to recommend
64
+ * the method that just did not work.
65
+ *
66
+ * Redirect methods are the exception and are handled by
67
+ * `rememberPendingSignInMethod`, because the page that would record success is
68
+ * one the browser leaves before reaching.
69
+ */
70
+ declare function recordLastUsedSignInMethod(projectId: string, method: LastUsedSignInMethod): void;
71
+ /**
72
+ * Note that a REDIRECT method is being attempted, without recording it as used.
73
+ *
74
+ * Social and SSO leave the page before anything can observe success, so the
75
+ * attempt is parked here and promoted only once the user comes back signed in.
76
+ * Kept separate from the recorded value on purpose: a user who bounces off a
77
+ * provider's consent screen and returns unauthenticated must not be told that
78
+ * provider is what worked last, because it did not.
79
+ */
80
+ declare function rememberPendingSignInMethod(projectId: string, method: LastUsedSignInMethod): void;
81
+ /**
82
+ * Settle a parked redirect attempt once the returning session has loaded.
83
+ *
84
+ * A signed-in return promotes it. A signed-out return clears it, so a cancelled
85
+ * redirect cannot be mistaken for an unrelated sign-in later.
86
+ */
87
+ declare function settlePendingSignInMethod(projectId: string, signedIn: boolean): void;
88
+
13
89
  /**
14
90
  * Complete Akedly Shield's browser-only proof ceremony. The provider package is
15
91
  * lazy-loaded only when the server-selected route requires it.
@@ -18,9 +94,6 @@ declare function solvePhoneOtpChallenge(challenge: Extract<PhoneOtpChallengeData
18
94
  kind: 'akedly_shield_v1_2';
19
95
  }>): Promise<AkedlyShieldStartProof>;
20
96
 
21
- /** Create a cryptographically random RFC 4122 v4 key for retry-safe write actions. */
22
- declare function createIdempotencyKey(): string;
23
-
24
97
  declare class AuthOwlError extends Error {
25
98
  readonly cause?: unknown | undefined;
26
99
  constructor(message: string, cause?: unknown | undefined);
@@ -40,4 +113,7 @@ declare class AuthOwlHttpError extends Error {
40
113
  constructor(label: string, response: Response, requestId?: string);
41
114
  }
42
115
 
43
- export { AkedlyShieldStartProof, AuthOwlError, AuthOwlHttpError, InvalidKeyError, PhoneOtpChallengeData, RateLimitedError, createIdempotencyKey, sessionChallengeIsEphemeral, solvePhoneOtpChallenge };
116
+ declare function setActiveLocale(projectId: string, locale: string | null): () => void;
117
+ declare function activeLocale(projectId: string): string | null;
118
+
119
+ export { AkedlyShieldStartProof, AuthOwlError, AuthOwlHttpError, InvalidKeyError, type LastUsedSignInMethod, PhoneOtpChallengeData, RateLimitedError, activeLocale, readLastUsedSignInMethod, recordLastUsedSignInMethod, rememberPendingSignInMethod, sessionChallengeIsEphemeral, setActiveLocale, settlePendingSignInMethod, solvePhoneOtpChallenge };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export{a as LOCALES,b as directionFor,c as isLocale}from'./chunk-M4QJVSXT.js';import {c as c$1,d,h,j,f as f$1}from'./chunk-24DA3F3A.js';export{e as AUTH_CHALLENGE_HEADER,b as AuthOwlHttpError,g as createIdempotencyKey,k as getPublicConfig,a as resolveProjectCapabilities}from'./chunk-24DA3F3A.js';import {f,g as g$1,e,q as q$1,s,r}from'./chunk-V3MSLXXB.js';export{j as SESSION_TOKEN_HEADER,l as SESSION_TRANSPORT_BEARER,k as SESSION_TRANSPORT_HEADER,o as TransportError,F as createMembershipHas,a as decodePublishableKey,E as membershipHas,B as membershipHasPermission,D as membershipHasRole,C as membershipHasTeam,m as resolveAuthTarget,n as resolveConfig,h as sessionChallengeIsEphemeral,b as sessionCookieName}from'./chunk-V3MSLXXB.js';import'./chunk-T5SH3ZZP.js';var N="authowl_invitation",F="authowl.invitation-claim",ee=/^[A-Za-z0-9_-]{1,128}$/,te=10080*60*1e3;function Ne(e=Date.now()){if(typeof window>"u")return S(e);let n;try{n=new URL(window.location.href);}catch{return S(e)}let t=n.searchParams.get(N);if(t===null)return S(e);n.searchParams.delete(N);try{window.history.replaceState(window.history.state,"",n.toString());}catch{}if(!ee.test(t))return S(e);let i={id:t,capturedAt:e};return f(g$1(),F,JSON.stringify(i)),i}function S(e$1=Date.now()){let n=e(g$1(),F);if(n===null)return null;let t;try{t=JSON.parse(n);}catch{return E(),null}if(typeof t!="object"||t===null)return E(),null;let{id:i,capturedAt:o}=t;return typeof i!="string"||!ee.test(i)||typeof o!="number"||e$1-o>te?(E(),null):{id:i,capturedAt:o}}function E(){f(g$1(),F,null);}function u(e){let n=new Uint8Array(e),t="";for(let o of n)t+=String.fromCharCode(o);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function g(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),t=(4-n.length%4)%4,i=n.padEnd(n.length+t,"="),o=atob(i),s=new ArrayBuffer(o.length),a=new Uint8Array(s);for(let l=0;l<o.length;l++)a[l]=o.charCodeAt(l);return s}function O(){return Fe.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}var Fe={stubThis:e=>e};function k(e){let{id:n}=e;return {...e,id:g(n),transports:e.transports}}function I(e){return e==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var c=class extends Error{constructor({message:n,code:t,cause:i,name:o}){super(n,{cause:i}),Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0}),this.name=o??i.name,this.code=t;}};function ne({error:e,options:n}){let{publicKey:t}=n;if(!t)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(n.signal instanceof AbortSignal)return new c({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(t.authenticatorSelection?.requireResidentKey===true)return new c({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(n.mediation==="conditional"&&t.authenticatorSelection?.userVerification==="required")return new c({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(t.authenticatorSelection?.userVerification==="required")return new c({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else {if(e.name==="InvalidStateError")return new c({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new c({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return t.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new c({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new c({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){let i=globalThis.location.hostname;if(I(i)){if(t.rp.id!==i)return new c({message:`The RP ID "${t.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new c({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(t.user.id.byteLength<1||t.user.id.byteLength>64)return new c({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new c({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}var L=class{constructor(){Object.defineProperty(this,"controller",{enumerable:true,configurable:true,writable:true,value:void 0});}createNewAbortSignal(){if(this.controller){let t=new Error("Cancelling existing WebAuthn API call for new one");t.name="AbortError",this.controller.abort(t);}let n=new AbortController;return this.controller=n,n.signal}cancelCeremony(){if(this.controller){let n=new Error("Manually cancelling existing WebAuthn API call");n.name="AbortError",this.controller.abort(n),this.controller=void 0;}}},x=new L;var Le=["cross-platform","platform"];function D(e){if(e&&!(Le.indexOf(e)<0))return e}async function oe(e){!e.optionsJSON&&e.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});let{optionsJSON:n,useAutoRegister:t=false}=e;if(!O())throw new Error("WebAuthn is not supported in this browser");let i={...n,challenge:g(n.challenge),user:{...n.user,id:g(n.user.id)},excludeCredentials:n.excludeCredentials?.map(k)},o={};t&&(o.mediation="conditional"),o.publicKey=i,o.signal=x.createNewAbortSignal();let s;try{s=await navigator.credentials.create(o);}catch(p){throw ne({error:p,options:o})}if(!s)throw new Error("Registration was not completed");let{id:a,rawId:l,response:r,type:y}=s,d;typeof r.getTransports=="function"&&(d=r.getTransports());let h;if(typeof r.getPublicKeyAlgorithm=="function")try{h=r.getPublicKeyAlgorithm();}catch(p){V("getPublicKeyAlgorithm()",p);}let f;if(typeof r.getPublicKey=="function")try{let p=r.getPublicKey();p!==null&&(f=u(p));}catch(p){V("getPublicKey()",p);}let m;if(typeof r.getAuthenticatorData=="function")try{m=u(r.getAuthenticatorData());}catch(p){V("getAuthenticatorData()",p);}return {id:a,rawId:u(l),response:{attestationObject:u(r.attestationObject),clientDataJSON:u(r.clientDataJSON),transports:d,publicKeyAlgorithm:h,publicKey:f,authenticatorData:m},type:y,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:D(s.authenticatorAttachment)}}function V(e,n){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
2
- `,n);}function ie(){if(!O())return M.stubThis(new Promise(n=>n(false)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?M.stubThis(new Promise(n=>n(false))):M.stubThis(e.isConditionalMediationAvailable())}var M={stubThis:e=>e};function re({error:e,options:n}){let{publicKey:t}=n;if(!t)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(n.signal instanceof AbortSignal)return new c({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else {if(e.name==="NotAllowedError")return new c({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){let i=globalThis.location.hostname;if(I(i)){if(t.rpId!==i)return new c({message:`The RP ID "${t.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new c({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new c({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}async function ae(e){!e.optionsJSON&&e.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});let{optionsJSON:n,useBrowserAutofill:t=false,verifyBrowserAutofillInput:i=true}=e;if(!O())throw new Error("WebAuthn is not supported in this browser");let o;n.allowCredentials?.length!==0&&(o=n.allowCredentials?.map(k));let s={...n,challenge:g(n.challenge),allowCredentials:o},a={};if(t){if(!await ie())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&i)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');a.mediation="conditional",s.allowCredentials=[];}a.publicKey=s,a.signal=x.createNewAbortSignal();let l;try{l=await navigator.credentials.get(a);}catch(m){throw re({error:m,options:a})}if(!l)throw new Error("Authentication was not completed");let{id:r,rawId:y,response:d,type:h}=l,f;return d.userHandle&&(f=u(d.userHandle)),{id:r,rawId:u(y),response:{authenticatorData:u(d.authenticatorData),clientDataJSON:u(d.clientDataJSON),signature:u(d.signature),userHandle:f},type:h,clientExtensionResults:l.getClientExtensionResults(),authenticatorAttachment:D(l.authenticatorAttachment)}}var se={authenticate:e=>ae(e),register:e=>oe(e),errorCode:e=>e instanceof c?e.code:void 0};function le(e){return `${new URL(e.apiUrl).origin}/api/projects/${e.decoded.projectId}/consent`}async function K(e){let n=await c$1(e,le(e),{init:{method:"GET",credentials:"include"},maxResponseBytes:65536,decode:Ve});return n.response.status===401?{required:false}:d(n,"consent status")}async function z(e,n){if(!Number.isSafeInteger(n)||n<1)throw new TypeError("Consent version must be a positive integer.");return d(await c$1(e,le(e),{init:{method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:JSON.stringify({version:n})},maxResponseBytes:64*1024,decode:Me}),"consent accept")}function Ve(e){let n=q$1(e),t=s(n.required),i=Ke(n.needsConsent),o=pe(n.version),s$1=ce(n.termsUrl),a=ce(n.privacyUrl);return {required:t,...i===void 0?{}:{needsConsent:i},...o===void 0?{}:{version:o},...s$1===void 0?{}:{termsUrl:s$1},...a===void 0?{}:{privacyUrl:a}}}function Me(e){let n=q$1(e),t=pe(n.version);return {ok:s(n.ok),...t===void 0?{}:{version:t}}}function Ke(e){if(e===void 0||typeof e=="boolean")return e;throw new TypeError("Invalid consent response.")}function pe(e){if(e===void 0||Number.isSafeInteger(e)&&e>=1)return e;throw new TypeError("Invalid consent response.")}function ce(e){if(e===void 0||typeof e=="string"&&e.length<=4096)return e;throw new TypeError("Invalid consent response.")}var ze=30;function Be(e){return typeof e?.exp=="number"?e.exp:null}function qe(e){let n=e.split(".")[1];if(!n)return null;try{let t=n.replace(/-/g,"+").replace(/_/g,"/"),i=JSON.parse(atob(t));return typeof i=="object"&&i!==null?i:null}catch{return null}}function B(e){let n=new Map;async function t(s={}){let a=s.template===void 0?null:s.template.trim().toLowerCase();if(a==="")throw new TypeError("Template missing");let l=a??"",r=n.get(l);r||(r={activeKey:null,cachedByKey:new Map,inflight:null,sequence:0},n.set(l,r));let y=s.forceRefresh===true;if(!y){let p=r.activeKey?r.cachedByKey.get(r.activeKey):null;if(p&&p.exp-Date.now()/1e3>ze)return p.token;if(r.inflight)return r.inflight}let d$1=++r.sequence,h=()=>n.get(l)===r&&r.sequence===d$1,f=(async()=>{let p=a?`${e.projectBaseURL}/token/${encodeURIComponent(a)}`:`${e.projectBaseURL}/token`,G=await c$1(e,p,{init:{method:"GET",credentials:"include"},maxResponseBytes:64*1024,decode:C=>He(C,a!==null)});if(G.response.status===401)return h()&&i(),null;let J=d(G,"token"),ue=J.policyVersion,v=J.token,b=qe(v),W=Be(b);if(h())if(W!==null){let C=typeof b?.sub=="string"?b.sub:null,de=typeof b?.org_id=="string"?b.org_id:null;if(!a||C){let j=JSON.stringify([e.projectBaseURL,C,de,a,ue]);r.cachedByKey.clear(),r.cachedByKey.set(j,{token:v,exp:W}),r.activeKey=j;}else o(r);}else o(r);return v})();if(y)return f;let m=f.finally(()=>{r.inflight===m&&(r.inflight=null);});return r.inflight=m,m}function i(){n.clear();}function o(s){s.cachedByKey.clear(),s.activeKey=null;}return {getToken:t,clear:i}}function He(e,n){let t=q$1(e),i=r(t.token);if(i.length===0||i.length>32*1024)throw new TypeError("Invalid token response.");if(!n)return {token:i,policyVersion:0};let o=q$1(t.template);if(!Number.isSafeInteger(o.policyVersion)||o.policyVersion<1)throw new TypeError("Invalid token response.");return {token:i,policyVersion:o.policyVersion}}function Ge(e){let n=B(e),t=h(e,n.clear,(a,l)=>j(a,l,se)),i=f$1(e,`${new URL(e.apiUrl).origin}/api/projects/${e.decoded.projectId}`),o=a=>(...l)=>(n.clear(),a(...l)),s={getConsentStatus:()=>K(e),acceptConsent:a=>z(e,a),getToken:n.getToken,waitlist:{join:(a,l)=>i.request("/waitlist",{method:"POST",body:a,fetchOptions:l,credentials:"omit"})},account:{...t.account,updateUnsafeMetadata:o(t.account.updateUnsafeMetadata),updateProfile:o(t.account.updateProfile),changeEmail:o(t.account.changeEmail),changePassword:o(t.account.changePassword),revokeSession:o(t.account.revokeSession),delete:o(t.account.delete)},signIn:{email:o(t.signIn.email),username:o(t.signIn.username),social:o(t.signIn.social),sso:t.signIn.sso,magicLink:t.signIn.magicLink,emailOtp:o(t.signIn.emailOtp),passkey:o(t.signIn.passkey)},signUp:{email:o(t.signUp.email)},emailOtp:{...t.emailOtp,verifyEmail:o(t.emailOtp.verifyEmail)},twoFactor:{enable:t.twoFactor.enable,disable:o(t.twoFactor.disable),verifyTotp:o(t.twoFactor.verifyTotp),verifyBackupCode:o(t.twoFactor.verifyBackupCode),sendOtp:t.twoFactor.sendOtp,verifyOtp:o(t.twoFactor.verifyOtp),generateBackupCodes:t.twoFactor.generateBackupCodes},phoneOtp:{prepare:t.phoneOtp.prepare,start:t.phoneOtp.start,verify:o(t.phoneOtp.verify)},signOut:o(t.signOut)};return {...t,...s}}async function Je(e){if(typeof window>"u")throw new Error("Akedly Shield challenges must be solved in a browser.");let n=await We(),t=e.challengeRequired?await n.solvePow(e.challenge,e.difficulty):null,i=e.turnstile.required?await n.getTurnstileToken(je(e.turnstile.siteKey)):void 0;return {connectionId:e.connectionId,...t?{challengeToken:e.challengeToken,nonce:t.nonce}:{},...i?{turnstileToken:i}:{}}}async function We(){return import('@akedly/shield')}function je(e){if(!e)throw new Error("Akedly Shield did not provide a Turnstile site key.");return e}var T=class extends Error{constructor(t,i){super(t);this.cause=i;this.name="AuthOwlError";}cause},q=class extends T{constructor(t,i){super(`Rate limited. Retry after ${t}s.`,i);this.retryAfterSeconds=t;this.name="RateLimitedError";}retryAfterSeconds},H=class extends T{constructor(n="invalid publishable key",t){super(n,t),this.name="InvalidKeyError";}};
3
- export{T as AuthOwlError,te as INVITATION_CLAIM_MAX_AGE_MS,N as INVITATION_QUERY_PARAM,H as InvalidKeyError,q as RateLimitedError,z as acceptConsent,Ne as captureInvitationClaim,E as clearInvitationClaim,Ge as createAuthOwlClient,B as createTokenClient,K as getConsentStatus,S as readInvitationClaim,Je as solvePhoneOtpChallenge};
1
+ import {c as c$1,d as d$1,k,m,i,j}from'./chunk-Y2VJN76I.js';export{g as AUTH_CHALLENGE_HEADER,h as AUTH_LOCALE_HEADER,b as AuthOwlHttpError,f as activeLocale,n as getPublicConfig,a as resolveProjectCapabilities,e as setActiveLocale}from'./chunk-Y2VJN76I.js';export{a as LOCALES,b as directionFor,c as isLocale}from'./chunk-M4QJVSXT.js';export{a as createIdempotencyKey}from'./chunk-5NL5GJW6.js';import {f,g,e,q as q$1,s,r}from'./chunk-V3MSLXXB.js';export{j as SESSION_TOKEN_HEADER,l as SESSION_TRANSPORT_BEARER,k as SESSION_TRANSPORT_HEADER,o as TransportError,F as createMembershipHas,a as decodePublishableKey,E as membershipHas,B as membershipHasPermission,D as membershipHasRole,C as membershipHasTeam,m as resolveAuthTarget,n as resolveConfig,h as sessionChallengeIsEphemeral,b as sessionCookieName}from'./chunk-V3MSLXXB.js';import'./chunk-T5SH3ZZP.js';var M="authowl_invitation",V="authowl.invitation-claim",ie=/^[A-Za-z0-9_-]{1,128}$/,re=10080*60*1e3;function qe(e=Date.now()){if(typeof window>"u")return C(e);let t;try{t=new URL(window.location.href);}catch{return C(e)}let n=t.searchParams.get(M);if(n===null)return C(e);t.searchParams.delete(M);try{window.history.replaceState(window.history.state,"",t.toString());}catch{}if(!ie.test(n))return C(e);let o={id:n,capturedAt:e};return f(g(),V,JSON.stringify(o)),o}function C(e$1=Date.now()){let t=e(g(),V);if(t===null)return null;let n;try{n=JSON.parse(t);}catch{return P(),null}if(typeof n!="object"||n===null)return P(),null;let{id:o,capturedAt:a}=n;return typeof o!="string"||!ie.test(o)||typeof a!="number"||e$1-a>re?(P(),null):{id:o,capturedAt:a}}function P(){f(g(),V,null);}var ae="authowl.last-used-method",He=/^(password|username|magic-link|email-otp|phone-otp|passkey|sso|social:[a-z0-9][a-z0-9_-]{0,63})$/,K=e=>`${ae}.${e}`;function D(e){return He.test(e)}function Ge(e$1){let t=e(g(),K(e$1));return t===null||!D(t)?null:t}function Je(e,t){D(t)&&(f(g(),x(e),null),f(g(),K(e),t));}var x=e=>`${ae}.pending.${e}`;function We(e,t){D(t)&&f(g(),x(e),t);}function $e(e$1,t){let n=e(g(),x(e$1));f(g(),x(e$1),null),t&&n!==null&&D(n)&&f(g(),K(e$1),n);}function d(e){let t=new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function O(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4,o=t.padEnd(t.length+n,"="),a=atob(o),i=new ArrayBuffer(a.length),l=new Uint8Array(i);for(let s=0;s<a.length;s++)l[s]=a.charCodeAt(s);return i}function A(){return je.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}var je={stubThis:e=>e};function v(e){let{id:t}=e;return {...e,id:O(t),transports:e.transports}}function U(e){return e==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var c=class extends Error{constructor({message:t,code:n,cause:o,name:a}){super(t,{cause:o}),Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0}),this.name=a??o.name,this.code=n;}};function se({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new c({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(n.authenticatorSelection?.requireResidentKey===true)return new c({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&n.authenticatorSelection?.userVerification==="required")return new c({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(n.authenticatorSelection?.userVerification==="required")return new c({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else {if(e.name==="InvalidStateError")return new c({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new c({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return n.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new c({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new c({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){let o=globalThis.location.hostname;if(U(o)){if(n.rp.id!==o)return new c({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new c({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new c({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new c({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}var z=class{constructor(){Object.defineProperty(this,"controller",{enumerable:true,configurable:true,writable:true,value:void 0});}createNewAbortSignal(){if(this.controller){let n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n);}let t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){let t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0;}}},_=new z;var Ye=["cross-platform","platform"];function N(e){if(e&&!(Ye.indexOf(e)<0))return e}async function ce(e){!e.optionsJSON&&e.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=false}=e;if(!A())throw new Error("WebAuthn is not supported in this browser");let o={...t,challenge:O(t.challenge),user:{...t.user,id:O(t.user.id)},excludeCredentials:t.excludeCredentials?.map(v)},a={};n&&(a.mediation="conditional"),a.publicKey=o,a.signal=_.createNewAbortSignal();let i;try{i=await navigator.credentials.create(a);}catch(p){throw se({error:p,options:a})}if(!i)throw new Error("Registration was not completed");let{id:l,rawId:s,response:r,type:b}=i,m;typeof r.getTransports=="function"&&(m=r.getTransports());let y;if(typeof r.getPublicKeyAlgorithm=="function")try{y=r.getPublicKeyAlgorithm();}catch(p){B("getPublicKeyAlgorithm()",p);}let h;if(typeof r.getPublicKey=="function")try{let p=r.getPublicKey();p!==null&&(h=d(p));}catch(p){B("getPublicKey()",p);}let f;if(typeof r.getAuthenticatorData=="function")try{f=d(r.getAuthenticatorData());}catch(p){B("getAuthenticatorData()",p);}return {id:l,rawId:d(s),response:{attestationObject:d(r.attestationObject),clientDataJSON:d(r.clientDataJSON),transports:m,publicKeyAlgorithm:y,publicKey:h,authenticatorData:f},type:b,clientExtensionResults:i.getClientExtensionResults(),authenticatorAttachment:N(i.authenticatorAttachment)}}function B(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
2
+ `,t);}function le(){if(!A())return q.stubThis(new Promise(t=>t(false)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?q.stubThis(new Promise(t=>t(false))):q.stubThis(e.isConditionalMediationAvailable())}var q={stubThis:e=>e};function pe({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new c({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else {if(e.name==="NotAllowedError")return new c({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){let o=globalThis.location.hostname;if(U(o)){if(n.rpId!==o)return new c({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new c({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new c({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}async function ue(e){!e.optionsJSON&&e.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=false,verifyBrowserAutofillInput:o=true}=e;if(!A())throw new Error("WebAuthn is not supported in this browser");let a;t.allowCredentials?.length!==0&&(a=t.allowCredentials?.map(v));let i={...t,challenge:O(t.challenge),allowCredentials:a},l={};if(n){if(!await le())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&o)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');l.mediation="conditional",i.allowCredentials=[];}l.publicKey=i,l.signal=_.createNewAbortSignal();let s;try{s=await navigator.credentials.get(l);}catch(f){throw pe({error:f,options:l})}if(!s)throw new Error("Authentication was not completed");let{id:r,rawId:b,response:m,type:y}=s,h;return m.userHandle&&(h=d(m.userHandle)),{id:r,rawId:d(b),response:{authenticatorData:d(m.authenticatorData),clientDataJSON:d(m.clientDataJSON),signature:d(m.signature),userHandle:h},type:y,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:N(s.authenticatorAttachment)}}var de={authenticate:e=>ue(e),register:e=>ce(e),errorCode:e=>e instanceof c?e.code:void 0};function fe(e){return `${new URL(e.apiUrl).origin}/api/projects/${e.decoded.projectId}/consent`}async function H(e){let t=await c$1(e,fe(e),{init:{method:"GET",credentials:"include"},maxResponseBytes:65536,decode:Qe});return t.response.status===401?{required:false}:d$1(t,"consent status")}async function G(e,t){if(!Number.isSafeInteger(t)||t<1)throw new TypeError("Consent version must be a positive integer.");return d$1(await c$1(e,fe(e),{init:{method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:JSON.stringify({version:t})},maxResponseBytes:64*1024,decode:Xe}),"consent accept")}function Qe(e){let t=q$1(e),n=s(t.required),o=Ze(t.needsConsent),a=ge(t.version),i=me(t.termsUrl),l=me(t.privacyUrl);return {required:n,...o===void 0?{}:{needsConsent:o},...a===void 0?{}:{version:a},...i===void 0?{}:{termsUrl:i},...l===void 0?{}:{privacyUrl:l}}}function Xe(e){let t=q$1(e),n=ge(t.version);return {ok:s(t.ok),...n===void 0?{}:{version:n}}}function Ze(e){if(e===void 0||typeof e=="boolean")return e;throw new TypeError("Invalid consent response.")}function ge(e){if(e===void 0||Number.isSafeInteger(e)&&e>=1)return e;throw new TypeError("Invalid consent response.")}function me(e){if(e===void 0||typeof e=="string"&&e.length<=4096)return e;throw new TypeError("Invalid consent response.")}var et=30;function tt(e){return typeof e?.exp=="number"?e.exp:null}function nt(e){let t=e.split(".")[1];if(!t)return null;try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),o=JSON.parse(atob(n));return typeof o=="object"&&o!==null?o:null}catch{return null}}function J(e){let t=new Map;async function n(i={}){let l=i.template===void 0?null:i.template.trim().toLowerCase();if(l==="")throw new TypeError("Template missing");let s=l??"",r=t.get(s);r||(r={activeKey:null,cachedByKey:new Map,inflight:null,sequence:0},t.set(s,r));let b=i.forceRefresh===true;if(!b){let p=r.activeKey?r.cachedByKey.get(r.activeKey):null;if(p&&p.exp-Date.now()/1e3>et)return p.token;if(r.inflight)return r.inflight}let m=++r.sequence,y=()=>t.get(s)===r&&r.sequence===m,h=(async()=>{let p=l?`${e.projectBaseURL}/token/${encodeURIComponent(l)}`:`${e.projectBaseURL}/token`,j=await c$1(e,p,{init:{method:"GET",credentials:"include"},maxResponseBytes:64*1024,decode:k=>ot(k,l!==null)});if(j.response.status===401)return y()&&o(),null;let Y=d$1(j,"token"),he=Y.policyVersion,F=Y.token,w=nt(F),Q=tt(w);if(y())if(Q!==null){let k=typeof w?.sub=="string"?w.sub:null,ye=typeof w?.org_id=="string"?w.org_id:null;if(!l||k){let X=JSON.stringify([e.projectBaseURL,k,ye,l,he]);r.cachedByKey.clear(),r.cachedByKey.set(X,{token:F,exp:Q}),r.activeKey=X;}else a(r);}else a(r);return F})();if(b)return h;let f=h.finally(()=>{r.inflight===f&&(r.inflight=null);});return r.inflight=f,f}function o(){t.clear();}function a(i){i.cachedByKey.clear(),i.activeKey=null;}return {getToken:n,clear:o}}function ot(e,t){let n=q$1(e),o=r(n.token);if(o.length===0||o.length>32*1024)throw new TypeError("Invalid token response.");if(!t)return {token:o,policyVersion:0};let a=q$1(n.template);if(!Number.isSafeInteger(a.policyVersion)||a.policyVersion<1)throw new TypeError("Invalid token response.");return {token:o,policyVersion:a.policyVersion}}function it(e){let t=J(e),n=k(e,t.clear,(s,r)=>m(s,r,de)),o=i(e,`${new URL(e.apiUrl).origin}/api/projects/${e.decoded.projectId}`),a=j(o),i$1=s=>(...r)=>(t.clear(),s(...r)),l={getConsentStatus:()=>H(e),acceptConsent:s=>G(e,s),getToken:t.getToken,privacy:a,waitlist:{join:(s,r)=>o.request("/waitlist",{method:"POST",body:s,fetchOptions:r,credentials:"omit"})},account:{...n.account,updateUnsafeMetadata:i$1(n.account.updateUnsafeMetadata),updateProfile:i$1(n.account.updateProfile),changeEmail:i$1(n.account.changeEmail),changePassword:i$1(n.account.changePassword),revokeSession:i$1(n.account.revokeSession),delete:i$1(n.account.delete)},signIn:{email:i$1(n.signIn.email),username:i$1(n.signIn.username),social:i$1(n.signIn.social),sso:n.signIn.sso,magicLink:n.signIn.magicLink,emailOtp:i$1(n.signIn.emailOtp),passkey:i$1(n.signIn.passkey)},signUp:{email:i$1(n.signUp.email)},emailOtp:{...n.emailOtp,verifyEmail:i$1(n.emailOtp.verifyEmail)},twoFactor:{enable:n.twoFactor.enable,disable:i$1(n.twoFactor.disable),verifyTotp:i$1(n.twoFactor.verifyTotp),verifyBackupCode:i$1(n.twoFactor.verifyBackupCode),sendOtp:n.twoFactor.sendOtp,verifyOtp:i$1(n.twoFactor.verifyOtp),generateBackupCodes:n.twoFactor.generateBackupCodes},phoneOtp:{prepare:n.phoneOtp.prepare,start:n.phoneOtp.start,verify:i$1(n.phoneOtp.verify)},signOut:i$1(n.signOut)};return {...n,...l}}async function rt(e){if(typeof window>"u")throw new Error("Akedly Shield challenges must be solved in a browser.");let t=await at(),n=e.challengeRequired?await t.solvePow(e.challenge,e.difficulty):null,o=e.turnstile.required?await t.getTurnstileToken(st(e.turnstile.siteKey)):void 0;return {connectionId:e.connectionId,...n?{challengeToken:e.challengeToken,nonce:n.nonce}:{},...o?{turnstileToken:o}:{}}}async function at(){return import('@akedly/shield')}function st(e){if(!e)throw new Error("Akedly Shield did not provide a Turnstile site key.");return e}var I=class extends Error{constructor(n,o){super(n);this.cause=o;this.name="AuthOwlError";}cause},W=class extends I{constructor(n,o){super(`Rate limited. Retry after ${n}s.`,o);this.retryAfterSeconds=n;this.name="RateLimitedError";}retryAfterSeconds},$=class extends I{constructor(t="invalid publishable key",n){super(t,n),this.name="InvalidKeyError";}};
3
+ export{I as AuthOwlError,re as INVITATION_CLAIM_MAX_AGE_MS,M as INVITATION_QUERY_PARAM,$ as InvalidKeyError,W as RateLimitedError,G as acceptConsent,qe as captureInvitationClaim,P as clearInvitationClaim,it as createAuthOwlClient,J as createTokenClient,H as getConsentStatus,C as readInvitationClaim,Ge as readLastUsedSignInMethod,Je as recordLastUsedSignInMethod,We as rememberPendingSignInMethod,$e as settlePendingSignInMethod,rt as solvePhoneOtpChallenge};