@cortejojicoy/admin-kit 0.1.8
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/LICENSE +21 -0
- package/README.md +347 -0
- package/dist/client.cjs +950 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +334 -0
- package/dist/client.d.ts +334 -0
- package/dist/client.js +900 -0
- package/dist/client.js.map +1 -0
- package/dist/index.cjs +47 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware.cjs +117 -0
- package/dist/middleware.cjs.map +1 -0
- package/dist/middleware.d.cts +28 -0
- package/dist/middleware.d.ts +28 -0
- package/dist/middleware.js +115 -0
- package/dist/middleware.js.map +1 -0
- package/dist/server.cjs +128 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +56 -0
- package/dist/server.d.ts +56 -0
- package/dist/server.js +122 -0
- package/dist/server.js.map +1 -0
- package/dist/types-N0f4k4Ie.d.cts +210 -0
- package/dist/types-N0f4k4Ie.d.ts +210 -0
- package/package.json +106 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { ReactNode, ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
interface AuthUser {
|
|
4
|
+
id: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
image?: string;
|
|
8
|
+
roles?: string[];
|
|
9
|
+
permissions?: string[];
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface AuthSession {
|
|
13
|
+
user: AuthUser;
|
|
14
|
+
accessToken?: string;
|
|
15
|
+
refreshToken?: string;
|
|
16
|
+
expiresAt?: number;
|
|
17
|
+
}
|
|
18
|
+
type AuthStatus = 'idle' | 'loading' | 'authenticated' | 'unauthenticated';
|
|
19
|
+
interface AuthState {
|
|
20
|
+
status: AuthStatus;
|
|
21
|
+
user: AuthUser | null;
|
|
22
|
+
session: AuthSession | null;
|
|
23
|
+
error: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface AuthActions {
|
|
26
|
+
login: (credentials: Record<string, unknown>) => Promise<AuthSession>;
|
|
27
|
+
logout: () => Promise<void>;
|
|
28
|
+
getSession: () => Promise<AuthSession | null>;
|
|
29
|
+
refresh?: () => Promise<AuthSession | null>;
|
|
30
|
+
}
|
|
31
|
+
type AuthContextValue = AuthState & AuthActions & {
|
|
32
|
+
isAuthenticated: boolean;
|
|
33
|
+
isLoading: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* AuthProvider is the strategy interface every auth backend implements.
|
|
37
|
+
* Instances are created from config and consumed by <AuthContextProvider>.
|
|
38
|
+
*/
|
|
39
|
+
interface AuthProvider {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
initialize?: () => Promise<AuthSession | null>;
|
|
42
|
+
login: (credentials: Record<string, unknown>) => Promise<AuthSession>;
|
|
43
|
+
logout: () => Promise<void>;
|
|
44
|
+
getSession: () => Promise<AuthSession | null>;
|
|
45
|
+
refresh?: () => Promise<AuthSession | null>;
|
|
46
|
+
}
|
|
47
|
+
interface JWTEndpoints {
|
|
48
|
+
login: string;
|
|
49
|
+
me: string;
|
|
50
|
+
logout?: string;
|
|
51
|
+
refresh?: string;
|
|
52
|
+
}
|
|
53
|
+
interface JWTAuthConfig {
|
|
54
|
+
endpoints: JWTEndpoints;
|
|
55
|
+
/** Where the token is stored on the client. Default: 'cookie'. */
|
|
56
|
+
tokenStorage?: 'cookie' | 'localStorage' | 'memory';
|
|
57
|
+
cookieName?: string;
|
|
58
|
+
/** Used by middleware/server helpers to verify tokens. NEVER ship to the client. */
|
|
59
|
+
secret?: string;
|
|
60
|
+
/** Header to send on authenticated requests. Default: 'Authorization' with 'Bearer '. */
|
|
61
|
+
header?: {
|
|
62
|
+
name: string;
|
|
63
|
+
prefix?: string;
|
|
64
|
+
};
|
|
65
|
+
/** Extract user from /me response. */
|
|
66
|
+
mapUser?: (raw: unknown) => AuthUser;
|
|
67
|
+
/** Extract { accessToken, refreshToken?, expiresAt? } from /login response. */
|
|
68
|
+
mapTokens?: (raw: unknown) => Partial<AuthSession>;
|
|
69
|
+
}
|
|
70
|
+
interface OAuthProviderConfig {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
authorizationUrl: string;
|
|
74
|
+
tokenUrl?: string;
|
|
75
|
+
userInfoUrl?: string;
|
|
76
|
+
clientId: string;
|
|
77
|
+
clientSecret?: string;
|
|
78
|
+
scopes?: string[];
|
|
79
|
+
redirectUri?: string;
|
|
80
|
+
icon?: ReactNode;
|
|
81
|
+
mapUser?: (raw: unknown) => AuthUser;
|
|
82
|
+
}
|
|
83
|
+
interface OAuthConfig {
|
|
84
|
+
providers: OAuthProviderConfig[];
|
|
85
|
+
callbackUrl?: string;
|
|
86
|
+
/** Server-only callback handler path; default '/api/auth/callback/:provider'. */
|
|
87
|
+
callbackPath?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface NavItem {
|
|
91
|
+
id?: string;
|
|
92
|
+
label: string;
|
|
93
|
+
href?: string;
|
|
94
|
+
icon?: ReactNode;
|
|
95
|
+
badge?: ReactNode | string | number;
|
|
96
|
+
external?: boolean;
|
|
97
|
+
/** Hide this item from rendering. Useful for feature flags. */
|
|
98
|
+
hidden?: boolean;
|
|
99
|
+
/** Restrict to users with any of these roles. */
|
|
100
|
+
roles?: string[];
|
|
101
|
+
/** Restrict to users with any of these permissions. */
|
|
102
|
+
permissions?: string[];
|
|
103
|
+
/** Programmatic visibility check; runs after role/permission filters. */
|
|
104
|
+
visible?: (user: AuthUser | null) => boolean;
|
|
105
|
+
/** Nested items render as a collapsible group. */
|
|
106
|
+
children?: NavItem[];
|
|
107
|
+
/** Optional sort weight; lower comes first. Default 0. */
|
|
108
|
+
order?: number;
|
|
109
|
+
}
|
|
110
|
+
interface NavSection {
|
|
111
|
+
id?: string;
|
|
112
|
+
label?: string;
|
|
113
|
+
items: NavItem[];
|
|
114
|
+
roles?: string[];
|
|
115
|
+
permissions?: string[];
|
|
116
|
+
visible?: (user: AuthUser | null) => boolean;
|
|
117
|
+
order?: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* An AdminModule is a self-contained feature pack a consumer can drop into
|
|
122
|
+
* `config.modules`. Modules can contribute:
|
|
123
|
+
* - nav sections (merged into the sidebar)
|
|
124
|
+
* - top-level providers (wrapped around the children inside AdminProvider)
|
|
125
|
+
* - dashboard widgets (rendered by the optional <DashboardSlot moduleId="..." />)
|
|
126
|
+
*/
|
|
127
|
+
interface AdminModule {
|
|
128
|
+
id: string;
|
|
129
|
+
name?: string;
|
|
130
|
+
description?: string;
|
|
131
|
+
/** Sections appended to the sidebar (merged with the same-id config section if present). */
|
|
132
|
+
navSections?: NavSection[];
|
|
133
|
+
/** Wrap children in this provider. Composed in declaration order. */
|
|
134
|
+
Provider?: ComponentType<{
|
|
135
|
+
children: ReactNode;
|
|
136
|
+
}>;
|
|
137
|
+
/** Optional dashboard widgets keyed by slot name. */
|
|
138
|
+
widgets?: Record<string, ComponentType>;
|
|
139
|
+
/** Predicate that runs once at boot — if false, module is fully skipped. */
|
|
140
|
+
enabled?: (ctx: {
|
|
141
|
+
user: AuthUser | null;
|
|
142
|
+
}) => boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
type RouterFlavor = 'app' | 'pages';
|
|
146
|
+
interface LoginPageConfig {
|
|
147
|
+
path?: string;
|
|
148
|
+
title?: string;
|
|
149
|
+
subtitle?: string;
|
|
150
|
+
logo?: ReactNode;
|
|
151
|
+
component?: ComponentType<LoginPageProps>;
|
|
152
|
+
}
|
|
153
|
+
interface LoginPageProps {
|
|
154
|
+
onSubmit?: (credentials: Record<string, string>) => Promise<void> | void;
|
|
155
|
+
error?: string | null;
|
|
156
|
+
loading?: boolean;
|
|
157
|
+
}
|
|
158
|
+
interface AuthConfig {
|
|
159
|
+
provider: 'jwt' | 'oauth' | 'custom';
|
|
160
|
+
jwt?: JWTAuthConfig;
|
|
161
|
+
oauth?: OAuthConfig;
|
|
162
|
+
custom?: AuthProvider;
|
|
163
|
+
loginPage?: LoginPageConfig;
|
|
164
|
+
afterLoginRedirect?: string;
|
|
165
|
+
afterLogoutRedirect?: string;
|
|
166
|
+
publicRoutes?: string[];
|
|
167
|
+
authorize?: (user: AuthUser, pathname: string) => boolean;
|
|
168
|
+
}
|
|
169
|
+
interface ThemeConfig {
|
|
170
|
+
mode?: 'light' | 'dark' | 'system';
|
|
171
|
+
primaryColor?: string;
|
|
172
|
+
tokens?: Record<string, string>;
|
|
173
|
+
className?: string;
|
|
174
|
+
}
|
|
175
|
+
interface LayoutConfig {
|
|
176
|
+
sidebarPosition?: 'left' | 'right';
|
|
177
|
+
sidebarCollapsible?: boolean;
|
|
178
|
+
sidebarDefaultCollapsed?: boolean;
|
|
179
|
+
topbar?: {
|
|
180
|
+
visible?: boolean;
|
|
181
|
+
component?: ComponentType;
|
|
182
|
+
};
|
|
183
|
+
footer?: {
|
|
184
|
+
visible?: boolean;
|
|
185
|
+
component?: ComponentType;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
interface AppConfig {
|
|
189
|
+
name: string;
|
|
190
|
+
logo?: ReactNode | string;
|
|
191
|
+
description?: string;
|
|
192
|
+
url?: string;
|
|
193
|
+
}
|
|
194
|
+
interface AdminConfig {
|
|
195
|
+
app: AppConfig;
|
|
196
|
+
router?: RouterFlavor;
|
|
197
|
+
auth: AuthConfig;
|
|
198
|
+
navigation: {
|
|
199
|
+
sections: NavSection[];
|
|
200
|
+
};
|
|
201
|
+
modules?: AdminModule[];
|
|
202
|
+
theme?: ThemeConfig;
|
|
203
|
+
layout?: LayoutConfig;
|
|
204
|
+
}
|
|
205
|
+
type ResolvedAdminConfig = Required<Pick<AdminConfig, 'app' | 'auth' | 'navigation'>> & AdminConfig & {
|
|
206
|
+
router: RouterFlavor;
|
|
207
|
+
layout: Required<Pick<LayoutConfig, 'sidebarPosition' | 'sidebarCollapsible' | 'sidebarDefaultCollapsed'>> & LayoutConfig;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export type { AdminConfig as A, JWTAuthConfig as J, LayoutConfig as L, NavItem as N, OAuthConfig as O, ResolvedAdminConfig as R, ThemeConfig as T, AdminModule as a, AppConfig as b, AuthActions as c, AuthConfig as d, AuthContextValue as e, AuthProvider as f, AuthSession as g, AuthState as h, AuthStatus as i, AuthUser as j, JWTEndpoints as k, LoginPageConfig as l, LoginPageProps as m, NavSection as n, OAuthProviderConfig as o, RouterFlavor as p };
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { ReactNode, ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
interface AuthUser {
|
|
4
|
+
id: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
image?: string;
|
|
8
|
+
roles?: string[];
|
|
9
|
+
permissions?: string[];
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface AuthSession {
|
|
13
|
+
user: AuthUser;
|
|
14
|
+
accessToken?: string;
|
|
15
|
+
refreshToken?: string;
|
|
16
|
+
expiresAt?: number;
|
|
17
|
+
}
|
|
18
|
+
type AuthStatus = 'idle' | 'loading' | 'authenticated' | 'unauthenticated';
|
|
19
|
+
interface AuthState {
|
|
20
|
+
status: AuthStatus;
|
|
21
|
+
user: AuthUser | null;
|
|
22
|
+
session: AuthSession | null;
|
|
23
|
+
error: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface AuthActions {
|
|
26
|
+
login: (credentials: Record<string, unknown>) => Promise<AuthSession>;
|
|
27
|
+
logout: () => Promise<void>;
|
|
28
|
+
getSession: () => Promise<AuthSession | null>;
|
|
29
|
+
refresh?: () => Promise<AuthSession | null>;
|
|
30
|
+
}
|
|
31
|
+
type AuthContextValue = AuthState & AuthActions & {
|
|
32
|
+
isAuthenticated: boolean;
|
|
33
|
+
isLoading: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* AuthProvider is the strategy interface every auth backend implements.
|
|
37
|
+
* Instances are created from config and consumed by <AuthContextProvider>.
|
|
38
|
+
*/
|
|
39
|
+
interface AuthProvider {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
initialize?: () => Promise<AuthSession | null>;
|
|
42
|
+
login: (credentials: Record<string, unknown>) => Promise<AuthSession>;
|
|
43
|
+
logout: () => Promise<void>;
|
|
44
|
+
getSession: () => Promise<AuthSession | null>;
|
|
45
|
+
refresh?: () => Promise<AuthSession | null>;
|
|
46
|
+
}
|
|
47
|
+
interface JWTEndpoints {
|
|
48
|
+
login: string;
|
|
49
|
+
me: string;
|
|
50
|
+
logout?: string;
|
|
51
|
+
refresh?: string;
|
|
52
|
+
}
|
|
53
|
+
interface JWTAuthConfig {
|
|
54
|
+
endpoints: JWTEndpoints;
|
|
55
|
+
/** Where the token is stored on the client. Default: 'cookie'. */
|
|
56
|
+
tokenStorage?: 'cookie' | 'localStorage' | 'memory';
|
|
57
|
+
cookieName?: string;
|
|
58
|
+
/** Used by middleware/server helpers to verify tokens. NEVER ship to the client. */
|
|
59
|
+
secret?: string;
|
|
60
|
+
/** Header to send on authenticated requests. Default: 'Authorization' with 'Bearer '. */
|
|
61
|
+
header?: {
|
|
62
|
+
name: string;
|
|
63
|
+
prefix?: string;
|
|
64
|
+
};
|
|
65
|
+
/** Extract user from /me response. */
|
|
66
|
+
mapUser?: (raw: unknown) => AuthUser;
|
|
67
|
+
/** Extract { accessToken, refreshToken?, expiresAt? } from /login response. */
|
|
68
|
+
mapTokens?: (raw: unknown) => Partial<AuthSession>;
|
|
69
|
+
}
|
|
70
|
+
interface OAuthProviderConfig {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
authorizationUrl: string;
|
|
74
|
+
tokenUrl?: string;
|
|
75
|
+
userInfoUrl?: string;
|
|
76
|
+
clientId: string;
|
|
77
|
+
clientSecret?: string;
|
|
78
|
+
scopes?: string[];
|
|
79
|
+
redirectUri?: string;
|
|
80
|
+
icon?: ReactNode;
|
|
81
|
+
mapUser?: (raw: unknown) => AuthUser;
|
|
82
|
+
}
|
|
83
|
+
interface OAuthConfig {
|
|
84
|
+
providers: OAuthProviderConfig[];
|
|
85
|
+
callbackUrl?: string;
|
|
86
|
+
/** Server-only callback handler path; default '/api/auth/callback/:provider'. */
|
|
87
|
+
callbackPath?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface NavItem {
|
|
91
|
+
id?: string;
|
|
92
|
+
label: string;
|
|
93
|
+
href?: string;
|
|
94
|
+
icon?: ReactNode;
|
|
95
|
+
badge?: ReactNode | string | number;
|
|
96
|
+
external?: boolean;
|
|
97
|
+
/** Hide this item from rendering. Useful for feature flags. */
|
|
98
|
+
hidden?: boolean;
|
|
99
|
+
/** Restrict to users with any of these roles. */
|
|
100
|
+
roles?: string[];
|
|
101
|
+
/** Restrict to users with any of these permissions. */
|
|
102
|
+
permissions?: string[];
|
|
103
|
+
/** Programmatic visibility check; runs after role/permission filters. */
|
|
104
|
+
visible?: (user: AuthUser | null) => boolean;
|
|
105
|
+
/** Nested items render as a collapsible group. */
|
|
106
|
+
children?: NavItem[];
|
|
107
|
+
/** Optional sort weight; lower comes first. Default 0. */
|
|
108
|
+
order?: number;
|
|
109
|
+
}
|
|
110
|
+
interface NavSection {
|
|
111
|
+
id?: string;
|
|
112
|
+
label?: string;
|
|
113
|
+
items: NavItem[];
|
|
114
|
+
roles?: string[];
|
|
115
|
+
permissions?: string[];
|
|
116
|
+
visible?: (user: AuthUser | null) => boolean;
|
|
117
|
+
order?: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* An AdminModule is a self-contained feature pack a consumer can drop into
|
|
122
|
+
* `config.modules`. Modules can contribute:
|
|
123
|
+
* - nav sections (merged into the sidebar)
|
|
124
|
+
* - top-level providers (wrapped around the children inside AdminProvider)
|
|
125
|
+
* - dashboard widgets (rendered by the optional <DashboardSlot moduleId="..." />)
|
|
126
|
+
*/
|
|
127
|
+
interface AdminModule {
|
|
128
|
+
id: string;
|
|
129
|
+
name?: string;
|
|
130
|
+
description?: string;
|
|
131
|
+
/** Sections appended to the sidebar (merged with the same-id config section if present). */
|
|
132
|
+
navSections?: NavSection[];
|
|
133
|
+
/** Wrap children in this provider. Composed in declaration order. */
|
|
134
|
+
Provider?: ComponentType<{
|
|
135
|
+
children: ReactNode;
|
|
136
|
+
}>;
|
|
137
|
+
/** Optional dashboard widgets keyed by slot name. */
|
|
138
|
+
widgets?: Record<string, ComponentType>;
|
|
139
|
+
/** Predicate that runs once at boot — if false, module is fully skipped. */
|
|
140
|
+
enabled?: (ctx: {
|
|
141
|
+
user: AuthUser | null;
|
|
142
|
+
}) => boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
type RouterFlavor = 'app' | 'pages';
|
|
146
|
+
interface LoginPageConfig {
|
|
147
|
+
path?: string;
|
|
148
|
+
title?: string;
|
|
149
|
+
subtitle?: string;
|
|
150
|
+
logo?: ReactNode;
|
|
151
|
+
component?: ComponentType<LoginPageProps>;
|
|
152
|
+
}
|
|
153
|
+
interface LoginPageProps {
|
|
154
|
+
onSubmit?: (credentials: Record<string, string>) => Promise<void> | void;
|
|
155
|
+
error?: string | null;
|
|
156
|
+
loading?: boolean;
|
|
157
|
+
}
|
|
158
|
+
interface AuthConfig {
|
|
159
|
+
provider: 'jwt' | 'oauth' | 'custom';
|
|
160
|
+
jwt?: JWTAuthConfig;
|
|
161
|
+
oauth?: OAuthConfig;
|
|
162
|
+
custom?: AuthProvider;
|
|
163
|
+
loginPage?: LoginPageConfig;
|
|
164
|
+
afterLoginRedirect?: string;
|
|
165
|
+
afterLogoutRedirect?: string;
|
|
166
|
+
publicRoutes?: string[];
|
|
167
|
+
authorize?: (user: AuthUser, pathname: string) => boolean;
|
|
168
|
+
}
|
|
169
|
+
interface ThemeConfig {
|
|
170
|
+
mode?: 'light' | 'dark' | 'system';
|
|
171
|
+
primaryColor?: string;
|
|
172
|
+
tokens?: Record<string, string>;
|
|
173
|
+
className?: string;
|
|
174
|
+
}
|
|
175
|
+
interface LayoutConfig {
|
|
176
|
+
sidebarPosition?: 'left' | 'right';
|
|
177
|
+
sidebarCollapsible?: boolean;
|
|
178
|
+
sidebarDefaultCollapsed?: boolean;
|
|
179
|
+
topbar?: {
|
|
180
|
+
visible?: boolean;
|
|
181
|
+
component?: ComponentType;
|
|
182
|
+
};
|
|
183
|
+
footer?: {
|
|
184
|
+
visible?: boolean;
|
|
185
|
+
component?: ComponentType;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
interface AppConfig {
|
|
189
|
+
name: string;
|
|
190
|
+
logo?: ReactNode | string;
|
|
191
|
+
description?: string;
|
|
192
|
+
url?: string;
|
|
193
|
+
}
|
|
194
|
+
interface AdminConfig {
|
|
195
|
+
app: AppConfig;
|
|
196
|
+
router?: RouterFlavor;
|
|
197
|
+
auth: AuthConfig;
|
|
198
|
+
navigation: {
|
|
199
|
+
sections: NavSection[];
|
|
200
|
+
};
|
|
201
|
+
modules?: AdminModule[];
|
|
202
|
+
theme?: ThemeConfig;
|
|
203
|
+
layout?: LayoutConfig;
|
|
204
|
+
}
|
|
205
|
+
type ResolvedAdminConfig = Required<Pick<AdminConfig, 'app' | 'auth' | 'navigation'>> & AdminConfig & {
|
|
206
|
+
router: RouterFlavor;
|
|
207
|
+
layout: Required<Pick<LayoutConfig, 'sidebarPosition' | 'sidebarCollapsible' | 'sidebarDefaultCollapsed'>> & LayoutConfig;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export type { AdminConfig as A, JWTAuthConfig as J, LayoutConfig as L, NavItem as N, OAuthConfig as O, ResolvedAdminConfig as R, ThemeConfig as T, AdminModule as a, AppConfig as b, AuthActions as c, AuthConfig as d, AuthContextValue as e, AuthProvider as f, AuthSession as g, AuthState as h, AuthStatus as i, AuthUser as j, JWTEndpoints as k, LoginPageConfig as l, LoginPageProps as m, NavSection as n, OAuthProviderConfig as o, RouterFlavor as p };
|
package/package.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cortejojicoy/admin-kit",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Next.js 16 admin panel kit — pluggable auth (JWT/OAuth/custom), customizable sidebar, modules, and components. Works with App Router and Pages Router.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./client": {
|
|
16
|
+
"types": "./dist/client.d.ts",
|
|
17
|
+
"import": "./dist/client.mjs",
|
|
18
|
+
"require": "./dist/client.js"
|
|
19
|
+
},
|
|
20
|
+
"./server": {
|
|
21
|
+
"types": "./dist/server.d.ts",
|
|
22
|
+
"import": "./dist/server.mjs",
|
|
23
|
+
"require": "./dist/server.js"
|
|
24
|
+
},
|
|
25
|
+
"./middleware": {
|
|
26
|
+
"types": "./dist/middleware.d.ts",
|
|
27
|
+
"import": "./dist/middleware.mjs",
|
|
28
|
+
"require": "./dist/middleware.js"
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsup",
|
|
39
|
+
"dev": "tsup --watch",
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
42
|
+
"clean": "rm -rf dist",
|
|
43
|
+
"preversion": "npm run typecheck && npm run build",
|
|
44
|
+
"version": "node scripts/update-changelog.mjs && git add CHANGELOG.md",
|
|
45
|
+
"postversion": "git push --follow-tags",
|
|
46
|
+
"release:patch": "npm version patch -m \"chore(release): v%s\"",
|
|
47
|
+
"release:minor": "npm version minor -m \"chore(release): v%s\"",
|
|
48
|
+
"release:major": "npm version major -m \"chore(release): v%s\"",
|
|
49
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
50
|
+
"publish:npm": "npm publish --access public --provenance",
|
|
51
|
+
"publish:npm:local": "node scripts/publish-local.mjs"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"next": ">=16.0.0",
|
|
55
|
+
"react": ">=19.0.0",
|
|
56
|
+
"react-dom": ">=19.0.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"next": { "optional": false },
|
|
60
|
+
"react": { "optional": false },
|
|
61
|
+
"react-dom": { "optional": false }
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@types/node": "^20.0.0",
|
|
65
|
+
"@types/react": "^19.0.0",
|
|
66
|
+
"@types/react-dom": "^19.0.0",
|
|
67
|
+
"next": "^16.0.0",
|
|
68
|
+
"react": "^19.0.0",
|
|
69
|
+
"react-dom": "^19.0.0",
|
|
70
|
+
"tsup": "^8.3.0",
|
|
71
|
+
"typescript": "^5.5.0"
|
|
72
|
+
},
|
|
73
|
+
"keywords": [
|
|
74
|
+
"nextjs",
|
|
75
|
+
"next16",
|
|
76
|
+
"admin",
|
|
77
|
+
"admin-panel",
|
|
78
|
+
"dashboard",
|
|
79
|
+
"jwt",
|
|
80
|
+
"oauth",
|
|
81
|
+
"sidebar",
|
|
82
|
+
"pluggable",
|
|
83
|
+
"app-router",
|
|
84
|
+
"pages-router"
|
|
85
|
+
],
|
|
86
|
+
"sideEffects": [
|
|
87
|
+
"**/*.css"
|
|
88
|
+
],
|
|
89
|
+
"license": "MIT",
|
|
90
|
+
"engines": {
|
|
91
|
+
"node": ">=20.9.0"
|
|
92
|
+
},
|
|
93
|
+
"publishConfig": {
|
|
94
|
+
"access": "public",
|
|
95
|
+
"registry": "https://registry.npmjs.org/",
|
|
96
|
+
"provenance": true
|
|
97
|
+
},
|
|
98
|
+
"repository": {
|
|
99
|
+
"type": "git",
|
|
100
|
+
"url": "git+https://github.com/cortejojicoy/admin-kit.git"
|
|
101
|
+
},
|
|
102
|
+
"bugs": {
|
|
103
|
+
"url": "https://github.com/cortejojicoy/admin-kit/issues"
|
|
104
|
+
},
|
|
105
|
+
"homepage": "https://github.com/cortejojicoy/admin-kit#readme"
|
|
106
|
+
}
|