@authsome/ui-core 0.1.4 → 0.1.6
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/adapters/index.d.mts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{provider-KGfwPsXv.d.mts → provider-Du6Oe4tD.d.mts} +22 -2
- package/dist/{provider-KGfwPsXv.d.ts → provider-Du6Oe4tD.d.ts} +22 -2
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as AuthProvider,
|
|
1
|
+
import { c as AuthProvider, G as ProviderConfig, S as SignInRequest, E as AuthResponse, d as SignUpRequest, t as User, u as Session, w as SessionData, U as UpdateUserRequest, P as PasswordChangeRequest, e as PasswordResetRequest, f as PasswordResetConfirmRequest, O as OAuthSignInRequest, g as OAuthCallbackRequest, h as OAuthProvider, M as MagicLinkRequest, i as MagicLinkVerifyRequest, j as PhoneAuthRequest, k as PhoneVerifyRequest, T as TwoFactorSetupRequest, l as TwoFactorSetupResponse, m as TwoFactorVerifyRequest, n as TwoFactorMethod, o as PasskeyRegisterRequest, p as PasskeyCredential, q as PasskeyAuthRequest, R as RequestContext, C as CookieData, a as AuthError } from '../provider-Du6Oe4tD.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Base auth provider implementation
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as AuthProvider,
|
|
1
|
+
import { c as AuthProvider, G as ProviderConfig, S as SignInRequest, E as AuthResponse, d as SignUpRequest, t as User, u as Session, w as SessionData, U as UpdateUserRequest, P as PasswordChangeRequest, e as PasswordResetRequest, f as PasswordResetConfirmRequest, O as OAuthSignInRequest, g as OAuthCallbackRequest, h as OAuthProvider, M as MagicLinkRequest, i as MagicLinkVerifyRequest, j as PhoneAuthRequest, k as PhoneVerifyRequest, T as TwoFactorSetupRequest, l as TwoFactorSetupResponse, m as TwoFactorVerifyRequest, n as TwoFactorMethod, o as PasskeyRegisterRequest, p as PasskeyCredential, q as PasskeyAuthRequest, R as RequestContext, C as CookieData, a as AuthError } from '../provider-Du6Oe4tD.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Base auth provider implementation
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AuthErrorType, a as AuthError, V as ValidationError, C as CookieData, b as AuthContext, c as AuthProvider, S as SignInRequest, d as SignUpRequest, U as UpdateUserRequest, P as PasswordChangeRequest, e as PasswordResetRequest, f as PasswordResetConfirmRequest, O as OAuthSignInRequest, g as OAuthCallbackRequest, h as OAuthProvider, M as MagicLinkRequest, i as MagicLinkVerifyRequest, j as PhoneAuthRequest, k as PhoneVerifyRequest, T as TwoFactorSetupRequest, l as TwoFactorSetupResponse, m as TwoFactorVerifyRequest, n as TwoFactorMethod, o as PasskeyRegisterRequest, p as PasskeyCredential, q as PasskeyAuthRequest, r as Organization, s as OrganizationMembership, t as User, u as Session } from './provider-
|
|
2
|
-
export {
|
|
1
|
+
import { A as AuthErrorType, a as AuthError, V as ValidationError, C as CookieData, b as AuthContext, c as AuthProvider, S as SignInRequest, d as SignUpRequest, U as UpdateUserRequest, P as PasswordChangeRequest, e as PasswordResetRequest, f as PasswordResetConfirmRequest, O as OAuthSignInRequest, g as OAuthCallbackRequest, h as OAuthProvider, M as MagicLinkRequest, i as MagicLinkVerifyRequest, j as PhoneAuthRequest, k as PhoneVerifyRequest, T as TwoFactorSetupRequest, l as TwoFactorSetupResponse, m as TwoFactorVerifyRequest, n as TwoFactorMethod, o as PasskeyRegisterRequest, p as PasskeyCredential, q as PasskeyAuthRequest, r as Organization, s as OrganizationMembership, t as User, u as Session } from './provider-Du6Oe4tD.mjs';
|
|
2
|
+
export { E as AuthResponse, v as AuthState, B as FieldDefinition, z as FieldType, F as FieldValidation, x as OAuthConfig, G as ProviderConfig, R as RequestContext, w as SessionData, D as SignupFieldsResponse, y as TwoFactorConfig } from './provider-Du6Oe4tD.mjs';
|
|
3
3
|
import { Storage, Observable, Unsubscribe } from './types/index.mjs';
|
|
4
4
|
export { Listener, LocalStorageAdapter, MemoryStorageAdapter, SessionStorageAdapter } from './types/index.mjs';
|
|
5
5
|
export { BaseAuthProvider } from './adapters/index.mjs';
|
|
@@ -626,6 +626,7 @@ declare enum FlowConfigType {
|
|
|
626
626
|
COMPLETE_SIGN_UP_FLOW = "complete_sign_up_flow",// signup → verify email → complete profile
|
|
627
627
|
SECURE_SIGN_IN_FLOW = "secure_sign_in_flow",// signin → MFA → success
|
|
628
628
|
PASSWORD_RESET_FLOW = "password_reset_flow",
|
|
629
|
+
EMAIL_VERIFICATION_FLOW = "email_verification_flow",
|
|
629
630
|
CUSTOM = "custom"
|
|
630
631
|
}
|
|
631
632
|
/**
|
|
@@ -746,6 +747,10 @@ declare const oauthSignInFlow: FlowConfig;
|
|
|
746
747
|
* Password reset flow
|
|
747
748
|
*/
|
|
748
749
|
declare const passwordResetFlow: FlowConfig;
|
|
750
|
+
/**
|
|
751
|
+
* Email verification flow
|
|
752
|
+
*/
|
|
753
|
+
declare const emailVerificationFlow: FlowConfig;
|
|
749
754
|
/**
|
|
750
755
|
* Get predefined flow configuration by type
|
|
751
756
|
*/
|
|
@@ -761,6 +766,7 @@ declare const predefinedFlows: {
|
|
|
761
766
|
phone_auth_flow: FlowConfig;
|
|
762
767
|
oauth_sign_in: FlowConfig;
|
|
763
768
|
password_reset_flow: FlowConfig;
|
|
769
|
+
email_verification_flow: FlowConfig;
|
|
764
770
|
};
|
|
765
771
|
|
|
766
|
-
export { AuthClient, type AuthClientConfig, AuthContext, AuthError, AuthErrorType, type AuthLocale, AuthProvider, CookieData, type DeepPartial, FlowAction, type FlowConfig, FlowConfigType, FlowEngine, type FlowEvent, type FlowState, FlowStep, type FlowTransition, MagicLinkRequest, MagicLinkVerifyRequest, OAuthCallbackRequest, OAuthProvider, OAuthSignInRequest, Observable, Organization, OrganizationMembership, PasskeyAuthRequest, PasskeyCredential, PasskeyRegisterRequest, PasswordChangeRequest, PasswordResetConfirmRequest, PasswordResetRequest, PhoneAuthRequest, PhoneVerifyRequest, Session, SignInRequest, SignUpRequest, Storage, TokenManager, TwoFactorMethod, TwoFactorSetupRequest, TwoFactorSetupResponse, TwoFactorVerifyRequest, Unsubscribe, UpdateUserRequest, User, ValidationError, completeSignUpFlow, createAuthError, createLocale, defaultLocale, extractCookiesFromHeaders, getFlowConfig, interpolate, isAuthError, isMFARequiredError, isNetworkError, isUnauthenticatedError, magicLinkFlow, oauthSignInFlow, parseCookie, parseCookieOptions, passwordResetFlow, phoneAuthFlow, predefinedFlows, serializeCookie, serializeCookies, signInWithMFAFlow, simpleSignInFlow, toAuthError, validate2FACode, validateEmail, validatePassword, validatePhone, validateRequired, validateUsername };
|
|
772
|
+
export { AuthClient, type AuthClientConfig, AuthContext, AuthError, AuthErrorType, type AuthLocale, AuthProvider, CookieData, type DeepPartial, FlowAction, type FlowConfig, FlowConfigType, FlowEngine, type FlowEvent, type FlowState, FlowStep, type FlowTransition, MagicLinkRequest, MagicLinkVerifyRequest, OAuthCallbackRequest, OAuthProvider, OAuthSignInRequest, Observable, Organization, OrganizationMembership, PasskeyAuthRequest, PasskeyCredential, PasskeyRegisterRequest, PasswordChangeRequest, PasswordResetConfirmRequest, PasswordResetRequest, PhoneAuthRequest, PhoneVerifyRequest, Session, SignInRequest, SignUpRequest, Storage, TokenManager, TwoFactorMethod, TwoFactorSetupRequest, TwoFactorSetupResponse, TwoFactorVerifyRequest, Unsubscribe, UpdateUserRequest, User, ValidationError, completeSignUpFlow, createAuthError, createLocale, defaultLocale, emailVerificationFlow, extractCookiesFromHeaders, getFlowConfig, interpolate, isAuthError, isMFARequiredError, isNetworkError, isUnauthenticatedError, magicLinkFlow, oauthSignInFlow, parseCookie, parseCookieOptions, passwordResetFlow, phoneAuthFlow, predefinedFlows, serializeCookie, serializeCookies, signInWithMFAFlow, simpleSignInFlow, toAuthError, validate2FACode, validateEmail, validatePassword, validatePhone, validateRequired, validateUsername };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AuthErrorType, a as AuthError, V as ValidationError, C as CookieData, b as AuthContext, c as AuthProvider, S as SignInRequest, d as SignUpRequest, U as UpdateUserRequest, P as PasswordChangeRequest, e as PasswordResetRequest, f as PasswordResetConfirmRequest, O as OAuthSignInRequest, g as OAuthCallbackRequest, h as OAuthProvider, M as MagicLinkRequest, i as MagicLinkVerifyRequest, j as PhoneAuthRequest, k as PhoneVerifyRequest, T as TwoFactorSetupRequest, l as TwoFactorSetupResponse, m as TwoFactorVerifyRequest, n as TwoFactorMethod, o as PasskeyRegisterRequest, p as PasskeyCredential, q as PasskeyAuthRequest, r as Organization, s as OrganizationMembership, t as User, u as Session } from './provider-
|
|
2
|
-
export {
|
|
1
|
+
import { A as AuthErrorType, a as AuthError, V as ValidationError, C as CookieData, b as AuthContext, c as AuthProvider, S as SignInRequest, d as SignUpRequest, U as UpdateUserRequest, P as PasswordChangeRequest, e as PasswordResetRequest, f as PasswordResetConfirmRequest, O as OAuthSignInRequest, g as OAuthCallbackRequest, h as OAuthProvider, M as MagicLinkRequest, i as MagicLinkVerifyRequest, j as PhoneAuthRequest, k as PhoneVerifyRequest, T as TwoFactorSetupRequest, l as TwoFactorSetupResponse, m as TwoFactorVerifyRequest, n as TwoFactorMethod, o as PasskeyRegisterRequest, p as PasskeyCredential, q as PasskeyAuthRequest, r as Organization, s as OrganizationMembership, t as User, u as Session } from './provider-Du6Oe4tD.js';
|
|
2
|
+
export { E as AuthResponse, v as AuthState, B as FieldDefinition, z as FieldType, F as FieldValidation, x as OAuthConfig, G as ProviderConfig, R as RequestContext, w as SessionData, D as SignupFieldsResponse, y as TwoFactorConfig } from './provider-Du6Oe4tD.js';
|
|
3
3
|
import { Storage, Observable, Unsubscribe } from './types/index.js';
|
|
4
4
|
export { Listener, LocalStorageAdapter, MemoryStorageAdapter, SessionStorageAdapter } from './types/index.js';
|
|
5
5
|
export { BaseAuthProvider } from './adapters/index.js';
|
|
@@ -626,6 +626,7 @@ declare enum FlowConfigType {
|
|
|
626
626
|
COMPLETE_SIGN_UP_FLOW = "complete_sign_up_flow",// signup → verify email → complete profile
|
|
627
627
|
SECURE_SIGN_IN_FLOW = "secure_sign_in_flow",// signin → MFA → success
|
|
628
628
|
PASSWORD_RESET_FLOW = "password_reset_flow",
|
|
629
|
+
EMAIL_VERIFICATION_FLOW = "email_verification_flow",
|
|
629
630
|
CUSTOM = "custom"
|
|
630
631
|
}
|
|
631
632
|
/**
|
|
@@ -746,6 +747,10 @@ declare const oauthSignInFlow: FlowConfig;
|
|
|
746
747
|
* Password reset flow
|
|
747
748
|
*/
|
|
748
749
|
declare const passwordResetFlow: FlowConfig;
|
|
750
|
+
/**
|
|
751
|
+
* Email verification flow
|
|
752
|
+
*/
|
|
753
|
+
declare const emailVerificationFlow: FlowConfig;
|
|
749
754
|
/**
|
|
750
755
|
* Get predefined flow configuration by type
|
|
751
756
|
*/
|
|
@@ -761,6 +766,7 @@ declare const predefinedFlows: {
|
|
|
761
766
|
phone_auth_flow: FlowConfig;
|
|
762
767
|
oauth_sign_in: FlowConfig;
|
|
763
768
|
password_reset_flow: FlowConfig;
|
|
769
|
+
email_verification_flow: FlowConfig;
|
|
764
770
|
};
|
|
765
771
|
|
|
766
|
-
export { AuthClient, type AuthClientConfig, AuthContext, AuthError, AuthErrorType, type AuthLocale, AuthProvider, CookieData, type DeepPartial, FlowAction, type FlowConfig, FlowConfigType, FlowEngine, type FlowEvent, type FlowState, FlowStep, type FlowTransition, MagicLinkRequest, MagicLinkVerifyRequest, OAuthCallbackRequest, OAuthProvider, OAuthSignInRequest, Observable, Organization, OrganizationMembership, PasskeyAuthRequest, PasskeyCredential, PasskeyRegisterRequest, PasswordChangeRequest, PasswordResetConfirmRequest, PasswordResetRequest, PhoneAuthRequest, PhoneVerifyRequest, Session, SignInRequest, SignUpRequest, Storage, TokenManager, TwoFactorMethod, TwoFactorSetupRequest, TwoFactorSetupResponse, TwoFactorVerifyRequest, Unsubscribe, UpdateUserRequest, User, ValidationError, completeSignUpFlow, createAuthError, createLocale, defaultLocale, extractCookiesFromHeaders, getFlowConfig, interpolate, isAuthError, isMFARequiredError, isNetworkError, isUnauthenticatedError, magicLinkFlow, oauthSignInFlow, parseCookie, parseCookieOptions, passwordResetFlow, phoneAuthFlow, predefinedFlows, serializeCookie, serializeCookies, signInWithMFAFlow, simpleSignInFlow, toAuthError, validate2FACode, validateEmail, validatePassword, validatePhone, validateRequired, validateUsername };
|
|
772
|
+
export { AuthClient, type AuthClientConfig, AuthContext, AuthError, AuthErrorType, type AuthLocale, AuthProvider, CookieData, type DeepPartial, FlowAction, type FlowConfig, FlowConfigType, FlowEngine, type FlowEvent, type FlowState, FlowStep, type FlowTransition, MagicLinkRequest, MagicLinkVerifyRequest, OAuthCallbackRequest, OAuthProvider, OAuthSignInRequest, Observable, Organization, OrganizationMembership, PasskeyAuthRequest, PasskeyCredential, PasskeyRegisterRequest, PasswordChangeRequest, PasswordResetConfirmRequest, PasswordResetRequest, PhoneAuthRequest, PhoneVerifyRequest, Session, SignInRequest, SignUpRequest, Storage, TokenManager, TwoFactorMethod, TwoFactorSetupRequest, TwoFactorSetupResponse, TwoFactorVerifyRequest, Unsubscribe, UpdateUserRequest, User, ValidationError, completeSignUpFlow, createAuthError, createLocale, defaultLocale, emailVerificationFlow, extractCookiesFromHeaders, getFlowConfig, interpolate, isAuthError, isMFARequiredError, isNetworkError, isUnauthenticatedError, magicLinkFlow, oauthSignInFlow, parseCookie, parseCookieOptions, passwordResetFlow, phoneAuthFlow, predefinedFlows, serializeCookie, serializeCookies, signInWithMFAFlow, simpleSignInFlow, toAuthError, validate2FACode, validateEmail, validatePassword, validatePhone, validateRequired, validateUsername };
|
package/dist/index.js
CHANGED
|
@@ -1251,6 +1251,7 @@ var FlowConfigType = /* @__PURE__ */ ((FlowConfigType2) => {
|
|
|
1251
1251
|
FlowConfigType2["COMPLETE_SIGN_UP_FLOW"] = "complete_sign_up_flow";
|
|
1252
1252
|
FlowConfigType2["SECURE_SIGN_IN_FLOW"] = "secure_sign_in_flow";
|
|
1253
1253
|
FlowConfigType2["PASSWORD_RESET_FLOW"] = "password_reset_flow";
|
|
1254
|
+
FlowConfigType2["EMAIL_VERIFICATION_FLOW"] = "email_verification_flow";
|
|
1254
1255
|
FlowConfigType2["CUSTOM"] = "custom";
|
|
1255
1256
|
return FlowConfigType2;
|
|
1256
1257
|
})(FlowConfigType || {});
|
|
@@ -1656,6 +1657,27 @@ var passwordResetFlow = {
|
|
|
1656
1657
|
}
|
|
1657
1658
|
}
|
|
1658
1659
|
};
|
|
1660
|
+
var emailVerificationFlow = {
|
|
1661
|
+
name: "Email Verification",
|
|
1662
|
+
description: "Verify email address with code or link",
|
|
1663
|
+
initialStep: "email_verification_required" /* EMAIL_VERIFICATION_REQUIRED */,
|
|
1664
|
+
allowedSteps: [
|
|
1665
|
+
"email_verification_required" /* EMAIL_VERIFICATION_REQUIRED */,
|
|
1666
|
+
"email_verification_sent" /* EMAIL_VERIFICATION_SENT */,
|
|
1667
|
+
"success" /* SUCCESS */,
|
|
1668
|
+
"error" /* ERROR */
|
|
1669
|
+
],
|
|
1670
|
+
transitions: {
|
|
1671
|
+
["email_verification_required" /* EMAIL_VERIFICATION_REQUIRED */]: {
|
|
1672
|
+
onSuccess: "email_verification_sent" /* EMAIL_VERIFICATION_SENT */,
|
|
1673
|
+
onError: "email_verification_required" /* EMAIL_VERIFICATION_REQUIRED */
|
|
1674
|
+
},
|
|
1675
|
+
["email_verification_sent" /* EMAIL_VERIFICATION_SENT */]: {
|
|
1676
|
+
onSuccess: "success" /* SUCCESS */,
|
|
1677
|
+
onError: "email_verification_required" /* EMAIL_VERIFICATION_REQUIRED */
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
};
|
|
1659
1681
|
function getFlowConfig(type) {
|
|
1660
1682
|
switch (type) {
|
|
1661
1683
|
case "simple_sign_in" /* SIMPLE_SIGN_IN */:
|
|
@@ -1672,6 +1694,8 @@ function getFlowConfig(type) {
|
|
|
1672
1694
|
return oauthSignInFlow;
|
|
1673
1695
|
case "password_reset_flow" /* PASSWORD_RESET_FLOW */:
|
|
1674
1696
|
return passwordResetFlow;
|
|
1697
|
+
case "email_verification_flow" /* EMAIL_VERIFICATION_FLOW */:
|
|
1698
|
+
return emailVerificationFlow;
|
|
1675
1699
|
default:
|
|
1676
1700
|
throw new Error(`Unknown flow type: ${type}`);
|
|
1677
1701
|
}
|
|
@@ -1683,7 +1707,8 @@ var predefinedFlows = {
|
|
|
1683
1707
|
["magic_link_flow" /* MAGIC_LINK_FLOW */]: magicLinkFlow,
|
|
1684
1708
|
["phone_auth_flow" /* PHONE_AUTH_FLOW */]: phoneAuthFlow,
|
|
1685
1709
|
["oauth_sign_in" /* OAUTH_SIGN_IN */]: oauthSignInFlow,
|
|
1686
|
-
["password_reset_flow" /* PASSWORD_RESET_FLOW */]: passwordResetFlow
|
|
1710
|
+
["password_reset_flow" /* PASSWORD_RESET_FLOW */]: passwordResetFlow,
|
|
1711
|
+
["email_verification_flow" /* EMAIL_VERIFICATION_FLOW */]: emailVerificationFlow
|
|
1687
1712
|
};
|
|
1688
1713
|
|
|
1689
1714
|
exports.AuthClient = AuthClient;
|
|
@@ -1706,6 +1731,7 @@ exports.completeSignUpFlow = completeSignUpFlow;
|
|
|
1706
1731
|
exports.createAuthError = createAuthError;
|
|
1707
1732
|
exports.createLocale = createLocale;
|
|
1708
1733
|
exports.defaultLocale = defaultLocale;
|
|
1734
|
+
exports.emailVerificationFlow = emailVerificationFlow;
|
|
1709
1735
|
exports.extractCookiesFromHeaders = extractCookiesFromHeaders;
|
|
1710
1736
|
exports.getFlowConfig = getFlowConfig;
|
|
1711
1737
|
exports.interpolate = interpolate;
|