node-pluginsmanager-plugin 7.3.2 → 7.4.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/lib/cjs/components/Orchestrator.d.ts +8 -4
- package/lib/cjs/components/Orchestrator.js +12 -19
- package/lib/cjs/main.cjs +10 -1
- package/lib/cjs/main.d.cts +7 -2
- package/lib/cjs/utils/file/isDirectory.d.ts +1 -0
- package/lib/cjs/utils/file/isDirectory.js +18 -0
- package/lib/cjs/utils/file/isFile.d.ts +1 -1
- package/lib/cjs/utils/file/isFile.js +3 -3
- package/lib/cjs/utils/isPlainObject.d.ts +1 -0
- package/lib/cjs/utils/isPlainObject.js +10 -0
- package/package.json +3 -3
|
@@ -13,6 +13,10 @@ export interface iOrchestratorOptions {
|
|
|
13
13
|
"serverFile": string;
|
|
14
14
|
"logger"?: tLogger;
|
|
15
15
|
}
|
|
16
|
+
export interface iEngines {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
"node": string;
|
|
19
|
+
}
|
|
16
20
|
export default class Orchestrator<T extends iEventsMinimal & tEventMap<T> = iEventsMinimal> extends MediatorUser<T> {
|
|
17
21
|
protected _Server: Server | null;
|
|
18
22
|
protected _socketServer: WebSocketServer | SocketIOServer | SocketIOServerV2 | null;
|
|
@@ -26,13 +30,13 @@ export default class Orchestrator<T extends iEventsMinimal & tEventMap<T> = iEve
|
|
|
26
30
|
enabled: boolean;
|
|
27
31
|
authors: string[];
|
|
28
32
|
description: string;
|
|
29
|
-
dependencies:
|
|
30
|
-
devDependencies:
|
|
31
|
-
engines:
|
|
33
|
+
dependencies: Record<string, string> | null;
|
|
34
|
+
devDependencies: Record<string, string> | null;
|
|
35
|
+
engines: iEngines | null;
|
|
32
36
|
license: string;
|
|
33
37
|
main: string;
|
|
34
38
|
name: string;
|
|
35
|
-
scripts:
|
|
39
|
+
scripts: Record<string, string> | null;
|
|
36
40
|
version: string;
|
|
37
41
|
constructor(options: iOrchestratorOptions);
|
|
38
42
|
checkConf(): Promise<void>;
|
|
@@ -11,8 +11,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
// deps
|
|
14
|
-
// natives
|
|
15
|
-
const node_path_1 = require("node:path");
|
|
16
14
|
// locals
|
|
17
15
|
const checkObject_1 = require("../checkers/TypeError/checkObject");
|
|
18
16
|
const MediatorUser_1 = __importDefault(require("./MediatorUser"));
|
|
@@ -206,23 +204,18 @@ class Orchestrator extends MediatorUser_1.default {
|
|
|
206
204
|
}
|
|
207
205
|
// load / destroy
|
|
208
206
|
load(...data) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
this.scripts = {};
|
|
222
|
-
this.version = "";
|
|
223
|
-
return (0, readJSONFile_1.default)(this._packageFile);
|
|
224
|
-
// formate authors
|
|
225
|
-
}).then((packageData) => {
|
|
207
|
+
// native
|
|
208
|
+
this.authors = [];
|
|
209
|
+
this.description = "";
|
|
210
|
+
this.dependencies = {};
|
|
211
|
+
this.devDependencies = {};
|
|
212
|
+
this.engines = null;
|
|
213
|
+
this.license = "MIT";
|
|
214
|
+
this.main = "lib/main.js";
|
|
215
|
+
this.name = "";
|
|
216
|
+
this.scripts = {};
|
|
217
|
+
this.version = "";
|
|
218
|
+
return (0, readJSONFile_1.default)(this._packageFile).then((packageData) => {
|
|
226
219
|
if ("undefined" !== typeof packageData.authors) {
|
|
227
220
|
if (Array.isArray(packageData.authors)) {
|
|
228
221
|
this.authors = packageData.authors;
|
package/lib/cjs/main.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.formateError = exports.UnauthorizedError = exports.NotFoundError = exports.LockedError = exports.ConflictError = exports.Server = exports.Orchestrator = exports.MediatorUser = exports.Mediator = exports.DescriptorUser = exports.checkNonEmptyStringSync = exports.checkNonEmptyString = exports.checkNonEmptyObjectSync = exports.checkNonEmptyObject = exports.checkNonEmptyNumberSync = exports.checkNonEmptyNumber = exports.checkIntegerSync = exports.checkInteger = exports.checkStringSync = exports.checkString = exports.checkObjectSync = exports.checkObject = exports.checkNumberSync = exports.checkNumber = exports.checkFunctionSync = exports.checkFunction = exports.checkExistsSync = exports.checkExists = void 0;
|
|
7
|
+
exports.formateError = exports.UnauthorizedError = exports.NotFoundError = exports.LockedError = exports.ConflictError = exports.Server = exports.Orchestrator = exports.MediatorUser = exports.Mediator = exports.DescriptorUser = exports.isDirectory = exports.readJSONFile = exports.isFile = exports.isPlainObject = exports.checkNonEmptyStringSync = exports.checkNonEmptyString = exports.checkNonEmptyObjectSync = exports.checkNonEmptyObject = exports.checkNonEmptyNumberSync = exports.checkNonEmptyNumber = exports.checkIntegerSync = exports.checkInteger = exports.checkStringSync = exports.checkString = exports.checkObjectSync = exports.checkObject = exports.checkNumberSync = exports.checkNumber = exports.checkFunctionSync = exports.checkFunction = exports.checkExistsSync = exports.checkExists = void 0;
|
|
8
8
|
// undefined
|
|
9
9
|
const checkExists_1 = require("./checkers/ReferenceError/checkExists");
|
|
10
10
|
Object.defineProperty(exports, "checkExists", { enumerable: true, get: function () { return checkExists_1.checkExists; } });
|
|
@@ -36,6 +36,15 @@ Object.defineProperty(exports, "checkNonEmptyObjectSync", { enumerable: true, ge
|
|
|
36
36
|
const checkNonEmptyString_1 = require("./checkers/RangeError/checkNonEmptyString");
|
|
37
37
|
Object.defineProperty(exports, "checkNonEmptyString", { enumerable: true, get: function () { return checkNonEmptyString_1.checkNonEmptyString; } });
|
|
38
38
|
Object.defineProperty(exports, "checkNonEmptyStringSync", { enumerable: true, get: function () { return checkNonEmptyString_1.checkNonEmptyStringSync; } });
|
|
39
|
+
// utils
|
|
40
|
+
const isPlainObject_1 = __importDefault(require("./utils/isPlainObject"));
|
|
41
|
+
exports.isPlainObject = isPlainObject_1.default;
|
|
42
|
+
const isFile_1 = __importDefault(require("./utils/file/isFile"));
|
|
43
|
+
exports.isFile = isFile_1.default;
|
|
44
|
+
const readJSONFile_1 = __importDefault(require("./utils/file/readJSONFile"));
|
|
45
|
+
exports.readJSONFile = readJSONFile_1.default;
|
|
46
|
+
const isDirectory_1 = __importDefault(require("./utils/file/isDirectory"));
|
|
47
|
+
exports.isDirectory = isDirectory_1.default;
|
|
39
48
|
// components
|
|
40
49
|
const DescriptorUser_1 = __importDefault(require("./components/DescriptorUser"));
|
|
41
50
|
exports.DescriptorUser = DescriptorUser_1.default;
|
package/lib/cjs/main.d.cts
CHANGED
|
@@ -8,10 +8,15 @@ import { checkNonEmptyNumber, checkNonEmptyNumberSync } from "./checkers/RangeEr
|
|
|
8
8
|
import { checkNonEmptyObject, checkNonEmptyObjectSync } from "./checkers/RangeError/checkNonEmptyObject";
|
|
9
9
|
import { checkNonEmptyString, checkNonEmptyStringSync } from "./checkers/RangeError/checkNonEmptyString";
|
|
10
10
|
export { checkExists, checkExistsSync, checkFunction, checkFunctionSync, checkNumber, checkNumberSync, checkObject, checkObjectSync, checkString, checkStringSync, checkInteger, checkIntegerSync, checkNonEmptyNumber, checkNonEmptyNumberSync, checkNonEmptyObject, checkNonEmptyObjectSync, checkNonEmptyString, checkNonEmptyStringSync };
|
|
11
|
+
import isPlainObject from "./utils/isPlainObject";
|
|
12
|
+
import isFile from "./utils/file/isFile";
|
|
13
|
+
import readJSONFile from "./utils/file/readJSONFile";
|
|
14
|
+
import isDirectory from "./utils/file/isDirectory";
|
|
15
|
+
export { isPlainObject, isFile, readJSONFile, isDirectory };
|
|
11
16
|
import DescriptorUser, { type iDescriptorUserOptions, type tLogType, type tLogger, type iEventsMinimal } from "./components/DescriptorUser";
|
|
12
17
|
import Mediator, { type iUrlAllowedParameters } from "./components/Mediator";
|
|
13
18
|
import MediatorUser, { type iMediatorUserOptions } from "./components/MediatorUser";
|
|
14
|
-
import Orchestrator, { type iOrchestratorOptions } from "./components/Orchestrator";
|
|
19
|
+
import Orchestrator, { type iOrchestratorOptions, type iEngines } from "./components/Orchestrator";
|
|
15
20
|
import Server, { type iClient } from "./components/Server";
|
|
16
21
|
import ConflictError from "./components/errors/ConflictError";
|
|
17
22
|
import LockedError from "./components/errors/LockedError";
|
|
@@ -19,4 +24,4 @@ import NotFoundError from "./components/errors/NotFoundError";
|
|
|
19
24
|
import UnauthorizedError from "./components/errors/UnauthorizedError";
|
|
20
25
|
import formateError, { type iFormattedError } from "./utils/server/formateError";
|
|
21
26
|
export type { tLogType, tLogger, iEventsMinimal, iUrlAllowedParameters, iClient };
|
|
22
|
-
export { DescriptorUser, type iDescriptorUserOptions, Mediator, MediatorUser, type iMediatorUserOptions, Orchestrator, type iOrchestratorOptions, Server, ConflictError, LockedError, NotFoundError, UnauthorizedError, formateError, type iFormattedError };
|
|
27
|
+
export { DescriptorUser, type iDescriptorUserOptions, Mediator, MediatorUser, type iMediatorUserOptions, Orchestrator, type iOrchestratorOptions, type iEngines, Server, ConflictError, LockedError, NotFoundError, UnauthorizedError, formateError, type iFormattedError };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isDirectory(directoryPath: string): Promise<boolean>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// deps
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = isDirectory;
|
|
5
|
+
// natives
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
// locals
|
|
8
|
+
const checkNonEmptyString_1 = require("../../checkers/RangeError/checkNonEmptyString");
|
|
9
|
+
// module
|
|
10
|
+
function isDirectory(directoryPath) {
|
|
11
|
+
return (0, checkNonEmptyString_1.checkNonEmptyString)("directoryPath", directoryPath).then(() => {
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
(0, node_fs_1.lstat)(directoryPath, (err, stats) => {
|
|
14
|
+
return resolve(Boolean(!err && stats.isDirectory()));
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isFile(
|
|
1
|
+
export default function isFile(filePath: string): Promise<boolean>;
|
|
@@ -7,10 +7,10 @@ const node_fs_1 = require("node:fs");
|
|
|
7
7
|
// locals
|
|
8
8
|
const checkNonEmptyString_1 = require("../../checkers/RangeError/checkNonEmptyString");
|
|
9
9
|
// module
|
|
10
|
-
function isFile(
|
|
11
|
-
return (0, checkNonEmptyString_1.checkNonEmptyString)("
|
|
10
|
+
function isFile(filePath) {
|
|
11
|
+
return (0, checkNonEmptyString_1.checkNonEmptyString)("filePath", filePath).then(() => {
|
|
12
12
|
return new Promise((resolve) => {
|
|
13
|
-
(0, node_fs_1.lstat)(
|
|
13
|
+
(0, node_fs_1.lstat)(filePath, (err, stats) => {
|
|
14
14
|
return resolve(Boolean(!err && stats.isFile()));
|
|
15
15
|
});
|
|
16
16
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isPlainObject(value: unknown): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// module
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = isPlainObject;
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
if ("object" !== typeof value || null === value) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return Object.getPrototypeOf(value) === Object.getPrototypeOf({});
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
|
|
3
3
|
"name": "node-pluginsmanager-plugin",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.4.1",
|
|
5
5
|
"description": "An abstract parent plugin for node-pluginsmanager.",
|
|
6
6
|
|
|
7
7
|
"type": "commonjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"lib/@types"
|
|
45
45
|
],
|
|
46
46
|
"engines": {
|
|
47
|
-
"node": ">=22.
|
|
47
|
+
"node": ">=22.23.1"
|
|
48
48
|
},
|
|
49
49
|
|
|
50
50
|
"dependencies": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/express": "5.0.6",
|
|
57
|
-
"@types/node": "25.9.
|
|
57
|
+
"@types/node": "25.9.3",
|
|
58
58
|
"@types/socket.io": "3.0.2",
|
|
59
59
|
"@types/uniqid": "5.3.4",
|
|
60
60
|
"@types/ws": "8.18.1",
|