graphql-upload 8.0.6 → 8.0.7
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 +8 -0
- package/lib/processRequest.js +13 -3
- package/lib/processRequest.mjs +12 -2
- package/package.json +18 -18
package/changelog.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# graphql-upload changelog
|
|
2
2
|
|
|
3
|
+
## 8.0.7
|
|
4
|
+
|
|
5
|
+
### Patch
|
|
6
|
+
|
|
7
|
+
- Updated dependencies.
|
|
8
|
+
- Handle invalid object paths in `map` multipart field entries, fixing [#154](https://github.com/jaydenseric/graphql-upload/issues/154).
|
|
9
|
+
- Import `WriteStream` from [`fs-capacitor`](https://npm.im/fs-capacitor) as a named rather than default import.
|
|
10
|
+
|
|
3
11
|
## 8.0.6
|
|
4
12
|
|
|
5
13
|
### Patch
|
package/lib/processRequest.js
CHANGED
|
@@ -7,7 +7,7 @@ var _util = _interopRequireDefault(require('util'))
|
|
|
7
7
|
|
|
8
8
|
var _busboy = _interopRequireDefault(require('busboy'))
|
|
9
9
|
|
|
10
|
-
var _fsCapacitor =
|
|
10
|
+
var _fsCapacitor = require('fs-capacitor')
|
|
11
11
|
|
|
12
12
|
var _httpErrors = _interopRequireDefault(require('http-errors'))
|
|
13
13
|
|
|
@@ -170,7 +170,17 @@ const processRequest = (
|
|
|
170
170
|
`Invalid type for the ‘map’ multipart field entry key ‘${fieldName}’ array index ‘${index}’ value (${SPEC_URL}).`
|
|
171
171
|
)
|
|
172
172
|
)
|
|
173
|
-
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
operationsPath.set(path, map.get(fieldName).promise)
|
|
176
|
+
} catch (error) {
|
|
177
|
+
return exit(
|
|
178
|
+
(0, _httpErrors.default)(
|
|
179
|
+
400,
|
|
180
|
+
`Invalid object path for the ‘map’ multipart field entry key ‘${fieldName}’ array index ‘${index}’ value ‘${path}’ (${SPEC_URL}).`
|
|
181
|
+
)
|
|
182
|
+
)
|
|
183
|
+
}
|
|
174
184
|
}
|
|
175
185
|
}
|
|
176
186
|
|
|
@@ -205,7 +215,7 @@ const processRequest = (
|
|
|
205
215
|
return
|
|
206
216
|
}
|
|
207
217
|
|
|
208
|
-
const capacitor = new _fsCapacitor.
|
|
218
|
+
const capacitor = new _fsCapacitor.WriteStream()
|
|
209
219
|
capacitor.on('error', () => {
|
|
210
220
|
stream.unpipe()
|
|
211
221
|
stream.resume()
|
package/lib/processRequest.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import util from 'util'
|
|
2
2
|
import Busboy from 'busboy'
|
|
3
|
-
import WriteStream from 'fs-capacitor'
|
|
3
|
+
import { WriteStream } from 'fs-capacitor'
|
|
4
4
|
import createError from 'http-errors'
|
|
5
5
|
import objectPath from 'object-path'
|
|
6
6
|
const SPEC_URL = 'https://github.com/jaydenseric/graphql-multipart-request-spec'
|
|
@@ -153,7 +153,17 @@ export const processRequest = (
|
|
|
153
153
|
`Invalid type for the ‘map’ multipart field entry key ‘${fieldName}’ array index ‘${index}’ value (${SPEC_URL}).`
|
|
154
154
|
)
|
|
155
155
|
)
|
|
156
|
-
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
operationsPath.set(path, map.get(fieldName).promise)
|
|
159
|
+
} catch (error) {
|
|
160
|
+
return exit(
|
|
161
|
+
createError(
|
|
162
|
+
400,
|
|
163
|
+
`Invalid object path for the ‘map’ multipart field entry key ‘${fieldName}’ array index ‘${index}’ value ‘${path}’ (${SPEC_URL}).`
|
|
164
|
+
)
|
|
165
|
+
)
|
|
166
|
+
}
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
169
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql-upload",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.7",
|
|
4
4
|
"description": "Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -37,33 +37,33 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"busboy": "^0.3.1",
|
|
40
|
-
"fs-capacitor": "^2.0.
|
|
40
|
+
"fs-capacitor": "^2.0.4",
|
|
41
41
|
"http-errors": "^1.7.2",
|
|
42
42
|
"object-path": "^0.11.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@babel/cli": "^7.4.
|
|
46
|
-
"@babel/core": "^7.4.
|
|
47
|
-
"@babel/preset-env": "^7.4.
|
|
45
|
+
"@babel/cli": "^7.4.4",
|
|
46
|
+
"@babel/core": "^7.4.5",
|
|
47
|
+
"@babel/preset-env": "^7.4.5",
|
|
48
48
|
"babel-eslint": "^10.0.1",
|
|
49
49
|
"eslint": "^5.16.0",
|
|
50
|
-
"eslint-config-env": "^
|
|
51
|
-
"eslint-config-prettier": "^4.
|
|
52
|
-
"eslint-plugin-import": "^2.17.
|
|
50
|
+
"eslint-config-env": "^6.0.0",
|
|
51
|
+
"eslint-config-prettier": "^4.3.0",
|
|
52
|
+
"eslint-plugin-import": "^2.17.3",
|
|
53
53
|
"eslint-plugin-import-order-alphabetical": "^0.0.2",
|
|
54
|
-
"eslint-plugin-node": "^
|
|
55
|
-
"eslint-plugin-prettier": "^3.0
|
|
56
|
-
"express": "^4.
|
|
54
|
+
"eslint-plugin-node": "^9.1.0",
|
|
55
|
+
"eslint-plugin-prettier": "^3.1.0",
|
|
56
|
+
"express": "^4.17.1",
|
|
57
57
|
"express-async-handler": "^1.1.4",
|
|
58
58
|
"form-data": "^2.3.3",
|
|
59
|
-
"graphql": "^14.
|
|
60
|
-
"husky": "^2.1
|
|
61
|
-
"jsdoc-md": "^
|
|
59
|
+
"graphql": "^14.3.1",
|
|
60
|
+
"husky": "^2.4.1",
|
|
61
|
+
"jsdoc-md": "^3.0.0",
|
|
62
62
|
"koa": "^2.7.0",
|
|
63
|
-
"lint-staged": "^8.
|
|
64
|
-
"node-fetch": "^2.
|
|
65
|
-
"prettier": "^1.
|
|
66
|
-
"tap": "^
|
|
63
|
+
"lint-staged": "^8.2.0",
|
|
64
|
+
"node-fetch": "^2.6.0",
|
|
65
|
+
"prettier": "^1.18.2",
|
|
66
|
+
"tap": "^14.2.2"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"prepare": "npm run prepare:clean && npm run prepare:mjs && npm run prepare:js && npm run prepare:jsdoc && npm run prepare:prettier",
|