Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mojaloop/#3689): fx quotes changes #469

Merged
merged 4 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .ncurc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ reject: [
npm-check-updates,
## Updating from version 16.5.0 breaks builds
nx,
'@mojaloop/central-services-shared'
'@mojaloop/central-services-shared',
# This can be removed after the JWS signing bug in v17.4.0 has been fixed
'@mojaloop/sdk-standard-components'
]
51 changes: 28 additions & 23 deletions audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,33 @@
// Only use one of ["low": true, "moderate": true, "high": true, "critical": true]
"moderate": true,
"allowlist": [
"GHSA-282f-qqgm-c34q",
"GHSA-v88g-cgmw-v5xw",
"GHSA-mjxr-4v3x-q3m4",
"GHSA-p9pc-299p-vxgp",
"GHSA-6vfc-qv3f-vr6c",
"GHSA-rjqq-98f6-6j3r",
"GHSA-phwq-j96m-2c2q",
"GHSA-wc69-rhjr-hc9g",
"GHSA-8qr4-xgw6-wmr3",
"GHSA-hrpp-h998-j3pp",
"GHSA-8cf7-32gw-wr33",
// Vulnerabilities for jsonwebtoken in
// sdk-standard-components
// central-services-error-handling
// central-services-shared
"GHSA-hjrf-2m68-5959",
"GHSA-qwph-4952-7xr6",
// Some audit issues with api-snippets
"GHSA-c2qf-rxjj-qqgw",
// Issue with protobuffs (https://github.com/advisories/GHSA-h755-8qp9-cq85). No fix available.
"GHSA-h755-8qp9-cq85",
"GHSA-7fh5-64p2-3v2j", // Issue with postcss (https://github.com/advisories/GHSA-7fh5-64p2-3v2j)
"GHSA-67hx-6x53-jw92", // Issue with @babel/traverse (https://github.com/advisories/GHSA-67hx-6x53-jw92)
"GHSA-p9pc-299p-vxgp", // nx>yargs-parser
"GHSA-p9pc-299p-vxgp", // nx>yargs>yargs-parser
"GHSA-p9pc-299p-vxgp", // @mojaloop/event-sdk>@grpc/proto-loader>yargs>yargs-parser
"GHSA-p9pc-299p-vxgp", // @mojaloop/event-sdk>@grpc/grpc-js>@grpc/proto-loader>yargs>yargs-parser
"GHSA-p9pc-299p-vxgp", // @mojaloop/central-services-shared>@mojaloop/event-sdk>@grpc/grpc-js>@grpc/proto-loader>yargs>yargs-parser
"GHSA-p9pc-299p-vxgp", // @mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>yargs-parser
"GHSA-v88g-cgmw-v5xw", // ajv
"GHSA-v88g-cgmw-v5xw", // @mojaloop/central-services-shared>ajv
"GHSA-v88g-cgmw-v5xw", // @mojaloop/central-services-shared>openapi-backend>ajv
"GHSA-v88g-cgmw-v5xw", // @mojaloop/central-services-shared>openapi-backend>openapi-schema-validator>ajv
"GHSA-v88g-cgmw-v5xw", // @mojaloop/central-services-shared>openapi-backend>openapi-schema-validator>ajv-formats>ajv
"GHSA-v88g-cgmw-v5xw", // eslint-config-airbnb-typescript>@typescript-eslint/eslint-plugin>@typescript-eslint/parser>eslint>@eslint/eslintrc>ajv
"GHSA-v88g-cgmw-v5xw", // eslint-config-airbnb-typescript>@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>@typescript-eslint/utils>eslint>@eslint/eslintrc>ajv
"GHSA-v88g-cgmw-v5xw", // eslint-config-airbnb-typescript>@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>@typescript-eslint/utils>eslint-utils>eslint>@eslint/eslintrc>ajv
"GHSA-phwq-j96m-2c2q", // @mojaloop/central-services-shared>shins>ejs
"GHSA-282f-qqgm-c34q", // @mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer
"GHSA-282f-qqgm-c34q", // @mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer
"GHSA-mjxr-4v3x-q3m4", // @mojaloop/central-services-shared>shins>sanitize-html
"GHSA-rjqq-98f6-6j3r", // @mojaloop/central-services-shared>shins>sanitize-html
"GHSA-6vfc-qv3f-vr6c", // @mojaloop/central-services-shared>shins>markdown-it
"GHSA-6vfc-qv3f-vr6c", // @mojaloop/central-services-shared>shins>markdown-it-attrs>markdown-it
"GHSA-7fh5-64p2-3v2j", // @mojaloop/central-services-shared>shins>sanitize-html>postcss
"GHSA-hrpp-h998-j3pp", // openapi-backend>qs
"GHSA-hrpp-h998-j3pp", // koa-body>formidable>qs
"GHSA-hrpp-h998-j3pp", // supertest>superagent>formidable>qs
"GHSA-hrpp-h998-j3pp", // @mojaloop/api-snippets>json-refs>path-loader>superagent>qs
"GHSA-hrpp-h998-j3pp", // @mojaloop/api-snippets>json-refs>path-loader>superagent>formidable>qs
"GHSA-rm97-x556-q36h" // @mojaloop/central-services-shared>shins>sanitize-html
]
}
36 changes: 18 additions & 18 deletions modules/api-svc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"url": "[email protected]:mojaloop/sdk-scheme-adapter.git"
},
"dependencies": {
"@koa/cors": "^4.0.0",
"@mojaloop/api-snippets": "v17.3.0-snapshot.0",
"@koa/cors": "^5.0.0",
"@mojaloop/api-snippets": "v17.4.0",
"@mojaloop/central-services-error-handling": "^12.0.7",
"@mojaloop/central-services-logger": "^11.2.2",
"@mojaloop/central-services-metrics": "^12.0.8",
Expand All @@ -72,48 +72,48 @@
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
"@mojaloop/sdk-standard-components": "v17.2.0-snapshot.4",
"ajv": "8.12.0",
"axios": "^1.6.2",
"axios": "^1.6.7",
"co-body": "^6.1.0",
"dotenv": "^16.3.1",
"dotenv": "^16.4.5",
"env-var": "^7.4.1",
"express": "^4.18.2",
"express": "^4.18.3",
"fast-json-patch": "^3.1.1",
"javascript-state-machine": "^3.1.0",
"js-yaml": "^4.1.0",
"json-schema-ref-parser": "^9.0.9",
"koa": "^2.14.2",
"koa": "^2.15.0",
"koa-body": "^6.0.1",
"lodash": "^4.17.21",
"module-alias": "^2.2.3",
"oauth2-server": "^4.0.0-dev.2",
"openapi-jsonschema-parameters": "^12.1.3",
"prom-client": "^15.0.0",
"prom-client": "^15.1.0",
"promise-timeout": "^1.3.0",
"random-word-slugs": "^0.1.7",
"redis": "^4.6.11",
"redis": "^4.6.13",
"uuidv4": "^6.2.13",
"ws": "^8.14.2"
"ws": "^8.16.0"
},
"devDependencies": {
"@babel/core": "^7.23.5",
"@babel/preset-env": "^7.23.5",
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@redocly/openapi-cli": "^1.0.0-beta.94",
"@types/jest": "^29.5.10",
"@types/jest": "^29.5.12",
"babel-jest": "^29.7.0",
"eslint": "^8.55.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.9.0",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"nock": "^13.4.0",
"nock": "^13.5.4",
"npm-check-updates": "^16.7.10",
"openapi-response-validator": "^12.1.3",
"openapi-typescript": "^6.7.2",
"openapi-typescript": "^6.7.4",
"redis-mock": "^0.56.3",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"supertest": "^6.3.3",
"supertest": "^6.3.4",
"swagger-cli": "^4.0.4"
},
"standard-version": {
Expand Down
16 changes: 16 additions & 0 deletions modules/api-svc/src/TestServer/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ paths:
application/json:
schema:
type: object
'/fxQuoteRequests/{ID}':
get:
description: Test support method. Allows the caller to see the body of a previous request
summary: getFxQuoteById
tags:
- test
operationId: getFxQuoteById
parameters:
- $ref: '#/components/parameters/ID'
responses:
'200':
description: Response
content:
application/json:
schema:
type: object
components:
parameters:
ID:
Expand Down
19 changes: 19 additions & 0 deletions modules/api-svc/src/TestServer/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ const getCallbackById = async(ctx) => {
}
};

