conduithub 1.0.1 → 1.1.0
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/dist/core/conduit-hub/index.d.cts +1 -1
- package/dist/core/conduit-hub/index.d.mts +1 -1
- package/dist/core/conduit-hub/index.d.ts +1 -1
- package/dist/core/config-manager/index.d.cts +1 -1
- package/dist/core/config-manager/index.d.mts +1 -1
- package/dist/core/config-manager/index.d.ts +1 -1
- package/dist/core/index.cjs +4 -2
- package/dist/core/index.d.cts +8 -184
- package/dist/core/index.d.mts +8 -184
- package/dist/core/index.d.ts +8 -184
- package/dist/core/index.mjs +3 -2
- package/dist/core/plugin/index.d.cts +1 -1
- package/dist/core/plugin/index.d.mts +1 -1
- package/dist/core/plugin/index.d.ts +1 -1
- package/dist/index.cjs +185 -14
- package/dist/index.d.cts +67 -3
- package/dist/index.d.mts +67 -3
- package/dist/index.d.ts +67 -3
- package/dist/index.mjs +159 -6
- package/dist/plugins/index.cjs +32 -4
- package/dist/plugins/index.d.cts +4 -2
- package/dist/plugins/index.d.mts +4 -2
- package/dist/plugins/index.d.ts +4 -2
- package/dist/plugins/index.mjs +21 -3
- package/dist/plugins/kafka/index.cjs +34 -0
- package/dist/plugins/kafka/index.d.cts +250 -0
- package/dist/plugins/kafka/index.d.mts +250 -0
- package/dist/plugins/kafka/index.d.ts +250 -0
- package/dist/plugins/kafka/index.mjs +23 -0
- package/dist/plugins/redis/index.cjs +26 -5
- package/dist/plugins/redis/index.d.cts +59 -17
- package/dist/plugins/redis/index.d.mts +59 -17
- package/dist/plugins/redis/index.d.ts +59 -17
- package/dist/plugins/redis/index.mjs +21 -4
- package/dist/shared/conduithub.0FKJet8c.cjs +1130 -0
- package/dist/shared/conduithub.B16qn6pY.mjs +174 -0
- package/dist/shared/conduithub.BW-S7Bp_.d.cts +181 -0
- package/dist/shared/conduithub.BdX_BLza.mjs +1124 -0
- package/dist/shared/{conduithub.-bZD30_I.mjs → conduithub.BzuAKyjY.mjs} +238 -36
- package/dist/shared/conduithub.DSAmRivG.d.ts +181 -0
- package/dist/shared/{conduithub.cvEjE62V.cjs → conduithub.DhMIxMx2.cjs} +242 -36
- package/dist/shared/conduithub.GrtzQn_7.d.mts +181 -0
- package/dist/shared/conduithub.jH-df3Zd.cjs +181 -0
- package/package.json +22 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createLogger } from '../../shared/conduithub.B7aryjPG.cjs';
|
|
2
|
-
import { PluginManager, ConfigManager, BasePlugin, PluginConfig, PluginStatus } from '
|
|
2
|
+
import { e as PluginManager, C as ConfigManager, B as BasePlugin, P as PluginConfig, d as PluginStatus } from '../../shared/conduithub.BW-S7Bp_.cjs';
|
|
3
3
|
import { E as EventBus } from '../../shared/conduithub.BZQmkQy7.cjs';
|
|
4
4
|
import { Hook } from '../hook/index.cjs';
|
|
5
5
|
import { ServiceContainer } from '../service-container/index.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createLogger } from '../../shared/conduithub.B7aryjPG.mjs';
|
|
2
|
-
import { PluginManager, ConfigManager, BasePlugin, PluginConfig, PluginStatus } from '
|
|
2
|
+
import { e as PluginManager, C as ConfigManager, B as BasePlugin, P as PluginConfig, d as PluginStatus } from '../../shared/conduithub.GrtzQn_7.mjs';
|
|
3
3
|
import { E as EventBus } from '../../shared/conduithub.BzLwccre.mjs';
|
|
4
4
|
import { Hook } from '../hook/index.mjs';
|
|
5
5
|
import { ServiceContainer } from '../service-container/index.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createLogger } from '../../shared/conduithub.B7aryjPG.js';
|
|
2
|
-
import { PluginManager, ConfigManager, BasePlugin, PluginConfig, PluginStatus } from '
|
|
2
|
+
import { e as PluginManager, C as ConfigManager, B as BasePlugin, P as PluginConfig, d as PluginStatus } from '../../shared/conduithub.DSAmRivG.js';
|
|
3
3
|
import { E as EventBus } from '../../shared/conduithub.DQOWQ-Bx.js';
|
|
4
4
|
import { Hook } from '../hook/index.js';
|
|
5
5
|
import { ServiceContainer } from '../service-container/index.js';
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const core_conduitHub_index = require('./conduit-hub/index.cjs');
|
|
3
4
|
const core_configManager_index = require('./config-manager/index.cjs');
|
|
4
5
|
const core_eventBus_index = require('./event-bus/index.cjs');
|
|
5
6
|
const core_hook_index = require('./hook/index.cjs');
|
|
@@ -7,17 +8,18 @@ const core_plugin_index = require('./plugin/index.cjs');
|
|
|
7
8
|
const core_serviceContainer_index = require('./service-container/index.cjs');
|
|
8
9
|
const core_stateManager_index = require('./state-manager/index.cjs');
|
|
9
10
|
const manager = require('../shared/conduithub.DsOOeNwU.cjs');
|
|
10
|
-
require('../shared/conduithub.CmZo_Vuc.cjs');
|
|
11
|
-
require('../shared/conduithub.DQO1dRnn.cjs');
|
|
12
11
|
require('../shared/conduithub.BNQsddJO.cjs');
|
|
13
12
|
require('process');
|
|
14
13
|
require('readline');
|
|
15
14
|
require('uuid');
|
|
15
|
+
require('../shared/conduithub.CmZo_Vuc.cjs');
|
|
16
|
+
require('../shared/conduithub.DQO1dRnn.cjs');
|
|
16
17
|
require('../error/index.cjs');
|
|
17
18
|
require('../shared/conduithub.Bq_7Xj0J.cjs');
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
22
|
+
exports.ConduitHub = core_conduitHub_index.ConduitHub;
|
|
21
23
|
exports.ConfigManager = core_configManager_index.ConfigManager;
|
|
22
24
|
exports.EventBus = core_eventBus_index.EventBus;
|
|
23
25
|
exports.Hook = core_hook_index.Hook;
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,184 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
export { StateChangeHandler } from './state-manager/index.cjs';
|
|
10
|
-
|
|
11
|
-
interface PluginStatus {
|
|
12
|
-
name: string;
|
|
13
|
-
version: string;
|
|
14
|
-
status: "registered" | "initialized" | "running" | "stopped" | "destroyed" | "error";
|
|
15
|
-
config: PluginConfig;
|
|
16
|
-
error?: string;
|
|
17
|
-
lastActivity: number;
|
|
18
|
-
}
|
|
19
|
-
declare class PluginManager {
|
|
20
|
-
private eventBus;
|
|
21
|
-
private logger;
|
|
22
|
-
private serviceContainer;
|
|
23
|
-
private stateManager;
|
|
24
|
-
private hookSystem;
|
|
25
|
-
private configManager;
|
|
26
|
-
private plugins;
|
|
27
|
-
private pluginStatuses;
|
|
28
|
-
private pluginConfigs;
|
|
29
|
-
constructor(eventBus: EventBus<Record<string, unknown>>, logger: Logger, serviceContainer: ServiceContainer, stateManager: StateManager, hookSystem: Hook<Record<string, {
|
|
30
|
-
input: unknown;
|
|
31
|
-
output: unknown;
|
|
32
|
-
}>>, configManager: ConfigManager);
|
|
33
|
-
private log;
|
|
34
|
-
registerPlugin(plugin: BasePlugin, config?: PluginConfig): Promise<void>;
|
|
35
|
-
unregisterPlugin(pluginName: string): Promise<void>;
|
|
36
|
-
initializePlugin(pluginName: string): Promise<void>;
|
|
37
|
-
startPlugin(pluginName: string): Promise<void>;
|
|
38
|
-
stopPlugin(pluginName: string): Promise<void>;
|
|
39
|
-
shutdownAll(): Promise<void>;
|
|
40
|
-
isPluginRegistered(pluginName: string): boolean;
|
|
41
|
-
isPluginRunning(pluginName: string): boolean;
|
|
42
|
-
getPluginStatus(pluginName: string): PluginStatus | undefined;
|
|
43
|
-
listPlugins(): string[];
|
|
44
|
-
getAllPluginStatuses(): PluginStatus[];
|
|
45
|
-
getPlugin(pluginName: string): BasePlugin | undefined;
|
|
46
|
-
getPluginConfig(pluginName: string): PluginConfig | undefined;
|
|
47
|
-
updatePluginConfig(pluginName: string, config: Partial<PluginConfig>): Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
interface PluginConfig {
|
|
51
|
-
name: string;
|
|
52
|
-
version: string;
|
|
53
|
-
enabled: boolean;
|
|
54
|
-
dependencies?: string[];
|
|
55
|
-
config?: Record<string, unknown>;
|
|
56
|
-
}
|
|
57
|
-
interface PluginContext<EM extends Record<string, unknown> = Record<string, unknown>, HM extends Record<string, {
|
|
58
|
-
input: unknown;
|
|
59
|
-
output: unknown;
|
|
60
|
-
}> = Record<string, {
|
|
61
|
-
input: unknown;
|
|
62
|
-
output: unknown;
|
|
63
|
-
}>> {
|
|
64
|
-
eventBus: EventBus<EM>;
|
|
65
|
-
logger: Logger;
|
|
66
|
-
config: PluginConfig;
|
|
67
|
-
serviceContainer: ServiceContainer;
|
|
68
|
-
hookSystem: Hook<HM>;
|
|
69
|
-
stateManager: StateManager;
|
|
70
|
-
}
|
|
71
|
-
interface PluginMetadata {
|
|
72
|
-
name: string;
|
|
73
|
-
version: string;
|
|
74
|
-
description?: string;
|
|
75
|
-
author?: string;
|
|
76
|
-
dependencies?: string[];
|
|
77
|
-
hooks: string[];
|
|
78
|
-
events: string[];
|
|
79
|
-
}
|
|
80
|
-
type PluginLifecycle = "beforeInit" | "afterInit" | "beforeStart" | "afterStart" | "beforeStop" | "afterStop" | "beforeDestroy" | "afterDestroy";
|
|
81
|
-
declare abstract class BasePlugin<T extends Record<string, unknown> = Record<string, unknown>, EM extends Record<string, unknown> = Record<string, unknown>, HM extends Record<string, {
|
|
82
|
-
input: unknown;
|
|
83
|
-
output: unknown;
|
|
84
|
-
}> = Record<string, {
|
|
85
|
-
input: unknown;
|
|
86
|
-
output: unknown;
|
|
87
|
-
}>> {
|
|
88
|
-
protected config: PluginConfig & {
|
|
89
|
-
config: T;
|
|
90
|
-
};
|
|
91
|
-
protected context: PluginContext<EM, HM>;
|
|
92
|
-
protected metadata: PluginMetadata;
|
|
93
|
-
protected isInitialized: boolean;
|
|
94
|
-
protected isRunning: boolean;
|
|
95
|
-
private managedEventHandlers;
|
|
96
|
-
private managedHookHandlers;
|
|
97
|
-
private lock;
|
|
98
|
-
constructor(config: PluginConfig & {
|
|
99
|
-
config: T;
|
|
100
|
-
});
|
|
101
|
-
abstract getMetadata(): PluginMetadata;
|
|
102
|
-
initialize(context: PluginContext<EM, HM>): Promise<void>;
|
|
103
|
-
start(): Promise<void>;
|
|
104
|
-
stop(): Promise<void>;
|
|
105
|
-
destroy(): Promise<void>;
|
|
106
|
-
protected abstract onInitialize(): Promise<void>;
|
|
107
|
-
protected abstract onStart(): Promise<void>;
|
|
108
|
-
protected abstract onStop(): Promise<void>;
|
|
109
|
-
protected abstract onDestroy(): Promise<void>;
|
|
110
|
-
private executeLifecycleHook;
|
|
111
|
-
getConfig(): PluginConfig & {
|
|
112
|
-
config: T;
|
|
113
|
-
};
|
|
114
|
-
getContext(): PluginContext<EM, HM>;
|
|
115
|
-
isPluginInitialized(): boolean;
|
|
116
|
-
isPluginRunning(): boolean;
|
|
117
|
-
protected emit<K extends keyof EM>(event: K, data: EM[K]): Promise<void>;
|
|
118
|
-
protected on<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
119
|
-
protected once<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
120
|
-
protected onManaged<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
121
|
-
protected onceManaged<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
122
|
-
protected off<K extends keyof EM>(event: K, handlerId: string): void;
|
|
123
|
-
protected executeHook<K extends keyof HM>(hook: K, input: HM[K]["input"]): Promise<HM[K]["output"]>;
|
|
124
|
-
protected executeHookSeries<K extends keyof HM>(hook: K, input: HM[K]["input"]): Promise<HookResult<HM[K]["output"]>[]>;
|
|
125
|
-
protected executeHookSeriesWithContext<K extends keyof HM>(hook: K, input: HM[K]["input"], context: Record<string, unknown>): Promise<HookResult<HM[K]["output"]>[]>;
|
|
126
|
-
protected registerHook<K extends keyof HM>(hook: K, handler: (data: HM[K]["input"], context?: Record<string, unknown>) => HM[K]["output"] | Promise<HM[K]["output"]> | HookResult<HM[K]["output"]> | Promise<HookResult<HM[K]["output"]>>, priority?: number, customId?: string): Promise<string>;
|
|
127
|
-
protected registerHookManaged<K extends keyof HM>(hook: K, handler: (data: HM[K]["input"], context?: Record<string, unknown>) => HM[K]["output"] | Promise<HM[K]["output"]> | HookResult<HM[K]["output"]> | Promise<HookResult<HM[K]["output"]>>, priority?: number, customId?: string): Promise<string>;
|
|
128
|
-
protected unregisterHook<K extends keyof HM>(hook: K, handlerId: string): Promise<boolean>;
|
|
129
|
-
protected getStatus(): {
|
|
130
|
-
initialized: boolean;
|
|
131
|
-
running: boolean;
|
|
132
|
-
};
|
|
133
|
-
protected getName(): string;
|
|
134
|
-
protected getVersion(): string;
|
|
135
|
-
protected isEnabled(): boolean;
|
|
136
|
-
protected getState(key: string): unknown;
|
|
137
|
-
protected setState(key: string, value: unknown): void;
|
|
138
|
-
protected deleteState(key: string): void;
|
|
139
|
-
protected get logger(): Logger;
|
|
140
|
-
updateConfig(update: Partial<PluginConfig & {
|
|
141
|
-
config: T;
|
|
142
|
-
}>): void;
|
|
143
|
-
private cleanupManagedHandlers;
|
|
144
|
-
private cleanupManagedHooks;
|
|
145
|
-
private withLock;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
declare class ConfigManager {
|
|
149
|
-
private config;
|
|
150
|
-
private pluginConfigs;
|
|
151
|
-
private isInitialized;
|
|
152
|
-
initialize(config: Record<string, unknown>): Promise<void>;
|
|
153
|
-
shutdown(): Promise<void>;
|
|
154
|
-
get<T>(key: string, defaultValue?: T): T | undefined;
|
|
155
|
-
set<T>(key: string, value: T): void;
|
|
156
|
-
has(key: string): boolean;
|
|
157
|
-
delete(key: string): boolean;
|
|
158
|
-
loadConfig(config: Record<string, unknown>): void;
|
|
159
|
-
clearConfig(): void;
|
|
160
|
-
getPluginConfig(pluginName: string): PluginConfig | undefined;
|
|
161
|
-
setPluginConfig(pluginName: string, config: PluginConfig): void;
|
|
162
|
-
updatePluginConfig(pluginName: string, updates: Partial<PluginConfig>): void;
|
|
163
|
-
hasPluginConfig(pluginName: string): boolean;
|
|
164
|
-
deletePluginConfig(pluginName: string): boolean;
|
|
165
|
-
getAllPluginConfigs(): Record<string, PluginConfig>;
|
|
166
|
-
loadPluginConfigs(configs: Record<string, PluginConfig>): void;
|
|
167
|
-
validateConfig(schema: z.ZodTypeAny, config: unknown): {
|
|
168
|
-
valid: boolean;
|
|
169
|
-
errors: string[];
|
|
170
|
-
};
|
|
171
|
-
exportConfig(format?: "json"): string;
|
|
172
|
-
importConfig(configJson: string): void;
|
|
173
|
-
getPluginConfigNames(): string[];
|
|
174
|
-
getStats(): {
|
|
175
|
-
totalConfigKeys: number;
|
|
176
|
-
totalPluginConfigs: number;
|
|
177
|
-
configKeys: string[];
|
|
178
|
-
pluginConfigNames: string[];
|
|
179
|
-
};
|
|
180
|
-
watchConfig(key: string, callback: (value: unknown) => void): () => void;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export { BasePlugin, ConfigManager, EventBus, Hook, HookResult, PluginManager, ServiceContainer, StateManager };
|
|
184
|
-
export type { PluginConfig, PluginContext, PluginLifecycle, PluginMetadata, PluginStatus };
|
|
1
|
+
export { ConduitHub } from './conduit-hub/index.cjs';
|
|
2
|
+
export { B as BasePlugin, C as ConfigManager, P as PluginConfig, a as PluginContext, c as PluginLifecycle, e as PluginManager, b as PluginMetadata, d as PluginStatus } from '../shared/conduithub.BW-S7Bp_.cjs';
|
|
3
|
+
export { E as EventBus } from '../shared/conduithub.BZQmkQy7.cjs';
|
|
4
|
+
export { Hook, HookHandler, HookResult } from './hook/index.cjs';
|
|
5
|
+
export { ServiceContainer, ServiceDescriptor } from './service-container/index.cjs';
|
|
6
|
+
export { StateChangeHandler, StateManager } from './state-manager/index.cjs';
|
|
7
|
+
import '../shared/conduithub.B7aryjPG.cjs';
|
|
8
|
+
import 'zod';
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,184 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
export { StateChangeHandler } from './state-manager/index.mjs';
|
|
10
|
-
|
|
11
|
-
interface PluginStatus {
|
|
12
|
-
name: string;
|
|
13
|
-
version: string;
|
|
14
|
-
status: "registered" | "initialized" | "running" | "stopped" | "destroyed" | "error";
|
|
15
|
-
config: PluginConfig;
|
|
16
|
-
error?: string;
|
|
17
|
-
lastActivity: number;
|
|
18
|
-
}
|
|
19
|
-
declare class PluginManager {
|
|
20
|
-
private eventBus;
|
|
21
|
-
private logger;
|
|
22
|
-
private serviceContainer;
|
|
23
|
-
private stateManager;
|
|
24
|
-
private hookSystem;
|
|
25
|
-
private configManager;
|
|
26
|
-
private plugins;
|
|
27
|
-
private pluginStatuses;
|
|
28
|
-
private pluginConfigs;
|
|
29
|
-
constructor(eventBus: EventBus<Record<string, unknown>>, logger: Logger, serviceContainer: ServiceContainer, stateManager: StateManager, hookSystem: Hook<Record<string, {
|
|
30
|
-
input: unknown;
|
|
31
|
-
output: unknown;
|
|
32
|
-
}>>, configManager: ConfigManager);
|
|
33
|
-
private log;
|
|
34
|
-
registerPlugin(plugin: BasePlugin, config?: PluginConfig): Promise<void>;
|
|
35
|
-
unregisterPlugin(pluginName: string): Promise<void>;
|
|
36
|
-
initializePlugin(pluginName: string): Promise<void>;
|
|
37
|
-
startPlugin(pluginName: string): Promise<void>;
|
|
38
|
-
stopPlugin(pluginName: string): Promise<void>;
|
|
39
|
-
shutdownAll(): Promise<void>;
|
|
40
|
-
isPluginRegistered(pluginName: string): boolean;
|
|
41
|
-
isPluginRunning(pluginName: string): boolean;
|
|
42
|
-
getPluginStatus(pluginName: string): PluginStatus | undefined;
|
|
43
|
-
listPlugins(): string[];
|
|
44
|
-
getAllPluginStatuses(): PluginStatus[];
|
|
45
|
-
getPlugin(pluginName: string): BasePlugin | undefined;
|
|
46
|
-
getPluginConfig(pluginName: string): PluginConfig | undefined;
|
|
47
|
-
updatePluginConfig(pluginName: string, config: Partial<PluginConfig>): Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
interface PluginConfig {
|
|
51
|
-
name: string;
|
|
52
|
-
version: string;
|
|
53
|
-
enabled: boolean;
|
|
54
|
-
dependencies?: string[];
|
|
55
|
-
config?: Record<string, unknown>;
|
|
56
|
-
}
|
|
57
|
-
interface PluginContext<EM extends Record<string, unknown> = Record<string, unknown>, HM extends Record<string, {
|
|
58
|
-
input: unknown;
|
|
59
|
-
output: unknown;
|
|
60
|
-
}> = Record<string, {
|
|
61
|
-
input: unknown;
|
|
62
|
-
output: unknown;
|
|
63
|
-
}>> {
|
|
64
|
-
eventBus: EventBus<EM>;
|
|
65
|
-
logger: Logger;
|
|
66
|
-
config: PluginConfig;
|
|
67
|
-
serviceContainer: ServiceContainer;
|
|
68
|
-
hookSystem: Hook<HM>;
|
|
69
|
-
stateManager: StateManager;
|
|
70
|
-
}
|
|
71
|
-
interface PluginMetadata {
|
|
72
|
-
name: string;
|
|
73
|
-
version: string;
|
|
74
|
-
description?: string;
|
|
75
|
-
author?: string;
|
|
76
|
-
dependencies?: string[];
|
|
77
|
-
hooks: string[];
|
|
78
|
-
events: string[];
|
|
79
|
-
}
|
|
80
|
-
type PluginLifecycle = "beforeInit" | "afterInit" | "beforeStart" | "afterStart" | "beforeStop" | "afterStop" | "beforeDestroy" | "afterDestroy";
|
|
81
|
-
declare abstract class BasePlugin<T extends Record<string, unknown> = Record<string, unknown>, EM extends Record<string, unknown> = Record<string, unknown>, HM extends Record<string, {
|
|
82
|
-
input: unknown;
|
|
83
|
-
output: unknown;
|
|
84
|
-
}> = Record<string, {
|
|
85
|
-
input: unknown;
|
|
86
|
-
output: unknown;
|
|
87
|
-
}>> {
|
|
88
|
-
protected config: PluginConfig & {
|
|
89
|
-
config: T;
|
|
90
|
-
};
|
|
91
|
-
protected context: PluginContext<EM, HM>;
|
|
92
|
-
protected metadata: PluginMetadata;
|
|
93
|
-
protected isInitialized: boolean;
|
|
94
|
-
protected isRunning: boolean;
|
|
95
|
-
private managedEventHandlers;
|
|
96
|
-
private managedHookHandlers;
|
|
97
|
-
private lock;
|
|
98
|
-
constructor(config: PluginConfig & {
|
|
99
|
-
config: T;
|
|
100
|
-
});
|
|
101
|
-
abstract getMetadata(): PluginMetadata;
|
|
102
|
-
initialize(context: PluginContext<EM, HM>): Promise<void>;
|
|
103
|
-
start(): Promise<void>;
|
|
104
|
-
stop(): Promise<void>;
|
|
105
|
-
destroy(): Promise<void>;
|
|
106
|
-
protected abstract onInitialize(): Promise<void>;
|
|
107
|
-
protected abstract onStart(): Promise<void>;
|
|
108
|
-
protected abstract onStop(): Promise<void>;
|
|
109
|
-
protected abstract onDestroy(): Promise<void>;
|
|
110
|
-
private executeLifecycleHook;
|
|
111
|
-
getConfig(): PluginConfig & {
|
|
112
|
-
config: T;
|
|
113
|
-
};
|
|
114
|
-
getContext(): PluginContext<EM, HM>;
|
|
115
|
-
isPluginInitialized(): boolean;
|
|
116
|
-
isPluginRunning(): boolean;
|
|
117
|
-
protected emit<K extends keyof EM>(event: K, data: EM[K]): Promise<void>;
|
|
118
|
-
protected on<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
119
|
-
protected once<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
120
|
-
protected onManaged<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
121
|
-
protected onceManaged<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
122
|
-
protected off<K extends keyof EM>(event: K, handlerId: string): void;
|
|
123
|
-
protected executeHook<K extends keyof HM>(hook: K, input: HM[K]["input"]): Promise<HM[K]["output"]>;
|
|
124
|
-
protected executeHookSeries<K extends keyof HM>(hook: K, input: HM[K]["input"]): Promise<HookResult<HM[K]["output"]>[]>;
|
|
125
|
-
protected executeHookSeriesWithContext<K extends keyof HM>(hook: K, input: HM[K]["input"], context: Record<string, unknown>): Promise<HookResult<HM[K]["output"]>[]>;
|
|
126
|
-
protected registerHook<K extends keyof HM>(hook: K, handler: (data: HM[K]["input"], context?: Record<string, unknown>) => HM[K]["output"] | Promise<HM[K]["output"]> | HookResult<HM[K]["output"]> | Promise<HookResult<HM[K]["output"]>>, priority?: number, customId?: string): Promise<string>;
|
|
127
|
-
protected registerHookManaged<K extends keyof HM>(hook: K, handler: (data: HM[K]["input"], context?: Record<string, unknown>) => HM[K]["output"] | Promise<HM[K]["output"]> | HookResult<HM[K]["output"]> | Promise<HookResult<HM[K]["output"]>>, priority?: number, customId?: string): Promise<string>;
|
|
128
|
-
protected unregisterHook<K extends keyof HM>(hook: K, handlerId: string): Promise<boolean>;
|
|
129
|
-
protected getStatus(): {
|
|
130
|
-
initialized: boolean;
|
|
131
|
-
running: boolean;
|
|
132
|
-
};
|
|
133
|
-
protected getName(): string;
|
|
134
|
-
protected getVersion(): string;
|
|
135
|
-
protected isEnabled(): boolean;
|
|
136
|
-
protected getState(key: string): unknown;
|
|
137
|
-
protected setState(key: string, value: unknown): void;
|
|
138
|
-
protected deleteState(key: string): void;
|
|
139
|
-
protected get logger(): Logger;
|
|
140
|
-
updateConfig(update: Partial<PluginConfig & {
|
|
141
|
-
config: T;
|
|
142
|
-
}>): void;
|
|
143
|
-
private cleanupManagedHandlers;
|
|
144
|
-
private cleanupManagedHooks;
|
|
145
|
-
private withLock;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
declare class ConfigManager {
|
|
149
|
-
private config;
|
|
150
|
-
private pluginConfigs;
|
|
151
|
-
private isInitialized;
|
|
152
|
-
initialize(config: Record<string, unknown>): Promise<void>;
|
|
153
|
-
shutdown(): Promise<void>;
|
|
154
|
-
get<T>(key: string, defaultValue?: T): T | undefined;
|
|
155
|
-
set<T>(key: string, value: T): void;
|
|
156
|
-
has(key: string): boolean;
|
|
157
|
-
delete(key: string): boolean;
|
|
158
|
-
loadConfig(config: Record<string, unknown>): void;
|
|
159
|
-
clearConfig(): void;
|
|
160
|
-
getPluginConfig(pluginName: string): PluginConfig | undefined;
|
|
161
|
-
setPluginConfig(pluginName: string, config: PluginConfig): void;
|
|
162
|
-
updatePluginConfig(pluginName: string, updates: Partial<PluginConfig>): void;
|
|
163
|
-
hasPluginConfig(pluginName: string): boolean;
|
|
164
|
-
deletePluginConfig(pluginName: string): boolean;
|
|
165
|
-
getAllPluginConfigs(): Record<string, PluginConfig>;
|
|
166
|
-
loadPluginConfigs(configs: Record<string, PluginConfig>): void;
|
|
167
|
-
validateConfig(schema: z.ZodTypeAny, config: unknown): {
|
|
168
|
-
valid: boolean;
|
|
169
|
-
errors: string[];
|
|
170
|
-
};
|
|
171
|
-
exportConfig(format?: "json"): string;
|
|
172
|
-
importConfig(configJson: string): void;
|
|
173
|
-
getPluginConfigNames(): string[];
|
|
174
|
-
getStats(): {
|
|
175
|
-
totalConfigKeys: number;
|
|
176
|
-
totalPluginConfigs: number;
|
|
177
|
-
configKeys: string[];
|
|
178
|
-
pluginConfigNames: string[];
|
|
179
|
-
};
|
|
180
|
-
watchConfig(key: string, callback: (value: unknown) => void): () => void;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export { BasePlugin, ConfigManager, EventBus, Hook, HookResult, PluginManager, ServiceContainer, StateManager };
|
|
184
|
-
export type { PluginConfig, PluginContext, PluginLifecycle, PluginMetadata, PluginStatus };
|
|
1
|
+
export { ConduitHub } from './conduit-hub/index.mjs';
|
|
2
|
+
export { B as BasePlugin, C as ConfigManager, P as PluginConfig, a as PluginContext, c as PluginLifecycle, e as PluginManager, b as PluginMetadata, d as PluginStatus } from '../shared/conduithub.GrtzQn_7.mjs';
|
|
3
|
+
export { E as EventBus } from '../shared/conduithub.BzLwccre.mjs';
|
|
4
|
+
export { Hook, HookHandler, HookResult } from './hook/index.mjs';
|
|
5
|
+
export { ServiceContainer, ServiceDescriptor } from './service-container/index.mjs';
|
|
6
|
+
export { StateChangeHandler, StateManager } from './state-manager/index.mjs';
|
|
7
|
+
import '../shared/conduithub.B7aryjPG.mjs';
|
|
8
|
+
import 'zod';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,184 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
export { StateChangeHandler } from './state-manager/index.js';
|
|
10
|
-
|
|
11
|
-
interface PluginStatus {
|
|
12
|
-
name: string;
|
|
13
|
-
version: string;
|
|
14
|
-
status: "registered" | "initialized" | "running" | "stopped" | "destroyed" | "error";
|
|
15
|
-
config: PluginConfig;
|
|
16
|
-
error?: string;
|
|
17
|
-
lastActivity: number;
|
|
18
|
-
}
|
|
19
|
-
declare class PluginManager {
|
|
20
|
-
private eventBus;
|
|
21
|
-
private logger;
|
|
22
|
-
private serviceContainer;
|
|
23
|
-
private stateManager;
|
|
24
|
-
private hookSystem;
|
|
25
|
-
private configManager;
|
|
26
|
-
private plugins;
|
|
27
|
-
private pluginStatuses;
|
|
28
|
-
private pluginConfigs;
|
|
29
|
-
constructor(eventBus: EventBus<Record<string, unknown>>, logger: Logger, serviceContainer: ServiceContainer, stateManager: StateManager, hookSystem: Hook<Record<string, {
|
|
30
|
-
input: unknown;
|
|
31
|
-
output: unknown;
|
|
32
|
-
}>>, configManager: ConfigManager);
|
|
33
|
-
private log;
|
|
34
|
-
registerPlugin(plugin: BasePlugin, config?: PluginConfig): Promise<void>;
|
|
35
|
-
unregisterPlugin(pluginName: string): Promise<void>;
|
|
36
|
-
initializePlugin(pluginName: string): Promise<void>;
|
|
37
|
-
startPlugin(pluginName: string): Promise<void>;
|
|
38
|
-
stopPlugin(pluginName: string): Promise<void>;
|
|
39
|
-
shutdownAll(): Promise<void>;
|
|
40
|
-
isPluginRegistered(pluginName: string): boolean;
|
|
41
|
-
isPluginRunning(pluginName: string): boolean;
|
|
42
|
-
getPluginStatus(pluginName: string): PluginStatus | undefined;
|
|
43
|
-
listPlugins(): string[];
|
|
44
|
-
getAllPluginStatuses(): PluginStatus[];
|
|
45
|
-
getPlugin(pluginName: string): BasePlugin | undefined;
|
|
46
|
-
getPluginConfig(pluginName: string): PluginConfig | undefined;
|
|
47
|
-
updatePluginConfig(pluginName: string, config: Partial<PluginConfig>): Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
interface PluginConfig {
|
|
51
|
-
name: string;
|
|
52
|
-
version: string;
|
|
53
|
-
enabled: boolean;
|
|
54
|
-
dependencies?: string[];
|
|
55
|
-
config?: Record<string, unknown>;
|
|
56
|
-
}
|
|
57
|
-
interface PluginContext<EM extends Record<string, unknown> = Record<string, unknown>, HM extends Record<string, {
|
|
58
|
-
input: unknown;
|
|
59
|
-
output: unknown;
|
|
60
|
-
}> = Record<string, {
|
|
61
|
-
input: unknown;
|
|
62
|
-
output: unknown;
|
|
63
|
-
}>> {
|
|
64
|
-
eventBus: EventBus<EM>;
|
|
65
|
-
logger: Logger;
|
|
66
|
-
config: PluginConfig;
|
|
67
|
-
serviceContainer: ServiceContainer;
|
|
68
|
-
hookSystem: Hook<HM>;
|
|
69
|
-
stateManager: StateManager;
|
|
70
|
-
}
|
|
71
|
-
interface PluginMetadata {
|
|
72
|
-
name: string;
|
|
73
|
-
version: string;
|
|
74
|
-
description?: string;
|
|
75
|
-
author?: string;
|
|
76
|
-
dependencies?: string[];
|
|
77
|
-
hooks: string[];
|
|
78
|
-
events: string[];
|
|
79
|
-
}
|
|
80
|
-
type PluginLifecycle = "beforeInit" | "afterInit" | "beforeStart" | "afterStart" | "beforeStop" | "afterStop" | "beforeDestroy" | "afterDestroy";
|
|
81
|
-
declare abstract class BasePlugin<T extends Record<string, unknown> = Record<string, unknown>, EM extends Record<string, unknown> = Record<string, unknown>, HM extends Record<string, {
|
|
82
|
-
input: unknown;
|
|
83
|
-
output: unknown;
|
|
84
|
-
}> = Record<string, {
|
|
85
|
-
input: unknown;
|
|
86
|
-
output: unknown;
|
|
87
|
-
}>> {
|
|
88
|
-
protected config: PluginConfig & {
|
|
89
|
-
config: T;
|
|
90
|
-
};
|
|
91
|
-
protected context: PluginContext<EM, HM>;
|
|
92
|
-
protected metadata: PluginMetadata;
|
|
93
|
-
protected isInitialized: boolean;
|
|
94
|
-
protected isRunning: boolean;
|
|
95
|
-
private managedEventHandlers;
|
|
96
|
-
private managedHookHandlers;
|
|
97
|
-
private lock;
|
|
98
|
-
constructor(config: PluginConfig & {
|
|
99
|
-
config: T;
|
|
100
|
-
});
|
|
101
|
-
abstract getMetadata(): PluginMetadata;
|
|
102
|
-
initialize(context: PluginContext<EM, HM>): Promise<void>;
|
|
103
|
-
start(): Promise<void>;
|
|
104
|
-
stop(): Promise<void>;
|
|
105
|
-
destroy(): Promise<void>;
|
|
106
|
-
protected abstract onInitialize(): Promise<void>;
|
|
107
|
-
protected abstract onStart(): Promise<void>;
|
|
108
|
-
protected abstract onStop(): Promise<void>;
|
|
109
|
-
protected abstract onDestroy(): Promise<void>;
|
|
110
|
-
private executeLifecycleHook;
|
|
111
|
-
getConfig(): PluginConfig & {
|
|
112
|
-
config: T;
|
|
113
|
-
};
|
|
114
|
-
getContext(): PluginContext<EM, HM>;
|
|
115
|
-
isPluginInitialized(): boolean;
|
|
116
|
-
isPluginRunning(): boolean;
|
|
117
|
-
protected emit<K extends keyof EM>(event: K, data: EM[K]): Promise<void>;
|
|
118
|
-
protected on<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
119
|
-
protected once<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
120
|
-
protected onManaged<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
121
|
-
protected onceManaged<K extends keyof EM>(event: K, listener: (payload: EM[K], event: EventData<K & string, EM[K]>) => Promise<void> | void): string;
|
|
122
|
-
protected off<K extends keyof EM>(event: K, handlerId: string): void;
|
|
123
|
-
protected executeHook<K extends keyof HM>(hook: K, input: HM[K]["input"]): Promise<HM[K]["output"]>;
|
|
124
|
-
protected executeHookSeries<K extends keyof HM>(hook: K, input: HM[K]["input"]): Promise<HookResult<HM[K]["output"]>[]>;
|
|
125
|
-
protected executeHookSeriesWithContext<K extends keyof HM>(hook: K, input: HM[K]["input"], context: Record<string, unknown>): Promise<HookResult<HM[K]["output"]>[]>;
|
|
126
|
-
protected registerHook<K extends keyof HM>(hook: K, handler: (data: HM[K]["input"], context?: Record<string, unknown>) => HM[K]["output"] | Promise<HM[K]["output"]> | HookResult<HM[K]["output"]> | Promise<HookResult<HM[K]["output"]>>, priority?: number, customId?: string): Promise<string>;
|
|
127
|
-
protected registerHookManaged<K extends keyof HM>(hook: K, handler: (data: HM[K]["input"], context?: Record<string, unknown>) => HM[K]["output"] | Promise<HM[K]["output"]> | HookResult<HM[K]["output"]> | Promise<HookResult<HM[K]["output"]>>, priority?: number, customId?: string): Promise<string>;
|
|
128
|
-
protected unregisterHook<K extends keyof HM>(hook: K, handlerId: string): Promise<boolean>;
|
|
129
|
-
protected getStatus(): {
|
|
130
|
-
initialized: boolean;
|
|
131
|
-
running: boolean;
|
|
132
|
-
};
|
|
133
|
-
protected getName(): string;
|
|
134
|
-
protected getVersion(): string;
|
|
135
|
-
protected isEnabled(): boolean;
|
|
136
|
-
protected getState(key: string): unknown;
|
|
137
|
-
protected setState(key: string, value: unknown): void;
|
|
138
|
-
protected deleteState(key: string): void;
|
|
139
|
-
protected get logger(): Logger;
|
|
140
|
-
updateConfig(update: Partial<PluginConfig & {
|
|
141
|
-
config: T;
|
|
142
|
-
}>): void;
|
|
143
|
-
private cleanupManagedHandlers;
|
|
144
|
-
private cleanupManagedHooks;
|
|
145
|
-
private withLock;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
declare class ConfigManager {
|
|
149
|
-
private config;
|
|
150
|
-
private pluginConfigs;
|
|
151
|
-
private isInitialized;
|
|
152
|
-
initialize(config: Record<string, unknown>): Promise<void>;
|
|
153
|
-
shutdown(): Promise<void>;
|
|
154
|
-
get<T>(key: string, defaultValue?: T): T | undefined;
|
|
155
|
-
set<T>(key: string, value: T): void;
|
|
156
|
-
has(key: string): boolean;
|
|
157
|
-
delete(key: string): boolean;
|
|
158
|
-
loadConfig(config: Record<string, unknown>): void;
|
|
159
|
-
clearConfig(): void;
|
|
160
|
-
getPluginConfig(pluginName: string): PluginConfig | undefined;
|
|
161
|
-
setPluginConfig(pluginName: string, config: PluginConfig): void;
|
|
162
|
-
updatePluginConfig(pluginName: string, updates: Partial<PluginConfig>): void;
|
|
163
|
-
hasPluginConfig(pluginName: string): boolean;
|
|
164
|
-
deletePluginConfig(pluginName: string): boolean;
|
|
165
|
-
getAllPluginConfigs(): Record<string, PluginConfig>;
|
|
166
|
-
loadPluginConfigs(configs: Record<string, PluginConfig>): void;
|
|
167
|
-
validateConfig(schema: z.ZodTypeAny, config: unknown): {
|
|
168
|
-
valid: boolean;
|
|
169
|
-
errors: string[];
|
|
170
|
-
};
|
|
171
|
-
exportConfig(format?: "json"): string;
|
|
172
|
-
importConfig(configJson: string): void;
|
|
173
|
-
getPluginConfigNames(): string[];
|
|
174
|
-
getStats(): {
|
|
175
|
-
totalConfigKeys: number;
|
|
176
|
-
totalPluginConfigs: number;
|
|
177
|
-
configKeys: string[];
|
|
178
|
-
pluginConfigNames: string[];
|
|
179
|
-
};
|
|
180
|
-
watchConfig(key: string, callback: (value: unknown) => void): () => void;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export { BasePlugin, ConfigManager, EventBus, Hook, HookResult, PluginManager, ServiceContainer, StateManager };
|
|
184
|
-
export type { PluginConfig, PluginContext, PluginLifecycle, PluginMetadata, PluginStatus };
|
|
1
|
+
export { ConduitHub } from './conduit-hub/index.js';
|
|
2
|
+
export { B as BasePlugin, C as ConfigManager, P as PluginConfig, a as PluginContext, c as PluginLifecycle, e as PluginManager, b as PluginMetadata, d as PluginStatus } from '../shared/conduithub.DSAmRivG.js';
|
|
3
|
+
export { E as EventBus } from '../shared/conduithub.DQOWQ-Bx.js';
|
|
4
|
+
export { Hook, HookHandler, HookResult } from './hook/index.js';
|
|
5
|
+
export { ServiceContainer, ServiceDescriptor } from './service-container/index.js';
|
|
6
|
+
export { StateChangeHandler, StateManager } from './state-manager/index.js';
|
|
7
|
+
import '../shared/conduithub.B7aryjPG.js';
|
|
8
|
+
import 'zod';
|