@twin.org/api-processors 0.0.2-next.6 → 0.0.2-next.8

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.
@@ -80,7 +80,7 @@ class RestRouteProcessor {
80
80
  // instead of the default application/json
81
81
  headers[web.HeaderTypes.ContentType] =
82
82
  restRouteResponse?.attachment?.mimeType ??
83
- response.headers?.[web.HeaderTypes.ContentType] ??
83
+ restRouteResponse.headers?.[web.HeaderTypes.ContentType] ??
84
84
  `${web.MimeTypes.Json}; charset=utf-8`;
85
85
  // If there are filename or inline options set then add the content disposition
86
86
  if (core.Is.stringValue(restRouteResponse?.attachment?.filename) ||
@@ -315,7 +315,7 @@ class LoggingProcessor {
315
315
  * The component for logging the information.
316
316
  * @internal
317
317
  */
318
- _loggingComponent;
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._loggingComponent = core.ComponentFactory.get(options?.loggingComponentType ?? "logging");
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._loggingComponent.log({
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._loggingComponent.log({
429
+ await this._logging?.log({
430
430
  level: core.Is.number(response.statusCode) && response.statusCode >= web.HttpStatusCode.badRequest
431
431
  ? "error"
432
432
  : "info",
@@ -78,7 +78,7 @@ class RestRouteProcessor {
78
78
  // instead of the default application/json
79
79
  headers[HeaderTypes.ContentType] =
80
80
  restRouteResponse?.attachment?.mimeType ??
81
- response.headers?.[HeaderTypes.ContentType] ??
81
+ restRouteResponse.headers?.[HeaderTypes.ContentType] ??
82
82
  `${MimeTypes.Json}; charset=utf-8`;
83
83
  // If there are filename or inline options set then add the content disposition
84
84
  if (Is.stringValue(restRouteResponse?.attachment?.filename) ||
@@ -313,7 +313,7 @@ class LoggingProcessor {
313
313
  * The component for logging the information.
314
314
  * @internal
315
315
  */
316
- _loggingComponent;
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._loggingComponent = ComponentFactory.get(options?.loggingComponentType ?? "logging");
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._loggingComponent.log({
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._loggingComponent.log({
427
+ await this._logging?.log({
428
428
  level: Is.number(response.statusCode) && response.statusCode >= HttpStatusCode.badRequest
429
429
  ? "error"
430
430
  : "info",
package/docs/changelog.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @twin.org/api-processors - Changelog
2
2
 
3
+ ## [0.0.2-next.8](https://github.com/twinfoundation/api/compare/api-processors-v0.0.2-next.7...api-processors-v0.0.2-next.8) (2025-08-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
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.7 to 0.0.2-next.8
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Features
21
+
22
+ * logging naming consistency ([a4a6ef2](https://github.com/twinfoundation/api/commit/a4a6ef2de5049045589eb78b177ff62e744bde9d))
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.6 to 0.0.2-next.7
30
+
3
31
  ## [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)
4
32
 
5
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-processors",
3
- "version": "0.0.2-next.6",
3
+ "version": "0.0.2-next.8",
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.6",
17
+ "@twin.org/api-models": "0.0.2-next.8",
18
18
  "@twin.org/core": "next",
19
19
  "@twin.org/logging-models": "next",
20
20
  "@twin.org/nameof": "next",