asset-pipe-build-server
Advanced tools
Comparing version 1.0.0-alpha.8 to 1.0.0-alpha.9
@@ -7,3 +7,6 @@ 'use strict'; | ||
const express = require('express'); | ||
const { validationError: ValidationError } = require('error-obj'); | ||
const params = require('./params'); | ||
const schemas = require('./schemas'); | ||
@@ -45,21 +48,27 @@ | ||
if (error) { | ||
return next(new Error()); | ||
return next(new Error('Failed parsing postBundle POST-body')); | ||
} | ||
let uri = `${(req.secure ? 'https://' : 'http://') + req.headers.host}/bundle/`; | ||
schemas.ids.validate(bodyObj, (validationError, value) => { | ||
if (validationError) { | ||
return next(new ValidationError(validationError)); | ||
} | ||
bodyObj.forEach((fileName, index, arr) => { | ||
arr[index] = this.sink.reader(fileName); | ||
}); | ||
let uri = `${(req.secure ? 'https://' : 'http://') + req.headers.host}/bundle/`; | ||
const writer = this.sink.writer('js', (id, fileName) => { | ||
uri += fileName; | ||
res.status(200).json({ | ||
file: fileName, | ||
uri, | ||
id, | ||
value.forEach((fileName, index, arr) => { | ||
arr[index] = this.sink.reader(fileName); | ||
}); | ||
const writer = this.sink.writer('js', (id, fileName) => { | ||
uri += fileName; | ||
res.status(200).json({ | ||
file: fileName, | ||
uri, | ||
id, | ||
}); | ||
}); | ||
reader(value).pipe(writer); | ||
}); | ||
reader(bodyObj).pipe(writer); | ||
}); | ||
@@ -66,0 +75,0 @@ }; |
'use strict'; | ||
const validators = require('./validators.js'); | ||
const errors = require('error-obj'); | ||
const { validationError: ValidationError } = require('error-obj'); | ||
const schemas = require('./schemas'); | ||
/** | ||
@@ -15,5 +16,5 @@ * Validate the "fileName" parameter | ||
module.exports.fileName = (req, res, next, param) => { | ||
validators.fileName.validate(param, (error, value) => { | ||
schemas.fileName.validate(param, (error, value) => { | ||
if (error) { | ||
return next(new errors.validationError(error)); // eslint-disable-line | ||
return next(new ValidationError(error)); | ||
} | ||
@@ -20,0 +21,0 @@ |
{ | ||
"name": "asset-pipe-build-server", | ||
"version": "1.0.0-alpha.8", | ||
"version": "1.0.0-alpha.9", | ||
"author": "Amedia", | ||
@@ -24,5 +24,2 @@ "description": "Asset pipe build server", | ||
], | ||
"engines": { | ||
"node": "6.x" | ||
}, | ||
"bugs": { | ||
@@ -32,4 +29,4 @@ "url": "https://github.com/asset-pipe/asset-pipe-build-server/issues" | ||
"dependencies": { | ||
"asset-pipe-js-reader": "1.0.0-alpha.2", | ||
"asset-pipe-sink-fs": "1.0.0-alpha.3", | ||
"asset-pipe-js-reader": "1.0.0-alpha.5", | ||
"asset-pipe-sink-fs": "1.0.0-alpha.5", | ||
"body": "5.1.0", | ||
@@ -44,3 +41,3 @@ "bole": "3.0.2", | ||
"hbs": "4.0.1", | ||
"joi": "10.2.2", | ||
"joi": "^10.2.2", | ||
"request": "2.79.0" | ||
@@ -47,0 +44,0 @@ }, |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8925
232
1
+ Addedasset-pipe-common@1.0.0-alpha.4(transitive)
+ Addedasset-pipe-js-reader@1.0.0-alpha.5(transitive)
+ Addedasset-pipe-sink-fs@1.0.0-alpha.5(transitive)
+ Addedbrowser-pack@6.0.2(transitive)
+ Addedjoi@10.6.0(transitive)
+ Addedmerge-stream@1.0.1(transitive)
+ Addedpump@1.0.2(transitive)
- Removedasset-pipe-common@1.0.0-alpha.2(transitive)
- Removedasset-pipe-js-reader@1.0.0-alpha.2(transitive)
- Removedasset-pipe-sink-fs@1.0.0-alpha.3(transitive)
- Removedbrowser-pack@6.0.1(transitive)
- Removedjoi@10.2.2(transitive)
- Removedmerge-stream@1.0.0(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedpump@1.0.1(transitive)
- Removedrequest@2.78.0(transitive)
Updatedjoi@^10.2.2