/**
* Handles a GET /fxQuoteRequests/{ID} request. This is a test support method that allows the caller
* to see the body of a previous incoming callback.
*/
const getFxQuoteById = async(ctx) => {
try {
const req = await ctx.state.cache.get(`fxQuote_in_${ctx.state.path.params.ID}`);
ctx.response.status = ReturnCodes.OK.CODE;
ctx.response.body = req;
}
catch(err) {
ctx.status = ReturnCodes.INTERNALSERVERERRROR.CODE;
ctx.response.body = err;
}
};


module.exports = {
'/': {
Expand All @@ -63,4 +79,7 @@ module.exports = {
'/callbacks/{ID}': {
get: getCallbackById
},
'/fxQuoteRequests/{ID}': {
get: getFxQuoteById
},
};
30 changes: 15 additions & 15 deletions modules/outbound-command-event-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,40 @@
"snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
},
"dependencies": {
"@mojaloop/api-snippets": "17.2.5",
"@mojaloop/api-snippets": "17.4.0",
"@mojaloop/central-services-shared": "^18.2.0",
"@mojaloop/logging-bc-client-lib": "^0.1.17",
"@mojaloop/logging-bc-public-types-lib": "^0.1.23",
"@mojaloop/logging-bc-public-types-lib": "^0.5.4",
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
"ajv": "^8.12.0",
"convict": "^6.2.4",
"express": "^4.18.2",
"openapi-backend": "^5.10.5",
"redis": "^4.6.11",
"express": "^4.18.3",
"openapi-backend": "^5.10.6",
"redis": "^4.6.13",
"swagger-ui-express": "^5.0.0",
"yamljs": "^0.3.0"
},
"devDependencies": {
"@types/convict": "^6.1.6",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.3",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.25",
"@types/node-cache": "^4.2.5",
"@types/supertest": "^2.0.16",
"@types/supertest": "^6.0.2",
"@types/swagger-ui-express": "^4.1.6",
"@types/yamljs": "^0.2.34",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"copyfiles": "^2.4.1",
"eslint": "^8.55.0",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"nodemon": "^3.0.2",
"nodemon": "^3.1.0",
"npm-check-updates": "^16.7.10",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.3.2"
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.2"
},
"nodemonConfig": {
"watch": [
Expand Down
30 changes: 15 additions & 15 deletions modules/outbound-domain-event-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,38 @@
"snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
},
"dependencies": {
"@mojaloop/api-snippets": "17.2.5",
"@mojaloop/api-snippets": "17.4.0",
"@mojaloop/logging-bc-client-lib": "^0.1.17",
"@mojaloop/logging-bc-public-types-lib": "^0.1.23",
"@mojaloop/logging-bc-public-types-lib": "^0.5.4",
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
"convict": "^6.2.4",
"express": "^4.18.2",
"openapi-backend": "^5.10.5",
"redis": "^4.6.11",
"express": "^4.18.3",
"openapi-backend": "^5.10.6",
"redis": "^4.6.13",
"swagger-ui-express": "^5.0.0",
"yamljs": "^0.3.0"
},
"devDependencies": {
"@types/convict": "^6.1.6",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.3",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.25",
"@types/node-cache": "^4.2.5",
"@types/supertest": "^2.0.16",
"@types/supertest": "^6.0.2",
"@types/swagger-ui-express": "^4.1.6",
"@types/yamljs": "^0.2.34",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"copyfiles": "^2.4.1",
"eslint": "^8.55.0",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"nodemon": "^3.0.2",
"nodemon": "^3.1.0",
"npm-check-updates": "^16.7.10",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.3.2"
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.2"
},
"nodemonConfig": {
"watch": [
Expand Down
16 changes: 8 additions & 8 deletions modules/private-shared-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@
"snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
},
"dependencies": {
"@mojaloop/api-snippets": "17.2.5",
"@mojaloop/api-snippets": "17.4.0",
"@mojaloop/central-services-shared": "^18.2.0",
"@mojaloop/logging-bc-public-types-lib": "^0.1.23",
"@mojaloop/platform-shared-lib-messaging-types-lib": "^0.2.103",
"@mojaloop/logging-bc-public-types-lib": "^0.5.4",
"@mojaloop/platform-shared-lib-messaging-types-lib": "^0.5.6",
"@mojaloop/platform-shared-lib-nodejs-kafka-client-lib": "0.2.15",
"ajv": "^8.12.0",
"redis": "^4.6.11",
"redis": "^4.6.13",
"uuid": "^9.0.1"
},
"devDependencies": {
"@types/node": "^20.10.3",
"eslint": "^8.55.0",
"@types/node": "^20.11.25",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"npm-check-updates": "^16.7.10",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.1.1",
"typescript": "^5.3.2"
"ts-jest": "^29.1.2",
"typescript": "^5.4.2"
},
"standard-version": {
"scripts": {
Expand Down
29 changes: 18 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
"build:no-cache": "nx run-many --all --target=build --skip-nx-cache",
"build:openapi": "yarn workspace @mojaloop/sdk-scheme-adapter-api-svc run build:openapi",
"build:openapi:inbound": "yarn workspace @mojaloop/sdk-scheme-adapter-api-svc run build:openapi:inbound",
"docker:build": "docker build --build-arg NODE_VERSION=\"$(cat .nvmrc)-alpine\" -t mojaloop/sdk-scheme-adapter:local -f ./Dockerfile .",
"docker:up": "docker-compose up",
"docker:stop": "docker-compose stop",
"docker:rm": "docker-compose rm -f -v",
"docker:down": "docker-compose down -v",
"docker:clean": "docker-compose down --rmi local",
"validate:api": "yarn workspace @mojaloop/sdk-scheme-adapter-api-svc run validate:api",
"validate:api-sequence-diagram": "node ./scripts/validate-api-sequence-diagram.js",
"watch": "nx run-many --parallel --all --target=watch",
Expand All @@ -58,6 +64,7 @@
"test:integration": "nx run-many --parallel --all --target=test:integration",
"test:integration:affected": "nx affected --parallel --target=test:integration",
"audit:check": "yarn dlx audit-ci --config ./audit-ci.jsonc",
"audit:fix": "yarn-audit-fix",
"dep:check": "yarn ncu -e 2 && nx run-many --parallel --all --target=dep:check --output-style=static",
"dep:update": "yarn ncu -u && nx run-many --parallel --all --target=dep:update --output-style=static",
"release": "yarn run release:modules -- --skip.tag --skip.commit && standard-version --commit-all --no-verify --releaseCommitMessageFormat 'chore(release): {{currentTag}} [skip ci]'",
Expand All @@ -71,24 +78,24 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@types/jest": "^29.5.10",
"@types/node": "^20.10.3",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.25",
"@types/node-cache": "^4.2.5",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"audit-ci": "^6.6.1",
"eslint": "^8.55.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-plugin-import": "latest",
"husky": "^8.0.3",
"husky": "^9.0.11",
"jest": "^29.7.0",
"nodemon": "^3.0.2",
"nodemon": "^3.1.0",
"npm-check-updates": "^16.7.10",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.3.2",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.2",
"yarn-audit-fix": "^10.0.7"
},
"standard-version": {
Expand Down
Loading