@snowtop/ent 0.2.12 → 0.2.13
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/graphql/graphql.js +5 -3
- package/graphql/upload.d.ts +16 -0
- package/graphql/upload.js +7 -0
- package/package.json +6 -2
package/graphql/graphql.js
CHANGED
|
@@ -631,11 +631,13 @@ exports.gqlQuery = GQLCapture.gqlQuery;
|
|
|
631
631
|
exports.gqlMutation = GQLCapture.gqlMutation;
|
|
632
632
|
exports.gqlContextType = GQLCapture.gqlContextType;
|
|
633
633
|
exports.gqlConnection = GQLCapture.gqlConnection;
|
|
634
|
-
//
|
|
634
|
+
// Apps that use uploads must install graphql-upload on their own. Keep the
|
|
635
|
+
// runtime import behind @snowtop/ent/graphql/upload so normal GraphQL users do
|
|
636
|
+
// not load the optional peer dependency.
|
|
635
637
|
const gqlFileUpload = {
|
|
636
638
|
type: "GraphQLUpload",
|
|
637
|
-
importPath: "graphql
|
|
639
|
+
importPath: "@snowtop/ent/graphql/upload",
|
|
638
640
|
tsType: "FileUpload",
|
|
639
|
-
tsImportPath: "graphql
|
|
641
|
+
tsImportPath: "@snowtop/ent/graphql/upload",
|
|
640
642
|
};
|
|
641
643
|
exports.gqlFileUpload = gqlFileUpload;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Readable } from "stream";
|
|
2
|
+
import type { GraphQLScalarType } from "graphql";
|
|
3
|
+
export interface FileUpload {
|
|
4
|
+
filename: string;
|
|
5
|
+
mimetype: string;
|
|
6
|
+
encoding: string;
|
|
7
|
+
createReadStream(): Readable;
|
|
8
|
+
}
|
|
9
|
+
export interface GraphQLUploadExpressOptions {
|
|
10
|
+
maxFieldSize?: number;
|
|
11
|
+
maxFileSize?: number;
|
|
12
|
+
maxFiles?: number;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export declare const GraphQLUpload: GraphQLScalarType;
|
|
16
|
+
export declare const graphqlUploadExpress: (options?: GraphQLUploadExpressOptions) => any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.graphqlUploadExpress = exports.GraphQLUpload = void 0;
|
|
4
|
+
const GraphQLUploadImport = require("graphql-upload/GraphQLUpload.js");
|
|
5
|
+
const graphqlUploadExpressImport = require("graphql-upload/graphqlUploadExpress.js");
|
|
6
|
+
exports.GraphQLUpload = GraphQLUploadImport;
|
|
7
|
+
exports.graphqlUploadExpress = graphqlUploadExpressImport;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snowtop/ent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "snowtop ent framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -23,9 +23,13 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@swc-node/register": "1.6.8",
|
|
25
25
|
"better-sqlite3": "12.5.0",
|
|
26
|
-
"graphql": "16.12.0"
|
|
26
|
+
"graphql": "16.12.0",
|
|
27
|
+
"graphql-upload": "15.0.2"
|
|
27
28
|
},
|
|
28
29
|
"peerDependenciesMeta": {
|
|
30
|
+
"graphql-upload": {
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
29
33
|
"better-sqlite3": {
|
|
30
34
|
"optional": true
|
|
31
35
|
},
|