weifuwu 0.19.7 → 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.
@@ -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
@@ -12,3 +12,5 @@ export declare function compileHotComponent(path: string): Promise<{
12
12
  hash: string;
13
13
  code: string;
14
14
  }>;
15
+ /** Clean up esbuild's internal worker pool. Call when you're done compiling. */
16
+ export declare function closeCompile(): Promise<void>;
package/dist/env.d.ts CHANGED
@@ -1 +1,3 @@
1
+ /** Whether NODE_ENV is explicitly set to 'development' */
2
+ export declare function isDev(): boolean;
1
3
  export declare function loadEnv(path?: string): void;
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';
@@ -73,3 +73,7 @@ export { layout } from './layout.ts';
73
73
  export { notFound } from './not-found.ts';
74
74
  export { errorBoundary } from './error-boundary.ts';
75
75
  export { clearCompileCache } from './compile.ts';
76
+ export { ssrEntries } from './ssr-entries.ts';
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';