@adminforge/core 0.3.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/.turbo/turbo-build.log +56 -0
- package/CHANGELOG.md +32 -0
- package/LICENSE +21 -0
- package/bin/adminforge.js +317 -0
- package/dist/auth-client.cjs +45 -0
- package/dist/auth-client.cjs.map +1 -0
- package/dist/auth-client.d.cts +17 -0
- package/dist/auth-client.d.ts +17 -0
- package/dist/auth-client.js +20 -0
- package/dist/auth-client.js.map +1 -0
- package/dist/auth.cjs +65 -0
- package/dist/auth.cjs.map +1 -0
- package/dist/auth.d.cts +21 -0
- package/dist/auth.d.ts +21 -0
- package/dist/auth.js +36 -0
- package/dist/auth.js.map +1 -0
- package/dist/client-D0cjJVsn.d.ts +20 -0
- package/dist/client-sRnmZ-Y9.d.cts +20 -0
- package/dist/index-CyzxaE7n.d.cts +124 -0
- package/dist/index-CyzxaE7n.d.ts +124 -0
- package/dist/index.cjs +453 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +65 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +410 -0
- package/dist/index.js.map +1 -0
- package/dist/next.cjs +839 -0
- package/dist/next.cjs.map +1 -0
- package/dist/next.d.cts +84 -0
- package/dist/next.d.ts +84 -0
- package/dist/next.js +800 -0
- package/dist/next.js.map +1 -0
- package/dist/styles.css +763 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.cts +2 -0
- package/dist/styles.d.ts +2 -0
- package/dist/ui.cjs +2500 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +119 -0
- package/dist/ui.d.ts +119 -0
- package/dist/ui.js +2448 -0
- package/dist/ui.js.map +1 -0
- package/eslint.config.js +35 -0
- package/package.json +99 -0
- package/src/api/controller.ts +234 -0
- package/src/api/index.ts +4 -0
- package/src/api/next.ts +281 -0
- package/src/api/security/agent-auth.ts +134 -0
- package/src/auth/config.ts +20 -0
- package/src/auth/index.ts +3 -0
- package/src/auth/middleware.ts +15 -0
- package/src/auth/provider.tsx +28 -0
- package/src/core/fields/index.ts +119 -0
- package/src/core/hooks/index.ts +60 -0
- package/src/core/index.ts +43 -0
- package/src/core/registry/index.ts +22 -0
- package/src/core/schema/collection.ts +12 -0
- package/src/core/schema/config.ts +11 -0
- package/src/core/schema/normalize.ts +32 -0
- package/src/core/types/index.ts +114 -0
- package/src/db/client.ts +146 -0
- package/src/db/index.ts +3 -0
- package/src/db/schema-generator.ts +104 -0
- package/src/fields/index.ts +1 -0
- package/src/index.ts +4 -0
- package/src/next.ts +3 -0
- package/src/styles/adminforge.css +840 -0
- package/src/ui/AdminDashboard.tsx +176 -0
- package/src/ui/AdminForgeContext.tsx +64 -0
- package/src/ui/components/AdminLayout.tsx +107 -0
- package/src/ui/form-engine/FormEngine.tsx +250 -0
- package/src/ui/form-engine/ImageUpload.tsx +68 -0
- package/src/ui/form-engine/RelationInput.tsx +215 -0
- package/src/ui/form-engine/RichTextEditor.tsx +708 -0
- package/src/ui/index.ts +18 -0
- package/src/ui/screens/AdminPage.tsx +162 -0
- package/src/ui/screens/AgentTokenPage.tsx +232 -0
- package/src/ui/screens/CollectionFormPage.tsx +135 -0
- package/src/ui/screens/CollectionListPage.tsx +170 -0
- package/src/ui/screens/CollectionSchemaPage.tsx +180 -0
- package/src/ui/screens/RoleDetailPage.tsx +147 -0
- package/src/ui/screens/RolesListPage.tsx +57 -0
- package/src/ui/table-engine/TableEngine.tsx +157 -0
- package/src/ui.ts +3 -0
- package/tsconfig.json +10 -0
- package/tsup.config.ts +54 -0
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { A as AdminForgeConfig, C as CollectionDefinition } from './index-CyzxaE7n.js';
|
|
3
|
+
import React$1 from 'react';
|
|
4
|
+
export { AuthProvider, useAdminSession } from './auth-client.js';
|
|
5
|
+
import 'zod';
|
|
6
|
+
|
|
7
|
+
interface AdminLayoutProps {
|
|
8
|
+
config: AdminForgeConfig;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
currentPath?: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function AdminLayout({ config, children, currentPath, role }: AdminLayoutProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
interface AdminDashboardProps {
|
|
16
|
+
config?: AdminForgeConfig;
|
|
17
|
+
params?: {
|
|
18
|
+
admin?: string[];
|
|
19
|
+
} | Promise<{
|
|
20
|
+
admin?: string[];
|
|
21
|
+
}>;
|
|
22
|
+
apiBase?: string;
|
|
23
|
+
}
|
|
24
|
+
declare function AdminDashboard({ config: initialConfig, params: initialParams, apiBase: initialApiBase }: AdminDashboardProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
interface AdminPageProps {
|
|
27
|
+
config: AdminForgeConfig;
|
|
28
|
+
role?: string;
|
|
29
|
+
}
|
|
30
|
+
declare function AdminPage({ config, role: propRole }: AdminPageProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
interface CollectionListPageProps {
|
|
33
|
+
config: AdminForgeConfig;
|
|
34
|
+
collection: CollectionDefinition;
|
|
35
|
+
data: unknown[];
|
|
36
|
+
total: number;
|
|
37
|
+
page: number;
|
|
38
|
+
pageSize: number;
|
|
39
|
+
role?: string;
|
|
40
|
+
}
|
|
41
|
+
declare function CollectionListPage({ config, collection, data, total, page, pageSize, role: propRole }: CollectionListPageProps): react_jsx_runtime.JSX.Element;
|
|
42
|
+
|
|
43
|
+
interface CollectionFormPageProps {
|
|
44
|
+
config: AdminForgeConfig;
|
|
45
|
+
collection: CollectionDefinition;
|
|
46
|
+
record?: Record<string, unknown> | null;
|
|
47
|
+
isNew: boolean;
|
|
48
|
+
role?: string;
|
|
49
|
+
}
|
|
50
|
+
declare function CollectionFormPage({ config, collection, record, isNew, role: propRole }: CollectionFormPageProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
|
|
52
|
+
interface CollectionSchemaPageProps {
|
|
53
|
+
config: AdminForgeConfig;
|
|
54
|
+
collection: CollectionDefinition;
|
|
55
|
+
role?: string;
|
|
56
|
+
}
|
|
57
|
+
declare function CollectionSchemaPage({ config, collection, role }: CollectionSchemaPageProps): react_jsx_runtime.JSX.Element;
|
|
58
|
+
|
|
59
|
+
interface RolesListPageProps {
|
|
60
|
+
config: AdminForgeConfig;
|
|
61
|
+
role?: string;
|
|
62
|
+
}
|
|
63
|
+
declare function RolesListPage({ config, role }: RolesListPageProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
|
|
65
|
+
interface RoleDetailPageProps {
|
|
66
|
+
config: AdminForgeConfig;
|
|
67
|
+
roleId: string;
|
|
68
|
+
role?: string;
|
|
69
|
+
}
|
|
70
|
+
declare function RoleDetailPage({ config, roleId, role }: RoleDetailPageProps): react_jsx_runtime.JSX.Element;
|
|
71
|
+
|
|
72
|
+
interface AgentTokenPageProps {
|
|
73
|
+
config: AdminForgeConfig;
|
|
74
|
+
}
|
|
75
|
+
declare function AgentTokenPage({ config }: AgentTokenPageProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
|
|
77
|
+
interface FormEngineProps {
|
|
78
|
+
collection: CollectionDefinition;
|
|
79
|
+
record?: Record<string, unknown> | null;
|
|
80
|
+
isNew: boolean;
|
|
81
|
+
role?: string;
|
|
82
|
+
}
|
|
83
|
+
declare function FormEngine({ collection, record, isNew, role }: FormEngineProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
interface TableEngineProps {
|
|
86
|
+
collection: CollectionDefinition;
|
|
87
|
+
data: unknown[];
|
|
88
|
+
basePath: string;
|
|
89
|
+
role?: string;
|
|
90
|
+
}
|
|
91
|
+
declare function TableEngine({ collection, data, basePath, role }: TableEngineProps): react_jsx_runtime.JSX.Element;
|
|
92
|
+
|
|
93
|
+
interface RichTextEditorProps {
|
|
94
|
+
name: string;
|
|
95
|
+
value?: string;
|
|
96
|
+
onChange: (value: string) => void;
|
|
97
|
+
}
|
|
98
|
+
declare function RichTextEditor({ name, value, onChange }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
99
|
+
|
|
100
|
+
interface ImageUploadProps {
|
|
101
|
+
name: string;
|
|
102
|
+
value?: string;
|
|
103
|
+
onChange: (value: string) => void;
|
|
104
|
+
}
|
|
105
|
+
declare function ImageUpload({ name, value, onChange }: ImageUploadProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
|
|
107
|
+
interface AdminForgeContextType {
|
|
108
|
+
config: AdminForgeConfig | undefined;
|
|
109
|
+
apiBase: string;
|
|
110
|
+
unauthorized: boolean;
|
|
111
|
+
}
|
|
112
|
+
declare function AdminForgeProvider({ children, config: initialConfig, apiBase }: {
|
|
113
|
+
children: React$1.ReactNode;
|
|
114
|
+
config?: AdminForgeConfig;
|
|
115
|
+
apiBase?: string;
|
|
116
|
+
}): react_jsx_runtime.JSX.Element;
|
|
117
|
+
declare function useAdminForge(): AdminForgeContextType;
|
|
118
|
+
|
|
119
|
+
export { AdminDashboard, AdminForgeProvider, AdminLayout, AdminPage, AgentTokenPage, CollectionFormPage, CollectionListPage, CollectionSchemaPage, FormEngine, ImageUpload, RichTextEditor, RoleDetailPage, RolesListPage, TableEngine, useAdminForge };
|