@insforge/nextjs 0.4.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/README.md +759 -0
- package/dist/Manrope-VariableFont_wght-OKHRIJEM.ttf +0 -0
- package/dist/api.d.mts +39 -0
- package/dist/api.d.ts +39 -0
- package/dist/api.js +267 -0
- package/dist/api.js.map +1 -0
- package/dist/api.mjs +240 -0
- package/dist/api.mjs.map +1 -0
- package/dist/index.css +468 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +146 -0
- package/dist/index.d.ts +146 -0
- package/dist/index.js +1086 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1037 -0
- package/dist/index.mjs.map +1 -0
- package/dist/middleware.d.mts +14 -0
- package/dist/middleware.d.ts +14 -0
- package/dist/middleware.js +99 -0
- package/dist/middleware.js.map +1 -0
- package/dist/middleware.mjs +70 -0
- package/dist/middleware.mjs.map +1 -0
- package/package.json +65 -0
- package/src/fonts/Manrope-VariableFont_wght.ttf +0 -0
- package/src/styles.css +551 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
interface InsforgeUser {
|
|
6
|
+
id: string;
|
|
7
|
+
email: string;
|
|
8
|
+
avatar_url?: string;
|
|
9
|
+
nickname?: string;
|
|
10
|
+
bio?: string;
|
|
11
|
+
birthday?: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
interface InsforgeSession {
|
|
17
|
+
userId: string;
|
|
18
|
+
token: string;
|
|
19
|
+
expiresAt: string;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
}
|
|
22
|
+
interface AuthContextValue {
|
|
23
|
+
user: InsforgeUser | null;
|
|
24
|
+
session: InsforgeSession | null;
|
|
25
|
+
isLoaded: boolean;
|
|
26
|
+
isSignedIn: boolean;
|
|
27
|
+
signIn: (email: string, password: string) => Promise<void>;
|
|
28
|
+
signUp: (email: string, password: string) => Promise<void>;
|
|
29
|
+
signOut: () => Promise<void>;
|
|
30
|
+
updateUser: (data: Partial<InsforgeUser>) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
interface AuthProviderProps {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
baseUrl: string;
|
|
35
|
+
onAuthChange?: (user: InsforgeUser | null) => void;
|
|
36
|
+
}
|
|
37
|
+
interface SignInProps {
|
|
38
|
+
baseUrl: string;
|
|
39
|
+
afterSignInUrl?: string;
|
|
40
|
+
providers?: OAuthProvider[];
|
|
41
|
+
appearance?: {
|
|
42
|
+
container?: React.CSSProperties;
|
|
43
|
+
form?: React.CSSProperties;
|
|
44
|
+
button?: React.CSSProperties;
|
|
45
|
+
};
|
|
46
|
+
title?: string;
|
|
47
|
+
subtitle?: string;
|
|
48
|
+
emailLabel?: string;
|
|
49
|
+
emailPlaceholder?: string;
|
|
50
|
+
passwordLabel?: string;
|
|
51
|
+
passwordPlaceholder?: string;
|
|
52
|
+
forgotPasswordText?: string;
|
|
53
|
+
submitButtonText?: string;
|
|
54
|
+
loadingButtonText?: string;
|
|
55
|
+
signUpText?: string;
|
|
56
|
+
signUpLinkText?: string;
|
|
57
|
+
signUpUrl?: string;
|
|
58
|
+
dividerText?: string;
|
|
59
|
+
onSuccess?: (user: InsforgeUser) => void;
|
|
60
|
+
onError?: (error: Error) => void;
|
|
61
|
+
}
|
|
62
|
+
interface SignUpProps {
|
|
63
|
+
baseUrl: string;
|
|
64
|
+
afterSignUpUrl?: string;
|
|
65
|
+
providers?: OAuthProvider[];
|
|
66
|
+
appearance?: {
|
|
67
|
+
container?: React.CSSProperties;
|
|
68
|
+
form?: React.CSSProperties;
|
|
69
|
+
button?: React.CSSProperties;
|
|
70
|
+
};
|
|
71
|
+
title?: string;
|
|
72
|
+
subtitle?: string;
|
|
73
|
+
emailLabel?: string;
|
|
74
|
+
emailPlaceholder?: string;
|
|
75
|
+
passwordLabel?: string;
|
|
76
|
+
passwordPlaceholder?: string;
|
|
77
|
+
submitButtonText?: string;
|
|
78
|
+
loadingButtonText?: string;
|
|
79
|
+
signInText?: string;
|
|
80
|
+
signInLinkText?: string;
|
|
81
|
+
signInUrl?: string;
|
|
82
|
+
dividerText?: string;
|
|
83
|
+
onSuccess?: (user: InsforgeUser) => void;
|
|
84
|
+
onError?: (error: Error) => void;
|
|
85
|
+
}
|
|
86
|
+
interface UserButtonProps {
|
|
87
|
+
afterSignOutUrl?: string;
|
|
88
|
+
mode?: 'detailed' | 'simple';
|
|
89
|
+
appearance?: {
|
|
90
|
+
button?: React.CSSProperties;
|
|
91
|
+
dropdown?: React.CSSProperties;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
interface ProtectProps {
|
|
95
|
+
children: ReactNode;
|
|
96
|
+
fallback?: ReactNode;
|
|
97
|
+
redirectTo?: string;
|
|
98
|
+
condition?: (user: InsforgeUser) => boolean;
|
|
99
|
+
}
|
|
100
|
+
interface ConditionalProps {
|
|
101
|
+
children: ReactNode;
|
|
102
|
+
}
|
|
103
|
+
type OAuthProvider = 'google' | 'github';
|
|
104
|
+
|
|
105
|
+
declare function AuthProvider({ children, baseUrl, onAuthChange }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
|
|
107
|
+
interface InsforgeConfig {
|
|
108
|
+
oauthProviders: OAuthProvider[];
|
|
109
|
+
isLoaded: boolean;
|
|
110
|
+
refetch: () => Promise<void>;
|
|
111
|
+
}
|
|
112
|
+
interface InsforgeConfigProviderProps {
|
|
113
|
+
children: ReactNode;
|
|
114
|
+
baseUrl: string;
|
|
115
|
+
}
|
|
116
|
+
declare function InsforgeConfigProvider({ children, baseUrl }: InsforgeConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
117
|
+
declare function useInsforgeConfig(): InsforgeConfig;
|
|
118
|
+
|
|
119
|
+
declare function useAuth(): AuthContextValue;
|
|
120
|
+
|
|
121
|
+
declare function useUser(): {
|
|
122
|
+
user: InsforgeUser | null;
|
|
123
|
+
isLoaded: boolean;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
declare function useSession(): {
|
|
127
|
+
session: InsforgeSession | null;
|
|
128
|
+
isLoaded: boolean;
|
|
129
|
+
isSignedIn: boolean;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
declare function useOAuthProviders(): OAuthProvider[];
|
|
133
|
+
|
|
134
|
+
declare function SignIn({ baseUrl, afterSignInUrl, providers, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, onSuccess, onError, }: SignInProps): react_jsx_runtime.JSX.Element;
|
|
135
|
+
|
|
136
|
+
declare function SignUp({ baseUrl, afterSignUpUrl, providers, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, onSuccess, onError, }: SignUpProps): react_jsx_runtime.JSX.Element;
|
|
137
|
+
|
|
138
|
+
declare function UserButton({ afterSignOutUrl, mode, appearance, }: UserButtonProps): react_jsx_runtime.JSX.Element | null;
|
|
139
|
+
|
|
140
|
+
declare function SignedIn({ children }: ConditionalProps): react_jsx_runtime.JSX.Element | null;
|
|
141
|
+
|
|
142
|
+
declare function SignedOut({ children }: ConditionalProps): react_jsx_runtime.JSX.Element | null;
|
|
143
|
+
|
|
144
|
+
declare function Protect({ children, fallback, redirectTo, condition, }: ProtectProps): string | number | bigint | true | Iterable<react.ReactNode> | Promise<react.AwaitedReactNode> | react_jsx_runtime.JSX.Element | null;
|
|
145
|
+
|
|
146
|
+
export { type AuthContextValue, AuthProvider, type AuthProviderProps, type ConditionalProps, InsforgeConfigProvider, type InsforgeSession, type InsforgeUser, type OAuthProvider, Protect, type ProtectProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, UserButton, type UserButtonProps, useAuth, useInsforgeConfig, useOAuthProviders, useSession, useUser };
|