@gasket/plugin-fastify 7.3.1 → 7.3.3
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/lib/index.d.ts +10 -27
- package/lib/index.js +0 -7
- package/package.json +12 -17
package/lib/index.d.ts
CHANGED
|
@@ -11,6 +11,15 @@ import type {
|
|
|
11
11
|
} from 'fastify';
|
|
12
12
|
import type { IncomingMessage, ServerResponse } from 'http';
|
|
13
13
|
|
|
14
|
+
export interface FastifyConfig {
|
|
15
|
+
/** Enable compression */
|
|
16
|
+
compression?: boolean;
|
|
17
|
+
/** Trust proxy configuration */
|
|
18
|
+
trustProxy?: FastifyServerOptions['trustProxy'];
|
|
19
|
+
/** Fastify request logging per route */
|
|
20
|
+
disableRequestLogging?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
declare module '@gasket/core' {
|
|
15
24
|
export interface GasketActions {
|
|
16
25
|
/** @deprecated */
|
|
@@ -18,32 +27,9 @@ declare module '@gasket/core' {
|
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
export interface GasketConfig {
|
|
21
|
-
fastify?:
|
|
22
|
-
/** Enable compression */
|
|
23
|
-
compression?: boolean;
|
|
24
|
-
/** Filter for which request URLs invoke Gasket middleware */
|
|
25
|
-
middlewareInclusionRegex?: RegExp;
|
|
26
|
-
/** @deprecated */
|
|
27
|
-
excludedRoutesRegex?: RegExp;
|
|
28
|
-
/** Trust proxy configuration */
|
|
29
|
-
trustProxy?: FastifyServerOptions['trustProxy'];
|
|
30
|
-
/** Fastify request logging per route */
|
|
31
|
-
disableRequestLogging?: boolean;
|
|
32
|
-
};
|
|
33
|
-
/** Middleware configuration */
|
|
34
|
-
middleware?: {
|
|
35
|
-
/** Plugin name */
|
|
36
|
-
plugin: string;
|
|
37
|
-
/** Paths for middleware */
|
|
38
|
-
paths?: (string | RegExp)[];
|
|
39
|
-
}[];
|
|
30
|
+
fastify?: FastifyConfig
|
|
40
31
|
}
|
|
41
32
|
|
|
42
|
-
/**
|
|
43
|
-
* Handler function type - The middie middleware is added for express
|
|
44
|
-
* compatibility
|
|
45
|
-
*/
|
|
46
|
-
type Handler = (req: any, res: any, next: (error?: Error) => void) => void;
|
|
47
33
|
|
|
48
34
|
/** Error handler function type */
|
|
49
35
|
type ErrorHandler = (
|
|
@@ -54,9 +40,6 @@ declare module '@gasket/core' {
|
|
|
54
40
|
) => void;
|
|
55
41
|
|
|
56
42
|
export interface HookExecTypes {
|
|
57
|
-
middleware(
|
|
58
|
-
app: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProviderDefault>
|
|
59
|
-
): MaybeAsync<MaybeMultiple<Handler> & { paths?: (string | RegExp)[] }>;
|
|
60
43
|
fastify(app: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProviderDefault>): MaybeAsync<void>;
|
|
61
44
|
errorMiddleware(): MaybeAsync<MaybeMultiple<ErrorHandler>>;
|
|
62
45
|
}
|
package/lib/index.js
CHANGED
|
@@ -46,13 +46,6 @@ const plugin = {
|
|
|
46
46
|
}
|
|
47
47
|
],
|
|
48
48
|
lifecycles: [
|
|
49
|
-
{
|
|
50
|
-
name: 'middleware',
|
|
51
|
-
method: 'exec',
|
|
52
|
-
description: 'Add Express style middleware for Fastify',
|
|
53
|
-
link: 'README.md#middleware',
|
|
54
|
-
parent: 'createServers'
|
|
55
|
-
},
|
|
56
49
|
{
|
|
57
50
|
name: 'fastify',
|
|
58
51
|
method: 'exec',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/plugin-fastify",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.3",
|
|
4
4
|
"description": "Adds fastify support to your application",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -8,10 +8,7 @@
|
|
|
8
8
|
"generator",
|
|
9
9
|
"lib"
|
|
10
10
|
],
|
|
11
|
-
"repository":
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+ssh://git@github.com/godaddy/gasket.git"
|
|
14
|
-
},
|
|
11
|
+
"repository": "godaddy/gasket.git",
|
|
15
12
|
"publishConfig": {
|
|
16
13
|
"access": "public"
|
|
17
14
|
},
|
|
@@ -22,9 +19,7 @@
|
|
|
22
19
|
],
|
|
23
20
|
"author": "GoDaddy Operating Company, LLC",
|
|
24
21
|
"license": "MIT",
|
|
25
|
-
"bugs":
|
|
26
|
-
"url": "https://github.com/godaddy/gasket/issues"
|
|
27
|
-
},
|
|
22
|
+
"bugs": "https://github.com/godaddy/gasket/issues",
|
|
28
23
|
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-plugin-fastify",
|
|
29
24
|
"dependencies": {
|
|
30
25
|
"fastify": "^4.29.0"
|
|
@@ -38,17 +33,17 @@
|
|
|
38
33
|
"eslint-config-godaddy-typescript": "^4.0.3",
|
|
39
34
|
"eslint-plugin-jest": "^28.11.0",
|
|
40
35
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
41
|
-
"fastify": "^4.
|
|
36
|
+
"fastify": "^4.29.0",
|
|
42
37
|
"jest": "^29.7.0",
|
|
43
38
|
"typescript": "^5.7.3",
|
|
44
|
-
"@gasket/core": "
|
|
45
|
-
"@gasket/plugin-https": "
|
|
46
|
-
"@gasket/plugin-logger": "
|
|
47
|
-
"@gasket/plugin-metadata": "
|
|
48
|
-
"create-gasket-app": "
|
|
39
|
+
"@gasket/core": "7.3.2",
|
|
40
|
+
"@gasket/plugin-https": "7.3.3",
|
|
41
|
+
"@gasket/plugin-logger": "7.3.2",
|
|
42
|
+
"@gasket/plugin-metadata": "7.3.4",
|
|
43
|
+
"create-gasket-app": "7.3.3"
|
|
49
44
|
},
|
|
50
45
|
"peerDependencies": {
|
|
51
|
-
"fastify": "^4"
|
|
46
|
+
"fastify": "^4.29.0"
|
|
52
47
|
},
|
|
53
48
|
"eslintConfig": {
|
|
54
49
|
"extends": [
|
|
@@ -86,10 +81,10 @@
|
|
|
86
81
|
"scripts": {
|
|
87
82
|
"lint": "eslint .",
|
|
88
83
|
"lint:fix": "pnpm run lint --fix",
|
|
84
|
+
"posttest": "pnpm run lint && pnpm run typecheck",
|
|
89
85
|
"test": "cross-env NODE_OPTIONS='--unhandled-rejections=strict' jest",
|
|
90
|
-
"test:watch": "jest --watch",
|
|
91
86
|
"test:coverage": "jest --coverage",
|
|
92
|
-
"
|
|
87
|
+
"test:watch": "jest --watch",
|
|
93
88
|
"typecheck": "tsc",
|
|
94
89
|
"typecheck:watch": "tsc --watch"
|
|
95
90
|
}
|