@twin.org/api-processors 0.0.2-next.5 → 0.0.2-next.7
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/dist/cjs/index.cjs
CHANGED
|
@@ -245,10 +245,10 @@ class NodeIdentityProcessor {
|
|
|
245
245
|
/**
|
|
246
246
|
* The service needs to be started when the application is initialized.
|
|
247
247
|
* @param nodeIdentity The identity of the node.
|
|
248
|
-
* @param
|
|
248
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
249
249
|
* @returns Nothing.
|
|
250
250
|
*/
|
|
251
|
-
async start(nodeIdentity,
|
|
251
|
+
async start(nodeIdentity, nodeLoggingComponentType) {
|
|
252
252
|
core.Guards.string(this.CLASS_NAME, "nodeIdentity", nodeIdentity);
|
|
253
253
|
this._nodeIdentity = nodeIdentity;
|
|
254
254
|
}
|
|
@@ -315,7 +315,7 @@ class LoggingProcessor {
|
|
|
315
315
|
* The component for logging the information.
|
|
316
316
|
* @internal
|
|
317
317
|
*/
|
|
318
|
-
|
|
318
|
+
_logging;
|
|
319
319
|
/**
|
|
320
320
|
* Include the body objects when logging the information.
|
|
321
321
|
* @internal
|
|
@@ -336,7 +336,7 @@ class LoggingProcessor {
|
|
|
336
336
|
* @param options Options for the processor.
|
|
337
337
|
*/
|
|
338
338
|
constructor(options) {
|
|
339
|
-
this.
|
|
339
|
+
this._logging = core.ComponentFactory.getIfExists(options?.loggingComponentType ?? "logging");
|
|
340
340
|
this._includeBody = options?.config?.includeBody ?? false;
|
|
341
341
|
this._fullBase64 = options?.config?.fullBase64 ?? false;
|
|
342
342
|
this._obfuscateProperties = options?.config?.obfuscateProperties ?? ["password"];
|
|
@@ -366,7 +366,7 @@ class LoggingProcessor {
|
|
|
366
366
|
requestUrl = request.url;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
await this.
|
|
369
|
+
await this._logging?.log({
|
|
370
370
|
level: "info",
|
|
371
371
|
source: this.CLASS_NAME,
|
|
372
372
|
ts: Date.now(),
|
|
@@ -426,7 +426,7 @@ class LoggingProcessor {
|
|
|
426
426
|
requestUrl = request.url;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
await this.
|
|
429
|
+
await this._logging?.log({
|
|
430
430
|
level: core.Is.number(response.statusCode) && response.statusCode >= web.HttpStatusCode.badRequest
|
|
431
431
|
? "error"
|
|
432
432
|
: "info",
|
package/dist/esm/index.mjs
CHANGED
|
@@ -243,10 +243,10 @@ class NodeIdentityProcessor {
|
|
|
243
243
|
/**
|
|
244
244
|
* The service needs to be started when the application is initialized.
|
|
245
245
|
* @param nodeIdentity The identity of the node.
|
|
246
|
-
* @param
|
|
246
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
247
247
|
* @returns Nothing.
|
|
248
248
|
*/
|
|
249
|
-
async start(nodeIdentity,
|
|
249
|
+
async start(nodeIdentity, nodeLoggingComponentType) {
|
|
250
250
|
Guards.string(this.CLASS_NAME, "nodeIdentity", nodeIdentity);
|
|
251
251
|
this._nodeIdentity = nodeIdentity;
|
|
252
252
|
}
|
|
@@ -313,7 +313,7 @@ class LoggingProcessor {
|
|
|
313
313
|
* The component for logging the information.
|
|
314
314
|
* @internal
|
|
315
315
|
*/
|
|
316
|
-
|
|
316
|
+
_logging;
|
|
317
317
|
/**
|
|
318
318
|
* Include the body objects when logging the information.
|
|
319
319
|
* @internal
|
|
@@ -334,7 +334,7 @@ class LoggingProcessor {
|
|
|
334
334
|
* @param options Options for the processor.
|
|
335
335
|
*/
|
|
336
336
|
constructor(options) {
|
|
337
|
-
this.
|
|
337
|
+
this._logging = ComponentFactory.getIfExists(options?.loggingComponentType ?? "logging");
|
|
338
338
|
this._includeBody = options?.config?.includeBody ?? false;
|
|
339
339
|
this._fullBase64 = options?.config?.fullBase64 ?? false;
|
|
340
340
|
this._obfuscateProperties = options?.config?.obfuscateProperties ?? ["password"];
|
|
@@ -364,7 +364,7 @@ class LoggingProcessor {
|
|
|
364
364
|
requestUrl = request.url;
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
await this.
|
|
367
|
+
await this._logging?.log({
|
|
368
368
|
level: "info",
|
|
369
369
|
source: this.CLASS_NAME,
|
|
370
370
|
ts: Date.now(),
|
|
@@ -424,7 +424,7 @@ class LoggingProcessor {
|
|
|
424
424
|
requestUrl = request.url;
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
await this.
|
|
427
|
+
await this._logging?.log({
|
|
428
428
|
level: Is.number(response.statusCode) && response.statusCode >= HttpStatusCode.badRequest
|
|
429
429
|
? "error"
|
|
430
430
|
: "info",
|
|
@@ -10,10 +10,10 @@ export declare class NodeIdentityProcessor implements IBaseRouteProcessor {
|
|
|
10
10
|
/**
|
|
11
11
|
* The service needs to be started when the application is initialized.
|
|
12
12
|
* @param nodeIdentity The identity of the node.
|
|
13
|
-
* @param
|
|
13
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
14
14
|
* @returns Nothing.
|
|
15
15
|
*/
|
|
16
|
-
start(nodeIdentity: string,
|
|
16
|
+
start(nodeIdentity: string, nodeLoggingComponentType?: string): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Pre process the REST request for the specified route.
|
|
19
19
|
* @param request The incoming request.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @twin.org/api-processors - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.7](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.6...api-processors-v0.0.2-next.7) (2025-08-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* logging naming consistency ([a4a6ef2](https://github.com/twinfoundation/api/commit/a4a6ef2de5049045589eb78b177ff62e744bde9d))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/api-models bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
16
|
+
|
|
17
|
+
## [0.0.2-next.6](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.5...api-processors-v0.0.2-next.6) (2025-08-19)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/api-models bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
30
|
+
|
|
3
31
|
## [0.0.2-next.5](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.4...api-processors-v0.0.2-next.5) (2025-07-25)
|
|
4
32
|
|
|
5
33
|
|
|
@@ -32,7 +32,7 @@ Runtime name for the class.
|
|
|
32
32
|
|
|
33
33
|
### start()
|
|
34
34
|
|
|
35
|
-
> **start**(`nodeIdentity`, `
|
|
35
|
+
> **start**(`nodeIdentity`, `nodeLoggingComponentType?`): `Promise`\<`void`\>
|
|
36
36
|
|
|
37
37
|
The service needs to be started when the application is initialized.
|
|
38
38
|
|
|
@@ -44,11 +44,11 @@ The service needs to be started when the application is initialized.
|
|
|
44
44
|
|
|
45
45
|
The identity of the node.
|
|
46
46
|
|
|
47
|
-
#####
|
|
47
|
+
##### nodeLoggingComponentType?
|
|
48
48
|
|
|
49
49
|
`string`
|
|
50
50
|
|
|
51
|
-
The node logging
|
|
51
|
+
The node logging component type.
|
|
52
52
|
|
|
53
53
|
#### Returns
|
|
54
54
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-processors",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.7",
|
|
4
4
|
"description": "Route processors for use with API servers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "0.0.2-next.
|
|
17
|
+
"@twin.org/api-models": "0.0.2-next.7",
|
|
18
18
|
"@twin.org/core": "next",
|
|
19
19
|
"@twin.org/logging-models": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|