@insforge/react 0.5.11 → 0.6.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/dist/atoms.cjs +14 -16
- package/dist/atoms.cjs.map +1 -1
- package/dist/atoms.d.cts +1 -0
- package/dist/atoms.d.ts +1 -0
- package/dist/atoms.js +13 -15
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +23 -25
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +2 -1
- package/dist/components.d.ts +2 -1
- package/dist/components.js +22 -24
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +14 -16
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.d.cts +1 -0
- package/dist/forms.d.ts +1 -0
- package/dist/forms.js +13 -15
- package/dist/forms.js.map +1 -1
- package/dist/hooks.cjs +16 -18
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +4 -5
- package/dist/hooks.d.ts +4 -5
- package/dist/hooks.js +15 -17
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +391 -313
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -60
- package/dist/index.d.ts +12 -60
- package/dist/index.js +391 -313
- package/dist/index.js.map +1 -1
- package/dist/types.d.cts +3 -19
- package/dist/types.d.ts +3 -19
- package/package.json +98 -110
package/dist/index.d.cts
CHANGED
|
@@ -3,68 +3,17 @@ export { ForgotPasswordForm, ForgotPasswordFormProps, ResetPasswordForm, ResetPa
|
|
|
3
3
|
export { AuthBranding, AuthContainer, AuthContainerProps, AuthDivider, AuthDividerProps, AuthEmailVerificationStep, AuthErrorBanner, AuthErrorBannerProps, AuthFormField, AuthFormFieldProps, AuthHeader, AuthHeaderProps, AuthLink, AuthLinkProps, AuthOAuthButton, AuthOAuthButtonProps, AuthOAuthProviders, AuthOAuthProvidersProps, AuthPasswordField, AuthPasswordFieldProps, AuthPasswordStrengthIndicator, AuthPasswordStrengthIndicatorProps, AuthResetPasswordVerificationStep, AuthSubmitButton, AuthSubmitButtonProps, AuthVerificationCodeInput, AuthVerificationCodeInputProps } from './atoms.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export { AuthConfig, EmailVerificationMethod } from './types.cjs';
|
|
9
|
-
import { CreateSessionResponse, CreateUserResponse, ResetPasswordResponse, GetPublicAuthConfigResponse } from '@insforge/shared-schemas';
|
|
6
|
+
import { InsforgeUser, InsforgeContextValue, OAuthProvider } from '@insforge/shared';
|
|
7
|
+
export { InsforgeContextValue, InsforgeUser, OAuthProvider } from '@insforge/shared';
|
|
10
8
|
export { useAuth, usePublicAuthConfig, useUser } from './hooks.cjs';
|
|
11
9
|
export { checkPasswordStrength, createPasswordSchema, emailSchema, passwordSchema, resolveAuthPath, resolveAuthUrl, validateEmail, validatePassword } from './lib.cjs';
|
|
10
|
+
import { OAuthProviderConfig } from './types.cjs';
|
|
11
|
+
export { AuthConfig, EmailVerificationMethod } from './types.cjs';
|
|
12
12
|
export { BrowserNavigationAdapter, NavigationAdapter, NavigationProvider, NavigationProviderProps, useNavigationAdapter, useSearchParams } from './navigation.cjs';
|
|
13
|
+
import '@insforge/sdk';
|
|
14
|
+
import '@insforge/shared-schemas';
|
|
13
15
|
import 'zod';
|
|
14
16
|
|
|
15
|
-
interface InsforgeContextValue {
|
|
16
|
-
user: InsforgeUser | null;
|
|
17
|
-
isLoaded: boolean;
|
|
18
|
-
isSignedIn: boolean;
|
|
19
|
-
setUser: (user: InsforgeUser | null) => void;
|
|
20
|
-
signIn: (email: string, password: string) => Promise<CreateSessionResponse | {
|
|
21
|
-
error: string;
|
|
22
|
-
statusCode?: number;
|
|
23
|
-
errorCode?: string;
|
|
24
|
-
}>;
|
|
25
|
-
signUp: (email: string, password: string) => Promise<CreateUserResponse | {
|
|
26
|
-
error: string;
|
|
27
|
-
statusCode?: number;
|
|
28
|
-
errorCode?: string;
|
|
29
|
-
}>;
|
|
30
|
-
signOut: () => Promise<void>;
|
|
31
|
-
updateUser: (data: Partial<InsforgeUser>) => Promise<{
|
|
32
|
-
error: string;
|
|
33
|
-
} | null>;
|
|
34
|
-
reloadAuth: () => Promise<{
|
|
35
|
-
success: boolean;
|
|
36
|
-
error?: string;
|
|
37
|
-
}>;
|
|
38
|
-
sendVerificationEmail: (email: string) => Promise<{
|
|
39
|
-
success: boolean;
|
|
40
|
-
message: string;
|
|
41
|
-
} | null>;
|
|
42
|
-
sendResetPasswordEmail: (email: string) => Promise<{
|
|
43
|
-
success: boolean;
|
|
44
|
-
message: string;
|
|
45
|
-
} | null>;
|
|
46
|
-
resetPassword: (token: string, newPassword: string) => Promise<ResetPasswordResponse | null>;
|
|
47
|
-
verifyEmail: (otp: string, email?: string) => Promise<{
|
|
48
|
-
accessToken: string;
|
|
49
|
-
user?: UserSchema;
|
|
50
|
-
redirectTo?: string;
|
|
51
|
-
error?: {
|
|
52
|
-
message: string;
|
|
53
|
-
};
|
|
54
|
-
} | null>;
|
|
55
|
-
exchangeResetPasswordToken: (email: string, code: string) => Promise<{
|
|
56
|
-
token: string;
|
|
57
|
-
expiresAt?: string;
|
|
58
|
-
} | {
|
|
59
|
-
error: {
|
|
60
|
-
message: string;
|
|
61
|
-
};
|
|
62
|
-
}>;
|
|
63
|
-
loginWithOAuth: (provider: OAuthProvider, redirectTo: string) => Promise<void>;
|
|
64
|
-
getPublicAuthConfig: () => Promise<GetPublicAuthConfigResponse | null>;
|
|
65
|
-
baseUrl: string;
|
|
66
|
-
afterSignInUrl: string;
|
|
67
|
-
}
|
|
68
17
|
interface InsforgeProviderProps {
|
|
69
18
|
children: ReactNode;
|
|
70
19
|
baseUrl: string;
|
|
@@ -80,8 +29,8 @@ interface InsforgeProviderProps {
|
|
|
80
29
|
/**
|
|
81
30
|
* Unified Insforge Provider - manages authentication state and configuration
|
|
82
31
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
32
|
+
* Uses singleton InsforgeManager to manage state across packages.
|
|
33
|
+
* Context only subscribes to Manager and triggers React re-renders.
|
|
85
34
|
*
|
|
86
35
|
* @example
|
|
87
36
|
* ```tsx
|
|
@@ -120,6 +69,9 @@ declare function InsforgeProvider(props: InsforgeProviderProps): react_jsx_runti
|
|
|
120
69
|
/**
|
|
121
70
|
* Hook to access Insforge context
|
|
122
71
|
*
|
|
72
|
+
* Works seamlessly across packages thanks to singleton Manager.
|
|
73
|
+
* Context instance is guaranteed to be consistent.
|
|
74
|
+
*
|
|
123
75
|
* @example
|
|
124
76
|
* ```tsx
|
|
125
77
|
* function MyComponent() {
|
|
@@ -148,4 +100,4 @@ declare function getProviderConfig(provider: OAuthProvider): OAuthProviderConfig
|
|
|
148
100
|
*/
|
|
149
101
|
declare function getAllProviderConfigs(): Partial<Record<OAuthProvider, OAuthProviderConfig>>;
|
|
150
102
|
|
|
151
|
-
export { InsforgeProvider, InsforgeProviderCore, type InsforgeProviderProps,
|
|
103
|
+
export { InsforgeProvider, InsforgeProviderCore, type InsforgeProviderProps, OAUTH_PROVIDER_CONFIG, OAuthProviderConfig, getAllProviderConfigs, getProviderConfig, useInsforge };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,68 +3,17 @@ export { ForgotPasswordForm, ForgotPasswordFormProps, ResetPasswordForm, ResetPa
|
|
|
3
3
|
export { AuthBranding, AuthContainer, AuthContainerProps, AuthDivider, AuthDividerProps, AuthEmailVerificationStep, AuthErrorBanner, AuthErrorBannerProps, AuthFormField, AuthFormFieldProps, AuthHeader, AuthHeaderProps, AuthLink, AuthLinkProps, AuthOAuthButton, AuthOAuthButtonProps, AuthOAuthProviders, AuthOAuthProvidersProps, AuthPasswordField, AuthPasswordFieldProps, AuthPasswordStrengthIndicator, AuthPasswordStrengthIndicatorProps, AuthResetPasswordVerificationStep, AuthSubmitButton, AuthSubmitButtonProps, AuthVerificationCodeInput, AuthVerificationCodeInputProps } from './atoms.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export { AuthConfig, EmailVerificationMethod } from './types.js';
|
|
9
|
-
import { CreateSessionResponse, CreateUserResponse, ResetPasswordResponse, GetPublicAuthConfigResponse } from '@insforge/shared-schemas';
|
|
6
|
+
import { InsforgeUser, InsforgeContextValue, OAuthProvider } from '@insforge/shared';
|
|
7
|
+
export { InsforgeContextValue, InsforgeUser, OAuthProvider } from '@insforge/shared';
|
|
10
8
|
export { useAuth, usePublicAuthConfig, useUser } from './hooks.js';
|
|
11
9
|
export { checkPasswordStrength, createPasswordSchema, emailSchema, passwordSchema, resolveAuthPath, resolveAuthUrl, validateEmail, validatePassword } from './lib.js';
|
|
10
|
+
import { OAuthProviderConfig } from './types.js';
|
|
11
|
+
export { AuthConfig, EmailVerificationMethod } from './types.js';
|
|
12
12
|
export { BrowserNavigationAdapter, NavigationAdapter, NavigationProvider, NavigationProviderProps, useNavigationAdapter, useSearchParams } from './navigation.js';
|
|
13
|
+
import '@insforge/sdk';
|
|
14
|
+
import '@insforge/shared-schemas';
|
|
13
15
|
import 'zod';
|
|
14
16
|
|
|
15
|
-
interface InsforgeContextValue {
|
|
16
|
-
user: InsforgeUser | null;
|
|
17
|
-
isLoaded: boolean;
|
|
18
|
-
isSignedIn: boolean;
|
|
19
|
-
setUser: (user: InsforgeUser | null) => void;
|
|
20
|
-
signIn: (email: string, password: string) => Promise<CreateSessionResponse | {
|
|
21
|
-
error: string;
|
|
22
|
-
statusCode?: number;
|
|
23
|
-
errorCode?: string;
|
|
24
|
-
}>;
|
|
25
|
-
signUp: (email: string, password: string) => Promise<CreateUserResponse | {
|
|
26
|
-
error: string;
|
|
27
|
-
statusCode?: number;
|
|
28
|
-
errorCode?: string;
|
|
29
|
-
}>;
|
|
30
|
-
signOut: () => Promise<void>;
|
|
31
|
-
updateUser: (data: Partial<InsforgeUser>) => Promise<{
|
|
32
|
-
error: string;
|
|
33
|
-
} | null>;
|
|
34
|
-
reloadAuth: () => Promise<{
|
|
35
|
-
success: boolean;
|
|
36
|
-
error?: string;
|
|
37
|
-
}>;
|
|
38
|
-
sendVerificationEmail: (email: string) => Promise<{
|
|
39
|
-
success: boolean;
|
|
40
|
-
message: string;
|
|
41
|
-
} | null>;
|
|
42
|
-
sendResetPasswordEmail: (email: string) => Promise<{
|
|
43
|
-
success: boolean;
|
|
44
|
-
message: string;
|
|
45
|
-
} | null>;
|
|
46
|
-
resetPassword: (token: string, newPassword: string) => Promise<ResetPasswordResponse | null>;
|
|
47
|
-
verifyEmail: (otp: string, email?: string) => Promise<{
|
|
48
|
-
accessToken: string;
|
|
49
|
-
user?: UserSchema;
|
|
50
|
-
redirectTo?: string;
|
|
51
|
-
error?: {
|
|
52
|
-
message: string;
|
|
53
|
-
};
|
|
54
|
-
} | null>;
|
|
55
|
-
exchangeResetPasswordToken: (email: string, code: string) => Promise<{
|
|
56
|
-
token: string;
|
|
57
|
-
expiresAt?: string;
|
|
58
|
-
} | {
|
|
59
|
-
error: {
|
|
60
|
-
message: string;
|
|
61
|
-
};
|
|
62
|
-
}>;
|
|
63
|
-
loginWithOAuth: (provider: OAuthProvider, redirectTo: string) => Promise<void>;
|
|
64
|
-
getPublicAuthConfig: () => Promise<GetPublicAuthConfigResponse | null>;
|
|
65
|
-
baseUrl: string;
|
|
66
|
-
afterSignInUrl: string;
|
|
67
|
-
}
|
|
68
17
|
interface InsforgeProviderProps {
|
|
69
18
|
children: ReactNode;
|
|
70
19
|
baseUrl: string;
|
|
@@ -80,8 +29,8 @@ interface InsforgeProviderProps {
|
|
|
80
29
|
/**
|
|
81
30
|
* Unified Insforge Provider - manages authentication state and configuration
|
|
82
31
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
32
|
+
* Uses singleton InsforgeManager to manage state across packages.
|
|
33
|
+
* Context only subscribes to Manager and triggers React re-renders.
|
|
85
34
|
*
|
|
86
35
|
* @example
|
|
87
36
|
* ```tsx
|
|
@@ -120,6 +69,9 @@ declare function InsforgeProvider(props: InsforgeProviderProps): react_jsx_runti
|
|
|
120
69
|
/**
|
|
121
70
|
* Hook to access Insforge context
|
|
122
71
|
*
|
|
72
|
+
* Works seamlessly across packages thanks to singleton Manager.
|
|
73
|
+
* Context instance is guaranteed to be consistent.
|
|
74
|
+
*
|
|
123
75
|
* @example
|
|
124
76
|
* ```tsx
|
|
125
77
|
* function MyComponent() {
|
|
@@ -148,4 +100,4 @@ declare function getProviderConfig(provider: OAuthProvider): OAuthProviderConfig
|
|
|
148
100
|
*/
|
|
149
101
|
declare function getAllProviderConfigs(): Partial<Record<OAuthProvider, OAuthProviderConfig>>;
|
|
150
102
|
|
|
151
|
-
export { InsforgeProvider, InsforgeProviderCore, type InsforgeProviderProps,
|
|
103
|
+
export { InsforgeProvider, InsforgeProviderCore, type InsforgeProviderProps, OAUTH_PROVIDER_CONFIG, OAuthProviderConfig, getAllProviderConfigs, getProviderConfig, useInsforge };
|