@kyro-cms/admin 0.1.2
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/.astro/content.d.ts +154 -0
- package/.astro/settings.json +5 -0
- package/.astro/types.d.ts +2 -0
- package/astro.config.mjs +28 -0
- package/bun.lock +1374 -0
- package/dist/client/_astro/AdminLayout.DkDpng53.css +1 -0
- package/dist/client/_astro/AutoForm.3eJCmCJp.js +1 -0
- package/dist/client/_astro/client.DyczpTbx.js +9 -0
- package/dist/client/_astro/index.B02hbnpo.js +1 -0
- package/dist/client/fonts/Serotiva-Black.woff2 +0 -0
- package/dist/client/fonts/Serotiva-Bold.woff2 +0 -0
- package/dist/client/fonts/Serotiva-Medium.woff2 +0 -0
- package/dist/client/fonts/Serotiva-Regular.woff2 +0 -0
- package/dist/client/fonts/Serotiva-SemiBold.woff2 +0 -0
- package/dist/server/chunks/AdminLayout_D-_JeUqC.mjs +26 -0
- package/dist/server/chunks/_id__BzI_o0qT.mjs +50 -0
- package/dist/server/chunks/_id__Cd-jOuY3.mjs +238 -0
- package/dist/server/chunks/_id__DvbD--iR.mjs +992 -0
- package/dist/server/chunks/_id__vpVaEo16.mjs +128 -0
- package/dist/server/chunks/_virtual_astro_server-island-manifest_CQQ1F5PF.mjs +7 -0
- package/dist/server/chunks/_virtual_astro_session-driver_Bk3Q189E.mjs +4 -0
- package/dist/server/chunks/astro-component_Dbx3T2Nh.mjs +37 -0
- package/dist/server/chunks/audit-logs_DrnUMRvY.mjs +74 -0
- package/dist/server/chunks/config_CPXslElD.mjs +4221 -0
- package/dist/server/chunks/dataStore_Dl7cA2Qp.mjs +89 -0
- package/dist/server/chunks/index_CVqOkerS.mjs +2960 -0
- package/dist/server/chunks/index_CX8SQ4BF.mjs +55 -0
- package/dist/server/chunks/index_CYofDU51.mjs +58 -0
- package/dist/server/chunks/index_DdNRhuaM.mjs +55 -0
- package/dist/server/chunks/index_DupPvtIF.mjs +42 -0
- package/dist/server/chunks/index_YTS_M-B9.mjs +263 -0
- package/dist/server/chunks/index_YeCzuVps.mjs +53 -0
- package/dist/server/chunks/login_DLyqMRO8.mjs +93 -0
- package/dist/server/chunks/logout_CSbt5wea.mjs +50 -0
- package/dist/server/chunks/me_C04jlYhH.mjs +41 -0
- package/dist/server/chunks/new_BbQ9b55M.mjs +92 -0
- package/dist/server/chunks/node_9bvTewss.mjs +1014 -0
- package/dist/server/chunks/noop-entrypoint_BOlrdqWF.mjs +3 -0
- package/dist/server/chunks/sequence_9cl7AJy-.mjs +2503 -0
- package/dist/server/chunks/server_peBx9VXG.mjs +8117 -0
- package/dist/server/chunks/sharp_pmJ7nHES.mjs +142 -0
- package/dist/server/chunks/users_Dzddy_YR.mjs +137 -0
- package/dist/server/entry.mjs +5 -0
- package/dist/server/virtual_astro_middleware.mjs +48 -0
- package/package.json +33 -0
- package/public/fonts/Serotiva-Black.woff2 +0 -0
- package/public/fonts/Serotiva-Bold.woff2 +0 -0
- package/public/fonts/Serotiva-Medium.woff2 +0 -0
- package/public/fonts/Serotiva-Regular.woff2 +0 -0
- package/public/fonts/Serotiva-SemiBold.woff2 +0 -0
- package/src/collections/auth/index.ts +155 -0
- package/src/components/ActionBar.tsx +215 -0
- package/src/components/Admin.tsx +214 -0
- package/src/components/AutoForm.tsx +1123 -0
- package/src/components/BulkActionsBar.tsx +80 -0
- package/src/components/CreateView.tsx +99 -0
- package/src/components/DetailView.tsx +329 -0
- package/src/components/Icons.tsx +23 -0
- package/src/components/ListView.tsx +192 -0
- package/src/components/StatusBadge.tsx +76 -0
- package/src/components/ThemeProvider.tsx +155 -0
- package/src/components/VersionHistoryPanel.tsx +205 -0
- package/src/components/fields/CheckboxField.tsx +37 -0
- package/src/components/fields/DateField.tsx +42 -0
- package/src/components/fields/NumberField.tsx +44 -0
- package/src/components/fields/RelationshipField.tsx +87 -0
- package/src/components/fields/SelectField.tsx +56 -0
- package/src/components/fields/TextField.tsx +49 -0
- package/src/components/index.ts +30 -0
- package/src/components/layout/Breadcrumbs.tsx +36 -0
- package/src/components/layout/Header.tsx +37 -0
- package/src/components/layout/Layout.tsx +25 -0
- package/src/components/layout/Sidebar.tsx +462 -0
- package/src/components/ui/Badge.tsx +14 -0
- package/src/components/ui/Button.tsx +41 -0
- package/src/components/ui/Dropdown.tsx +82 -0
- package/src/components/ui/Modal.tsx +135 -0
- package/src/components/ui/SlidePanel.tsx +73 -0
- package/src/components/ui/Spinner.tsx +24 -0
- package/src/components/ui/Toast.tsx +78 -0
- package/src/layouts/AdminLayout.astro +197 -0
- package/src/lib/config.ts +68 -0
- package/src/lib/dataStore.ts +111 -0
- package/src/middleware.ts +48 -0
- package/src/pages/[collection]/[id].astro +176 -0
- package/src/pages/[collection]/index.astro +180 -0
- package/src/pages/api/[collection]/[id].ts +258 -0
- package/src/pages/api/[collection]/index.ts +289 -0
- package/src/pages/api/auth/[id].ts +142 -0
- package/src/pages/api/auth/audit-logs.ts +80 -0
- package/src/pages/api/auth/login.ts +101 -0
- package/src/pages/api/auth/logout.ts +48 -0
- package/src/pages/api/auth/me.ts +36 -0
- package/src/pages/api/auth/users.ts +150 -0
- package/src/pages/audit/index.astro +110 -0
- package/src/pages/index.astro +225 -0
- package/src/pages/roles/index.astro +114 -0
- package/src/pages/users/[id].astro +174 -0
- package/src/pages/users/index.astro +142 -0
- package/src/pages/users/new.astro +91 -0
- package/src/styles/main.css +1449 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
declare module 'astro:content' {
|
|
2
|
+
export interface RenderResult {
|
|
3
|
+
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
|
|
4
|
+
headings: import('astro').MarkdownHeading[];
|
|
5
|
+
remarkPluginFrontmatter: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
interface Render {
|
|
8
|
+
'.md': Promise<RenderResult>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RenderedContent {
|
|
12
|
+
html: string;
|
|
13
|
+
metadata?: {
|
|
14
|
+
imagePaths: Array<string>;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
|
|
20
|
+
|
|
21
|
+
export type CollectionKey = keyof DataEntryMap;
|
|
22
|
+
export type CollectionEntry<C extends CollectionKey> = Flatten<DataEntryMap[C]>;
|
|
23
|
+
|
|
24
|
+
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
|
|
25
|
+
|
|
26
|
+
export type ReferenceDataEntry<
|
|
27
|
+
C extends CollectionKey,
|
|
28
|
+
E extends keyof DataEntryMap[C] = string,
|
|
29
|
+
> = {
|
|
30
|
+
collection: C;
|
|
31
|
+
id: E;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type ReferenceLiveEntry<C extends keyof LiveContentConfig['collections']> = {
|
|
35
|
+
collection: C;
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export function getCollection<C extends keyof DataEntryMap, E extends CollectionEntry<C>>(
|
|
40
|
+
collection: C,
|
|
41
|
+
filter?: (entry: CollectionEntry<C>) => entry is E,
|
|
42
|
+
): Promise<E[]>;
|
|
43
|
+
export function getCollection<C extends keyof DataEntryMap>(
|
|
44
|
+
collection: C,
|
|
45
|
+
filter?: (entry: CollectionEntry<C>) => unknown,
|
|
46
|
+
): Promise<CollectionEntry<C>[]>;
|
|
47
|
+
|
|
48
|
+
export function getLiveCollection<C extends keyof LiveContentConfig['collections']>(
|
|
49
|
+
collection: C,
|
|
50
|
+
filter?: LiveLoaderCollectionFilterType<C>,
|
|
51
|
+
): Promise<
|
|
52
|
+
import('astro').LiveDataCollectionResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>
|
|
53
|
+
>;
|
|
54
|
+
|
|
55
|
+
export function getEntry<
|
|
56
|
+
C extends keyof DataEntryMap,
|
|
57
|
+
E extends keyof DataEntryMap[C] | (string & {}),
|
|
58
|
+
>(
|
|
59
|
+
entry: ReferenceDataEntry<C, E>,
|
|
60
|
+
): E extends keyof DataEntryMap[C]
|
|
61
|
+
? Promise<DataEntryMap[C][E]>
|
|
62
|
+
: Promise<CollectionEntry<C> | undefined>;
|
|
63
|
+
export function getEntry<
|
|
64
|
+
C extends keyof DataEntryMap,
|
|
65
|
+
E extends keyof DataEntryMap[C] | (string & {}),
|
|
66
|
+
>(
|
|
67
|
+
collection: C,
|
|
68
|
+
id: E,
|
|
69
|
+
): E extends keyof DataEntryMap[C]
|
|
70
|
+
? string extends keyof DataEntryMap[C]
|
|
71
|
+
? Promise<DataEntryMap[C][E]> | undefined
|
|
72
|
+
: Promise<DataEntryMap[C][E]>
|
|
73
|
+
: Promise<CollectionEntry<C> | undefined>;
|
|
74
|
+
export function getLiveEntry<C extends keyof LiveContentConfig['collections']>(
|
|
75
|
+
collection: C,
|
|
76
|
+
filter: string | LiveLoaderEntryFilterType<C>,
|
|
77
|
+
): Promise<import('astro').LiveDataEntryResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>>;
|
|
78
|
+
|
|
79
|
+
/** Resolve an array of entry references from the same collection */
|
|
80
|
+
export function getEntries<C extends keyof DataEntryMap>(
|
|
81
|
+
entries: ReferenceDataEntry<C, keyof DataEntryMap[C]>[],
|
|
82
|
+
): Promise<CollectionEntry<C>[]>;
|
|
83
|
+
|
|
84
|
+
export function render<C extends keyof DataEntryMap>(
|
|
85
|
+
entry: DataEntryMap[C][string],
|
|
86
|
+
): Promise<RenderResult>;
|
|
87
|
+
|
|
88
|
+
export function reference<
|
|
89
|
+
C extends
|
|
90
|
+
| keyof DataEntryMap
|
|
91
|
+
// Allow generic `string` to avoid excessive type errors in the config
|
|
92
|
+
// if `dev` is not running to update as you edit.
|
|
93
|
+
// Invalid collection names will be caught at build time.
|
|
94
|
+
| (string & {}),
|
|
95
|
+
>(
|
|
96
|
+
collection: C,
|
|
97
|
+
): import('astro/zod').ZodPipe<
|
|
98
|
+
import('astro/zod').ZodString,
|
|
99
|
+
import('astro/zod').ZodTransform<
|
|
100
|
+
C extends keyof DataEntryMap
|
|
101
|
+
? {
|
|
102
|
+
collection: C;
|
|
103
|
+
id: string;
|
|
104
|
+
}
|
|
105
|
+
: never,
|
|
106
|
+
string
|
|
107
|
+
>
|
|
108
|
+
>;
|
|
109
|
+
|
|
110
|
+
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
|
|
111
|
+
type InferEntrySchema<C extends keyof DataEntryMap> = import('astro/zod').infer<
|
|
112
|
+
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
|
|
113
|
+
>;
|
|
114
|
+
type ExtractLoaderConfig<T> = T extends { loader: infer L } ? L : never;
|
|
115
|
+
type InferLoaderSchema<
|
|
116
|
+
C extends keyof DataEntryMap,
|
|
117
|
+
L = ExtractLoaderConfig<ContentConfig['collections'][C]>,
|
|
118
|
+
> = L extends { schema: import('astro/zod').ZodSchema }
|
|
119
|
+
? import('astro/zod').infer<L['schema']>
|
|
120
|
+
: any;
|
|
121
|
+
|
|
122
|
+
type DataEntryMap = {
|
|
123
|
+
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
type ExtractLoaderTypes<T> = T extends import('astro/loaders').LiveLoader<
|
|
127
|
+
infer TData,
|
|
128
|
+
infer TEntryFilter,
|
|
129
|
+
infer TCollectionFilter,
|
|
130
|
+
infer TError
|
|
131
|
+
>
|
|
132
|
+
? { data: TData; entryFilter: TEntryFilter; collectionFilter: TCollectionFilter; error: TError }
|
|
133
|
+
: { data: never; entryFilter: never; collectionFilter: never; error: never };
|
|
134
|
+
type ExtractEntryFilterType<T> = ExtractLoaderTypes<T>['entryFilter'];
|
|
135
|
+
type ExtractCollectionFilterType<T> = ExtractLoaderTypes<T>['collectionFilter'];
|
|
136
|
+
type ExtractErrorType<T> = ExtractLoaderTypes<T>['error'];
|
|
137
|
+
|
|
138
|
+
type LiveLoaderDataType<C extends keyof LiveContentConfig['collections']> =
|
|
139
|
+
LiveContentConfig['collections'][C]['schema'] extends undefined
|
|
140
|
+
? ExtractDataType<LiveContentConfig['collections'][C]['loader']>
|
|
141
|
+
: import('astro/zod').infer<
|
|
142
|
+
Exclude<LiveContentConfig['collections'][C]['schema'], undefined>
|
|
143
|
+
>;
|
|
144
|
+
type LiveLoaderEntryFilterType<C extends keyof LiveContentConfig['collections']> =
|
|
145
|
+
ExtractEntryFilterType<LiveContentConfig['collections'][C]['loader']>;
|
|
146
|
+
type LiveLoaderCollectionFilterType<C extends keyof LiveContentConfig['collections']> =
|
|
147
|
+
ExtractCollectionFilterType<LiveContentConfig['collections'][C]['loader']>;
|
|
148
|
+
type LiveLoaderErrorType<C extends keyof LiveContentConfig['collections']> = ExtractErrorType<
|
|
149
|
+
LiveContentConfig['collections'][C]['loader']
|
|
150
|
+
>;
|
|
151
|
+
|
|
152
|
+
export type ContentConfig = never;
|
|
153
|
+
export type LiveContentConfig = never;
|
|
154
|
+
}
|
package/astro.config.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineConfig } from 'astro/config';
|
|
2
|
+
import react from '@astrojs/react';
|
|
3
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
+
import node from '@astrojs/node';
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
integrations: [react()],
|
|
8
|
+
vite: {
|
|
9
|
+
plugins: [tailwindcss()],
|
|
10
|
+
ssr: {
|
|
11
|
+
external: ['@mapbox/node-pre-gyp', 'mock-aws-s3', 'aws-sdk', 'nock'],
|
|
12
|
+
},
|
|
13
|
+
optimizeDeps: {
|
|
14
|
+
exclude: ['@mapbox/node-pre-gyp'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
output: 'server',
|
|
18
|
+
adapter: node({
|
|
19
|
+
mode: 'standalone'
|
|
20
|
+
}),
|
|
21
|
+
server: {
|
|
22
|
+
port: 4555,
|
|
23
|
+
host: true,
|
|
24
|
+
},
|
|
25
|
+
build: {
|
|
26
|
+
inlineStylesheets: 'auto',
|
|
27
|
+
},
|
|
28
|
+
});
|