five-bells-shared
Advanced tools
Comparing version 8.1.0 to 8.2.0
@@ -12,3 +12,3 @@ 'use strict' | ||
* handler (ctx, log) { | ||
log.warn('Invalid Body: ' + this.message) | ||
log.warn('Unauthorized: ' + this.message) | ||
ctx.status = 403 | ||
@@ -15,0 +15,0 @@ ctx.body = { |
@@ -196,3 +196,3 @@ 'use strict' | ||
*/ | ||
validateExternal (data) { | ||
static validateExternal (data) { | ||
return { | ||
@@ -199,0 +199,0 @@ valid: true, |
@@ -96,11 +96,7 @@ 'use strict' | ||
Model.findById = function findById (id, options) { | ||
return DbModel.findById(id, options).then(function (result) { | ||
return result ? Model.fromDatabaseModel(result) : result | ||
}) | ||
return DbModel.findById(id, options).then(fromDatabaseModel) | ||
} | ||
Model.findOne = function findOne (options) { | ||
return DbModel.findOne(options).then(function (result) { | ||
return result ? Model.fromDatabaseModel(result) : result | ||
}) | ||
return DbModel.findOne(options).then(fromDatabaseModel) | ||
} | ||
@@ -121,3 +117,3 @@ | ||
return DbModel.create(model.getDataPersistent(), options) | ||
return DbModel.create(model.getDataPersistent(), options).then(fromDatabaseModel) | ||
} | ||
@@ -128,3 +124,3 @@ | ||
return DbModel.upsert(model.getDataPersistent(), options) | ||
return DbModel.upsert(model.getDataPersistent(), options).then(fromDatabaseModel) | ||
} | ||
@@ -165,2 +161,6 @@ | ||
} | ||
function fromDatabaseModel (result) { | ||
return result ? Model.fromDatabaseModel(result) : result | ||
} | ||
} |
{ | ||
"name": "five-bells-shared", | ||
"version": "8.1.0", | ||
"version": "8.2.0", | ||
"description": "Shared components for Five Bells projects.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -35,2 +35,10 @@ { | ||
}, | ||
"cancellation_condition": { | ||
"description": "The condition for executing the transfer", | ||
"$ref": "Condition.json" | ||
}, | ||
"cancellation_condition_fulfillment": { | ||
"description": "Proof that the execution_condition has been met", | ||
"$ref": "ConditionFulfillment.json" | ||
}, | ||
"expiry_duration": { | ||
@@ -37,0 +45,0 @@ "description": "Time in seconds between proposed_at and expires_at. Set in quotes from payment systems but not valid in actual transfers", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1690331
2888