conduithub 1.0.0 → 1.0.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.
Files changed (39) hide show
  1. package/dist/core/conduit-hub/index.cjs +1 -1
  2. package/dist/core/conduit-hub/index.mjs +1 -1
  3. package/dist/core/event-bus/index.cjs +4 -4
  4. package/dist/core/event-bus/index.mjs +1 -1
  5. package/dist/core/hook/index.cjs +6 -6
  6. package/dist/core/hook/index.mjs +1 -1
  7. package/dist/core/index.cjs +1 -1
  8. package/dist/core/index.mjs +1 -1
  9. package/dist/core/service-container/index.cjs +9 -9
  10. package/dist/core/service-container/index.mjs +1 -1
  11. package/dist/core/state-manager/index.cjs +3 -3
  12. package/dist/core/state-manager/index.mjs +1 -1
  13. package/dist/{shared/conduithub.BqUYv04j.cjs → error/index.cjs} +3 -0
  14. package/dist/error/index.d.cts +47 -0
  15. package/dist/error/index.d.mts +47 -0
  16. package/dist/error/index.d.ts +47 -0
  17. package/dist/{shared/conduithub.BDwZXllF.mjs → error/index.mjs} +3 -1
  18. package/dist/index.cjs +10 -6
  19. package/dist/index.d.cts +2 -48
  20. package/dist/index.d.mts +2 -48
  21. package/dist/index.d.ts +2 -48
  22. package/dist/index.mjs +5 -2
  23. package/dist/plugins/index.cjs +12 -0
  24. package/dist/plugins/index.d.cts +8 -0
  25. package/dist/plugins/index.d.mts +8 -0
  26. package/dist/plugins/index.d.ts +8 -0
  27. package/dist/plugins/index.mjs +6 -0
  28. package/dist/plugins/redis/index.cjs +12 -0
  29. package/dist/plugins/redis/index.d.cts +109 -0
  30. package/dist/plugins/redis/index.d.mts +109 -0
  31. package/dist/plugins/redis/index.d.ts +109 -0
  32. package/dist/plugins/redis/index.mjs +6 -0
  33. package/dist/shared/conduithub.-bZD30_I.mjs +769 -0
  34. package/dist/shared/{conduithub.gF2DFc43.cjs → conduithub.Dlvl2xGE.cjs} +3 -3
  35. package/dist/shared/{conduithub.bsiNMTVD.mjs → conduithub.Up0QYVao.mjs} +1 -1
  36. package/dist/shared/conduithub.cvEjE62V.cjs +775 -0
  37. package/dist/utils/index.cjs +3 -2
  38. package/dist/utils/index.mjs +3 -2
  39. package/package.json +1 -1
@@ -12,7 +12,7 @@ const core_serviceContainer_index = require('../service-container/index.cjs');
12
12
  const core_stateManager_index = require('../state-manager/index.cjs');
13
13
  require('../../shared/conduithub.CmZo_Vuc.cjs');
14
14
  require('../../shared/conduithub.DQO1dRnn.cjs');
15
- require('../../shared/conduithub.BqUYv04j.cjs');
15
+ require('../../error/index.cjs');
16
16
  require('../../shared/conduithub.Bq_7Xj0J.cjs');
17
17
 
