node-pluginsmanager-plugin 6.4.4 → 6.4.5
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.
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import MediatorUser from "./MediatorUser";
|
|
2
|
-
import Server
|
|
3
|
-
import
|
|
2
|
+
import Server from "./Server";
|
|
3
|
+
import { IncomingMessage } from "node:http";
|
|
4
4
|
import type { Server as SocketIOServer } from "socket.io";
|
|
5
|
+
import type { Server as WebSocketServer } from "ws";
|
|
6
|
+
import type { iServerResponse } from "./Server";
|
|
5
7
|
import type { tLogger } from "./DescriptorUser";
|
|
6
8
|
export interface iOrchestratorOptions {
|
|
7
9
|
"externalRessourcesDirectory": string;
|
|
@@ -43,7 +45,7 @@ export default class Orchestrator extends MediatorUser {
|
|
|
43
45
|
enableCheckResponse(): this;
|
|
44
46
|
disableCors(): this;
|
|
45
47
|
enableCors(): this;
|
|
46
|
-
appMiddleware(req:
|
|
48
|
+
appMiddleware(req: IncomingMessage, res: iServerResponse, next: () => void): void;
|
|
47
49
|
socketMiddleware(server: WebSocketServer | SocketIOServer): void;
|
|
48
50
|
load(...data: any): Promise<void>;
|
|
49
51
|
destroy(...data: any): Promise<void>;
|
|
@@ -38,7 +38,7 @@ export default class Server extends MediatorUser {
|
|
|
38
38
|
enableCheckResponse(): this;
|
|
39
39
|
disableCors(): this;
|
|
40
40
|
enableCors(): this;
|
|
41
|
-
appMiddleware(
|
|
41
|
+
appMiddleware(_req: IncomingMessage, res: iServerResponse, next: (err?: Error) => void): void;
|
|
42
42
|
socketMiddleware(socketServer: WebSocketServer | SocketIOServer): void;
|
|
43
43
|
push(command: string, data?: any, log?: boolean): this;
|
|
44
44
|
getClients(): iClient[];
|
|
@@ -4,9 +4,8 @@ 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
|
-
// natives
|
|
8
|
-
const node_url_1 = require("node:url");
|
|
9
7
|
const node_os_1 = require("node:os");
|
|
8
|
+
const node_url_1 = require("node:url");
|
|
10
9
|
// externals
|
|
11
10
|
const uniqid_1 = __importDefault(require("uniqid"));
|
|
12
11
|
// locals
|
|
@@ -102,7 +101,7 @@ class Server extends MediatorUser_1.default {
|
|
|
102
101
|
this._cors = true;
|
|
103
102
|
return this;
|
|
104
103
|
}
|
|
105
|
-
appMiddleware(
|
|
104
|
+
appMiddleware(_req, res, next) {
|
|
106
105
|
if (!this._Descriptor) {
|
|
107
106
|
return next();
|
|
108
107
|
}
|
|
@@ -111,6 +110,7 @@ class Server extends MediatorUser_1.default {
|
|
|
111
110
|
}
|
|
112
111
|
this.checkDescriptor().then(() => {
|
|
113
112
|
var _a, _b, _c;
|
|
113
|
+
const req = Object.assign(_req);
|
|
114
114
|
// parse
|
|
115
115
|
const { pathname, query } = (0, node_url_1.parse)(req.url, true);
|
|
116
116
|
req.method = req.method ? req.method.toLowerCase() : "get";
|
package/lib/cjs/main.d.cts
CHANGED
|
@@ -24,9 +24,9 @@ import DescriptorUser, { type iDescriptorUserOptions, type tLogType, type tLogge
|
|
|
24
24
|
import Mediator, { type iUrlAllowedParameters } from "./components/Mediator";
|
|
25
25
|
import MediatorUser, { type iMediatorUserOptions } from "./components/MediatorUser";
|
|
26
26
|
import Orchestrator, { type iOrchestratorOptions } from "./components/Orchestrator";
|
|
27
|
-
import Server, { type iClient, type
|
|
27
|
+
import Server, { type iClient, type iServerResponse } from "./components/Server";
|
|
28
28
|
import UnauthorizedError from "./components/errors/UnauthorizedError";
|
|
29
29
|
import NotFoundError from "./components/errors/NotFoundError";
|
|
30
30
|
import LockedError from "./components/errors/LockedError";
|
|
31
|
-
export type { tLogType, tLogger, iUrlAllowedParameters, iClient,
|
|
31
|
+
export type { tLogType, tLogger, iUrlAllowedParameters, iClient, iServerResponse };
|
|
32
32
|
export { DescriptorUser, type iDescriptorUserOptions, Mediator, MediatorUser, type iMediatorUserOptions, Orchestrator, type iOrchestratorOptions, Server, UnauthorizedError, NotFoundError, LockedError };
|
package/lib/cjs/utils/send.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { IncomingMessage } from "node:http";
|
|
2
|
+
import type { iServerResponse } from "../components/Server";
|
|
3
|
+
export default function send(req: IncomingMessage, res: iServerResponse, code: number, content: any, options: {
|
|
3
4
|
"apiVersion": string;
|
|
4
5
|
"cors": boolean;
|
|
5
6
|
"mime": string;
|