weifuwu 0.19.8 → 0.19.9
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/cli/template/.weifuwu/ssr/96f5704e.js +481 -0
- package/cli/template/.weifuwu/ssr/fae6ecbe.js +14 -0
- package/cli/template/ui/components/Greeting.tsx +1 -1
- package/cli.ts +3 -3
- package/dist/cli.js +3 -3
- package/dist/cms/admin.d.ts +3 -0
- package/dist/cms/api.d.ts +3 -0
- package/dist/cms/client.d.ts +2 -0
- package/dist/cms/content.d.ts +36 -0
- package/dist/cms/index.d.ts +2 -0
- package/dist/cms/media.d.ts +17 -0
- package/dist/cms/types.d.ts +93 -0
- package/dist/compile.d.ts +2 -0
- package/dist/env.d.ts +2 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1271 -36
- package/package.json +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Router } from '../router.ts';
|
|
2
|
+
import type { PostgresClient } from '../postgres/types.ts';
|
|
3
|
+
export type CmsFieldType = 'string' | 'richtext' | 'integer' | 'float' | 'boolean' | 'datetime' | 'json' | 'slug' | 'enum' | 'image' | 'gallery' | 'relation';
|
|
4
|
+
export interface CmsFieldDef {
|
|
5
|
+
name: string;
|
|
6
|
+
type: CmsFieldType;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
unique?: boolean;
|
|
9
|
+
index?: boolean;
|
|
10
|
+
default?: unknown;
|
|
11
|
+
options?: string[];
|
|
12
|
+
relation?: {
|
|
13
|
+
contentType: string;
|
|
14
|
+
field?: string;
|
|
15
|
+
};
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
helpText?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ContentTypeConfig {
|
|
20
|
+
workflow?: boolean;
|
|
21
|
+
i18n?: boolean;
|
|
22
|
+
slugField?: string;
|
|
23
|
+
titleField?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ContentType {
|
|
26
|
+
id: number;
|
|
27
|
+
slug: string;
|
|
28
|
+
label: string;
|
|
29
|
+
description: string;
|
|
30
|
+
fields: CmsFieldDef[];
|
|
31
|
+
config: ContentTypeConfig;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
}
|
|
35
|
+
export type EntryStatus = 'draft' | 'published' | 'archived';
|
|
36
|
+
export interface ContentEntry {
|
|
37
|
+
id: number;
|
|
38
|
+
contentType: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
title: string;
|
|
41
|
+
status: EntryStatus;
|
|
42
|
+
data: Record<string, unknown>;
|
|
43
|
+
locale: string | null;
|
|
44
|
+
createdBy: number | null;
|
|
45
|
+
updatedBy: number | null;
|
|
46
|
+
publishedAt: string | null;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ContentVersion {
|
|
51
|
+
id: number;
|
|
52
|
+
entryId: number;
|
|
53
|
+
version: number;
|
|
54
|
+
data: Record<string, unknown>;
|
|
55
|
+
createdBy: number | null;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
}
|
|
58
|
+
export interface CmsMedia {
|
|
59
|
+
id: number;
|
|
60
|
+
filename: string;
|
|
61
|
+
originalName: string;
|
|
62
|
+
mimetype: string;
|
|
63
|
+
size: number;
|
|
64
|
+
width: number | null;
|
|
65
|
+
height: number | null;
|
|
66
|
+
alt: string;
|
|
67
|
+
createdBy: number | null;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
}
|
|
70
|
+
export interface CmsWebhook {
|
|
71
|
+
id: number;
|
|
72
|
+
name: string;
|
|
73
|
+
url: string;
|
|
74
|
+
events: string[];
|
|
75
|
+
secret: string;
|
|
76
|
+
active: boolean;
|
|
77
|
+
createdAt: string;
|
|
78
|
+
}
|
|
79
|
+
export interface CmsRedirect {
|
|
80
|
+
id: number;
|
|
81
|
+
fromPath: string;
|
|
82
|
+
toPath: string;
|
|
83
|
+
type: number;
|
|
84
|
+
createdAt: string;
|
|
85
|
+
}
|
|
86
|
+
export interface CmsOptions {
|
|
87
|
+
pg: PostgresClient;
|
|
88
|
+
mediaDir?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface CmsModule extends Router {
|
|
91
|
+
migrate: () => Promise<void>;
|
|
92
|
+
close: () => Promise<void>;
|
|
93
|
+
}
|
package/dist/compile.d.ts
CHANGED
package/dist/env.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { Context, Handler, Middleware, ErrorHandler } from './types.ts';
|
|
2
|
-
export { loadEnv } from './env.ts';
|
|
2
|
+
export { loadEnv, isDev } from './env.ts';
|
|
3
3
|
export { serve, createTestServer } from './serve.ts';
|
|
4
4
|
export type { ServeOptions, Server } from './serve.ts';
|
|
5
5
|
export { Router } from './router.ts';
|
|
@@ -75,3 +75,5 @@ export { errorBoundary } from './error-boundary.ts';
|
|
|
75
75
|
export { clearCompileCache } from './compile.ts';
|
|
76
76
|
export { ssrEntries } from './ssr-entries.ts';
|
|
77
77
|
export type { SsrEntry } from './ssr-entries.ts';
|
|
78
|
+
export { cms } from './cms/index.ts';
|
|
79
|
+
export type { CmsOptions, CmsModule, ContentType, ContentEntry, ContentVersion, CmsMedia, CmsFieldDef, CmsFieldType, EntryStatus, ContentTypeConfig, } from './cms/types.ts';
|