@prefabs.tech/fastify-graphql 0.94.1 → 0.96.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/README.md +53 -8
- package/dist/prefabs-tech-fastify-graphql.cjs +2 -2
- package/dist/prefabs-tech-fastify-graphql.js +70 -37
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/constants.d.ts +4 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/index.d.ts +9 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/types.d.ts +11 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/uploads/processMultipartFormData.d.ts +5 -0
- package/dist/types/uploads/processMultipartFormData.d.ts.map +1 -0
- package/dist/types/uploads/transport.d.ts +8 -0
- package/dist/types/uploads/transport.d.ts.map +1 -0
- package/package.json +39 -38
- package/LICENSE +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,oBAAoB,aAAa,CAAC;AACxC,QAAA,MAAM,4BAA4B,qCAAqC,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,10 +13,18 @@ declare module "@prefabs.tech/fastify-config" {
|
|
|
13
13
|
graphql: GraphqlConfig;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
declare module "fastify" {
|
|
17
|
+
interface FastifyRequest {
|
|
18
|
+
graphqlFileUploadMultipart?: boolean;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
16
21
|
export { default as baseSchema } from "./baseSchema";
|
|
22
|
+
export * from "./constants";
|
|
17
23
|
export { default } from "./plugin";
|
|
18
|
-
export type { GraphqlConfig, GraphqlEnabledPlugin, GraphqlOptions, } from "./types";
|
|
24
|
+
export type { GraphqlConfig, GraphqlEnabledPlugin, GraphqlOptions, GraphqlUploadsConfig, MultipartFile, } from "./types";
|
|
25
|
+
export { default as graphqlUploadTransport } from "./uploads/transport";
|
|
19
26
|
export { mergeTypeDefs } from "@graphql-tools/merge";
|
|
20
27
|
export type { DocumentNode } from "graphql";
|
|
21
28
|
export { gql } from "graphql-tag";
|
|
29
|
+
export type { FileUpload as GraphQLFileUpload, Upload as GraphQLUpload, } from "graphql-upload-minimal";
|
|
22
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,gBAAgB;QACxB,MAAM,EAAE,SAAS,CAAC;QAClB,QAAQ,EAAE,QAAQ,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,OAAO,QAAQ,8BAA8B,CAAC;IAC5C,UAAU,SAAS;QACjB,OAAO,EAAE,aAAa,CAAC;KACxB;CACF;AAED,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,gBAAgB;QACxB,MAAM,EAAE,SAAS,CAAC;QAClB,QAAQ,EAAE,QAAQ,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,OAAO,QAAQ,8BAA8B,CAAC;IAC5C,UAAU,SAAS;QACjB,OAAO,EAAE,aAAa,CAAC;KACxB;CACF;AAED,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,cAAc;QACtB,0BAA0B,CAAC,EAAE,OAAO,CAAC;KACtC;CACF;AAED,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,YAAY,EACV,UAAU,IAAI,iBAAiB,EAC/B,MAAM,IAAI,aAAa,GACxB,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;kCAMf,eAAe,WAAW,cAAc;AAwCvE,wBAAqC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import type { FastifyPluginAsync, FastifyPluginCallback, FastifyReply, FastifyRequest } from "fastify";
|
|
2
|
+
import type { UploadOptions } from "graphql-upload-minimal";
|
|
2
3
|
import type { MercuriusContext, MercuriusOptions } from "mercurius";
|
|
3
4
|
export interface GraphqlConfig extends MercuriusOptions {
|
|
4
5
|
enabled?: boolean;
|
|
5
6
|
plugins?: GraphqlEnabledPlugin[];
|
|
7
|
+
uploads?: GraphqlUploadsConfig;
|
|
6
8
|
}
|
|
7
9
|
export interface GraphqlEnabledPlugin extends FastifyPluginAsync, FastifyPluginCallback {
|
|
8
10
|
updateContext: (context: MercuriusContext, request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
9
11
|
}
|
|
10
12
|
export type GraphqlOptions = GraphqlConfig;
|
|
13
|
+
export interface GraphqlUploadsConfig extends UploadOptions {
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface MultipartFile {
|
|
17
|
+
data: Buffer;
|
|
18
|
+
encoding?: string;
|
|
19
|
+
filename: string;
|
|
20
|
+
mimetype: string;
|
|
21
|
+
}
|
|
11
22
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;AAED,MAAM,WAAW,oBACf,SAAQ,kBAAkB,EAAE,qBAAqB;IACjD,aAAa,EAAE,CACb,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,YAAY,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC;AAE3C,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FastifyRequest } from "fastify";
|
|
2
|
+
import { IncomingMessage } from "node:http";
|
|
3
|
+
declare const processMultipartFormData: (req: FastifyRequest, _payload: IncomingMessage, done: (err: Error | null, body?: unknown) => void) => void;
|
|
4
|
+
export { processMultipartFormData };
|
|
5
|
+
//# sourceMappingURL=processMultipartFormData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processMultipartFormData.d.ts","sourceRoot":"","sources":["../../../src/uploads/processMultipartFormData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAK5C,QAAA,MAAM,wBAAwB,GAC5B,KAAK,cAAc,EACnB,UAAU,eAAe,EACzB,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,SAqDlD,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FastifyInstance } from "fastify";
|
|
2
|
+
import type { GraphqlUploadsConfig } from "../types";
|
|
3
|
+
type UploadTransportOptions = GraphqlUploadsConfig & {
|
|
4
|
+
path?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: (fastify: FastifyInstance, options: UploadTransportOptions) => Promise<void>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/uploads/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAQrD,KAAK,sBAAsB,GAAG,oBAAoB,GAAG;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;kCAGS,eAAe,WACf,sBAAsB;AAgCjC,wBAGG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prefabs.tech/fastify-graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.96.0",
|
|
4
4
|
"description": "Fastify graphql plugin",
|
|
5
5
|
"homepage": "https://github.com/prefabs-tech/fastify/tree/main/packages/graphql#readme",
|
|
6
6
|
"repository": {
|
|
@@ -19,51 +19,52 @@
|
|
|
19
19
|
"main": "./dist/prefabs-tech-fastify-graphql.cjs",
|
|
20
20
|
"module": "./dist/prefabs-tech-fastify-graphql.js",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
|
-
"files": [
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
"files": ["dist"],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types",
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"lint:fix": "eslint . --fix",
|
|
27
|
+
"sort-package": "npx sort-package-json",
|
|
28
|
+
"test": "vitest run --coverage",
|
|
29
|
+
"typecheck": "tsc --noEmit -p tsconfig.json --composite false"
|
|
30
|
+
},
|
|
25
31
|
"dependencies": {
|
|
26
|
-
"@graphql-tools/merge": "9.
|
|
27
|
-
"
|
|
32
|
+
"@graphql-tools/merge": "9.2.0",
|
|
33
|
+
"@types/busboy": "1.5.4",
|
|
34
|
+
"busboy": "1.6.0",
|
|
35
|
+
"graphql-tag": "2.12.7",
|
|
36
|
+
"graphql-upload-minimal": "1.6.4"
|
|
28
37
|
},
|
|
29
38
|
"devDependencies": {
|
|
30
|
-
"@prefabs.tech/eslint-config": "0.7
|
|
31
|
-
"@prefabs.tech/fastify-config": "0.
|
|
32
|
-
"@prefabs.tech/fastify-slonik": "0.
|
|
33
|
-
"@prefabs.tech/tsconfig": "0.7
|
|
34
|
-
"@types/node": "24.
|
|
35
|
-
"@vitest/coverage-istanbul": "
|
|
36
|
-
"eslint": "
|
|
37
|
-
"fastify": "5.
|
|
38
|
-
"fastify-plugin": "
|
|
39
|
-
"graphql": "16.
|
|
40
|
-
"mercurius": "16.
|
|
41
|
-
"prettier": "3.
|
|
39
|
+
"@prefabs.tech/eslint-config": "0.8.7",
|
|
40
|
+
"@prefabs.tech/fastify-config": "0.96.0",
|
|
41
|
+
"@prefabs.tech/fastify-slonik": "0.96.0",
|
|
42
|
+
"@prefabs.tech/tsconfig": "0.8.7",
|
|
43
|
+
"@types/node": "24.13.3",
|
|
44
|
+
"@vitest/coverage-istanbul": "4.1.10",
|
|
45
|
+
"eslint": "10.7.0",
|
|
46
|
+
"fastify": "5.10.0",
|
|
47
|
+
"fastify-plugin": "6.0.0",
|
|
48
|
+
"graphql": "16.14.2",
|
|
49
|
+
"mercurius": "16.10.0",
|
|
50
|
+
"prettier": "3.9.5",
|
|
42
51
|
"slonik": "46.8.0",
|
|
43
52
|
"typescript": "5.9.3",
|
|
44
|
-
"vite": "
|
|
45
|
-
"vitest": "
|
|
53
|
+
"vite": "8.1.5",
|
|
54
|
+
"vitest": "4.1.10",
|
|
46
55
|
"zod": "3.25.76"
|
|
47
56
|
},
|
|
48
57
|
"peerDependencies": {
|
|
49
|
-
"@prefabs.tech/fastify-config": "0.
|
|
50
|
-
"@prefabs.tech/fastify-slonik": "0.
|
|
51
|
-
"fastify": ">=5.
|
|
52
|
-
"fastify-plugin": ">=5.0
|
|
53
|
-
"graphql": ">=16.
|
|
54
|
-
"mercurius": ">=16.
|
|
55
|
-
"slonik": ">=46.
|
|
56
|
-
"zod": ">=3.
|
|
58
|
+
"@prefabs.tech/fastify-config": "0.96.0",
|
|
59
|
+
"@prefabs.tech/fastify-slonik": "0.96.0",
|
|
60
|
+
"fastify": ">=5.10.0",
|
|
61
|
+
"fastify-plugin": ">=5.1.0",
|
|
62
|
+
"graphql": ">=16.14.2",
|
|
63
|
+
"mercurius": ">=16.10.0",
|
|
64
|
+
"slonik": ">=46.8.0",
|
|
65
|
+
"zod": ">=3.25.76"
|
|
57
66
|
},
|
|
58
67
|
"engines": {
|
|
59
|
-
"node": ">=
|
|
60
|
-
},
|
|
61
|
-
"scripts": {
|
|
62
|
-
"build": "vite build && tsc --emitDeclarationOnly && mv dist/src dist/types",
|
|
63
|
-
"lint": "eslint .",
|
|
64
|
-
"lint:fix": "eslint . --fix",
|
|
65
|
-
"sort-package": "npx sort-package-json",
|
|
66
|
-
"test": "vitest run --coverage",
|
|
67
|
-
"typecheck": "tsc --noEmit -p tsconfig.json --composite false"
|
|
68
|
+
"node": ">=22"
|
|
68
69
|
}
|
|
69
|
-
}
|
|
70
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 Olivier Pichon
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|