@sonicjs-cms/core 2.2.0 → 2.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/README.md +75 -1
- package/dist/app-Db0AfT5F.d.cts +100 -0
- package/dist/app-Db0AfT5F.d.ts +100 -0
- package/dist/chunk-23VPL6VI.cjs +1828 -0
- package/dist/chunk-23VPL6VI.cjs.map +1 -0
- package/dist/chunk-3MPQII4R.js +1826 -0
- package/dist/chunk-3MPQII4R.js.map +1 -0
- package/dist/{chunk-YTMFJLJZ.cjs → chunk-44LBCF3B.cjs} +5 -3
- package/dist/chunk-44LBCF3B.cjs.map +1 -0
- package/dist/{chunk-2DIWLDCA.cjs → chunk-5QJX2VMP.cjs} +541 -533
- package/dist/chunk-5QJX2VMP.cjs.map +1 -0
- package/dist/{chunk-UEYMFNBN.cjs → chunk-5UUYHAZT.cjs} +7 -36
- package/dist/chunk-5UUYHAZT.cjs.map +1 -0
- package/dist/{chunk-ZUK55KZB.js → chunk-6RJU7HL5.js} +5 -3
- package/dist/chunk-6RJU7HL5.js.map +1 -0
- package/dist/{chunk-K4Z3IHOK.js → chunk-7CXL5K7N.js} +5 -248
- package/dist/chunk-7CXL5K7N.js.map +1 -0
- package/dist/{chunk-WBX5YMTB.cjs → chunk-7KCDFDRI.cjs} +27 -15
- package/dist/chunk-7KCDFDRI.cjs.map +1 -0
- package/dist/{chunk-HKEK7UNV.js → chunk-CPXAVWCU.js} +3 -3
- package/dist/{chunk-HKEK7UNV.js.map → chunk-CPXAVWCU.js.map} +1 -1
- package/dist/{chunk-F5ESJXI2.cjs → chunk-DTLB6UIH.cjs} +3 -3
- package/dist/{chunk-F5ESJXI2.cjs.map → chunk-DTLB6UIH.cjs.map} +1 -1
- package/dist/{chunk-AINTFRTC.cjs → chunk-ES3BRZQJ.cjs} +252 -2
- package/dist/chunk-ES3BRZQJ.cjs.map +1 -0
- package/dist/{chunk-HV2I6API.cjs → chunk-NAYD76QF.cjs} +4 -251
- package/dist/chunk-NAYD76QF.cjs.map +1 -0
- package/dist/{chunk-L232U757.js → chunk-Q52ZQFMB.js} +249 -3
- package/dist/chunk-Q52ZQFMB.js.map +1 -0
- package/dist/{chunk-NMVOTNSL.js → chunk-RRKXFGIO.js} +28 -16
- package/dist/chunk-RRKXFGIO.js.map +1 -0
- package/dist/{chunk-OORGXYDA.js → chunk-WK5EUGBO.js} +5 -32
- package/dist/chunk-WK5EUGBO.js.map +1 -0
- package/dist/{chunk-R57VFNP3.js → chunk-ZPERJATF.js} +441 -433
- package/dist/chunk-ZPERJATF.js.map +1 -0
- package/dist/collection-config-FLlGtsh9.d.cts +107 -0
- package/dist/collection-config-FLlGtsh9.d.ts +107 -0
- package/dist/filter-bar.template-By4jeiw_.d.cts +140 -0
- package/dist/filter-bar.template-By4jeiw_.d.ts +140 -0
- package/dist/index.cjs +146 -165
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -0
- package/dist/index.d.ts +43 -5
- package/dist/index.js +19 -14
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +24 -33
- package/dist/middleware.d.cts +89 -0
- package/dist/middleware.d.ts +89 -2
- package/dist/middleware.js +3 -4
- package/dist/migrations-CCLAGJGP.js +4 -0
- package/dist/{migrations-IHERIQVD.js.map → migrations-CCLAGJGP.js.map} +1 -1
- package/dist/migrations-O6INOHRD.cjs +13 -0
- package/dist/{migrations-POFD5KNG.cjs.map → migrations-O6INOHRD.cjs.map} +1 -1
- package/dist/plugin-bootstrap-C0E3jdz-.d.cts +8339 -0
- package/dist/plugin-bootstrap-CDh0JHtW.d.ts +8339 -0
- package/dist/plugin-manifest-BCMx9CAq.d.cts +35 -0
- package/dist/plugin-manifest-BCMx9CAq.d.ts +35 -0
- package/dist/plugin-zvZpaiP5.d.cts +357 -0
- package/dist/plugin-zvZpaiP5.d.ts +357 -0
- package/dist/plugins.cjs +7 -7
- package/dist/plugins.d.cts +330 -0
- package/dist/plugins.d.ts +330 -2
- package/dist/plugins.js +1 -1
- package/dist/routes.cjs +27 -27
- package/dist/routes.d.cts +224 -0
- package/dist/routes.d.ts +224 -2
- package/dist/routes.js +7 -7
- package/dist/services.cjs +41 -41
- package/dist/services.d.cts +236 -0
- package/dist/services.d.ts +236 -2
- package/dist/services.js +4 -4
- package/dist/telemetry-BFBIjBxK.d.cts +36 -0
- package/dist/telemetry-BFBIjBxK.d.ts +36 -0
- package/dist/templates.d.cts +133 -0
- package/dist/templates.d.ts +133 -2
- package/dist/types.d.cts +7 -0
- package/dist/types.d.ts +7 -2
- package/dist/utils.cjs +27 -27
- package/dist/utils.d.cts +53 -0
- package/dist/utils.d.ts +53 -2
- package/dist/utils.js +2 -2
- package/dist/version-vktVAxhe.d.cts +195 -0
- package/dist/version-vktVAxhe.d.ts +195 -0
- package/migrations/001_initial_schema.sql +1 -1
- package/migrations/002_faq_plugin.sql +86 -0
- package/package.json +3 -1
- package/dist/chunk-2DIWLDCA.cjs.map +0 -1
- package/dist/chunk-AINTFRTC.cjs.map +0 -1
- package/dist/chunk-HV2I6API.cjs.map +0 -1
- package/dist/chunk-K4Z3IHOK.js.map +0 -1
- package/dist/chunk-L232U757.js.map +0 -1
- package/dist/chunk-NMVOTNSL.js.map +0 -1
- package/dist/chunk-OORGXYDA.js.map +0 -1
- package/dist/chunk-R57VFNP3.js.map +0 -1
- package/dist/chunk-T7IYBGGO.cjs +0 -746
- package/dist/chunk-T7IYBGGO.cjs.map +0 -1
- package/dist/chunk-UEYMFNBN.cjs.map +0 -1
- package/dist/chunk-WBX5YMTB.cjs.map +0 -1
- package/dist/chunk-YTMFJLJZ.cjs.map +0 -1
- package/dist/chunk-ZPMFT2JW.js +0 -744
- package/dist/chunk-ZPMFT2JW.js.map +0 -1
- package/dist/chunk-ZUK55KZB.js.map +0 -1
- package/dist/migrations-IHERIQVD.js +0 -4
- package/dist/migrations-POFD5KNG.cjs +0 -13
- /package/migrations/{021_add_otp_login.sql → 026_add_otp_login.sql} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Manifest Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for plugin manifest.json files
|
|
5
|
+
*/
|
|
6
|
+
interface PluginManifest {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
description: string;
|
|
11
|
+
author: string;
|
|
12
|
+
homepage?: string;
|
|
13
|
+
repository?: string;
|
|
14
|
+
license?: string;
|
|
15
|
+
category: string;
|
|
16
|
+
tags?: string[];
|
|
17
|
+
dependencies?: string[];
|
|
18
|
+
settings?: Record<string, any>;
|
|
19
|
+
hooks?: Record<string, string>;
|
|
20
|
+
routes?: Array<{
|
|
21
|
+
path: string;
|
|
22
|
+
method: string;
|
|
23
|
+
handler: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
}>;
|
|
26
|
+
permissions?: Record<string, string>;
|
|
27
|
+
adminMenu?: {
|
|
28
|
+
label: string;
|
|
29
|
+
icon: string;
|
|
30
|
+
path: string;
|
|
31
|
+
order: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type { PluginManifest as P };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Manifest Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for plugin manifest.json files
|
|
5
|
+
*/
|
|
6
|
+
interface PluginManifest {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
description: string;
|
|
11
|
+
author: string;
|
|
12
|
+
homepage?: string;
|
|
13
|
+
repository?: string;
|
|
14
|
+
license?: string;
|
|
15
|
+
category: string;
|
|
16
|
+
tags?: string[];
|
|
17
|
+
dependencies?: string[];
|
|
18
|
+
settings?: Record<string, any>;
|
|
19
|
+
hooks?: Record<string, string>;
|
|
20
|
+
routes?: Array<{
|
|
21
|
+
path: string;
|
|
22
|
+
method: string;
|
|
23
|
+
handler: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
}>;
|
|
26
|
+
permissions?: Record<string, string>;
|
|
27
|
+
adminMenu?: {
|
|
28
|
+
label: string;
|
|
29
|
+
icon: string;
|
|
30
|
+
path: string;
|
|
31
|
+
order: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type { PluginManifest as P };
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { Context, MiddlewareHandler, Hono } from 'hono';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { D1Database, KVNamespace, R2Bucket } from '@cloudflare/workers-types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SonicJS Plugin System Types
|
|
7
|
+
*
|
|
8
|
+
* Defines the core interfaces and types for the plugin system
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface Plugin {
|
|
12
|
+
/** Unique plugin identifier */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Plugin version (semantic versioning) */
|
|
15
|
+
version: string;
|
|
16
|
+
/** Human-readable description */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** Plugin author information */
|
|
19
|
+
author?: {
|
|
20
|
+
name: string;
|
|
21
|
+
email?: string;
|
|
22
|
+
url?: string;
|
|
23
|
+
};
|
|
24
|
+
/** Plugin dependencies (other plugins required) */
|
|
25
|
+
dependencies?: string[];
|
|
26
|
+
/** SonicJS version compatibility */
|
|
27
|
+
compatibility?: string;
|
|
28
|
+
/** Plugin license */
|
|
29
|
+
license?: string;
|
|
30
|
+
routes?: PluginRoutes[];
|
|
31
|
+
middleware?: PluginMiddleware[];
|
|
32
|
+
models?: PluginModel[];
|
|
33
|
+
services?: PluginService[];
|
|
34
|
+
adminPages?: PluginAdminPage[];
|
|
35
|
+
adminComponents?: PluginComponent[];
|
|
36
|
+
menuItems?: PluginMenuItem[];
|
|
37
|
+
hooks?: PluginHook[];
|
|
38
|
+
install?: (context: PluginContext) => Promise<void>;
|
|
39
|
+
uninstall?: (context: PluginContext) => Promise<void>;
|
|
40
|
+
activate?: (context: PluginContext) => Promise<void>;
|
|
41
|
+
deactivate?: (context: PluginContext) => Promise<void>;
|
|
42
|
+
configure?: (config: PluginConfig) => Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
interface PluginContext {
|
|
45
|
+
/** Database instance */
|
|
46
|
+
db: D1Database;
|
|
47
|
+
/** Key-value storage */
|
|
48
|
+
kv: KVNamespace;
|
|
49
|
+
/** R2 storage bucket */
|
|
50
|
+
r2?: R2Bucket;
|
|
51
|
+
/** Plugin configuration */
|
|
52
|
+
config: PluginConfig;
|
|
53
|
+
/** Core SonicJS services */
|
|
54
|
+
services: {
|
|
55
|
+
auth: AuthService;
|
|
56
|
+
content: ContentService;
|
|
57
|
+
media: MediaService;
|
|
58
|
+
};
|
|
59
|
+
/** Hook system for inter-plugin communication */
|
|
60
|
+
hooks: HookSystem | ScopedHookSystem;
|
|
61
|
+
/** Logging utilities */
|
|
62
|
+
logger: PluginLogger;
|
|
63
|
+
}
|
|
64
|
+
interface PluginConfig {
|
|
65
|
+
/** Plugin-specific configuration */
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
/** Whether plugin is enabled */
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
/** Plugin installation timestamp */
|
|
70
|
+
installedAt?: number;
|
|
71
|
+
/** Plugin last update timestamp */
|
|
72
|
+
updatedAt?: number;
|
|
73
|
+
}
|
|
74
|
+
interface PluginRoutes {
|
|
75
|
+
/** Route path prefix */
|
|
76
|
+
path: string;
|
|
77
|
+
/** Hono route handler */
|
|
78
|
+
handler: Hono;
|
|
79
|
+
/** Route description */
|
|
80
|
+
description?: string;
|
|
81
|
+
/** Whether route requires authentication */
|
|
82
|
+
requiresAuth?: boolean;
|
|
83
|
+
/** Required roles for access */
|
|
84
|
+
roles?: string[];
|
|
85
|
+
/** Route priority (for ordering) */
|
|
86
|
+
priority?: number;
|
|
87
|
+
}
|
|
88
|
+
interface PluginMiddleware {
|
|
89
|
+
/** Middleware name */
|
|
90
|
+
name: string;
|
|
91
|
+
/** Middleware handler function */
|
|
92
|
+
handler: MiddlewareHandler;
|
|
93
|
+
/** Middleware description */
|
|
94
|
+
description?: string;
|
|
95
|
+
/** Middleware priority (lower = earlier) */
|
|
96
|
+
priority?: number;
|
|
97
|
+
/** Routes to apply middleware to */
|
|
98
|
+
routes?: string[];
|
|
99
|
+
/** Whether to apply globally */
|
|
100
|
+
global?: boolean;
|
|
101
|
+
}
|
|
102
|
+
interface PluginModel {
|
|
103
|
+
/** Model name */
|
|
104
|
+
name: string;
|
|
105
|
+
/** Database table name */
|
|
106
|
+
tableName: string;
|
|
107
|
+
/** Zod schema for validation */
|
|
108
|
+
schema: z.ZodSchema;
|
|
109
|
+
/** Database migrations */
|
|
110
|
+
migrations: string[];
|
|
111
|
+
/** Model relationships */
|
|
112
|
+
relationships?: ModelRelationship[];
|
|
113
|
+
/** Whether model extends core content */
|
|
114
|
+
extendsContent?: boolean;
|
|
115
|
+
}
|
|
116
|
+
interface ModelRelationship {
|
|
117
|
+
type: 'oneToOne' | 'oneToMany' | 'manyToMany';
|
|
118
|
+
target: string;
|
|
119
|
+
foreignKey?: string;
|
|
120
|
+
joinTable?: string;
|
|
121
|
+
}
|
|
122
|
+
interface PluginService {
|
|
123
|
+
/** Service name */
|
|
124
|
+
name: string;
|
|
125
|
+
/** Service implementation */
|
|
126
|
+
implementation: any;
|
|
127
|
+
/** Service description */
|
|
128
|
+
description?: string;
|
|
129
|
+
/** Service dependencies */
|
|
130
|
+
dependencies?: string[];
|
|
131
|
+
/** Whether service is singleton */
|
|
132
|
+
singleton?: boolean;
|
|
133
|
+
}
|
|
134
|
+
interface PluginAdminPage {
|
|
135
|
+
/** Page path (relative to /admin) */
|
|
136
|
+
path: string;
|
|
137
|
+
/** Page title */
|
|
138
|
+
title: string;
|
|
139
|
+
/** Page component/template */
|
|
140
|
+
component: string;
|
|
141
|
+
/** Page description */
|
|
142
|
+
description?: string;
|
|
143
|
+
/** Required permissions */
|
|
144
|
+
permissions?: string[];
|
|
145
|
+
/** Menu item configuration */
|
|
146
|
+
menuItem?: PluginMenuItem;
|
|
147
|
+
/** Page icon */
|
|
148
|
+
icon?: string;
|
|
149
|
+
}
|
|
150
|
+
interface PluginComponent {
|
|
151
|
+
/** Component name */
|
|
152
|
+
name: string;
|
|
153
|
+
/** Component template function */
|
|
154
|
+
template: (props: any) => string;
|
|
155
|
+
/** Component description */
|
|
156
|
+
description?: string;
|
|
157
|
+
/** Component props schema */
|
|
158
|
+
propsSchema?: z.ZodSchema;
|
|
159
|
+
}
|
|
160
|
+
interface PluginMenuItem {
|
|
161
|
+
/** Menu item label */
|
|
162
|
+
label: string;
|
|
163
|
+
/** Menu item path */
|
|
164
|
+
path: string;
|
|
165
|
+
/** Menu item icon */
|
|
166
|
+
icon?: string;
|
|
167
|
+
/** Menu item order */
|
|
168
|
+
order?: number;
|
|
169
|
+
/** Parent menu item */
|
|
170
|
+
parent?: string;
|
|
171
|
+
/** Required permissions */
|
|
172
|
+
permissions?: string[];
|
|
173
|
+
/** Whether item is active */
|
|
174
|
+
active?: boolean;
|
|
175
|
+
}
|
|
176
|
+
interface PluginHook {
|
|
177
|
+
/** Hook name */
|
|
178
|
+
name: string;
|
|
179
|
+
/** Hook handler function */
|
|
180
|
+
handler: HookHandler;
|
|
181
|
+
/** Hook priority */
|
|
182
|
+
priority?: number;
|
|
183
|
+
/** Hook description */
|
|
184
|
+
description?: string;
|
|
185
|
+
}
|
|
186
|
+
type HookHandler = (data: any, context: HookContext) => Promise<any>;
|
|
187
|
+
interface HookContext {
|
|
188
|
+
/** Plugin that registered the hook */
|
|
189
|
+
plugin: string;
|
|
190
|
+
/** Hook execution context */
|
|
191
|
+
context: PluginContext;
|
|
192
|
+
/** Cancel hook execution */
|
|
193
|
+
cancel?: () => void;
|
|
194
|
+
}
|
|
195
|
+
interface HookSystem {
|
|
196
|
+
/** Register a hook handler */
|
|
197
|
+
register(hookName: string, handler: HookHandler, priority?: number): void;
|
|
198
|
+
/** Execute all handlers for a hook */
|
|
199
|
+
execute(hookName: string, data: any, context?: any): Promise<any>;
|
|
200
|
+
/** Remove a hook handler */
|
|
201
|
+
unregister(hookName: string, handler: HookHandler): void;
|
|
202
|
+
/** Get all registered hooks */
|
|
203
|
+
getHooks(hookName: string): PluginHook[];
|
|
204
|
+
/** Create a scoped hook system (optional) */
|
|
205
|
+
createScope?(pluginName: string): ScopedHookSystem;
|
|
206
|
+
}
|
|
207
|
+
interface ScopedHookSystem {
|
|
208
|
+
/** Register a hook handler */
|
|
209
|
+
register(hookName: string, handler: HookHandler, priority?: number): void;
|
|
210
|
+
/** Execute all handlers for a hook */
|
|
211
|
+
execute(hookName: string, data: any, context?: any): Promise<any>;
|
|
212
|
+
/** Remove a hook handler */
|
|
213
|
+
unregister(hookName: string, handler: HookHandler): void;
|
|
214
|
+
/** Remove all hooks for this scope */
|
|
215
|
+
unregisterAll(): void;
|
|
216
|
+
}
|
|
217
|
+
interface PluginRegistry {
|
|
218
|
+
/** Get plugin by name */
|
|
219
|
+
get(name: string): Plugin | undefined;
|
|
220
|
+
/** Get all registered plugins */
|
|
221
|
+
getAll(): Plugin[];
|
|
222
|
+
/** Get active plugins */
|
|
223
|
+
getActive(): Plugin[];
|
|
224
|
+
/** Register a plugin */
|
|
225
|
+
register(plugin: Plugin): Promise<void>;
|
|
226
|
+
/** Unregister a plugin */
|
|
227
|
+
unregister(name: string): Promise<void>;
|
|
228
|
+
/** Check if plugin is registered */
|
|
229
|
+
has(name: string): boolean;
|
|
230
|
+
/** Activate a plugin */
|
|
231
|
+
activate(name: string): Promise<void>;
|
|
232
|
+
/** Deactivate a plugin */
|
|
233
|
+
deactivate(name: string): Promise<void>;
|
|
234
|
+
/** Get plugin configuration */
|
|
235
|
+
getConfig(name: string): PluginConfig | undefined;
|
|
236
|
+
/** Set plugin configuration */
|
|
237
|
+
setConfig(name: string, config: PluginConfig): void;
|
|
238
|
+
/** Get plugin status */
|
|
239
|
+
getStatus(name: string): PluginStatus | undefined;
|
|
240
|
+
/** Get all plugin statuses */
|
|
241
|
+
getAllStatuses(): Map<string, PluginStatus>;
|
|
242
|
+
/** Resolve plugin load order based on dependencies */
|
|
243
|
+
resolveLoadOrder(): string[];
|
|
244
|
+
}
|
|
245
|
+
interface PluginManager {
|
|
246
|
+
/** Plugin registry */
|
|
247
|
+
registry: PluginRegistry;
|
|
248
|
+
/** Hook system */
|
|
249
|
+
hooks: HookSystem;
|
|
250
|
+
/** Initialize plugin system */
|
|
251
|
+
initialize(context: PluginContext): Promise<void>;
|
|
252
|
+
/** Load plugins from configuration */
|
|
253
|
+
loadPlugins(config: PluginConfig[]): Promise<void>;
|
|
254
|
+
/** Install a plugin */
|
|
255
|
+
install(plugin: Plugin, config?: PluginConfig): Promise<void>;
|
|
256
|
+
/** Uninstall a plugin */
|
|
257
|
+
uninstall(name: string): Promise<void>;
|
|
258
|
+
/** Get plugin status */
|
|
259
|
+
getStatus(name: string): PluginStatus;
|
|
260
|
+
}
|
|
261
|
+
interface PluginStatus {
|
|
262
|
+
name: string;
|
|
263
|
+
version: string;
|
|
264
|
+
active: boolean;
|
|
265
|
+
installed: boolean;
|
|
266
|
+
hasErrors: boolean;
|
|
267
|
+
errors?: string[];
|
|
268
|
+
lastError?: string;
|
|
269
|
+
}
|
|
270
|
+
interface AuthService {
|
|
271
|
+
/** Verify user permissions */
|
|
272
|
+
hasPermission(userId: string, permission: string): Promise<boolean>;
|
|
273
|
+
/** Get current user */
|
|
274
|
+
getCurrentUser(context: Context): Promise<any>;
|
|
275
|
+
/** Create authentication middleware */
|
|
276
|
+
createMiddleware(options?: any): MiddlewareHandler;
|
|
277
|
+
}
|
|
278
|
+
interface ContentService {
|
|
279
|
+
/** Get content by ID */
|
|
280
|
+
getById(id: string): Promise<any>;
|
|
281
|
+
/** Create new content */
|
|
282
|
+
create(data: any): Promise<any>;
|
|
283
|
+
/** Update content */
|
|
284
|
+
update(id: string, data: any): Promise<any>;
|
|
285
|
+
/** Delete content */
|
|
286
|
+
delete(id: string): Promise<void>;
|
|
287
|
+
/** Search content */
|
|
288
|
+
search(query: string, options?: any): Promise<any[]>;
|
|
289
|
+
}
|
|
290
|
+
interface MediaService {
|
|
291
|
+
/** Upload file */
|
|
292
|
+
upload(file: File, options?: any): Promise<any>;
|
|
293
|
+
/** Get media by ID */
|
|
294
|
+
getById(id: string): Promise<any>;
|
|
295
|
+
/** Delete media */
|
|
296
|
+
delete(id: string): Promise<void>;
|
|
297
|
+
/** Transform image */
|
|
298
|
+
transform(id: string, options: any): Promise<string>;
|
|
299
|
+
}
|
|
300
|
+
interface PluginLogger {
|
|
301
|
+
debug(message: string, data?: any): void;
|
|
302
|
+
info(message: string, data?: any): void;
|
|
303
|
+
warn(message: string, data?: any): void;
|
|
304
|
+
error(message: string, error?: Error, data?: any): void;
|
|
305
|
+
}
|
|
306
|
+
interface PluginBuilderOptions {
|
|
307
|
+
name: string;
|
|
308
|
+
version: string;
|
|
309
|
+
description?: string;
|
|
310
|
+
author?: Plugin['author'];
|
|
311
|
+
dependencies?: string[];
|
|
312
|
+
}
|
|
313
|
+
interface PluginValidator {
|
|
314
|
+
/** Validate plugin definition */
|
|
315
|
+
validate(plugin: Plugin): PluginValidationResult;
|
|
316
|
+
/** Validate plugin dependencies */
|
|
317
|
+
validateDependencies(plugin: Plugin, registry: PluginRegistry): PluginValidationResult;
|
|
318
|
+
/** Validate plugin compatibility */
|
|
319
|
+
validateCompatibility(plugin: Plugin, version: string): PluginValidationResult;
|
|
320
|
+
}
|
|
321
|
+
interface PluginValidationResult {
|
|
322
|
+
valid: boolean;
|
|
323
|
+
errors: string[];
|
|
324
|
+
warnings: string[];
|
|
325
|
+
}
|
|
326
|
+
declare const HOOKS: {
|
|
327
|
+
readonly APP_INIT: "app:init";
|
|
328
|
+
readonly APP_READY: "app:ready";
|
|
329
|
+
readonly APP_SHUTDOWN: "app:shutdown";
|
|
330
|
+
readonly REQUEST_START: "request:start";
|
|
331
|
+
readonly REQUEST_END: "request:end";
|
|
332
|
+
readonly REQUEST_ERROR: "request:error";
|
|
333
|
+
readonly AUTH_LOGIN: "auth:login";
|
|
334
|
+
readonly AUTH_LOGOUT: "auth:logout";
|
|
335
|
+
readonly AUTH_REGISTER: "auth:register";
|
|
336
|
+
readonly USER_LOGIN: "user:login";
|
|
337
|
+
readonly USER_LOGOUT: "user:logout";
|
|
338
|
+
readonly CONTENT_CREATE: "content:create";
|
|
339
|
+
readonly CONTENT_UPDATE: "content:update";
|
|
340
|
+
readonly CONTENT_DELETE: "content:delete";
|
|
341
|
+
readonly CONTENT_PUBLISH: "content:publish";
|
|
342
|
+
readonly CONTENT_SAVE: "content:save";
|
|
343
|
+
readonly MEDIA_UPLOAD: "media:upload";
|
|
344
|
+
readonly MEDIA_DELETE: "media:delete";
|
|
345
|
+
readonly MEDIA_TRANSFORM: "media:transform";
|
|
346
|
+
readonly PLUGIN_INSTALL: "plugin:install";
|
|
347
|
+
readonly PLUGIN_UNINSTALL: "plugin:uninstall";
|
|
348
|
+
readonly PLUGIN_ACTIVATE: "plugin:activate";
|
|
349
|
+
readonly PLUGIN_DEACTIVATE: "plugin:deactivate";
|
|
350
|
+
readonly ADMIN_MENU_RENDER: "admin:menu:render";
|
|
351
|
+
readonly ADMIN_PAGE_RENDER: "admin:page:render";
|
|
352
|
+
readonly DB_MIGRATE: "db:migrate";
|
|
353
|
+
readonly DB_SEED: "db:seed";
|
|
354
|
+
};
|
|
355
|
+
type HookName = typeof HOOKS[keyof typeof HOOKS];
|
|
356
|
+
|
|
357
|
+
export { type AuthService as A, type ContentService as C, type HookHandler as H, type ModelRelationship as M, type Plugin as P, type ScopedHookSystem as S, type PluginContext as a, type PluginConfig as b, type PluginRoutes as c, type PluginMiddleware as d, type PluginModel as e, type PluginService as f, type PluginAdminPage as g, type PluginComponent as h, type PluginMenuItem as i, type PluginHook as j, type HookContext as k, type HookSystem as l, type PluginRegistry as m, type PluginManager as n, type PluginStatus as o, type MediaService as p, type PluginLogger as q, type PluginBuilderOptions as r, type PluginValidator as s, type PluginValidationResult as t, type HookName as u, HOOKS as v };
|