-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaudit.plugin.ts
More file actions
44 lines (35 loc) · 1.35 KB
/
audit.plugin.ts
File metadata and controls
44 lines (35 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* ObjectQL
* Copyright (c) 2026-present ObjectStack Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// Import RuntimePlugin types from @objectql/core instead of @objectstack/runtime
// to avoid ESM/CJS compatibility issues
interface RuntimeContext {
engine: any; // ObjectStackKernel
}
interface RuntimePlugin {
name: string;
install?: (ctx: RuntimeContext) => void | Promise<void>;
onStart?: (ctx: RuntimeContext) => void | Promise<void>;
}
const AuditLogPlugin: RuntimePlugin = {
name: 'audit-log',
async install(ctx: RuntimeContext) {
console.log('[AuditLogPlugin] Installing...');
// Plugin installation logic here
},
async onStart(ctx: RuntimeContext) {
console.log('[AuditLogPlugin] Starting...');
// TODO: Register event handlers using the runtime context
// The RuntimeContext provides:
// - ctx.engine for accessing the kernel
// For now, we'll just log that the plugin is started
console.log('[AuditLogPlugin] Plugin started');
// Note: The new plugin system uses RuntimeContext instead of PluginContextData
// This will need to be enhanced when the full events API is available
}
};
export default AuditLogPlugin;