@twin.org/api-server-fastify 0.0.1 → 0.0.2-next.1

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.
@@ -3,6 +3,7 @@
3
3
  var FastifyCompress = require('@fastify/compress');
4
4
  var FastifyCors = require('@fastify/cors');
5
5
  var apiModels = require('@twin.org/api-models');
6
+ var apiProcessors = require('@twin.org/api-processors');
6
7
  var core = require('@twin.org/core');
7
8
  var loggingModels = require('@twin.org/logging-models');
8
9
  var web = require('@twin.org/web');
@@ -99,6 +100,10 @@ class FastifyWebServer {
99
100
  };
100
101
  this._started = false;
101
102
  this._mimeTypeProcessors = options?.mimeTypeProcessors ?? [];
103
+ const hasJsonLd = this._mimeTypeProcessors.find(processor => processor.CLASS_NAME === "json-ld");
104
+ if (!hasJsonLd) {
105
+ this._mimeTypeProcessors.push(new apiProcessors.JsonLdMimeTypeProcessor());
106
+ }
102
107
  this._includeErrorStack = options?.config?.includeErrorStack ?? false;
103
108
  }
104
109
  /**
@@ -1,6 +1,7 @@
1
1
  import FastifyCompress from '@fastify/compress';
2
2
  import FastifyCors from '@fastify/cors';
3
3
  import { HttpErrorHelper } from '@twin.org/api-models';
4
+ import { JsonLdMimeTypeProcessor } from '@twin.org/api-processors';
4
5
  import { StringHelper, Is, GeneralError, BaseError } from '@twin.org/core';
5
6
  import { LoggingConnectorFactory } from '@twin.org/logging-models';
6
7
  import { HttpStatusCode, HttpMethod, HeaderTypes } from '@twin.org/web';
@@ -97,6 +98,10 @@ class FastifyWebServer {
97
98
  };
98
99
  this._started = false;
99
100
  this._mimeTypeProcessors = options?.mimeTypeProcessors ?? [];
101
+ const hasJsonLd = this._mimeTypeProcessors.find(processor => processor.CLASS_NAME === "json-ld");
102
+ if (!hasJsonLd) {
103
+ this._mimeTypeProcessors.push(new JsonLdMimeTypeProcessor());
104
+ }
100
105
  this._includeErrorStack = options?.config?.includeErrorStack ?? false;
101
106
  }
102
107
  /**
package/docs/changelog.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @twin.org/api-server-fastify - Changelog
2
2
 
3
+ ## [0.0.2-next.1](https://github.com/twinfoundation/api/compare/api-server-fastify-v0.0.2-next.0...api-server-fastify-v0.0.2-next.1) (2025-07-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * add json-ld mime type processor and auth admin component ([8861791](https://github.com/twinfoundation/api/commit/88617916e23bfbca023dbae1976fe421983a02ff))
9
+ * update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
10
+ * use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
11
+
12
+
13
+ ### Dependencies
14
+
15
+ * The following workspace dependencies were updated
16
+ * dependencies
17
+ * @twin.org/api-core bumped from 0.0.2-next.0 to 0.0.2-next.1
18
+ * @twin.org/api-models bumped from 0.0.2-next.0 to 0.0.2-next.1
19
+ * @twin.org/api-processors bumped from 0.0.2-next.0 to 0.0.2-next.1
20
+
3
21
  ## 0.0.1 (2025-07-03)
4
22
 
5
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-server-fastify",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-next.1",
4
4
  "description": "Use Fastify as the core web server for APIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,12 +16,13 @@
16
16
  "dependencies": {
17
17
  "@fastify/compress": "8.0.3",
18
18
  "@fastify/cors": "11.0.1",
19
- "@twin.org/api-core": "^0.0.1",
20
- "@twin.org/api-models": "^0.0.1",
21
- "@twin.org/core": "^0.0.1",
22
- "@twin.org/logging-models": "^0.0.1-next.2",
23
- "@twin.org/nameof": "^0.0.1",
24
- "@twin.org/web": "^0.0.1",
19
+ "@twin.org/api-core": "0.0.2-next.1",
20
+ "@twin.org/api-models": "0.0.2-next.1",
21
+ "@twin.org/api-processors": "0.0.2-next.1",
22
+ "@twin.org/core": "next",
23
+ "@twin.org/logging-models": "next",
24
+ "@twin.org/nameof": "next",
25
+ "@twin.org/web": "next",
25
26
  "fastify": "5.3.3",
26
27
  "socket.io": "4.8.1"
27
28
  },