@verii/fastify-plugins 1.1.0-pre.1770078755 → 1.1.0-pre.1770084266
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verii/fastify-plugins",
|
|
3
|
-
"version": "1.1.0-pre.
|
|
3
|
+
"version": "1.1.0-pre.1770084266",
|
|
4
4
|
"description": "Plugin for handling errors",
|
|
5
5
|
"repository": "https://github.com/LFDT-Verii/core",
|
|
6
6
|
"main": "index.js",
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "cross-env NODE_ENV=test node --test --test-concurrency=1 --experimental-test-module-mocks --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout 'test/**/*.test.js'",
|
|
12
12
|
"test:ci": "NODE_ENV=test node --test --test-concurrency=1 --experimental-test-module-mocks --experimental-test-coverage --test-coverage-include='src/**' --test-reporter=spec --test-reporter=junit --test-reporter-destination=stdout --test-reporter-destination=test-results.junit.xml --test-reporter=lcov --test-reporter-destination=lcov.info 'test/**/*.test.js'",
|
|
13
|
-
"lint": "eslint
|
|
13
|
+
"lint": "eslint .",
|
|
14
14
|
"lint:ci": "eslint . --format json >> eslint-results.json",
|
|
15
|
-
"lint:fix": "eslint --fix
|
|
15
|
+
"lint:fix": "eslint --fix ."
|
|
16
16
|
},
|
|
17
17
|
"author": "Yauheni Pozdnyakov",
|
|
18
18
|
"license": "Apache-2.0",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@fastify/cors": "11.1.0",
|
|
21
|
-
"@verii/crypto": "1.1.0-pre.
|
|
22
|
-
"@verii/error-aggregation": "1.1.0-pre.
|
|
23
|
-
"@verii/http-client": "1.1.0-pre.
|
|
21
|
+
"@verii/crypto": "1.1.0-pre.1770084266",
|
|
22
|
+
"@verii/error-aggregation": "1.1.0-pre.1770084266",
|
|
23
|
+
"@verii/http-client": "1.1.0-pre.1770084266",
|
|
24
24
|
"fastify-plugin": "~5.1.0",
|
|
25
25
|
"http-errors": "^2.0.0",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
@@ -29,24 +29,25 @@
|
|
|
29
29
|
"toidentifier": "~1.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"eslint": "
|
|
33
|
-
"eslint-config-airbnb-
|
|
34
|
-
"eslint-config-prettier": "
|
|
35
|
-
"eslint-plugin-autofix": "
|
|
36
|
-
"eslint-plugin-better-mutation": "1.
|
|
32
|
+
"eslint": "9.39.2",
|
|
33
|
+
"eslint-config-airbnb-extended": "3.0.1",
|
|
34
|
+
"eslint-config-prettier": "10.1.8",
|
|
35
|
+
"eslint-plugin-autofix": "2.2.0",
|
|
36
|
+
"eslint-plugin-better-mutation": "2.1.0",
|
|
37
37
|
"eslint-plugin-import": "2.32.0",
|
|
38
38
|
"eslint-plugin-prefer-arrow-functions": "3.9.1",
|
|
39
|
-
"eslint-plugin-prettier": "
|
|
40
|
-
"eslint-watch": "
|
|
39
|
+
"eslint-plugin-prettier": "5.5.5",
|
|
40
|
+
"eslint-watch": "8.0.0",
|
|
41
41
|
"expect": "30.2.0",
|
|
42
42
|
"fastify": "5.7.3",
|
|
43
|
+
"globals": "16.5.0",
|
|
43
44
|
"nock": "15.0.0-beta.6",
|
|
44
|
-
"prettier": "
|
|
45
|
+
"prettier": "3.8.1"
|
|
45
46
|
},
|
|
46
47
|
"nx": {
|
|
47
48
|
"tags": [
|
|
48
49
|
"lib"
|
|
49
50
|
]
|
|
50
51
|
},
|
|
51
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "53570389d95350e797d52f6bfd77d07e945f9ceb"
|
|
52
53
|
}
|
|
@@ -18,6 +18,7 @@ const fp = require('fastify-plugin');
|
|
|
18
18
|
const statuses = require('statuses');
|
|
19
19
|
const toIdentifier = require('toidentifier');
|
|
20
20
|
|
|
21
|
+
// eslint-disable-next-line complexity
|
|
21
22
|
const autoSchemaPlugin = async (fastify, opts) => {
|
|
22
23
|
const defaultOptions = {
|
|
23
24
|
errorSchemaId: 'error',
|
|
@@ -27,7 +28,7 @@ const autoSchemaPlugin = async (fastify, opts) => {
|
|
|
27
28
|
|
|
28
29
|
if (fastify.getSchema(options.errorSchemaId) == null) {
|
|
29
30
|
throw new Error(
|
|
30
|
-
`autoSchemaPlugin requires a schema with id "${options.errorSchemaId}"
|
|
31
|
+
`autoSchemaPlugin requires a schema with id "${options.errorSchemaId}"`,
|
|
31
32
|
);
|
|
32
33
|
}
|
|
33
34
|
|
package/src/cors-plugin.js
CHANGED
package/src/errors-plugin.js
CHANGED
|
@@ -83,7 +83,7 @@ const errorsPlugin = (fastify, options, next) => {
|
|
|
83
83
|
addValidationErrorCode,
|
|
84
84
|
(err) => ensureErrorCode(err, fastify),
|
|
85
85
|
(err) => addRequestId(err, request),
|
|
86
|
-
(err) => transformToInternalServerError(err, fastify)
|
|
86
|
+
(err) => transformToInternalServerError(err, fastify),
|
|
87
87
|
)(_error.processedError || _error);
|
|
88
88
|
|
|
89
89
|
sendError(error);
|
|
@@ -20,7 +20,7 @@ const fp = require('fastify-plugin');
|
|
|
20
20
|
|
|
21
21
|
const httpClientPlugin = async (
|
|
22
22
|
fastify,
|
|
23
|
-
{ name, options, requestDecorator }
|
|
23
|
+
{ name, options, requestDecorator },
|
|
24
24
|
) => {
|
|
25
25
|
const fastifyDecoration = `base${name[0].toUpperCase()}${name.slice(1)}`;
|
|
26
26
|
const requestDecoration = name;
|
|
@@ -28,7 +28,7 @@ const httpClientPlugin = async (
|
|
|
28
28
|
.decorate(
|
|
29
29
|
fastifyDecoration,
|
|
30
30
|
initHttpClient({ ...options, cache: fastify.cache }),
|
|
31
|
-
['cache']
|
|
31
|
+
['cache'],
|
|
32
32
|
)
|
|
33
33
|
.decorateRequest(requestDecoration, null)
|
|
34
34
|
.addHook('preValidation', async (req) => {
|
|
@@ -18,7 +18,7 @@ const { fastifyVersionPluginFactory } = require('./version-plugin-factory');
|
|
|
18
18
|
|
|
19
19
|
const vnfProtocolVersionPlugin = fastifyVersionPluginFactory(
|
|
20
20
|
'x-vnf-protocol-version',
|
|
21
|
-
'vnfProtocolVersion'
|
|
21
|
+
'vnfProtocolVersion',
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
module.exports = { vnfProtocolVersionPlugin };
|