nightingale-web-processor 12.1.3 → 13.0.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/CHANGELOG.md +33 -0
- package/README.md +3 -0
- package/dist/{index.d.ts → definitions/index.d.ts} +0 -0
- package/dist/definitions/index.d.ts.map +1 -0
- package/dist/{index-node14.mjs → index-node16.mjs} +1 -2
- package/dist/{index-node14.mjs.map → index-node16.mjs.map} +1 -1
- package/package.json +19 -28
- package/dist/index-node14.cjs.js +0 -20
- package/dist/index-node14.cjs.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/rollup.config.mjs +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [13.0.0](https://github.com/christophehurpeau/nightingale/compare/v12.1.4...v13.0.0) (2022-11-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Code Refactoring
|
|
10
|
+
|
|
11
|
+
* drop node 14 and cjs ([9a8ca06](https://github.com/christophehurpeau/nightingale/commit/9a8ca064449ddc0d69e26543e21c2d522536c50a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* build for node 16 ([30ae3e9](https://github.com/christophehurpeau/nightingale/commit/30ae3e9c455dbad793c2f704b9d860069dc80c32))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### BREAKING CHANGES
|
|
20
|
+
|
|
21
|
+
* dropped node 14 and cjs
|
|
22
|
+
* drop node 14
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [12.1.4](https://github.com/christophehurpeau/nightingale/compare/v12.1.3...v12.1.4) (2022-02-05)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* cjs build ([2e24ac5](https://github.com/christophehurpeau/nightingale/commit/2e24ac5753ee386c5be9ca56796194ee598f10ff))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [12.1.3](https://github.com/christophehurpeau/nightingale/compare/v12.1.2...v12.1.3) (2022-01-15)
|
|
7
40
|
|
|
8
41
|
**Note:** Version bump only for package nightingale-web-processor
|
package/README.md
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
10
|
<a href="https://npmjs.org/package/nightingale-web-processor"><img src="https://img.shields.io/npm/v/nightingale-web-processor.svg?style=flat-square"></a>
|
|
11
|
+
<a href="https://npmjs.org/package/nightingale-web-processor"><img src="https://img.shields.io/npm/dw/nightingale-web-processor.svg?style=flat-square"></a>
|
|
12
|
+
<a href="https://npmjs.org/package/nightingale-web-processor"><img src="https://img.shields.io/node/v/nightingale-web-processor.svg?style=flat-square"></a>
|
|
13
|
+
<a href="https://npmjs.org/package/nightingale-web-processor"><img src="https://img.shields.io/npm/types/nightingale-web-processor.svg?style=flat-square"></a>
|
|
11
14
|
</p>
|
|
12
15
|
|
|
13
16
|
## Install
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,QAAQ,EACrD,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE,0BAA0B,GACnC,IAAI,CAYN"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function webProcessor(record, context) {
|
|
2
2
|
const request = context?.request;
|
|
3
|
-
|
|
4
3
|
if (request) {
|
|
5
4
|
record.extra = record.extra || {};
|
|
6
5
|
Object.assign(record.extra, {
|
|
@@ -13,4 +12,4 @@ function webProcessor(record, context) {
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
export { webProcessor as default };
|
|
16
|
-
//# sourceMappingURL=index-
|
|
15
|
+
//# sourceMappingURL=index-node16.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-node16.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { IncomingMessage } from 'http';\nimport type { LogRecord, Metadata } from 'nightingale-types';\n\nexport interface ContextWithOptionalRequest {\n request?: IncomingMessage;\n}\n\nexport default function webProcessor<T extends Metadata>(\n record: LogRecord<T>,\n context?: ContextWithOptionalRequest,\n): void {\n const request = context?.request;\n if (request) {\n record.extra = record.extra || {};\n Object.assign(record.extra, {\n url: request.url,\n method: request.method,\n server: request.headers.host,\n ip:\n request.headers['x-forwarded-for'] || request.connection.remoteAddress,\n });\n }\n}\n"],"names":["webProcessor","record","context","request","extra","Object","assign","url","method","server","headers","host","ip","connection","remoteAddress"],"mappings":"AAOe,SAASA,YAAY,CAClCC,MAAoB,EACpBC,OAAoC,EAC9B;AACN,EAAA,MAAMC,OAAO,GAAGD,OAAO,EAAEC,OAAO,CAAA;AAChC,EAAA,IAAIA,OAAO,EAAE;IACXF,MAAM,CAACG,KAAK,GAAGH,MAAM,CAACG,KAAK,IAAI,EAAE,CAAA;AACjCC,IAAAA,MAAM,CAACC,MAAM,CAACL,MAAM,CAACG,KAAK,EAAE;MAC1BG,GAAG,EAAEJ,OAAO,CAACI,GAAG;MAChBC,MAAM,EAAEL,OAAO,CAACK,MAAM;AACtBC,MAAAA,MAAM,EAAEN,OAAO,CAACO,OAAO,CAACC,IAAI;MAC5BC,EAAE,EACAT,OAAO,CAACO,OAAO,CAAC,iBAAiB,CAAC,IAAIP,OAAO,CAACU,UAAU,CAACC,aAAAA;AAC7D,KAAC,CAAC,CAAA;AACJ,GAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightingale-web-processor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Nightingale web processor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -16,43 +16,34 @@
|
|
|
16
16
|
"homepage": "https://github.com/christophehurpeau/nightingale",
|
|
17
17
|
"type": "module",
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": "
|
|
19
|
+
"node": ">=16.0.0"
|
|
20
20
|
},
|
|
21
|
-
"main": "./dist/index-
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
21
|
+
"main": "./dist/index-node16.mjs",
|
|
22
|
+
"types": "./dist/definitions/index.d.ts",
|
|
23
23
|
"exports": {
|
|
24
24
|
"./package.json": "./package.json",
|
|
25
25
|
".": {
|
|
26
26
|
"node": {
|
|
27
|
-
"import": "./dist/index-
|
|
28
|
-
"require": "./dist/index-node14.cjs.js"
|
|
27
|
+
"import": "./dist/index-node16.mjs"
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
},
|
|
32
|
-
"module:node": "./dist/index-node14.mjs",
|
|
33
31
|
"sideEffects": false,
|
|
34
32
|
"scripts": {
|
|
35
|
-
"build": "
|
|
36
|
-
"build:definitions": "tsc -p
|
|
37
|
-
"clean": "
|
|
33
|
+
"build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
|
|
34
|
+
"build:definitions": "tsc -p",
|
|
35
|
+
"clean": "yarn clean:build",
|
|
36
|
+
"clean:build": "pob-babel-clean-out dist",
|
|
38
37
|
"lint": "yarn run lint:eslint",
|
|
39
|
-
"lint:eslint": "
|
|
40
|
-
"watch": "
|
|
41
|
-
},
|
|
42
|
-
"prettier": {
|
|
43
|
-
"trailingComma": "all",
|
|
44
|
-
"singleQuote": true,
|
|
45
|
-
"arrowParens": "always"
|
|
38
|
+
"lint:eslint": "yarn ../.. run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-web-processor",
|
|
39
|
+
"watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
|
|
46
40
|
},
|
|
41
|
+
"prettier": "@pob/root/prettier-config",
|
|
47
42
|
"pob": {
|
|
48
43
|
"babelEnvs": [
|
|
49
44
|
{
|
|
50
45
|
"target": "node",
|
|
51
|
-
"version": "
|
|
52
|
-
"formats": [
|
|
53
|
-
"cjs",
|
|
54
|
-
"es"
|
|
55
|
-
]
|
|
46
|
+
"version": "16"
|
|
56
47
|
}
|
|
57
48
|
],
|
|
58
49
|
"entries": [
|
|
@@ -60,13 +51,13 @@
|
|
|
60
51
|
]
|
|
61
52
|
},
|
|
62
53
|
"dependencies": {
|
|
63
|
-
"@types/node": ">=
|
|
64
|
-
"nightingale-types": "
|
|
54
|
+
"@types/node": ">=16.0.0",
|
|
55
|
+
"nightingale-types": "13.0.0"
|
|
65
56
|
},
|
|
66
57
|
"devDependencies": {
|
|
67
|
-
"@babel/core": "7.
|
|
68
|
-
"pob-babel": "
|
|
69
|
-
"typescript": "4.
|
|
58
|
+
"@babel/core": "7.20.2",
|
|
59
|
+
"pob-babel": "35.3.0",
|
|
60
|
+
"typescript": "4.9.3"
|
|
70
61
|
},
|
|
71
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "52cf7e3c8762a07891da9dde497ec03298c15654"
|
|
72
63
|
}
|
package/dist/index-node14.cjs.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
function webProcessor(record, context) {
|
|
6
|
-
const request = context?.request;
|
|
7
|
-
|
|
8
|
-
if (request) {
|
|
9
|
-
record.extra = record.extra || {};
|
|
10
|
-
Object.assign(record.extra, {
|
|
11
|
-
url: request.url,
|
|
12
|
-
method: request.method,
|
|
13
|
-
server: request.headers.host,
|
|
14
|
-
ip: request.headers['x-forwarded-for'] || request.connection.remoteAddress
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
exports["default"] = webProcessor;
|
|
20
|
-
//# sourceMappingURL=index-node14.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-node14.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { IncomingMessage } from 'http';\nimport type { LogRecord, Metadata } from 'nightingale-types';\n\nexport interface ContextWithOptionalRequest {\n request?: IncomingMessage;\n}\n\nexport default function webProcessor<T extends Metadata>(\n record: LogRecord<T>,\n context?: ContextWithOptionalRequest,\n): void {\n const request = context?.request;\n if (request) {\n record.extra = record.extra || {};\n Object.assign(record.extra, {\n url: request.url,\n method: request.method,\n server: request.headers.host,\n ip:\n request.headers['x-forwarded-for'] || request.connection.remoteAddress,\n });\n }\n}\n"],"names":["webProcessor","record","context","request","extra","Object","assign","url","method","server","headers","host","ip","connection","remoteAddress"],"mappings":";;;;AAOe,SAASA,YAAT,CACbC,MADa,EAEbC,OAFa,EAGP;AACN,QAAMC,OAAO,GAAGD,OAAO,EAAEC,OAAzB;;AACA,MAAIA,OAAJ,EAAa;AACXF,IAAAA,MAAM,CAACG,KAAP,GAAeH,MAAM,CAACG,KAAP,IAAgB,EAA/B;AACAC,IAAAA,MAAM,CAACC,MAAP,CAAcL,MAAM,CAACG,KAArB,EAA4B;AAC1BG,MAAAA,GAAG,EAAEJ,OAAO,CAACI,GADa;AAE1BC,MAAAA,MAAM,EAAEL,OAAO,CAACK,MAFU;AAG1BC,MAAAA,MAAM,EAAEN,OAAO,CAACO,OAAR,CAAgBC,IAHE;AAI1BC,MAAAA,EAAE,EACAT,OAAO,CAACO,OAAR,CAAgB,iBAAhB,KAAsCP,OAAO,CAACU,UAAR,CAAmBC;AALjC,KAA5B;AAOD;AACF;;;;"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,QAAQ,EACrD,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE,0BAA0B,GACnC,IAAI,CAYN"}
|
package/rollup.config.mjs
DELETED