@zenflux/core 0.1.6 → 0.1.8
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/src/bases/controller-base.d.ts +4 -4
- package/dist/src/bases/index.d.ts +2 -2
- package/dist/src/clients/http.d.ts +3 -3
- package/dist/src/command-bases/command-base.d.ts +3 -3
- package/dist/src/command-bases/command-internal.d.ts +1 -1
- package/dist/src/command-bases/command-public.d.ts +1 -1
- package/dist/src/command-bases/command-restful.d.ts +1 -1
- package/dist/src/command-bases/index.d.ts +4 -4
- package/dist/src/errors/command-already-registered.d.ts +1 -1
- package/dist/src/errors/controller-already-registered.d.ts +1 -1
- package/dist/src/errors/controller-already-set.d.ts +1 -1
- package/dist/src/errors/force-method-implementation.d.ts +1 -1
- package/dist/src/errors/index-public.d.ts +1 -1
- package/dist/src/errors/index.d.ts +5 -5
- package/dist/src/exports-index.d.ts +5 -5
- package/dist/src/exports.d.ts +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/interfaces/index.d.ts +4 -4
- package/dist/src/managers/commands.d.ts +4 -4
- package/dist/src/managers/controllers.d.ts +2 -2
- package/dist/src/managers/export.d.ts +5 -5
- package/dist/src/managers/index.d.ts +4 -4
- package/dist/src/managers/internal.d.ts +1 -1
- package/dist/src/managers/restful.d.ts +5 -5
- package/dist/zenflux-core.cjs +39 -40
- package/dist/zenflux-core.d.ts +448 -3
- package/dist/zenflux-core.mjs +39 -40
- package/package.json +11 -2
- package/src/bases/controller-base.ts +5 -5
- package/src/bases/index.ts +6 -2
- package/src/bases/initialize-base.ts +32 -0
- package/src/bases/object-base.ts +15 -43
- package/src/clients/http.ts +3 -3
- package/src/command-bases/command-base.ts +4 -4
- package/src/command-bases/command-internal.ts +1 -1
- package/src/command-bases/command-public.ts +1 -1
- package/src/command-bases/command-restful.ts +3 -3
- package/src/command-bases/index.ts +5 -4
- package/src/errors/command-already-registered.ts +1 -1
- package/src/errors/controller-already-registered.ts +1 -1
- package/src/errors/controller-already-set.ts +1 -1
- package/src/errors/error-with-metadata.ts +14 -0
- package/src/errors/force-method-implementation.ts +3 -11
- package/src/errors/index-public.ts +1 -1
- package/src/errors/index.ts +9 -5
- package/src/exports-index.ts +5 -5
- package/src/exports.ts +6 -5
- package/src/index.ts +3 -2
- package/src/interfaces/index.ts +5 -4
- package/src/interfaces/logger.ts +3 -2
- package/src/managers/commands.ts +6 -6
- package/src/managers/controllers.ts +3 -3
- package/src/managers/export.ts +5 -5
- package/src/managers/index.ts +5 -4
- package/src/managers/internal.ts +1 -1
- package/src/managers/restful.ts +5 -5
- package/src/modules/debugger.ts +113 -0
- package/src/modules/event-bus/event-bus.ts +204 -0
- package/src/modules/logger/config.ts +44 -0
- package/src/modules/logger/index.ts +82 -0
- package/src/modules/mcp-server/mcp-server.ts +139 -0
- package/src/modules/mcp-server/mcp-service.ts +80 -0
- package/src/modules/service/service-base.ts +55 -0
- package/src/modules/service/service-locator.ts +205 -0
- package/src/modules/service/service-with-dependencies-base.ts +51 -0
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
6
6
|
*/
|
|
7
|
-
import { ObjectBase } from "@zenflux/core/
|
|
8
|
-
import type { CommandPublic } from "@zenflux/core/
|
|
9
|
-
import type { CommandRestful } from "@zenflux/core/
|
|
10
|
-
import type { CommandInternal } from "@zenflux/core/
|
|
7
|
+
import { ObjectBase } from "@zenflux/core/src/bases/object-base";
|
|
8
|
+
import type { CommandPublic } from "@zenflux/core/src/command-bases/command-public";
|
|
9
|
+
import type { CommandRestful } from "@zenflux/core/src/command-bases/command-restful";
|
|
10
|
+
import type { CommandInternal } from "@zenflux/core/src/command-bases/command-internal";
|
|
11
11
|
export declare abstract class ControllerBase extends ObjectBase {
|
|
12
12
|
private commands;
|
|
13
13
|
private restful;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ControllerBase } from "@zenflux/core/
|
|
2
|
-
export { ObjectBase } from "@zenflux/core/
|
|
1
|
+
export { ControllerBase } from "@zenflux/core/src/bases/controller-base";
|
|
2
|
+
export { ObjectBase } from "@zenflux/core/src/bases/object-base";
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
5
5
|
*/
|
|
6
|
-
import { E_HTTP_METHOD_TYPE } from "@zenflux/core/
|
|
7
|
-
import { ObjectBase } from "@zenflux/core/
|
|
8
|
-
import type { TErrorHandlerCallbackType, TResponseFilterCallbackType, TResponseHandlerCallbackType } from "@zenflux/core/
|
|
6
|
+
import { E_HTTP_METHOD_TYPE } from "@zenflux/core/src/interfaces";
|
|
7
|
+
import { ObjectBase } from "@zenflux/core/src/bases/object-base";
|
|
8
|
+
import type { TErrorHandlerCallbackType, TResponseFilterCallbackType, TResponseHandlerCallbackType } from "@zenflux/core/src/interfaces";
|
|
9
9
|
export declare class Http extends ObjectBase {
|
|
10
10
|
private readonly logger;
|
|
11
11
|
private readonly apiBaseUrl;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* TODO
|
|
6
6
|
* - Add validateArgs method or find something better.
|
|
7
7
|
*/
|
|
8
|
-
import { ObjectBase } from "@zenflux/core/
|
|
9
|
-
import type { ControllerBase } from "@zenflux/core/
|
|
10
|
-
import type { ICommandArgsInterface, ICommandOptionsInterface } from "@zenflux/core/
|
|
8
|
+
import { ObjectBase } from "@zenflux/core/src/bases";
|
|
9
|
+
import type { ControllerBase } from "@zenflux/core/src/bases";
|
|
10
|
+
import type { ICommandArgsInterface, ICommandOptionsInterface } from "@zenflux/core/src/interfaces";
|
|
11
11
|
export declare abstract class CommandBase extends ObjectBase {
|
|
12
12
|
private static controller;
|
|
13
13
|
protected args: ICommandArgsInterface;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
* @description CommandInternal, is used when part of the logic needed to be in the command but not represent a user action.
|
|
4
4
|
*/
|
|
5
|
-
import { CommandBase } from "@zenflux/core/
|
|
5
|
+
import { CommandBase } from "@zenflux/core/src/command-bases/command-base";
|
|
6
6
|
export declare class CommandInternal extends CommandBase {
|
|
7
7
|
static getName(): string;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
* @description CommandPublic represents a USER action, every class which inherit from this class will USER action.
|
|
4
4
|
* */
|
|
5
|
-
import { CommandBase } from "@zenflux/core/
|
|
5
|
+
import { CommandBase } from "@zenflux/core/src/command-bases/command-base";
|
|
6
6
|
export declare class CommandPublic extends CommandBase {
|
|
7
7
|
static getName(): string;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
* @description Each rest command should represent a final REST endpoint.
|
|
4
4
|
*/
|
|
5
|
-
import { CommandBase } from "@zenflux/core/
|
|
5
|
+
import { CommandBase } from "@zenflux/core/src/command-bases/command-base";
|
|
6
6
|
export declare abstract class CommandRestful extends CommandBase {
|
|
7
7
|
static getName(): string;
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
*/
|
|
4
|
-
export { CommandPublic } from "@zenflux/core/
|
|
5
|
-
export { CommandRestful } from "@zenflux/core/
|
|
6
|
-
export { CommandBase } from "@zenflux/core/
|
|
7
|
-
export { CommandInternal } from "@zenflux/core/
|
|
4
|
+
export { CommandPublic } from "@zenflux/core/src/command-bases/command-public";
|
|
5
|
+
export { CommandRestful } from "@zenflux/core/src/command-bases/command-restful";
|
|
6
|
+
export { CommandBase } from "@zenflux/core/src/command-bases/command-base";
|
|
7
|
+
export { CommandInternal } from "@zenflux/core/src/command-bases/command-internal";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ForceMethodImplementation } from "@zenflux/core/
|
|
1
|
+
export { ForceMethodImplementation } from "@zenflux/core/src/errors/force-method-implementation";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CommandAlreadyRegistered } from "@zenflux/core/
|
|
2
|
-
export { CommandNotFound } from "@zenflux/core/
|
|
3
|
-
export { ControllerAlreadyRegistered } from "@zenflux/core/
|
|
4
|
-
export { ControllerAlreadySet } from "@zenflux/core/
|
|
5
|
-
export { ForceMethodImplementation } from "@zenflux/core/
|
|
1
|
+
export { CommandAlreadyRegistered } from "@zenflux/core/src/errors/command-already-registered";
|
|
2
|
+
export { CommandNotFound } from "@zenflux/core/src/errors/command-not-found";
|
|
3
|
+
export { ControllerAlreadyRegistered } from "@zenflux/core/src/errors/controller-already-registered";
|
|
4
|
+
export { ControllerAlreadySet } from "@zenflux/core/src/errors/controller-already-set";
|
|
5
|
+
export { ForceMethodImplementation } from "@zenflux/core/src/errors/force-method-implementation";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as bases from "@zenflux/core/
|
|
2
|
-
import * as commandBases from "@zenflux/core/
|
|
3
|
-
import * as errors from "@zenflux/core/
|
|
4
|
-
import * as interfaces from "@zenflux/core/
|
|
5
|
-
import * as managers from "@zenflux/core/
|
|
1
|
+
import * as bases from "@zenflux/core/src/bases";
|
|
2
|
+
import * as commandBases from "@zenflux/core/src/command-bases";
|
|
3
|
+
import * as errors from "@zenflux/core/src/errors/index-public";
|
|
4
|
+
import * as interfaces from "@zenflux/core/src/interfaces";
|
|
5
|
+
import * as managers from "@zenflux/core/src/managers/export";
|
|
6
6
|
export { bases, commandBases, errors, interfaces, managers, };
|
package/dist/src/exports.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
*/
|
|
4
|
-
import { bases, commandBases, errors, interfaces, managers } from "@zenflux/core/
|
|
4
|
+
import { bases, commandBases, errors, interfaces, managers } from "@zenflux/core/src/exports-index";
|
|
5
5
|
declare global {
|
|
6
6
|
var __ZEN_CORE__IS_INITIALIZED__: boolean;
|
|
7
7
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
*/
|
|
4
|
-
import * as ZenCore from "@zenflux/core/
|
|
4
|
+
import * as ZenCore from "@zenflux/core/src/exports";
|
|
5
5
|
declare global {
|
|
6
6
|
var zCore: typeof ZenCore;
|
|
7
7
|
}
|
|
8
|
-
export * from "@zenflux/core/
|
|
8
|
+
export * from "@zenflux/core/src/exports-index";
|
|
9
9
|
export default ZenCore;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
*/
|
|
4
|
-
export type * from "@zenflux/core/
|
|
5
|
-
export type * from "@zenflux/core/
|
|
6
|
-
export type * from "@zenflux/core/
|
|
7
|
-
export * from "@zenflux/core/
|
|
4
|
+
export type * from "@zenflux/core/src/interfaces/commands";
|
|
5
|
+
export type * from "@zenflux/core/src/interfaces/config";
|
|
6
|
+
export type * from "@zenflux/core/src/interfaces/logger";
|
|
7
|
+
export * from "@zenflux/core/src/interfaces/restful";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
* @description Responsible for manging/running/hooking commands.
|
|
4
4
|
*/
|
|
5
|
-
import { ObjectBase } from "@zenflux/core/
|
|
6
|
-
import type { TCommandCallbackType, ICommandArgsInterface, ILogger } from "@zenflux/core/
|
|
7
|
-
import type { ControllerBase } from "@zenflux/core/
|
|
8
|
-
import type { CommandBase } from "@zenflux/core/
|
|
5
|
+
import { ObjectBase } from "@zenflux/core/src/bases/object-base";
|
|
6
|
+
import type { TCommandCallbackType, ICommandArgsInterface, ILogger } from "@zenflux/core/src/interfaces";
|
|
7
|
+
import type { ControllerBase } from "@zenflux/core/src/bases/controller-base";
|
|
8
|
+
import type { CommandBase } from "@zenflux/core/src/command-bases/command-base";
|
|
9
9
|
export declare class Commands extends ObjectBase {
|
|
10
10
|
static readonly trace: string[];
|
|
11
11
|
private current;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ObjectBase } from "@zenflux/core/
|
|
2
|
-
import type { ControllerBase } from "@zenflux/core/
|
|
1
|
+
import { ObjectBase } from "@zenflux/core/src/bases/object-base";
|
|
2
|
+
import type { ControllerBase } from "@zenflux/core/src/bases/controller-base";
|
|
3
3
|
export declare class Controllers extends ObjectBase {
|
|
4
4
|
private controllers;
|
|
5
5
|
constructor();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
*/
|
|
4
|
-
import { Commands } from "@zenflux/core/
|
|
5
|
-
import { Controllers } from "@zenflux/core/
|
|
6
|
-
import { Restful } from "@zenflux/core/
|
|
7
|
-
import { Internal } from "@zenflux/core/
|
|
8
|
-
import type { IAPIConfig } from "@zenflux/core/
|
|
4
|
+
import { Commands } from "@zenflux/core/src/managers/commands";
|
|
5
|
+
import { Controllers } from "@zenflux/core/src/managers/controllers";
|
|
6
|
+
import { Restful } from "@zenflux/core/src/managers/restful";
|
|
7
|
+
import { Internal } from "@zenflux/core/src/managers/internal";
|
|
8
|
+
import type { IAPIConfig } from "@zenflux/core/src/interfaces";
|
|
9
9
|
export declare const afterInitializeCallbacks: (() => void)[];
|
|
10
10
|
export declare function initialize(config: IAPIConfig): void;
|
|
11
11
|
export declare function destroy(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
*/
|
|
4
|
-
export { Commands } from "@zenflux/core/
|
|
5
|
-
export { Controllers } from "@zenflux/core/
|
|
6
|
-
export { Restful } from "@zenflux/core/
|
|
7
|
-
export { Internal } from "@zenflux/core/
|
|
4
|
+
export { Commands } from "@zenflux/core/src/managers/commands";
|
|
5
|
+
export { Controllers } from "@zenflux/core/src/managers/controllers";
|
|
6
|
+
export { Restful } from "@zenflux/core/src/managers/restful";
|
|
7
|
+
export { Internal } from "@zenflux/core/src/managers/internal";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
* @description Responsible for manging internal commands, To serve commands that are not triggered by user.
|
|
4
4
|
*/
|
|
5
|
-
import { Commands } from "@zenflux/core/
|
|
5
|
+
import { Commands } from "@zenflux/core/src/managers/commands";
|
|
6
6
|
export declare class Internal extends Commands {
|
|
7
7
|
static getName(): string;
|
|
8
8
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @author Leonid Vinikov <leonidvinikov@gmail.com>
|
|
3
3
|
* @description Responsible for manging restful commands which are wrappers for HTTP requests.
|
|
4
4
|
*/
|
|
5
|
-
import { Commands } from "@zenflux/core/
|
|
6
|
-
import { Http } from "@zenflux/core/
|
|
7
|
-
import { E_RESPONSE_HANDLER_TYPE, E_HTTP_METHOD_TYPE } from "@zenflux/core/
|
|
8
|
-
import type { CommandRestful } from "@zenflux/core/
|
|
9
|
-
import type { IAPIConfig, ICommandArgsInterface, ICommandOptionsInterface, TPossibleHandlersType } from "@zenflux/core/
|
|
5
|
+
import { Commands } from "@zenflux/core/src/managers/commands";
|
|
6
|
+
import { Http } from "@zenflux/core/src/clients/http";
|
|
7
|
+
import { E_RESPONSE_HANDLER_TYPE, E_HTTP_METHOD_TYPE } from "@zenflux/core/src/interfaces";
|
|
8
|
+
import type { CommandRestful } from "@zenflux/core/src/command-bases";
|
|
9
|
+
import type { IAPIConfig, ICommandArgsInterface, ICommandOptionsInterface, TPossibleHandlersType } from "@zenflux/core/src/interfaces";
|
|
10
10
|
export declare class Restful extends Commands {
|
|
11
11
|
private static client;
|
|
12
12
|
currentHttpMethod: E_HTTP_METHOD_TYPE;
|
package/dist/zenflux-core.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Bundled with love using the help of @zenflux/cli toolkit v0.1.
|
|
3
|
-
* Bundle name: @zenflux/core fileName: 'zenflux-core', built at
|
|
2
|
+
* Bundled with love using the help of @zenflux/cli toolkit v0.1.29
|
|
3
|
+
* Bundle name: @zenflux/core fileName: 'zenflux-core', built at Wed Nov 19 2025 14:11:49 GMT+0200 (Israel Standard Time)
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
'use strict';
|
|
@@ -80,46 +80,45 @@ ForceMethodImplementation: ForceMethodImplementation
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
var _package = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
"name": "@zenflux/core",
|
|
84
|
+
"version": "0.1.7",
|
|
85
|
+
"types": "dist/zenflux-core.d.ts",
|
|
86
|
+
"type": "module",
|
|
87
|
+
"files": [
|
|
88
|
+
"dist",
|
|
89
|
+
"src",
|
|
90
|
+
"types"
|
|
91
|
+
],
|
|
92
|
+
"scripts": {
|
|
93
|
+
"@z-core--test": "jest",
|
|
94
|
+
"@z-core--build": "@z-cli @build",
|
|
95
|
+
"@z-core--dev": "@z-cli @watch --dev"
|
|
96
|
+
},
|
|
97
|
+
"exports": {
|
|
98
|
+
".": {
|
|
99
|
+
"import": "./dist/zenflux-core.mjs",
|
|
100
|
+
"default": "./dist/zenflux-core.cjs",
|
|
101
|
+
"require": "./dist/zenflux-core.mjs.js",
|
|
102
|
+
"types": "./dist/zenflux-core.d.ts"
|
|
96
103
|
},
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"devDependencies": {
|
|
114
|
-
"@zenflux/cli": "workspace:*"
|
|
115
|
-
},
|
|
116
|
-
"publishConfig": {
|
|
117
|
-
"access": "public"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
;
|
|
104
|
+
"./dist/src/*": "./src/*",
|
|
105
|
+
"./src/bases": "./src/bases/index.ts",
|
|
106
|
+
"./src/clients": "./src/clients/index.ts",
|
|
107
|
+
"./src/command-bases": "./src/command-bases/index.ts",
|
|
108
|
+
"./src/errors": "./src/errors/index.ts",
|
|
109
|
+
"./src/interfaces": "./src/interfaces/index.ts",
|
|
110
|
+
"./src/managers": "./src/managers/index.ts",
|
|
111
|
+
"./package.json": "./package.json"
|
|
112
|
+
},
|
|
113
|
+
"devDependencies": {
|
|
114
|
+
"@zenflux/cli": "workspace:*"
|
|
115
|
+
},
|
|
116
|
+
"publishConfig": {
|
|
117
|
+
"access": "public"
|
|
118
|
+
}
|
|
119
|
+
};
|
|
121
120
|
const name = "@zenflux/core";
|
|
122
|
-
const version = "0.1.
|
|
121
|
+
const version = "0.1.7";
|
|
123
122
|
const types = "dist/zenflux-core.d.ts";
|
|
124
123
|
const type = "module";
|
|
125
124
|
const files = ["dist","src","types"];
|