@eik/service 2.3.2 → 3.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 +13 -0
- package/bin/eik-server.js +1 -1
- package/lib/main.js +4 -4
- package/package.json +1 -1
- package/types/main.d.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
# [3.0.0](https://github.com/eik-lib/service/compare/v2.3.2...v3.0.0) (2024-08-22)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* let compression finish before adding routes ([#592](https://github.com/eik-lib/service/issues/592)) ([f3796eb](https://github.com/eik-lib/service/commit/f3796ebfcb6d7c350e0eeae3578f329c6ec1f49e))
|
7
|
+
|
8
|
+
|
9
|
+
### BREAKING CHANGES
|
10
|
+
|
11
|
+
* requires `await` when registering the eik plugin
|
12
|
+
with fastify (`await fastify.register(service.api())`).
|
13
|
+
|
1
14
|
## [2.3.2](https://github.com/eik-lib/service/compare/v2.3.1...v2.3.2) (2024-08-19)
|
2
15
|
|
3
16
|
|
package/bin/eik-server.js
CHANGED
package/lib/main.js
CHANGED
@@ -201,7 +201,8 @@ const EikService = class EikService {
|
|
201
201
|
}
|
202
202
|
|
203
203
|
api() {
|
204
|
-
|
204
|
+
/** @param {import('fastify').FastifyInstance} app */
|
205
|
+
return async (app) => {
|
205
206
|
if (!app.initialConfig.ignoreTrailingSlash) {
|
206
207
|
this.logger.warn(
|
207
208
|
'Fastify is configured with "ignoreTrailingSlash" set to "false". Its adviced to set "ignoreTrailingSlash" to "true"',
|
@@ -233,6 +234,7 @@ const EikService = class EikService {
|
|
233
234
|
});
|
234
235
|
|
235
236
|
const authOptions = {
|
237
|
+
// @ts-expect-error We decorate it above
|
236
238
|
preValidation: [app.authenticate],
|
237
239
|
};
|
238
240
|
|
@@ -246,7 +248,7 @@ const EikService = class EikService {
|
|
246
248
|
app.addContentTypeParser('multipart', setMultipart);
|
247
249
|
|
248
250
|
// Compression
|
249
|
-
app.register(compression, {
|
251
|
+
await app.register(compression, {
|
250
252
|
global: config.get('compression.global'),
|
251
253
|
});
|
252
254
|
|
@@ -905,8 +907,6 @@ const EikService = class EikService {
|
|
905
907
|
authOptions,
|
906
908
|
aliasDelRoute,
|
907
909
|
);
|
908
|
-
|
909
|
-
done();
|
910
910
|
};
|
911
911
|
}
|
912
912
|
};
|
package/package.json
CHANGED
package/types/main.d.ts
CHANGED
@@ -599,7 +599,7 @@ declare const EikService: {
|
|
599
599
|
logger: pino.Logger<never>;
|
600
600
|
sink: import("@eik/sink").default;
|
601
601
|
health(): Promise<void>;
|
602
|
-
api(): (app:
|
602
|
+
api(): (app: import("fastify").FastifyInstance) => Promise<void>;
|
603
603
|
};
|
604
604
|
};
|
605
605
|
import { PassThrough } from 'stream';
|