node-pluginsmanager-plugin 6.0.4 → 6.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/lib/cjs/checkers/RangeError/checkArrayLength.js +1 -3
- package/lib/cjs/checkers/RangeError/checkArrayLengthBetween.js +1 -3
- package/lib/cjs/checkers/RangeError/checkIntegerBetween.js +1 -3
- package/lib/cjs/checkers/RangeError/checkNonEmptyArray.js +1 -3
- package/lib/cjs/checkers/RangeError/checkNonEmptyInteger.js +1 -3
- package/lib/cjs/checkers/RangeError/checkNonEmptyNumber.js +1 -3
- package/lib/cjs/checkers/RangeError/checkNonEmptyObject.js +1 -3
- package/lib/cjs/checkers/RangeError/checkNonEmptyString.js +1 -3
- package/lib/cjs/checkers/RangeError/checkNumberBetween.js +1 -3
- package/lib/cjs/checkers/RangeError/checkObjectLength.js +1 -3
- package/lib/cjs/checkers/RangeError/checkObjectLengthBetween.js +1 -3
- package/lib/cjs/checkers/RangeError/checkStringLength.js +1 -3
- package/lib/cjs/checkers/RangeError/checkStringLengthBetween.js +1 -3
- package/lib/cjs/checkers/ReferenceError/checkExists.js +1 -3
- package/lib/cjs/checkers/TypeError/checkArray.js +1 -3
- package/lib/cjs/checkers/TypeError/checkBoolean.js +1 -3
- package/lib/cjs/checkers/TypeError/checkFunction.js +1 -3
- package/lib/cjs/checkers/TypeError/checkInteger.js +1 -3
- package/lib/cjs/checkers/TypeError/checkNumber.js +1 -3
- package/lib/cjs/checkers/TypeError/checkObject.js +1 -3
- package/lib/cjs/checkers/TypeError/checkString.js +1 -3
- package/lib/cjs/components/DescriptorUser.d.ts +1 -1
- package/lib/cjs/components/DescriptorUser.js +22 -14
- package/lib/cjs/components/Mediator.d.ts +6 -14
- package/lib/cjs/components/Mediator.js +10 -13
- package/lib/cjs/components/MediatorUser.d.ts +1 -1
- package/lib/cjs/components/MediatorUser.js +4 -4
- package/lib/cjs/components/NotFoundError.js +1 -2
- package/lib/cjs/components/Orchestrator.d.ts +7 -8
- package/lib/cjs/components/Orchestrator.js +7 -9
- package/lib/cjs/components/Server.d.ts +14 -22
- package/lib/cjs/components/Server.js +38 -29
- package/lib/cjs/main.cjs +1 -1
- package/lib/cjs/main.d.cts +7 -7
- package/lib/cjs/utils/cleanSendedError.js +1 -2
- package/lib/cjs/utils/descriptor/extractParams.d.ts +1 -3
- package/lib/cjs/utils/descriptor/extractParams.js +1 -2
- package/lib/cjs/utils/descriptor/extractPathMethodByOperationId.js +1 -2
- package/lib/cjs/utils/descriptor/extractPattern.js +4 -4
- package/lib/cjs/utils/descriptor/extractSchemaType.d.ts +1 -3
- package/lib/cjs/utils/descriptor/extractSchemaType.js +1 -1
- package/lib/cjs/utils/file/checkFile.js +4 -4
- package/lib/cjs/utils/file/isFile.js +1 -2
- package/lib/cjs/utils/file/readJSONFile.js +1 -2
- package/lib/cjs/utils/jsonParser.js +1 -2
- package/lib/cjs/utils/removeFirstSlash.js +1 -2
- package/lib/cjs/utils/request/extractBody.d.ts +1 -1
- package/lib/cjs/utils/request/extractBody.js +4 -5
- package/lib/cjs/utils/request/extractCookies.d.ts +1 -3
- package/lib/cjs/utils/request/extractCookies.js +1 -1
- package/lib/cjs/utils/request/extractIp.js +1 -2
- package/lib/cjs/utils/request/extractMime.d.ts +4 -8
- package/lib/cjs/utils/request/extractMime.js +4 -11
- package/lib/cjs/utils/send.d.ts +1 -1
- package/lib/cjs/utils/send.js +26 -22
- package/package.json +97 -91
package/lib/cjs/utils/send.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// types & interfaces
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
// module
|
|
4
5
|
function send(req, res, code, content, options) {
|
|
@@ -42,27 +43,31 @@ function send(req, res, code, content, options) {
|
|
|
42
43
|
}, options.cors ? {
|
|
43
44
|
"Access-Control-Allow-Origin": "*",
|
|
44
45
|
"Access-Control-Allow-Credentials": true,
|
|
45
|
-
"Access-Control-Allow-Methods": req.headers["access-control-request-method"]
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
"Access-Control-Allow-Methods": req.headers["access-control-request-method"]
|
|
47
|
+
? req.headers["access-control-request-method"]
|
|
48
|
+
: [
|
|
49
|
+
"GET",
|
|
50
|
+
"POST",
|
|
51
|
+
"PUT",
|
|
52
|
+
"DELETE",
|
|
53
|
+
"PATCH",
|
|
54
|
+
"OPTIONS"
|
|
55
|
+
].join(", "),
|
|
56
|
+
"Access-Control-Allow-Headers": req.headers["access-control-request-headers"]
|
|
57
|
+
? req.headers["access-control-request-headers"]
|
|
58
|
+
: [
|
|
59
|
+
"Origin",
|
|
60
|
+
"Accept",
|
|
61
|
+
"Accept-Version",
|
|
62
|
+
"Content-Length",
|
|
63
|
+
"Content-MD5",
|
|
64
|
+
"Content-Type",
|
|
65
|
+
"Date",
|
|
66
|
+
"X-Api-Version",
|
|
67
|
+
"X-File-Name",
|
|
68
|
+
"X-CSRF-Token",
|
|
69
|
+
"X-Requested-With"
|
|
70
|
+
].join(", ")
|
|
66
71
|
} : {});
|
|
67
72
|
// send data
|
|
68
73
|
res.writeHead(res.statusCode, res.headers);
|
|
@@ -81,4 +86,3 @@ function send(req, res, code, content, options) {
|
|
|
81
86
|
});
|
|
82
87
|
}
|
|
83
88
|
exports.default = send;
|
|
84
|
-
;
|
package/package.json
CHANGED
|
@@ -1,91 +1,97 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
"name": "node-pluginsmanager-plugin",
|
|
4
|
-
"version": "6.0
|
|
5
|
-
"description": "An abstract parent plugin for node-pluginsmanager",
|
|
6
|
-
|
|
7
|
-
"type": "commonjs",
|
|
8
|
-
"typings": "./lib/cjs/main.d.cts",
|
|
9
|
-
"main": "./lib/cjs/main.cjs",
|
|
10
|
-
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"require": {
|
|
14
|
-
"types": "./lib/cjs/main.d.cts",
|
|
15
|
-
"default": "./lib/cjs/main.cjs"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
"scripts": {
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@types/
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
1
|
+
{
|
|
2
|
+
|
|
3
|
+
"name": "node-pluginsmanager-plugin",
|
|
4
|
+
"version": "6.1.0",
|
|
5
|
+
"description": "An abstract parent plugin for node-pluginsmanager",
|
|
6
|
+
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"typings": "./lib/cjs/main.d.cts",
|
|
9
|
+
"main": "./lib/cjs/main.cjs",
|
|
10
|
+
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"require": {
|
|
14
|
+
"types": "./lib/cjs/main.d.cts",
|
|
15
|
+
"default": "./lib/cjs/main.cjs"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"scripts": {
|
|
21
|
+
|
|
22
|
+
"prepare": "npx husky install",
|
|
23
|
+
|
|
24
|
+
"clean": "npx rimraf lib",
|
|
25
|
+
"build": "npm run-script clean && npx tsc --project \"./tsconfig.json\"",
|
|
26
|
+
|
|
27
|
+
"lint": "npx eslint --config .eslintrc-src.js --ext .cts,.ts ./src/**/* && npx eslint --config .eslintrc-tests.js ./bin/*.js ./test/**/*.js",
|
|
28
|
+
"check-requires": "npx used-deps-analyzer \"./package.json\" \"./src\" --no-dev --overkill \"fs-extra\" \"node-promfs\"",
|
|
29
|
+
"check-updates": "npx check-version-modules",
|
|
30
|
+
"unit-tests": "npm run-script build && npx nyc --reporter=html --reporter=text mocha",
|
|
31
|
+
|
|
32
|
+
"tests": "npm run-script lint && npm run-script check-requires && npm run-script check-updates && npm run-script unit-tests"
|
|
33
|
+
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"files": [
|
|
37
|
+
"/bin",
|
|
38
|
+
"/lib",
|
|
39
|
+
"/public"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=16.0.0"
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@apidevtools/swagger-parser": "10.1.0",
|
|
47
|
+
"express-openapi-validate": "0.6.1",
|
|
48
|
+
"uniqid": "5.4.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/express": "4.17.21",
|
|
52
|
+
"@types/node": "20.11.10",
|
|
53
|
+
"@types/socket.io": "3.0.2",
|
|
54
|
+
"@types/uniqid": "5.3.4",
|
|
55
|
+
"@types/ws": "8.5.10",
|
|
56
|
+
"check-version-modules": "2.0.0",
|
|
57
|
+
"colors": "1.4.0",
|
|
58
|
+
"eslint-plugin-personnallinter": "git+ssh://git@github.com/Psychopoulet/eslint-plugin-personnallinter",
|
|
59
|
+
"express": "4.18.2",
|
|
60
|
+
"husky": "9.0.7",
|
|
61
|
+
"mocha": "10.2.0",
|
|
62
|
+
"nyc": "15.1.0",
|
|
63
|
+
"openapi-types": "12.1.3",
|
|
64
|
+
"rimraf": "5.0.5",
|
|
65
|
+
"socket.io": "4.7.4",
|
|
66
|
+
"socket.io-client": "4.7.4",
|
|
67
|
+
"typescript": "5.3.3",
|
|
68
|
+
"used-deps-analyzer": "0.1.8",
|
|
69
|
+
"ws": "8.16.0"
|
|
70
|
+
},
|
|
71
|
+
"optionalDependencies": {},
|
|
72
|
+
|
|
73
|
+
"husky": {
|
|
74
|
+
"hooks": {
|
|
75
|
+
"pre-commit": "npm run-script lint",
|
|
76
|
+
"pre-push": "npm run-script unit-tests",
|
|
77
|
+
"pre-receive": "npm run-script tests"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"keywords": [
|
|
81
|
+
"plugin",
|
|
82
|
+
"manage",
|
|
83
|
+
"gestion"
|
|
84
|
+
],
|
|
85
|
+
"author": "Sébastien VIDAL",
|
|
86
|
+
"license": "ISC",
|
|
87
|
+
|
|
88
|
+
"homepage": "https://github.com/Psychopoulet/node-pluginsmanager-plugin#readme",
|
|
89
|
+
"repository": {
|
|
90
|
+
"type": "git",
|
|
91
|
+
"url": "git://github.com/Psychopoulet/node-pluginsmanager-plugin"
|
|
92
|
+
},
|
|
93
|
+
"bugs": {
|
|
94
|
+
"url": "https://github.com/Psychopoulet/node-pluginsmanager-plugin/issues"
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}
|