Skip to content

Commit

Permalink
Feature/validation for name place accents (#221)
Browse files Browse the repository at this point in the history
* updated to newly released version of event-sdk

* updated dependencies and version

* updates to migrate quoting api to use openapi-backend
create openapi >= 3.0 swagger
updated dependencies
added new routes
converted server to use new libraries
golden path tests pass
coverage may need some attention

* added production to quotes audit checks

* fixed incorrect case for file path

* Updated code coverage

* update of dependencies

* error handling dependency update

* updated dependency
  • Loading branch information
rmothilal authored Jun 15, 2020
1 parent 79ca56f commit 88a8c05
Show file tree
Hide file tree
Showing 21 changed files with 3,112 additions and 1,619 deletions.
4 changes: 1 addition & 3 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"reject": [
"@hapi/hapi",
"json-rules-engine",
"hapi-openapi"
"json-rules-engine"
]
}
46 changes: 0 additions & 46 deletions audit-resolve.json
Original file line number Diff line number Diff line change
@@ -1,46 +0,0 @@
{
"decisions": {
"1179|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1588247839506,
"expiresAt": 1588852630163
},
"1179|@mojaloop/event-sdk>grpc>node-pre-gyp>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1588247839507,
"expiresAt": 1588852630163
},
"1179|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>tar>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1588247839507,
"expiresAt": 1588852630163
},
"1179|@mojaloop/event-sdk>grpc>node-pre-gyp>tar>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1588247839507,
"expiresAt": 1588852630163
},
"1179|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>rc>minimist": {
"decision": "ignore",
"madeAt": 1588247839507,
"expiresAt": 1588852630163
},
"1179|@mojaloop/event-sdk>grpc>node-pre-gyp>rc>minimist": {
"decision": "ignore",
"madeAt": 1588247839507,
"expiresAt": 1588852630163
},
"1500|npm-audit-resolver>yargs-unparser>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1588760499425,
"expiresAt": 1589365290340
},
"1500|npm-audit-resolver>audit-resolve-core>yargs-parser": {
"decision": "ignore",
"madeAt": 1589898179690,
"expiresAt": 1592490171384
}
},
"rules": {},
"version": 1
}
2,701 changes: 1,194 additions & 1,507 deletions package-lock.json

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "quoting-service",
"description": "Quoting Service hosted by a scheme",
"license": "Apache-2.0",
"version": "10.3.2",
"version": "10.4.0",
"author": "ModusBox",
"contributors": [
"James Bush <james.bush@modusbox.com>",
Expand Down Expand Up @@ -52,42 +52,41 @@
"package-lock": "docker run --rm -it quoting-service:local cat package-lock.json > package-lock.json",
"docker:up": "docker-compose -f docker-compose.yml -f docker-compose.base.yml up",
"docker:stop": "docker-compose -f docker-compose.yml -f docker-compose.base.yml stop",
"audit:resolve": "SHELL=sh resolve-audit",
"audit:check": "SHELL=sh check-audit",
"audit:resolve": "SHELL=sh resolve-audit --production",
"audit:check": "SHELL=sh check-audit --production",
"dep:check": "npx ncu -e 2",
"dep:update": "npx ncu -u"
},
"dependencies": {
"@hapi/good": "9.0.0",
"@hapi/hapi": "18.4.1",
"@mojaloop/central-services-error-handling": "10.3.0",
"@mojaloop/central-services-logger": "9.5.1",
"@mojaloop/central-services-shared": "10.2.1",
"@mojaloop/event-sdk": "9.5.2",
"@hapi/hapi": "19.1.1",
"@mojaloop/central-services-error-handling": "10.4.1",
"@mojaloop/central-services-logger": "10.4.0",
"@mojaloop/central-services-shared": "10.4.3",
"@mojaloop/event-sdk": "10.4.0",
"@mojaloop/ml-number": "8.2.0",
"@mojaloop/sdk-standard-components": "10.3.0",
"@mojaloop/sdk-standard-components": "10.3.2",
"axios": "0.19.2",
"blipp": "4.0.1",
"eslint-config-standard": "14.1.1",
"good-console": "8.0.0",
"good-squeeze": "5.1.0",
"hapi-openapi": "1.2.6",
"json-rules-engine": "5.0.2",
"knex": "0.21.1",
"memory-cache": "0.2.0",
"minimist": "^1.2.5",
"minimist": "1.2.5",
"mysql": "2.18.1",
"node-fetch": "2.6.0",
"parse-strings-in-object": "2.0.0",
"rc": "1.2.8"
},
"devDependencies": {
"@types/jest": "25.2.3",
"eslint": "7.1.0",
"@types/jest": "26.0.0",
"eslint": "7.2.0",
"jest": "26.0.1",
"jest-junit": "10.0.0",
"npm-audit-resolver": "2.2.0",
"npm-check-updates": "6.0.1",
"npm-check-updates": "7.0.1",
"nyc": "15.1.0",
"pre-commit": "1.2.2",
"proxyquire": "2.1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/bulkQuotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = {
* produces: application/json
* responses: 202, 400, 401, 403, 404, 405, 406, 501, 503
*/
post: function BulkQuotes () {
post: function BulkQuotes (context, request, h) {
throw ErrorHandler.CreateFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.NOT_IMPLEMENTED, 'Bulk quotes not implemented')
}
}
4 changes: 2 additions & 2 deletions src/handlers/bulkQuotes/{id}.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = {
* produces: application/json
* responses: 202, 400, 401, 403, 404, 405, 406, 501, 503
*/
get: function BulkQuotesById () {
get: function BulkQuotesById (context, request, h) {
throw ErrorHandler.CreateFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.NOT_IMPLEMENTED, 'Bulk quotes not implemented')
},
/**
Expand All @@ -55,7 +55,7 @@ module.exports = {
* produces: application/json
* responses: 200, 400, 401, 403, 404, 405, 406, 501, 503
*/
put: function BulkQuotesById1 () {
put: function BulkQuotesById1 (context, request, h) {
throw ErrorHandler.CreateFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.NOT_IMPLEMENTED, 'Bulk quotes not implemented')
}
}
2 changes: 1 addition & 1 deletion src/handlers/bulkQuotes/{id}/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = {
* produces: application/json
* responses: 200, 400, 401, 403, 404, 405, 406, 501, 503
*/
put: function BulkQuotesErrorById () {
put: function BulkQuotesErrorById (context, request, h) {
throw ErrorHandler.CreateFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.NOT_IMPLEMENTED, 'Bulk quotes not implemented')
}
}
2 changes: 1 addition & 1 deletion src/handlers/health.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = {
* produces: application/json
* responses: 200, 400, 401, 403, 404, 405, 406, 501, 503
*/
get: async (request, h) => {
get: async (context, request, h) => {
// Check to see if we are NOT in simpleRoutingMode
let serviceHealthList = []
// console.log('envConfig', envConfig)
Expand Down
50 changes: 50 additions & 0 deletions src/handlers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*****
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
* ModusBox
- Rajiv Mothilal <rajiv.mothilal@modusbox.com>
--------------
******/

'use strict'

const OpenapiBackend = require('@mojaloop/central-services-shared').Util.OpenapiBackend
const quotes = require('./quotes')
const quotesById = require('./quotes/{id}')
const quotesErrorByID = require('./quotes/{id}/error')
const health = require('./health')
const bulkQuotes = require('./bulkQuotes')
const bulkQuotesById = require('./bulkQuotes/{id}')
const bulkQuotesErrorById = require('./bulkQuotes/{id}/error')

module.exports = {
HealthGet: health.get,
QuotesErrorByIDPut: quotesErrorByID.put,
QuotesByIdGet: quotesById.get,
QuotesByIdPut: quotesById.put,
QuotesPost: quotes.post,
BulkQuotesErrorByIdPut: bulkQuotesErrorById.put,
BulkQuotesByIdGet: bulkQuotesById.get,
BulkQuotesByIdPut: bulkQuotesById.put,
BulkQuotesPost: bulkQuotes.post,
validationFail: OpenapiBackend.validationFail,
notFound: OpenapiBackend.notFound,
methodNotAllowed: OpenapiBackend.methodNotAllowed
}
2 changes: 1 addition & 1 deletion src/handlers/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = {
* produces: application/json
* responses: 202, 400, 401, 403, 404, 405, 406, 501, 503
*/
post: async function Quotes (request, h) {
post: async function Quotes (context, request, h) {
// log request
request.server.log(['info'], `got a POST /quotes request: ${util.inspect(request.payload)}`)

Expand Down
4 changes: 2 additions & 2 deletions src/handlers/quotes/{id}.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = {
* produces: application/json
* responses: 202, 400, 401, 403, 404, 405, 406, 501, 503
*/
get: async function getQuotesById (request, h) {
get: async function getQuotesById (context, request, h) {
// log request
request.server.log(['info'], `got a GET /quotes/{id} request for quoteId ${request.params.id}`)

Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = {
* produces: application/json
* responses: 200, 400, 401, 403, 404, 405, 406, 501, 503
*/
put: async function putQuotesById (request, h) {
put: async function putQuotesById (context, request, h) {
// log request
request.server.log(['info'], `got a PUT /quotes/{id} request: ${util.inspect(request.payload)}`)

Expand Down
2 changes: 1 addition & 1 deletion src/handlers/quotes/{id}/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = {
* produces: application/json
* responses: 200, 400, 401, 403, 404, 405, 406, 501, 503
*/
put: async function QuotesByIdAndError (request, h) {
put: async function QuotesByIdAndError (context, request, h) {
// log request
request.server.log(['info'], `got a PUT /quotes/{id}/error request: ${util.inspect(request.payload)}`)

Expand Down
Loading

0 comments on commit 88a8c05

Please sign in to comment.