18
18
  class ConduitHub {
@@ -10,7 +10,7 @@ import { ServiceContainer } from '../service-container/index.mjs';
10
10
  import { StateManager } from '../state-manager/index.mjs';
11
11
  import '../../shared/conduithub.G7ICpZIy.mjs';
12
12
  import '../../shared/conduithub.alPiaJax.mjs';
13
- import '../../shared/conduithub.BDwZXllF.mjs';
13
+ import '../../error/index.mjs';
14
14
  import '../../shared/conduithub.CkOQG3cD.mjs';
15
15
 
16
16
  class ConduitHub {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('../../shared/conduithub.BqUYv04j.cjs');
3
+ const error_index = require('../../error/index.cjs');
4
4
  const logger = require('../../shared/conduithub.BNQsddJO.cjs');
5
5
  require('process');
6
6
  require('readline');
@@ -41,7 +41,7 @@ class EventBus {
41
41
  }
42
42
  ensureInitialized() {
43
43
  if (!this.initialized) {
44
- throw new index.ConduithubError(code.ERROR_CODE.EVENT_BUS_NOT_INITIALIZED);
44
+ throw new error_index.ConduithubError(code.ERROR_CODE.EVENT_BUS_NOT_INITIALIZED);
45
45
  }
46
46
  }
47
47
  sanitizeLog(data) {
@@ -94,13 +94,13 @@ class EventBus {
94
94
  registerHandler(type, handler, once, priority, customId) {
95
95
  const list = this.handlers[type] ??= [];
96
96
  if (list.length >= this.maxHandlersPerEvent) {
97
- throw new index.ConduithubError(
97
+ throw new error_index.ConduithubError(
98
98
  `${code.ERROR_CODE.EVENT_HANDLER_LIMIT_EXCEEDED} ${String(type)} (${this.maxHandlersPerEvent})`
99
99
  );
100
100
  }
101
101
  const id = customId ?? uuid.generateUuid();
102
102
  if (customId && list.some((h) => h.id === customId)) {
103
- throw new index.ConduithubError(
103
+ throw new error_index.ConduithubError(
104
104
  `${code.ERROR_CODE.DUPLICATE_EVENT_HANDLER_ID} ${String(type)}: ${customId}`
105
105
  );
106
106
  }
@@ -1,4 +1,4 @@
1
- import { C as ConduithubError } from '../../shared/conduithub.BDwZXllF.mjs';
1
+ import { ConduithubError } from '../../error/index.mjs';
2
2
  import { c as createLogger } from '../../shared/conduithub.BNefRQsK.mjs';
3
3
  import 'process';
4
4
  import 'readline';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('../../shared/conduithub.BqUYv04j.cjs');
3
+ const error_index = require('../../error/index.cjs');
4
4
  const logger = require('../../shared/conduithub.BNQsddJO.cjs');
5
5
  require('process');
6
6
  require('readline');
@@ -39,7 +39,7 @@ class Hook {
39
39
  }
40
40
  ensureInitialized() {
41
41
  if (!this.initialized) {
42
- throw new index.ConduithubError(code.ERROR_CODE.HOOK_SYSTEM_NOT_INITIALIZED);
42
+ throw new error_index.ConduithubError(code.ERROR_CODE.HOOK_SYSTEM_NOT_INITIALIZED);
43
43
  }
44
44
  }
45
45
  sanitizeLog(data) {
@@ -81,13 +81,13 @@ class Hook {
81
81
  if (!this.hooks.has(hook)) this.hooks.set(hook, []);
82
82
  const handlers = this.hooks.get(hook);
83
83
  if (handlers.length >= this.maxHandlersPerHook) {
84
- throw new index.ConduithubError(
84
+ throw new error_index.ConduithubError(
85
85
  `${code.ERROR_CODE.HOOK_HANDLER_LIMIT_EXCEEDED} ${String(hook)} (${this.maxHandlersPerHook})`
86
86
  );
87
87
  }
88
88
  const id = customId ?? uuid.generateUuid();
89
89
  if (customId && handlers.some((h) => h.id === customId)) {
90
- throw new index.ConduithubError(
90
+ throw new error_index.ConduithubError(
91
91
  `${code.ERROR_CODE.DUPLICATE_HOOK_HANDLER_ID} ${String(hook)}: ${customId}`
92
92
  );
93
93
  }
@@ -141,7 +141,7 @@ class Hook {
141
141
  if (typeof result === "object" && result && "success" in result) {
142
142
  const res = result;
143
143
  if (!res.success && failFast)
144
- throw new index.ConduithubError(
144
+ throw new error_index.ConduithubError(
145
145
  res.error ?? code.ERROR_CODE.HOOK_EXECUTION_FAILED
146
146
  );
147
147
  this.logger.debug(
@@ -197,7 +197,7 @@ class Hook {
197
197
  } else {
198
198
  errorCount++;
199
199
  if (this.failFast)
200
- throw new index.ConduithubError(error ?? code.ERROR_CODE.UNKNOWN_ERROR);
200
+ throw new error_index.ConduithubError(error ?? code.ERROR_CODE.UNKNOWN_ERROR);
201
201
  }
202
202
  }
203
203
  this.logger.debug(
@@ -1,4 +1,4 @@
1
- import { C as ConduithubError } from '../../shared/conduithub.BDwZXllF.mjs';
1
+ import { ConduithubError } from '../../error/index.mjs';
2
2
  import { c as createLogger } from '../../shared/conduithub.BNefRQsK.mjs';
3
3
  import 'process';
4
4
  import 'readline';
@@ -13,7 +13,7 @@ require('../shared/conduithub.BNQsddJO.cjs');
13
13
  require('process');
14
14
  require('readline');
15
15
  require('uuid');
16
- require('../shared/conduithub.BqUYv04j.cjs');
16
+ require('../error/index.cjs');
17
17
  require('../shared/conduithub.Bq_7Xj0J.cjs');
18
18
 
19
19
 
@@ -11,5 +11,5 @@ import '../shared/conduithub.BNefRQsK.mjs';
11
11
  import 'process';
12
12
  import 'readline';
13
13
  import 'uuid';
14
- import '../shared/conduithub.BDwZXllF.mjs';
14
+ import '../error/index.mjs';
15
15
  import '../shared/conduithub.CkOQG3cD.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('../../shared/conduithub.BqUYv04j.cjs');
3
+ const error_index = require('../../error/index.cjs');
4
4
  const logger = require('../../shared/conduithub.BNQsddJO.cjs');
5
5
  require('process');
6
6
  require('readline');
@@ -30,7 +30,7 @@ class ServiceContainer {
30
30
  }
31
31
  ensureInitialized() {
32
32
  if (!this.isInitialized) {
33
- throw new index.ConduithubError(code.ERROR_CODE.SERVICE_CONTAINER_NOT_INITIALIZED);
33
+ throw new error_index.ConduithubError(code.ERROR_CODE.SERVICE_CONTAINER_NOT_INITIALIZED);
34
34
  }
35
35
  }
36
36
  register(name, factory, singleton = true, dependencies, metadata) {
@@ -49,7 +49,7 @@ class ServiceContainer {
49
49
  this.ensureInitialized();
50
50
  const service = this.services.get(name);
51
51
  if (!service) {
52
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
52
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
53
53
  }
54
54
  if (service.singleton && this.instances.has(name)) {
55
55
  return this.instances.get(name);
@@ -58,7 +58,7 @@ class ServiceContainer {
58
58
  return this.pendingResolutions.get(name);
59
59
  }
60
60
  if (this.resolutionStack.has(name)) {
61
- throw new index.ConduithubError(
61
+ throw new error_index.ConduithubError(
62
62
  `${code.ERROR_CODE.CIRCULAR_DEPENDENCY_DETECTED}: ${name}`
63
63
  );
64
64
  }
@@ -93,7 +93,7 @@ class ServiceContainer {
93
93
  remove(name) {
94
94
  this.ensureInitialized();
95
95
  if (!this.services.has(name)) {
96
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
96
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
97
97
  }
98
98
  this.instances.delete(name);
99
99
  this.services.delete(name);
@@ -123,10 +123,10 @@ class ServiceContainer {
123
123
  this.ensureInitialized();
124
124
  const descriptor = this.services.get(name);
125
125
  if (!descriptor) {
126
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
126
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
127
127
  }
128
128
  if (descriptor.singleton) {
129
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_IS_SINGLETON}: ${name}`);
129
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_IS_SINGLETON}: ${name}`);
130
130
  }
131
131
  if (this.instances.has(name)) {
132
132
  return this.instances.get(name);
@@ -139,7 +139,7 @@ class ServiceContainer {
139
139
  return instance;
140
140
  } catch (error) {
141
141
  logger.logger.error(`Failed to create instance for service: ${name}`, error);
142
- throw new index.ConduithubError(
142
+ throw new error_index.ConduithubError(
143
143
  `${code.ERROR_CODE.SERVICE_CREATION_FAILED}: ${name}`,
144
144
  {
145
145
  code: "SERVICE_CREATION_FAILED",
@@ -286,7 +286,7 @@ class ServiceContainer {
286
286
  dispose(name) {
287
287
  this.ensureInitialized();
288
288
  if (!this.services.has(name)) {
289
- throw new index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
289
+ throw new error_index.ConduithubError(`${code.ERROR_CODE.SERVICE_NOT_FOUND}: ${name}`);
290
290
  }
291
291
  const instance = this.instances.get(name);
292
292
  if (instance && typeof instance === "object" && "dispose" in instance) {
@@ -1,4 +1,4 @@
1
- import { C as ConduithubError } from '../../shared/conduithub.BDwZXllF.mjs';
1
+ import { ConduithubError } from '../../error/index.mjs';
2
2
  import { a as logger } from '../../shared/conduithub.BNefRQsK.mjs';
3
3
  import 'process';
4
4
  import 'readline';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('../../shared/conduithub.BqUYv04j.cjs');
3
+ const error_index = require('../../error/index.cjs');
4
4
  const logger = require('../../shared/conduithub.BNQsddJO.cjs');
5
5
  require('process');
6
6
  require('readline');
@@ -26,7 +26,7 @@ class StateManager {
26
26
  }
27
27
  ensureInitialized() {
28
28
  if (!this.isInitialized) {
29
- throw new index.ConduithubError(code.ERROR_CODE.STATE_MANAGER_NOT_INITIALIZED);
29
+ throw new error_index.ConduithubError(code.ERROR_CODE.STATE_MANAGER_NOT_INITIALIZED);
30
30
  }
31
31
  }
32
32
  get(key) {
@@ -187,7 +187,7 @@ class StateManager {
187
187
  logger.logger.success("State imported successfully");
188
188
  } catch (error) {
189
189
  logger.logger.error("Failed to import state", error);
190
- throw new index.ConduithubError(code.ERROR_CODE.INVALID_STATE_JSON_FORMAT);
190
+ throw new error_index.ConduithubError(code.ERROR_CODE.INVALID_STATE_JSON_FORMAT);
191
191
  }
192
192
  }
193
193
  }
@@ -1,4 +1,4 @@
1
- import { C as ConduithubError } from '../../shared/conduithub.BDwZXllF.mjs';
1
+ import { ConduithubError } from '../../error/index.mjs';
2
2
  import { a as logger } from '../../shared/conduithub.BNefRQsK.mjs';
3
3
  import 'process';
4
4
  import 'readline';
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const code = require('../shared/conduithub.CmZo_Vuc.cjs');
4
+
3
5
  class ConduithubError extends Error {
4
6
  code;
5
7
  details;
@@ -62,6 +64,7 @@ class MissingDependencyError extends ConduithubError {
62
64
  }
63
65
  }
64
66
 
67
+ exports.ERROR_CODE = code.ERROR_CODE;
65
68
  exports.ConduithubError = ConduithubError;
66
69
  exports.MissingDependencyError = MissingDependencyError;
67
70
  exports.getPkgManager = getPkgManager;
@@ -0,0 +1,47 @@
1
+ declare const ERROR_CODE: {
2
+ readonly INVALID_JSON: "Invalid JSON format";
3
+ readonly INVALID_CONFIG: "Configuration validation failed";
4
+ readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
5
+ readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
6
+ readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
7
+ readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
8
+ readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
9
+ readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
10
+ readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
11
+ readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
12
+ readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
13
+ readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
14
+ readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
15
+ readonly UNKNOWN_ERROR: "Unknown error";
16
+ readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
17
+ readonly SERVICE_NOT_FOUND: "Service not found";
18
+ readonly SERVICE_CREATION_FAILED: "Service creation failed";
19
+ readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
20
+ readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
21
+ readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
22
+ readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
23
+ readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
24
+ readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
25
+ };
26
+ type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
27
+
28
+ interface ErrorContext {
29
+ readonly code?: string;
30
+ readonly details?: Record<string, unknown>;
31
+ readonly timestamp?: number;
32
+ }
33
+ declare class ConduithubError extends Error {
34
+ readonly code?: string;
35
+ readonly details?: Record<string, unknown>;
36
+ readonly timestamp: number;
37
+ constructor(message: string, context?: ErrorContext);
38
+ toJSON(): Record<string, unknown>;
39
+ }
40
+ declare function setPkgManager(manager: string): void;
41
+ declare function getPkgManager(): string;
42
+ declare class MissingDependencyError extends ConduithubError {
43
+ constructor(pkgName: string);
44
+ }
45
+
46
+ export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
47
+ export type { ErrorCode };
@@ -0,0 +1,47 @@
1
+ declare const ERROR_CODE: {
2
+ readonly INVALID_JSON: "Invalid JSON format";
3
+ readonly INVALID_CONFIG: "Configuration validation failed";
4
+ readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
5
+ readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
6
+ readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
7
+ readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
8
+ readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
9
+ readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
10
+ readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
11
+ readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
12
+ readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
13
+ readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
14
+ readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
15
+ readonly UNKNOWN_ERROR: "Unknown error";
16
+ readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
17
+ readonly SERVICE_NOT_FOUND: "Service not found";
18
+ readonly SERVICE_CREATION_FAILED: "Service creation failed";
19
+ readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
20
+ readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
21
+ readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
22
+ readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
23
+ readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
24
+ readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
25
+ };
26
+ type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
27
+
28
+ interface ErrorContext {
29
+ readonly code?: string;
30
+ readonly details?: Record<string, unknown>;
31
+ readonly timestamp?: number;
32
+ }
33
+ declare class ConduithubError extends Error {
34
+ readonly code?: string;
35
+ readonly details?: Record<string, unknown>;
36
+ readonly timestamp: number;
37
+ constructor(message: string, context?: ErrorContext);
38
+ toJSON(): Record<string, unknown>;
39
+ }
40
+ declare function setPkgManager(manager: string): void;
41
+ declare function getPkgManager(): string;
42
+ declare class MissingDependencyError extends ConduithubError {
43
+ constructor(pkgName: string);
44
+ }
45
+
46
+ export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
47
+ export type { ErrorCode };
@@ -0,0 +1,47 @@
1
+ declare const ERROR_CODE: {
2
+ readonly INVALID_JSON: "Invalid JSON format";
3
+ readonly INVALID_CONFIG: "Configuration validation failed";
4
+ readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
5
+ readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
6
+ readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
7
+ readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
8
+ readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
9
+ readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
10
+ readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
11
+ readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
12
+ readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
13
+ readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
14
+ readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
15
+ readonly UNKNOWN_ERROR: "Unknown error";
16
+ readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
17
+ readonly SERVICE_NOT_FOUND: "Service not found";
18
+ readonly SERVICE_CREATION_FAILED: "Service creation failed";
19
+ readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
20
+ readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
21
+ readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
22
+ readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
23
+ readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
24
+ readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
25
+ };
26
+ type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
27
+
28
+ interface ErrorContext {
29
+ readonly code?: string;
30
+ readonly details?: Record<string, unknown>;
31
+ readonly timestamp?: number;
32
+ }
33
+ declare class ConduithubError extends Error {
34
+ readonly code?: string;
35
+ readonly details?: Record<string, unknown>;
36
+ readonly timestamp: number;
37
+ constructor(message: string, context?: ErrorContext);
38
+ toJSON(): Record<string, unknown>;
39
+ }
40
+ declare function setPkgManager(manager: string): void;
41
+ declare function getPkgManager(): string;
42
+ declare class MissingDependencyError extends ConduithubError {
43
+ constructor(pkgName: string);
44
+ }
45
+
46
+ export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
47
+ export type { ErrorCode };
@@ -1,3 +1,5 @@
1
+ export { E as ERROR_CODE } from '../shared/conduithub.G7ICpZIy.mjs';
2
+
1
3
  class ConduithubError extends Error {
2
4
  code;
3
5
  details;
@@ -60,4 +62,4 @@ class MissingDependencyError extends ConduithubError {
60
62
  }
61
63
  }
62
64
 
63
- export { ConduithubError as C, MissingDependencyError as M, getPkgManager as g, setPkgManager as s };
65
+ export { ConduithubError, MissingDependencyError, getPkgManager, setPkgManager };
package/dist/index.cjs CHANGED
@@ -6,16 +6,19 @@ const core_hook_index = require('./core/hook/index.cjs');
6
6
  const core_plugin_index = require('./core/plugin/index.cjs');
7
7
  const core_serviceContainer_index = require('./core/service-container/index.cjs');
8
8
  const core_stateManager_index = require('./core/state-manager/index.cjs');
9
- const index = require('./shared/conduithub.BqUYv04j.cjs');
9
+ const error_index = require('./error/index.cjs');
10
10
  const json = require('./shared/conduithub.DQO1dRnn.cjs');
11
11
  const logger = require('./shared/conduithub.BNQsddJO.cjs');
12
- const packageManager = require('./shared/conduithub.gF2DFc43.cjs');
12
+ const packageManager = require('./shared/conduithub.Dlvl2xGE.cjs');
13
13
  const uuid = require('./shared/conduithub.Bq_7Xj0J.cjs');
14
+ const plugin = require('./shared/conduithub.cvEjE62V.cjs');
14
15
  const manager = require('./shared/conduithub.DsOOeNwU.cjs');
15
16
  const code = require('./shared/conduithub.CmZo_Vuc.cjs');
16
17
  require('process');
17
18
  require('readline');
18
19
  require('uuid');
20
+ require('ioredis');
21
+ require('zod');
19
22
 
20
23
 
21
24
 
@@ -25,10 +28,10 @@ exports.Hook = core_hook_index.Hook;
25
28
  exports.BasePlugin = core_plugin_index.BasePlugin;
26
29
  exports.ServiceContainer = core_serviceContainer_index.ServiceContainer;
27
30
  exports.StateManager = core_stateManager_index.StateManager;
28
- exports.ConduithubError = index.ConduithubError;
29
- exports.MissingDependencyError = index.MissingDependencyError;
30
- exports.getPkgManager = index.getPkgManager;
31
- exports.setPkgManager = index.setPkgManager;
31
+ exports.ConduithubError = error_index.ConduithubError;
32
+ exports.MissingDependencyError = error_index.MissingDependencyError;
33
+ exports.getPkgManager = error_index.getPkgManager;
34
+ exports.setPkgManager = error_index.setPkgManager;
32
35
  exports.parseJson = json.parseJson;
33
36
  exports.safeStringifyJson = json.safeStringifyJson;
34
37
  exports.stringifyJson = json.stringifyJson;
@@ -41,5 +44,6 @@ exports.packageManagerUtil = packageManager.packageManagerUtil;
41
44
  exports.generateShortId = uuid.generateShortId;
42
45
  exports.generateUuid = uuid.generateUuid;
43
46
  exports.isValidUuid = uuid.isValidUuid;
47
+ exports.RedisPlugin = plugin.RedisPlugin;
44
48
  exports.PluginManager = manager.PluginManager;
45
49
  exports.ERROR_CODE = code.ERROR_CODE;
package/dist/index.d.cts CHANGED
@@ -3,54 +3,8 @@ export { E as EventBus } from './shared/conduithub.BZQmkQy7.cjs';
3
3
  export { Hook, HookHandler, HookResult } from './core/hook/index.cjs';
4
4
  export { ServiceContainer, ServiceDescriptor } from './core/service-container/index.cjs';
5
5
  export { StateChangeHandler, StateManager } from './core/state-manager/index.cjs';
6
+ export { ConduithubError, ERROR_CODE, ErrorCode, MissingDependencyError, getPkgManager, setPkgManager } from './error/index.cjs';
6
7
  export { PackageManagerUtil, generateShortId, generateUuid, isValidUuid, packageManagerUtil, parseJson, safeStringifyJson, stringifyJson } from './utils/index.cjs';
7
8
  export { b as LogHandlerParams, L as LogLevel, a as Logger, c as createLogger, l as levels, d as logger, s as shouldPublishLog } from './shared/conduithub.B7aryjPG.cjs';
9
+ export { RedisPlugin } from './plugins/redis/index.cjs';
8
10
  import 'zod';
9
-
10
- declare const ERROR_CODE: {
11
- readonly INVALID_JSON: "Invalid JSON format";
12
- readonly INVALID_CONFIG: "Configuration validation failed";
13
- readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
14
- readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
15
- readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
16
- readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
17
- readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
18
- readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
19
- readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
20
- readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
21
- readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
22
- readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
23
- readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
24
- readonly UNKNOWN_ERROR: "Unknown error";
25
- readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
26
- readonly SERVICE_NOT_FOUND: "Service not found";
27
- readonly SERVICE_CREATION_FAILED: "Service creation failed";
28
- readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
29
- readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
30
- readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
31
- readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
32
- readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
33
- readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
34
- };
35
- type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
36
-
37
- interface ErrorContext {
38
- readonly code?: string;
39
- readonly details?: Record<string, unknown>;
40
- readonly timestamp?: number;
41
- }
42
- declare class ConduithubError extends Error {
43
- readonly code?: string;
44
- readonly details?: Record<string, unknown>;
45
- readonly timestamp: number;
46
- constructor(message: string, context?: ErrorContext);
47
- toJSON(): Record<string, unknown>;
48
- }
49
- declare function setPkgManager(manager: string): void;
50
- declare function getPkgManager(): string;
51
- declare class MissingDependencyError extends ConduithubError {
52
- constructor(pkgName: string);
53
- }
54
-
55
- export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
56
- export type { ErrorCode };
package/dist/index.d.mts CHANGED
@@ -3,54 +3,8 @@ export { E as EventBus } from './shared/conduithub.BzLwccre.mjs';
3
3
  export { Hook, HookHandler, HookResult } from './core/hook/index.mjs';
4
4
  export { ServiceContainer, ServiceDescriptor } from './core/service-container/index.mjs';
5
5
  export { StateChangeHandler, StateManager } from './core/state-manager/index.mjs';
6
+ export { ConduithubError, ERROR_CODE, ErrorCode, MissingDependencyError, getPkgManager, setPkgManager } from './error/index.mjs';
6
7
  export { PackageManagerUtil, generateShortId, generateUuid, isValidUuid, packageManagerUtil, parseJson, safeStringifyJson, stringifyJson } from './utils/index.mjs';
7
8
  export { b as LogHandlerParams, L as LogLevel, a as Logger, c as createLogger, l as levels, d as logger, s as shouldPublishLog } from './shared/conduithub.B7aryjPG.mjs';
9
+ export { RedisPlugin } from './plugins/redis/index.mjs';
8
10
  import 'zod';
9
-
10
- declare const ERROR_CODE: {
11
- readonly INVALID_JSON: "Invalid JSON format";
12
- readonly INVALID_CONFIG: "Configuration validation failed";
13
- readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
14
- readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
15
- readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
16
- readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
17
- readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
18
- readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
19
- readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
20
- readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
21
- readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
22
- readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
23
- readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
24
- readonly UNKNOWN_ERROR: "Unknown error";
25
- readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
26
- readonly SERVICE_NOT_FOUND: "Service not found";
27
- readonly SERVICE_CREATION_FAILED: "Service creation failed";
28
- readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
29
- readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
30
- readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
31
- readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
32
- readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
33
- readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
34
- };
35
- type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
36
-
37
- interface ErrorContext {
38
- readonly code?: string;
39
- readonly details?: Record<string, unknown>;
40
- readonly timestamp?: number;
41
- }
42
- declare class ConduithubError extends Error {
43
- readonly code?: string;
44
- readonly details?: Record<string, unknown>;
45
- readonly timestamp: number;
46
- constructor(message: string, context?: ErrorContext);
47
- toJSON(): Record<string, unknown>;
48
- }
49
- declare function setPkgManager(manager: string): void;
50
- declare function getPkgManager(): string;
51
- declare class MissingDependencyError extends ConduithubError {
52
- constructor(pkgName: string);
53
- }
54
-
55
- export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
56
- export type { ErrorCode };
package/dist/index.d.ts CHANGED
@@ -3,54 +3,8 @@ export { E as EventBus } from './shared/conduithub.DQOWQ-Bx.js';
3
3
  export { Hook, HookHandler, HookResult } from './core/hook/index.js';
4
4
  export { ServiceContainer, ServiceDescriptor } from './core/service-container/index.js';
5
5
  export { StateChangeHandler, StateManager } from './core/state-manager/index.js';
6
+ export { ConduithubError, ERROR_CODE, ErrorCode, MissingDependencyError, getPkgManager, setPkgManager } from './error/index.js';
6
7
  export { PackageManagerUtil, generateShortId, generateUuid, isValidUuid, packageManagerUtil, parseJson, safeStringifyJson, stringifyJson } from './utils/index.js';
7
8
  export { b as LogHandlerParams, L as LogLevel, a as Logger, c as createLogger, l as levels, d as logger, s as shouldPublishLog } from './shared/conduithub.B7aryjPG.js';
9
+ export { RedisPlugin } from './plugins/redis/index.js';
8
10
  import 'zod';
9
-
10
- declare const ERROR_CODE: {
11
- readonly INVALID_JSON: "Invalid JSON format";
12
- readonly INVALID_CONFIG: "Configuration validation failed";
13
- readonly UNSUPPORTED_CONFIG_FORMAT: "JavaScript config files are not supported. Use JSON format.";
14
- readonly STATE_MANAGER_NOT_INITIALIZED: "StateManager is not initialized";
15
- readonly SERVICE_CONTAINER_NOT_INITIALIZED: "Service Container is not initialized";
16
- readonly EVENT_BUS_NOT_INITIALIZED: "EventBus is not initialized";
17
- readonly HOOK_SYSTEM_NOT_INITIALIZED: "Hook system is not initialized";
18
- readonly EVENT_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for event";
19
- readonly HOOK_HANDLER_LIMIT_EXCEEDED: "Handler limit exceeded for hook";
20
- readonly DUPLICATE_EVENT_HANDLER_ID: "Duplicate custom ID for event";
21
- readonly DUPLICATE_HOOK_HANDLER_ID: "Duplicate custom ID for hook";
22
- readonly INVALID_STATE_JSON_FORMAT: "Invalid state JSON format";
23
- readonly HOOK_EXECUTION_FAILED: "Hook execution failed";
24
- readonly UNKNOWN_ERROR: "Unknown error";
25
- readonly CIRCULAR_DEPENDENCY_DETECTED: "Circular dependency detected";
26
- readonly SERVICE_NOT_FOUND: "Service not found";
27
- readonly SERVICE_CREATION_FAILED: "Service creation failed";
28
- readonly SERVICE_IS_SINGLETON: "Service is a singleton and cannot be registered again";
29
- readonly PLUGIN_NOT_INITIALIZED: "Plugin is not initialized";
30
- readonly PLUGIN_ALREADY_INITIALIZED: "Plugin is already initialized";
31
- readonly PLUGIN_NOT_RUNNING: "Plugin is not running";
32
- readonly CONFIG_MANAGER_NOT_INITIALIZED: "ConfigManager is not initialized";
33
- readonly CONFIG_MANAGER_ALREADY_INITIALIZED: "ConfigManager is already initialized";
34
- };
35
- type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
36
-
37
- interface ErrorContext {
38
- readonly code?: string;
39
- readonly details?: Record<string, unknown>;
40
- readonly timestamp?: number;
41
- }
42
- declare class ConduithubError extends Error {
43
- readonly code?: string;
44
- readonly details?: Record<string, unknown>;
45
- readonly timestamp: number;
46
- constructor(message: string, context?: ErrorContext);
47
- toJSON(): Record<string, unknown>;
48
- }
49
- declare function setPkgManager(manager: string): void;
50
- declare function getPkgManager(): string;
51
- declare class MissingDependencyError extends ConduithubError {
52
- constructor(pkgName: string);
53
- }
54
-
55
- export { ConduithubError, ERROR_CODE, MissingDependencyError, getPkgManager, setPkgManager };
56
- export type { ErrorCode };