trailpack-proxy-generics
Advanced tools
Comparing version 0.0.15 to 0.0.16
'use strict' | ||
const joi = require('joi') | ||
// TODO schema | ||
module.exports = joi.string() | ||
// TODO schema req.file | ||
module.exports = joi.object() |
@@ -5,2 +5,5 @@ 'use strict' | ||
// TODO schema | ||
module.exports = joi.object() | ||
module.exports = joi.object().keys({ | ||
src: joi.string().required(), | ||
url: joi.string() | ||
}).unknown() |
'use strict' | ||
const joi = require('joi') | ||
// TODO schema | ||
module.exports = joi.array() | ||
const fileSchema = require('./uploadFile') | ||
module.exports = joi.array().items(fileSchema) |
'use strict' | ||
const joi = require('joi') | ||
const fileSchema = require('./uploadFileSuccess') | ||
// TODO schema | ||
module.exports = joi.array().items(fileSchema) |
@@ -6,4 +6,6 @@ 'use strict' | ||
module.exports = joi.object().keys({ | ||
status: joi.string().required(), | ||
url: joi.string().required() | ||
status: joi.string().required().valid(['pending','failure','success']), | ||
url: joi.string().required(), | ||
failure_message: joi.string(), | ||
file_details: joi.object() | ||
}).unknown() |
@@ -7,3 +7,4 @@ 'use strict' | ||
status: joi.string().required(), | ||
url: joi.string().required() | ||
}) | ||
url: joi.string().required(), | ||
file_details: joi.object() | ||
}).unknown() |
{ | ||
"name": "trailpack-proxy-generics", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Generics - Trailpack for Proxy Engine", | ||
@@ -5,0 +5,0 @@ "homepage": "https://cali-style.com", |
@@ -12,3 +12,7 @@ 'use strict' | ||
it('should upload a buffer', (done) => { | ||
DataStoreGenericService.upload('buffer') | ||
DataStoreGenericService.upload({ | ||
mimetype: 'image/jpeg', | ||
oringalname: 'name', | ||
buffer: 'helloworld' | ||
}) | ||
.then(image => { | ||
@@ -25,2 +29,3 @@ assert.equal(image.status, 'success') | ||
DataStoreGenericService.uploadFile({ | ||
src: 'https://placeholdit.imgix.net/~text?txtsize=33&txt=350%C3%97150&w=350&h=150', | ||
url: 'https://placeholdit.imgix.net/~text?txtsize=33&txt=350%C3%97150&w=350&h=150' | ||
@@ -39,2 +44,3 @@ }) | ||
DataStoreGenericService.uploadFiles([{ | ||
src: 'https://placeholdit.imgix.net/~text?txtsize=33&txt=350%C3%97150&w=350&h=150', | ||
url: 'https://placeholdit.imgix.net/~text?txtsize=33&txt=350%C3%97150&w=350&h=150' | ||
@@ -41,0 +47,0 @@ }]) |
68953
2186