nightingale-web-processor 13.0.0 → 14.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 +19 -0
- package/dist/definitions/index.d.ts +1 -1
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/{index-node16.mjs → index-node18.mjs} +1 -1
- package/dist/index-node18.mjs.map +1 -0
- package/package.json +12 -12
- package/src/index.ts +1 -1
- package/dist/index-node16.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## [14.0.0](https://github.com/christophehurpeau/nightingale/compare/v13.0.0...v14.0.0) (2023-06-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* **deps:** require node 18
|
|
12
|
+
* requires node 18
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* requires node 18 ([4452b11](https://github.com/christophehurpeau/nightingale/commit/4452b116188e58c293be85e462e04922f7ad51f0))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Miscellaneous Chores
|
|
20
|
+
|
|
21
|
+
* **deps:** update dependency @pob/root to v8 ([#760](https://github.com/christophehurpeau/nightingale/issues/760)) ([22dc3cc](https://github.com/christophehurpeau/nightingale/commit/22dc3cceabdfd465d04ee36fec8fdac31febab69))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [13.0.0](https://github.com/christophehurpeau/nightingale/compare/v12.1.4...v13.0.0) (2022-11-19)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type { IncomingMessage } from 'http';
|
|
2
|
+
import type { IncomingMessage } from 'node:http';
|
|
3
3
|
import type { LogRecord, Metadata } from 'nightingale-types';
|
|
4
4
|
export interface ContextWithOptionalRequest {
|
|
5
5
|
request?: IncomingMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-node18.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { IncomingMessage } from 'node: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,YAAYA,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": "14.0.0",
|
|
4
4
|
"description": "Nightingale web processor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -16,22 +16,22 @@
|
|
|
16
16
|
"homepage": "https://github.com/christophehurpeau/nightingale",
|
|
17
17
|
"type": "module",
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=18.12.0"
|
|
20
20
|
},
|
|
21
|
-
"main": "./dist/index-
|
|
21
|
+
"main": "./dist/index-node18.mjs",
|
|
22
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-
|
|
27
|
+
"import": "./dist/index-node18.mjs"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
|
|
34
|
-
"build:definitions": "tsc -p",
|
|
34
|
+
"build:definitions": "tsc -p tsconfig.json",
|
|
35
35
|
"clean": "yarn clean:build",
|
|
36
36
|
"clean:build": "pob-babel-clean-out dist",
|
|
37
37
|
"lint": "yarn run lint:eslint",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"babelEnvs": [
|
|
44
44
|
{
|
|
45
45
|
"target": "node",
|
|
46
|
-
"version": "
|
|
46
|
+
"version": "18"
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
49
|
"entries": [
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@types/node": ">=
|
|
55
|
-
"nightingale-types": "
|
|
54
|
+
"@types/node": ">=18.0.0",
|
|
55
|
+
"nightingale-types": "14.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@babel/core": "7.
|
|
59
|
-
"pob-babel": "
|
|
60
|
-
"typescript": "
|
|
58
|
+
"@babel/core": "7.22.5",
|
|
59
|
+
"pob-babel": "36.1.0",
|
|
60
|
+
"typescript": "5.1.6"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "bc20e0f093a4fecd4d87f9374f6dbc375c09c25e"
|
|
63
63
|
}
|
package/src/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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;;;;"}
|