From b80f943760a2bfc09415c64fd31faf84782a523e Mon Sep 17 00:00:00 2001 From: Kevin Leyow Date: Tue, 19 Apr 2022 11:48:02 -0500 Subject: [PATCH] chore: move files out of src/ (#300) * chore: remove outdated koa2-oauth-server and bump to node 16 * chore: change * chore: bump audit * chore: changes * chore: ci * chore: move files out of src/ * chore: path fixes * chore: path fixes * chore: path --- .circleci/config.yml | 52 +- src/.env.example => .env.example | 0 src/.eslintignore => .eslintignore | 0 src/.eslintrc.json => .eslintrc.json | 0 src/.nvmrc => .nvmrc | 0 src/.versionrc => .versionrc | 0 src/CHANGELOG.md => CHANGELOG.md | 0 Dockerfile | 4 +- src/audit-resolve.json => audit-resolve.json | 0 src/babel.config.js => babel.config.js | 0 docker-compose.yml | 4 +- src/jest.config.js => jest.config.js | 5 +- junit.xml | 515 ++++++++++++++++++ src/package-lock.json => package-lock.json | 11 + src/package.json => package.json | 15 +- src/InboundServer/api_template.yaml | 58 +- .../components/parameters/bulkQuoteId.yaml | 2 +- .../components/parameters/bulkTransferId.yaml | 2 +- .../parameters/requestToPayTransactionId.yaml | 2 +- .../components/parameters/transferId.yaml | 2 +- .../responses/partiesByIdError404.yaml | 2 +- .../schemas/accountCreationStatus.yaml | 6 +- .../components/schemas/accountsRequest.yaml | 8 +- .../components/schemas/accountsResponse.yaml | 2 +- .../components/schemas/bulkQuoteRequest.yaml | 4 +- .../components/schemas/bulkQuoteResponse.yaml | 2 +- .../schemas/bulkQuoteStatusResponse.yaml | 2 +- .../schemas/bulkTransferRequest.yaml | 4 +- .../schemas/bulkTransferResponse.yaml | 2 +- .../schemas/bulkTransferStatusResponse.yaml | 2 +- .../schemas/extensionListEmptiable.yaml | 2 +- .../components/schemas/individualQuote.yaml | 12 +- .../schemas/individualQuoteResult.yaml | 10 +- .../schemas/individualTransfer.yaml | 12 +- .../schemas/individualTransferFulfilment.yaml | 4 +- .../schemas/individualTransferResult.yaml | 12 +- .../components/schemas/mojaloopError.yaml | 2 +- .../mojaloopTransactionRequestState.yaml | 2 +- .../schemas/partiesByIdResponse.yaml | 2 +- .../components/schemas/quote.yaml | 2 +- .../components/schemas/quotesPostRequest.yaml | 4 +- .../schemas/quotesPostResponse.yaml | 20 +- .../schemas/requestToPayRequest.yaml | 12 +- .../schemas/requestToPayResponse.yaml | 16 +- .../schemas/requestToPayTransferRequest.yaml | 14 +- .../schemas/requestToPayTransferResponse.yaml | 12 +- .../schemas/simpleTransfersPostRequest.yaml | 4 +- .../schemas/simpleTransfersPostResponse.yaml | 2 +- .../schemas/transferFulfilment.yaml | 2 +- .../components/schemas/transferParty.yaml | 22 +- .../components/schemas/transferRequest.yaml | 8 +- .../components/schemas/transferResponse.yaml | 12 +- .../schemas/transferStatusResponse.yaml | 2 +- .../api_template/paths/parties_Type_ID.yaml | 4 +- .../paths/parties_Type_ID_SubId.yaml | 6 +- .../@mojaloop/sdk-standard-components.js | 0 .../__mocks__/javascript-state-machine.js | 0 {src/test => test}/__mocks__/redis.js | 0 {src/test => test}/__mocks__/uuidv4.js | 0 {src/test => test}/config/integration.env | 0 .../lib/Outbound/data/quotesPostRequest.json | 0 .../Outbound/data/transfersPostRequest.json | 0 .../integration/lib/Outbound/parties.test.js | 0 .../integration/lib/Outbound/quotes.test.js | 0 .../lib/Outbound/simpleTransfers.test.js | 0 .../integration/lib/cache.test.js | 6 +- {src/test => test}/integration/testEnv.js | 0 {src/test => test}/unit/InboundServer.test.js | 8 +- {src/test => test}/unit/TestServer.test.js | 10 +- .../unit/api/accounts/accounts.test.js | 0 .../api/accounts/data/postAccountsBody.json | 0 .../postAccountsErrorMojaloopResponse.json | 0 .../postAccountsErrorTimeoutResponse.json | 0 .../data/postAccountsSuccessResponse.json | 0 ...postAccountsSuccessResponseWithError1.json | 0 ...postAccountsSuccessResponseWithError2.json | 0 {src/test => test}/unit/api/accounts/utils.js | 0 .../unit/api/proxy/data/proxyConfig.yaml | 0 .../unit/api/proxy/data/requestBody.json | 0 .../unit/api/proxy/data/requestHeaders.json | 0 .../unit/api/proxy/data/requestQuery.json | 0 .../unit/api/proxy/data/responseBody.json | 0 .../unit/api/proxy/data/responseHeaders.json | 0 .../unit/api/proxy/proxy.test.js | 0 {src/test => test}/unit/api/proxy/utils.js | 0 .../data/getTransfersCommittedResponse.json | 0 .../data/getTransfersErrorNotFound.json | 0 .../api/transfers/data/postQuotesBody.json | 0 .../transfers/data/postTransfersBadBody.json | 0 .../api/transfers/data/postTransfersBody.json | 0 .../postTransfersErrorMojaloopResponse.json | 0 .../postTransfersErrorTimeoutResponse.json | 0 .../data/postTransfersSimpleBody.json | 0 .../data/postTransfersSuccessResponse.json | 0 .../api/transfers/data/putPartiesBody.json | 0 .../api/transfers/data/putQuotesBody.json | 0 .../api/transfers/data/putTransfersBody.json | 0 .../unit/api/transfers/transfers.test.js | 0 .../test => test}/unit/api/transfers/utils.js | 0 {src/test => test}/unit/api/utils.js | 10 +- {src/test => test}/unit/config.test.js | 18 +- .../unit/data/commonHttpHeaders.json | 0 .../unit/data/defaultConfig.json | 0 .../unit/data/postQuotesBody.json | 0 .../unit/data/putParticipantsBody.json | 0 .../unit/data/putPartiesBody.json | 0 {src/test => test}/unit/data/testFile.json | 0 {src/test => test}/unit/data/testFile.yaml | 0 .../unit/inboundApi/data/mockArguments.json | 0 .../data/mockTransactionRequest.json | 0 .../unit/inboundApi/handlers.test.js | 12 +- {src/test => test}/unit/index.test.js | 2 +- {src/test => test}/unit/lib/cache.test.js | 2 +- .../unit/lib/model/AccountsModel.test.js | 4 +- .../lib/model/InboundTransfersModel.test.js | 10 +- .../lib/model/OutboundBulkQuotesModel.test.js | 4 +- .../model/OutboundBulkTransfersModel.test.js | 4 +- .../model/OutboundRequestToPayModel.test.js | 6 +- .../OutboundRequestToPayTransferModel.test.js | 4 +- .../lib/model/OutboundTransfersModel.test.js | 6 +- .../unit/lib/model/PartiesModel.test.js | 56 +- .../unit/lib/model/QuotesModel.test.js | 62 +-- .../unit/lib/model/TransfersModel.test.js | 6 +- .../common/PersistentStateMachine.test.js | 26 +- .../model/data/authorizationsResponse.json | 0 .../unit/lib/model/data/bulkQuoteRequest.json | 0 .../lib/model/data/bulkQuoteResponse.json | 0 .../lib/model/data/bulkTransferFulfil.json | 0 .../lib/model/data/bulkTransferRequest.json | 0 .../unit/lib/model/data/defaultConfig.json | 0 .../data/getBulkTransfersBackendResponse.json | 0 .../getBulkTransfersMojaloopResponse.json | 0 .../data/getTransfersBackendResponse.json | 0 .../data/getTransfersMojaloopResponse.json | 0 .../unit/lib/model/data/mockArguments.json | 0 .../model/data/mockTxnRequestsArguments.json | 0 .../lib/model/data/notificationToPayee.json | 0 .../unit/lib/model/data/payeeParty.json | 0 .../lib/model/data/putQuotesResponse.json | 0 .../lib/model/data/putTransfersResponse.json | 0 .../unit/lib/model/data/quoteResponse.json | 0 .../lib/model/data/requestToPayRequest.json | 0 .../data/requestToPayTransferRequest.json | 0 .../data/transactionRequestResponse.json | 0 .../unit/lib/model/data/transferFulfil.json | 0 .../unit/lib/model/data/transferRequest.json | 0 .../unit/lib/model/mockedLibRequests.js | 2 +- {src/test => test}/unit/mockLogger.js | 0 .../outboundApi/data/bulkQuoteRequest.json | 0 .../outboundApi/data/bulkTransferRequest.json | 0 .../outboundApi/data/mockBulkQuoteError.json | 0 .../data/mockBulkTransferError.json | 0 .../unit/outboundApi/data/mockError.json | 0 .../outboundApi/data/mockGetPartiesError.json | 0 .../data/mockRequestToPayError.json | 0 .../data/mockRequestToPayTransferError.json | 0 .../unit/outboundApi/data/requestToPay.json | 0 .../data/requestToPayTransferRequest.json | 0 .../outboundApi/data/transferRequest.json | 0 .../unit/outboundApi/handlers.test.js | 6 +- 160 files changed, 849 insertions(+), 321 deletions(-) rename src/.env.example => .env.example (100%) rename src/.eslintignore => .eslintignore (100%) rename src/.eslintrc.json => .eslintrc.json (100%) rename src/.nvmrc => .nvmrc (100%) rename src/.versionrc => .versionrc (100%) rename src/CHANGELOG.md => CHANGELOG.md (100%) rename src/audit-resolve.json => audit-resolve.json (100%) rename src/babel.config.js => babel.config.js (100%) rename src/jest.config.js => jest.config.js (74%) create mode 100644 junit.xml rename src/package-lock.json => package-lock.json (99%) rename src/package.json => package.json (83%) rename {src/test => test}/__mocks__/@mojaloop/sdk-standard-components.js (100%) rename {src/test => test}/__mocks__/javascript-state-machine.js (100%) rename {src/test => test}/__mocks__/redis.js (100%) rename {src/test => test}/__mocks__/uuidv4.js (100%) rename {src/test => test}/config/integration.env (100%) rename {src/test => test}/integration/lib/Outbound/data/quotesPostRequest.json (100%) rename {src/test => test}/integration/lib/Outbound/data/transfersPostRequest.json (100%) rename {src/test => test}/integration/lib/Outbound/parties.test.js (100%) rename {src/test => test}/integration/lib/Outbound/quotes.test.js (100%) rename {src/test => test}/integration/lib/Outbound/simpleTransfers.test.js (100%) rename {src/test => test}/integration/lib/cache.test.js (97%) rename {src/test => test}/integration/testEnv.js (100%) rename {src/test => test}/unit/InboundServer.test.js (98%) rename {src/test => test}/unit/TestServer.test.js (98%) rename {src/test => test}/unit/api/accounts/accounts.test.js (100%) rename {src/test => test}/unit/api/accounts/data/postAccountsBody.json (100%) rename {src/test => test}/unit/api/accounts/data/postAccountsErrorMojaloopResponse.json (100%) rename {src/test => test}/unit/api/accounts/data/postAccountsErrorTimeoutResponse.json (100%) rename {src/test => test}/unit/api/accounts/data/postAccountsSuccessResponse.json (100%) rename {src/test => test}/unit/api/accounts/data/postAccountsSuccessResponseWithError1.json (100%) rename {src/test => test}/unit/api/accounts/data/postAccountsSuccessResponseWithError2.json (100%) rename {src/test => test}/unit/api/accounts/utils.js (100%) rename {src/test => test}/unit/api/proxy/data/proxyConfig.yaml (100%) rename {src/test => test}/unit/api/proxy/data/requestBody.json (100%) rename {src/test => test}/unit/api/proxy/data/requestHeaders.json (100%) rename {src/test => test}/unit/api/proxy/data/requestQuery.json (100%) rename {src/test => test}/unit/api/proxy/data/responseBody.json (100%) rename {src/test => test}/unit/api/proxy/data/responseHeaders.json (100%) rename {src/test => test}/unit/api/proxy/proxy.test.js (100%) rename {src/test => test}/unit/api/proxy/utils.js (100%) rename {src/test => test}/unit/api/transfers/data/getTransfersCommittedResponse.json (100%) rename {src/test => test}/unit/api/transfers/data/getTransfersErrorNotFound.json (100%) rename {src/test => test}/unit/api/transfers/data/postQuotesBody.json (100%) rename {src/test => test}/unit/api/transfers/data/postTransfersBadBody.json (100%) rename {src/test => test}/unit/api/transfers/data/postTransfersBody.json (100%) rename {src/test => test}/unit/api/transfers/data/postTransfersErrorMojaloopResponse.json (100%) rename {src/test => test}/unit/api/transfers/data/postTransfersErrorTimeoutResponse.json (100%) rename {src/test => test}/unit/api/transfers/data/postTransfersSimpleBody.json (100%) rename {src/test => test}/unit/api/transfers/data/postTransfersSuccessResponse.json (100%) rename {src/test => test}/unit/api/transfers/data/putPartiesBody.json (100%) rename {src/test => test}/unit/api/transfers/data/putQuotesBody.json (100%) rename {src/test => test}/unit/api/transfers/data/putTransfersBody.json (100%) rename {src/test => test}/unit/api/transfers/transfers.test.js (100%) rename {src/test => test}/unit/api/transfers/utils.js (100%) rename {src/test => test}/unit/api/utils.js (88%) rename {src/test => test}/unit/config.test.js (89%) rename {src/test => test}/unit/data/commonHttpHeaders.json (100%) rename {src/test => test}/unit/data/defaultConfig.json (100%) rename {src/test => test}/unit/data/postQuotesBody.json (100%) rename {src/test => test}/unit/data/putParticipantsBody.json (100%) rename {src/test => test}/unit/data/putPartiesBody.json (100%) rename {src/test => test}/unit/data/testFile.json (100%) rename {src/test => test}/unit/data/testFile.yaml (100%) rename {src/test => test}/unit/inboundApi/data/mockArguments.json (100%) rename {src/test => test}/unit/inboundApi/data/mockTransactionRequest.json (100%) rename {src/test => test}/unit/inboundApi/handlers.test.js (98%) rename {src/test => test}/unit/index.test.js (98%) rename {src/test => test}/unit/lib/cache.test.js (99%) rename {src/test => test}/unit/lib/model/AccountsModel.test.js (97%) rename {src/test => test}/unit/lib/model/InboundTransfersModel.test.js (98%) rename {src/test => test}/unit/lib/model/OutboundBulkQuotesModel.test.js (98%) rename {src/test => test}/unit/lib/model/OutboundBulkTransfersModel.test.js (98%) rename {src/test => test}/unit/lib/model/OutboundRequestToPayModel.test.js (96%) rename {src/test => test}/unit/lib/model/OutboundRequestToPayTransferModel.test.js (98%) rename {src/test => test}/unit/lib/model/OutboundTransfersModel.test.js (99%) rename {src/test => test}/unit/lib/model/PartiesModel.test.js (96%) rename {src/test => test}/unit/lib/model/QuotesModel.test.js (96%) rename {src/test => test}/unit/lib/model/TransfersModel.test.js (98%) rename {src/test => test}/unit/lib/model/common/PersistentStateMachine.test.js (95%) rename {src/test => test}/unit/lib/model/data/authorizationsResponse.json (100%) rename {src/test => test}/unit/lib/model/data/bulkQuoteRequest.json (100%) rename {src/test => test}/unit/lib/model/data/bulkQuoteResponse.json (100%) rename {src/test => test}/unit/lib/model/data/bulkTransferFulfil.json (100%) rename {src/test => test}/unit/lib/model/data/bulkTransferRequest.json (100%) rename {src/test => test}/unit/lib/model/data/defaultConfig.json (100%) rename {src/test => test}/unit/lib/model/data/getBulkTransfersBackendResponse.json (100%) rename {src/test => test}/unit/lib/model/data/getBulkTransfersMojaloopResponse.json (100%) rename {src/test => test}/unit/lib/model/data/getTransfersBackendResponse.json (100%) rename {src/test => test}/unit/lib/model/data/getTransfersMojaloopResponse.json (100%) rename {src/test => test}/unit/lib/model/data/mockArguments.json (100%) rename {src/test => test}/unit/lib/model/data/mockTxnRequestsArguments.json (100%) rename {src/test => test}/unit/lib/model/data/notificationToPayee.json (100%) rename {src/test => test}/unit/lib/model/data/payeeParty.json (100%) rename {src/test => test}/unit/lib/model/data/putQuotesResponse.json (100%) rename {src/test => test}/unit/lib/model/data/putTransfersResponse.json (100%) rename {src/test => test}/unit/lib/model/data/quoteResponse.json (100%) rename {src/test => test}/unit/lib/model/data/requestToPayRequest.json (100%) rename {src/test => test}/unit/lib/model/data/requestToPayTransferRequest.json (100%) rename {src/test => test}/unit/lib/model/data/transactionRequestResponse.json (100%) rename {src/test => test}/unit/lib/model/data/transferFulfil.json (100%) rename {src/test => test}/unit/lib/model/data/transferRequest.json (100%) rename {src/test => test}/unit/lib/model/mockedLibRequests.js (97%) rename {src/test => test}/unit/mockLogger.js (100%) rename {src/test => test}/unit/outboundApi/data/bulkQuoteRequest.json (100%) rename {src/test => test}/unit/outboundApi/data/bulkTransferRequest.json (100%) rename {src/test => test}/unit/outboundApi/data/mockBulkQuoteError.json (100%) rename {src/test => test}/unit/outboundApi/data/mockBulkTransferError.json (100%) rename {src/test => test}/unit/outboundApi/data/mockError.json (100%) rename {src/test => test}/unit/outboundApi/data/mockGetPartiesError.json (100%) rename {src/test => test}/unit/outboundApi/data/mockRequestToPayError.json (100%) rename {src/test => test}/unit/outboundApi/data/mockRequestToPayTransferError.json (100%) rename {src/test => test}/unit/outboundApi/data/requestToPay.json (100%) rename {src/test => test}/unit/outboundApi/data/requestToPayTransferRequest.json (100%) rename {src/test => test}/unit/outboundApi/data/transferRequest.json (100%) rename {src/test => test}/unit/outboundApi/handlers.test.js (99%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d3146c37..9f61c52a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,13 +46,12 @@ defaults_license_scanner: &defaults_license_scanner defaults_npm_auth: &defaults_npm_auth name: Update NPM registry auth token - command: cd src; echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc + command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc defaults_npm_publish_release: &defaults_npm_publish_release name: Publish NPM $RELEASE_TAG artifact command: | source $BASH_ENV - cd src echo "Publishing tag $RELEASE_TAG" npm publish --tag $RELEASE_TAG --access public @@ -89,14 +88,14 @@ jobs: command: cd $(npm root -g)/npm - run: name: Update NPM install (using `npm ci`) - command: cd src && npm ci + command: npm ci - run: name: Delete build dependencies command: apk del build-dependencies - save_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} paths: - - src/node_modules + - node_modules test-unit: executor: default-docker @@ -106,14 +105,14 @@ jobs: command: *defaults_Dependencies - checkout - restore_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} - run: name: Execute unit tests - command: cd src && npm run test + command: npm run test - store_test_results: - path: /home/circleci/project/src/ + path: /home/circleci/project/ - store_artifacts: - path: /home/circleci/project/src/junit.xml + path: /home/circleci/project/junit.xml test-integration: executor: default-machine @@ -126,7 +125,7 @@ jobs: chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose - restore_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} - run: name: Set up NVM command: | @@ -152,14 +151,13 @@ jobs: name: Execute integration tests command: | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - cd src npm ci npm run test:int - run: name: prepare test/results command: | mkdir -p test/results - mv src/junit.xml test/results + mv junit.xml test/results - store_artifacts: path: ./test/results - store_test_results: @@ -173,10 +171,10 @@ jobs: command: *defaults_Dependencies - checkout - restore_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} - run: name: Execute unit tests - command: cd src && npm run build:openapi && npm run validate:api + command: npm run build:openapi && npm run validate:api lint: executor: default-docker @@ -186,13 +184,13 @@ jobs: command: *defaults_Dependencies - checkout - restore_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} - run: name: Create dir for lint results - command: cd src && mkdir -p /lintresults + command: mkdir -p /lintresults - run: name: Execute linting - command: cd src && (npm run lint > /lintresults/results.txt) + command: (npm run lint > /lintresults/results.txt) - store_artifacts: path: /lintresults @@ -204,13 +202,13 @@ jobs: command: *defaults_Dependencies - checkout - restore_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} - run: name: Create dir for test results command: mkdir -p ./audit/results - run: name: Check for new npm vulnerabilities - command: cd src && npm run audit:check --silent -- --json > ../audit/results/auditResults.json + command: npm run audit:check --silent -- --json > ./audit/results/auditResults.json - store_artifacts: path: ./audit/results @@ -224,10 +222,10 @@ jobs: - run: <<: *defaults_license_scanner - restore_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} - run: name: Prune non-production packages before running license-scanner - command: cd src && npm prune --production + command: npm prune --production - run: name: Run the license-scanner command: cd /tmp/license-scanner && pathToRepo=$CIRCLE_WORKING_DIRECTORY make run @@ -326,7 +324,7 @@ jobs: command: *defaults_Dependencies - checkout - restore_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} - run: name: Configure git command: | @@ -341,7 +339,7 @@ jobs: ssh-keyscan github.com >> ~/.ssh/known_hosts - run: name: Generate changelog and bump package version - command: cd src && npm run release + command: npm run release - run: name: Push the release command: git push --follow-tags origin ${CIRCLE_BRANCH} @@ -365,9 +363,9 @@ jobs: # Note: this is rather imperfect, but will do for now name: Format the changelog into the github release body and get release tag command: | - git diff --no-indent-heuristic master~1 HEAD src/CHANGELOG.md | sed -n '/^+[^+]/ s/^+//p' > /tmp/changes + git diff --no-indent-heuristic master~1 HEAD CHANGELOG.md | sed -n '/^+[^+]/ s/^+//p' > /tmp/changes echo 'export RELEASE_CHANGES=`cat /tmp/changes`' >> $BASH_ENV - echo 'export RELEASE_TAG=`cat src/package-lock.json | jq -r .version`' >> $BASH_ENV + echo 'export RELEASE_TAG=`cat package-lock.json | jq -r .version`' >> $BASH_ENV - run: name: check the release changes command: | @@ -377,7 +375,7 @@ jobs: tag: v${RELEASE_TAG} title: v${RELEASE_TAG} Release description: ${RELEASE_CHANGES} - file-path: src/CHANGELOG.md + file-path: CHANGELOG.md - slack/status: webhook: "$SLACK_WEBHOOK_ANNOUNCEMENT" success_message: '*"${CIRCLE_PROJECT_REPONAME}"* - Release \`"v${RELEASE_TAG}"\` \nhttps://github.com/mojaloop/"${CIRCLE_PROJECT_REPONAME}"/releases/tag/"v${RELEASE_TAG}"' @@ -415,7 +413,7 @@ jobs: name: Install general dependencies command: *defaults_Dependencies - restore_cache: - key: dependency-cache-v3-{{ checksum "src/package-lock.json" }} + key: dependency-cache-v3-{{ checksum "package-lock.json" }} - run: name: setup environment vars for LATEST release command: | diff --git a/src/.env.example b/.env.example similarity index 100% rename from src/.env.example rename to .env.example diff --git a/src/.eslintignore b/.eslintignore similarity index 100% rename from src/.eslintignore rename to .eslintignore diff --git a/src/.eslintrc.json b/.eslintrc.json similarity index 100% rename from src/.eslintrc.json rename to .eslintrc.json diff --git a/src/.nvmrc b/.nvmrc similarity index 100% rename from src/.nvmrc rename to .nvmrc diff --git a/src/.versionrc b/.versionrc similarity index 100% rename from src/.versionrc rename to .versionrc diff --git a/src/CHANGELOG.md b/CHANGELOG.md similarity index 100% rename from src/CHANGELOG.md rename to CHANGELOG.md diff --git a/Dockerfile b/Dockerfile index e07f261f2..7a67ccfeb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ WORKDIR /src # This is super-ugly, but it means we don't have to re-run npm install every time any of the source # files change- only when any dependencies change- which is a superior developer experience when # relying on docker-compose. -COPY ./src/package.json . -COPY ./src/package-lock.json . +COPY ./package.json . +COPY ./package-lock.json . RUN npm ci --only=production FROM node:16-alpine diff --git a/src/audit-resolve.json b/audit-resolve.json similarity index 100% rename from src/audit-resolve.json rename to audit-resolve.json diff --git a/src/babel.config.js b/babel.config.js similarity index 100% rename from src/babel.config.js rename to babel.config.js diff --git a/docker-compose.yml b/docker-compose.yml index b00f83b98..33b4bcae9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - mojaloop-net build: context: . - env_file: ./src/test/config/integration.env + env_file: ./test/config/integration.env ports: - "4000:4000" - "4001:4001" @@ -64,4 +64,4 @@ services: # - AUTH_ENABLED=FALSE # command: # - sh - # - /usr/share/nginx/start.sh \ No newline at end of file + # - /usr/share/nginx/start.sh diff --git a/src/jest.config.js b/jest.config.js similarity index 74% rename from src/jest.config.js rename to jest.config.js index a4aca9158..151a92e83 100644 --- a/src/jest.config.js +++ b/jest.config.js @@ -11,5 +11,8 @@ module.exports = { lines: 90 } }, - clearMocks: true + clearMocks: true, + moduleNameMapper: { + "^~/(.*)$": "/src/$1" + } }; diff --git a/junit.xml b/junit.xml new file mode 100644 index 000000000..84613cf42 --- /dev/null +++ b/junit.xml @@ -0,0 +1,515 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/package-lock.json b/package-lock.json similarity index 99% rename from src/package-lock.json rename to package-lock.json index 12e7bc2dc..0493a4759 100644 --- a/src/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "json-schema-ref-parser": "^9.0.9", "koa": "^2.13.1", "koa-body": "^4.2.0", + "module-alias": "^2.2.2", "oauth2-server": "^4.0.0-dev.2", "openapi-jsonschema-parameters": "^9.3.0", "promise-timeout": "^1.3.0", @@ -15297,6 +15298,11 @@ "node": ">=0.10.0" } }, + "node_modules/module-alias": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.2.tgz", + "integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==" + }, "node_modules/moment": { "version": "2.29.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", @@ -33011,6 +33017,11 @@ "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", "dev": true }, + "module-alias": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.2.tgz", + "integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==" + }, "moment": { "version": "2.29.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", diff --git a/src/package.json b/package.json similarity index 83% rename from src/package.json rename to package.json index 76a0dda62..e9e1c4e36 100644 --- a/src/package.json +++ b/package.json @@ -12,16 +12,16 @@ "audit:check": "SHELL=sh check-audit --production", "build": "npm run build:openapi; npm run build:dto:outbound", "build:openapi": "npm run build:openapi:inbound && npm run build:openapi:outbound", - "build:openapi:inbound": "openapi bundle --output ./InboundServer/api.yaml --ext yaml ./InboundServer/api_template.yaml", - "build:openapi:outbound": "openapi bundle --output ./OutboundServer/api.yaml --ext yaml ./OutboundServer/api_template/openapi.yaml", - "build:dto:outbound": "openapi-typescript ./OutboundServer/api.yaml --output ./OutboundServer/api_interfaces/openapi.d.ts", - "lint": "eslint .", - "lint:fix": "eslint . --fix", + "build:openapi:inbound": "openapi bundle --output ./src/InboundServer/api.yaml --ext yaml ./src/InboundServer/api_template.yaml", + "build:openapi:outbound": "openapi bundle --output ./src/OutboundServer/api.yaml --ext yaml ./src/OutboundServer/api_template/openapi.yaml", + "build:dto:outbound": "openapi-typescript ./src/OutboundServer/api.yaml --output ./src/OutboundServer/api_interfaces/openapi.d.ts", + "lint": "eslint ./src/", + "lint:fix": "eslint ./src/ --fix", "test": "jest --ci --reporters=default --reporters=jest-junit --env=node test/unit/", "test:int": "jest --ci --reporters=default --reporters=jest-junit --env=node test/integration", "validate:api": "npm run validate:api:in; npm run validate:api:out", - "validate:api:in": "swagger-cli validate ./InboundServer/api.yaml", - "validate:api:out": "swagger-cli validate ./OutboundServer/api.yaml", + "validate:api:in": "swagger-cli validate ./src/InboundServer/api.yaml", + "validate:api:out": "swagger-cli validate ./src/OutboundServer/api.yaml", "updates:check": "npm run dep:check", "updates:update": "npm run dep:update && npm install", "dep:check": "npx ncu -e 2", @@ -70,6 +70,7 @@ "json-schema-ref-parser": "^9.0.9", "koa": "^2.13.1", "koa-body": "^4.2.0", + "module-alias": "^2.2.2", "oauth2-server": "^4.0.0-dev.2", "openapi-jsonschema-parameters": "^9.3.0", "promise-timeout": "^1.3.0", diff --git a/src/InboundServer/api_template.yaml b/src/InboundServer/api_template.yaml index a9888c79b..cca6ead93 100644 --- a/src/InboundServer/api_template.yaml +++ b/src/InboundServer/api_template.yaml @@ -10,60 +10,60 @@ info: name: Open API for FSP Interoperability (FSPIOP) paths: '/participants/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_ID_error.yaml' '/participants/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_ID.yaml' '/participants/{Type}/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_error.yaml' '/participants/{Type}/{ID}/{SubId}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_SubId_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_SubId_error.yaml' '/participants/{Type}/{ID}/{SubId}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_SubId.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_SubId.yaml' '/participants/{Type}/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID.yaml' '/participants': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants.yaml' '/parties/{Type}/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID.yaml' '/parties/{Type}/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_error.yaml' '/parties/{Type}/{ID}/{SubId}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_SubId.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_SubId.yaml' '/parties/{Type}/{ID}/{SubId}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_SubId_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_SubId_error.yaml' '/transactionRequests/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests_ID_error.yaml' '/transactionRequests/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests_ID.yaml' '/transactionRequests': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests.yaml' '/quotes/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes_ID_error.yaml' '/quotes/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes_ID.yaml' '/quotes': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes.yaml' '/authorizations/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/authorizations_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/authorizations_ID.yaml' '/authorizations/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/authorizations_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/authorizations_ID_error.yaml' '/transfers/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers_ID_error.yaml' '/transfers/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers_ID.yaml' '/transfers': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers.yaml' '/transactions/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactions_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactions_ID.yaml' '/transactions/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactions_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactions_ID_error.yaml' '/bulkQuotes/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkQuotes_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkQuotes_ID_error.yaml' '/bulkQuotes/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkQuotes_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkQuotes_ID.yaml' '/bulkTransfers/{ID}': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers_ID.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers_ID.yaml' '/bulkTransfers': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers.yaml' '/bulkTransfers/{ID}/error': - $ref: '../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers_ID_error.yaml' + $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers_ID_error.yaml' diff --git a/src/OutboundServer/api_template/components/parameters/bulkQuoteId.yaml b/src/OutboundServer/api_template/components/parameters/bulkQuoteId.yaml index 0ec601bd1..e8d986b9e 100644 --- a/src/OutboundServer/api_template/components/parameters/bulkQuoteId.yaml +++ b/src/OutboundServer/api_template/components/parameters/bulkQuoteId.yaml @@ -3,7 +3,7 @@ in: path required: true schema: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml description: >- Identifier of the bulk transfer to continue as returned in the response to a `POST /bulkTransfers` request. diff --git a/src/OutboundServer/api_template/components/parameters/bulkTransferId.yaml b/src/OutboundServer/api_template/components/parameters/bulkTransferId.yaml index 3be974150..8ad85cebb 100644 --- a/src/OutboundServer/api_template/components/parameters/bulkTransferId.yaml +++ b/src/OutboundServer/api_template/components/parameters/bulkTransferId.yaml @@ -3,7 +3,7 @@ in: path required: true schema: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml description: >- Identifier of the bulk transfer to continue as returned in the response to a `POST /bulkTransfers` request. diff --git a/src/OutboundServer/api_template/components/parameters/requestToPayTransactionId.yaml b/src/OutboundServer/api_template/components/parameters/requestToPayTransactionId.yaml index 7c074d91a..9ddea9732 100644 --- a/src/OutboundServer/api_template/components/parameters/requestToPayTransactionId.yaml +++ b/src/OutboundServer/api_template/components/parameters/requestToPayTransactionId.yaml @@ -3,7 +3,7 @@ in: path required: true schema: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml description: >- Identifier of the merchant request to pay transfer to continue as returned in the response to a `POST /requestToPayTransfer` request. diff --git a/src/OutboundServer/api_template/components/parameters/transferId.yaml b/src/OutboundServer/api_template/components/parameters/transferId.yaml index 8eb8d9ef7..b741f6341 100644 --- a/src/OutboundServer/api_template/components/parameters/transferId.yaml +++ b/src/OutboundServer/api_template/components/parameters/transferId.yaml @@ -3,7 +3,7 @@ in: path required: true schema: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml description: >- Identifier of the transfer to continue as returned in the response to a `POST /transfers` request. diff --git a/src/OutboundServer/api_template/components/responses/partiesByIdError404.yaml b/src/OutboundServer/api_template/components/responses/partiesByIdError404.yaml index 03726ba52..d80e1a195 100644 --- a/src/OutboundServer/api_template/components/responses/partiesByIdError404.yaml +++ b/src/OutboundServer/api_template/components/responses/partiesByIdError404.yaml @@ -6,4 +6,4 @@ content: properties: errorInformation: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ErrorInformation.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ErrorInformation.yaml diff --git a/src/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml b/src/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml index d5d2992ae..0ea0952b6 100644 --- a/src/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml +++ b/src/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml @@ -7,12 +7,12 @@ items: properties: idType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml idValue: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml idSubValue: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml error: $ref: ./errorResponse.yaml diff --git a/src/OutboundServer/api_template/components/schemas/accountsRequest.yaml b/src/OutboundServer/api_template/components/schemas/accountsRequest.yaml index 50adaee7d..c485e5f61 100644 --- a/src/OutboundServer/api_template/components/schemas/accountsRequest.yaml +++ b/src/OutboundServer/api_template/components/schemas/accountsRequest.yaml @@ -8,13 +8,13 @@ items: properties: idType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml idValue: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml idSubValue: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml diff --git a/src/OutboundServer/api_template/components/schemas/accountsResponse.yaml b/src/OutboundServer/api_template/components/schemas/accountsResponse.yaml index 848430f75..cb641af0e 100644 --- a/src/OutboundServer/api_template/components/schemas/accountsResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/accountsResponse.yaml @@ -4,7 +4,7 @@ required: properties: modelId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml accounts: $ref: ./accountsRequest.yaml response: diff --git a/src/OutboundServer/api_template/components/schemas/bulkQuoteRequest.yaml b/src/OutboundServer/api_template/components/schemas/bulkQuoteRequest.yaml index d210cabe6..7a2b60648 100644 --- a/src/OutboundServer/api_template/components/schemas/bulkQuoteRequest.yaml +++ b/src/OutboundServer/api_template/components/schemas/bulkQuoteRequest.yaml @@ -11,7 +11,7 @@ properties: between the Switch and DFSP backend systems. bulkQuoteId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml from: $ref: ./transferParty.yaml individualQuotes: @@ -23,4 +23,4 @@ properties: $ref: ./individualQuote.yaml extensions: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml diff --git a/src/OutboundServer/api_template/components/schemas/bulkQuoteResponse.yaml b/src/OutboundServer/api_template/components/schemas/bulkQuoteResponse.yaml index c8c48a1c4..1a86ad2ed 100644 --- a/src/OutboundServer/api_template/components/schemas/bulkQuoteResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/bulkQuoteResponse.yaml @@ -5,7 +5,7 @@ required: properties: quoteId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml homeTransactionId: type: string description: >- diff --git a/src/OutboundServer/api_template/components/schemas/bulkQuoteStatusResponse.yaml b/src/OutboundServer/api_template/components/schemas/bulkQuoteStatusResponse.yaml index b3f5997aa..5180c02dc 100644 --- a/src/OutboundServer/api_template/components/schemas/bulkQuoteStatusResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/bulkQuoteStatusResponse.yaml @@ -6,7 +6,7 @@ required: properties: bulkQuoteId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml currentState: $ref: ./bulkQuoteStatus.yaml individualQuotes: diff --git a/src/OutboundServer/api_template/components/schemas/bulkTransferRequest.yaml b/src/OutboundServer/api_template/components/schemas/bulkTransferRequest.yaml index 50a418f16..1d53b5b2d 100644 --- a/src/OutboundServer/api_template/components/schemas/bulkTransferRequest.yaml +++ b/src/OutboundServer/api_template/components/schemas/bulkTransferRequest.yaml @@ -11,7 +11,7 @@ properties: between the Switch and DFSP backend systems. bulkTransferId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml from: $ref: ./transferParty.yaml individualTransfers: @@ -23,4 +23,4 @@ properties: $ref: ./individualTransfer.yaml extensions: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml diff --git a/src/OutboundServer/api_template/components/schemas/bulkTransferResponse.yaml b/src/OutboundServer/api_template/components/schemas/bulkTransferResponse.yaml index 78962f055..c0a9bbaad 100644 --- a/src/OutboundServer/api_template/components/schemas/bulkTransferResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/bulkTransferResponse.yaml @@ -5,7 +5,7 @@ required: properties: transferId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml from: $ref: ./transferParty.yaml individualTransferResults: diff --git a/src/OutboundServer/api_template/components/schemas/bulkTransferStatusResponse.yaml b/src/OutboundServer/api_template/components/schemas/bulkTransferStatusResponse.yaml index 5289196ee..720bfcca9 100644 --- a/src/OutboundServer/api_template/components/schemas/bulkTransferStatusResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/bulkTransferStatusResponse.yaml @@ -6,7 +6,7 @@ required: properties: bulkTransferId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml currentState: $ref: ./bulkTransferStatus.yaml fulfils: diff --git a/src/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml b/src/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml index 3e6616bcf..e4c6c0564 100644 --- a/src/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml +++ b/src/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml @@ -1,6 +1,6 @@ type: array items: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Extension.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Extension.yaml minItems: 0 maxItems: 16 diff --git a/src/OutboundServer/api_template/components/schemas/individualQuote.yaml b/src/OutboundServer/api_template/components/schemas/individualQuote.yaml index f5e5485a3..a08643725 100644 --- a/src/OutboundServer/api_template/components/schemas/individualQuote.yaml +++ b/src/OutboundServer/api_template/components/schemas/individualQuote.yaml @@ -4,26 +4,26 @@ description: Data model for the complex type 'individualQuote'. properties: quoteId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml to: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml transactionType: $ref: ./transactionType.yaml note: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml extensions: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml required: - quoteId - to diff --git a/src/OutboundServer/api_template/components/schemas/individualQuoteResult.yaml b/src/OutboundServer/api_template/components/schemas/individualQuoteResult.yaml index 9f7a1ae9a..2cc39a7d9 100644 --- a/src/OutboundServer/api_template/components/schemas/individualQuoteResult.yaml +++ b/src/OutboundServer/api_template/components/schemas/individualQuoteResult.yaml @@ -2,23 +2,23 @@ type: object properties: quoteId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml to: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml transactionType: $ref: ./transactionType.yaml note: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml lastError: description: > Object representing the last error to occur during a quote process. This diff --git a/src/OutboundServer/api_template/components/schemas/individualTransfer.yaml b/src/OutboundServer/api_template/components/schemas/individualTransfer.yaml index fccd47020..7e40c57fe 100644 --- a/src/OutboundServer/api_template/components/schemas/individualTransfer.yaml +++ b/src/OutboundServer/api_template/components/schemas/individualTransfer.yaml @@ -4,26 +4,26 @@ description: Data model for the complex type 'individualTransfer'. properties: transferId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml to: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml transactionType: $ref: ./transactionType.yaml note: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml extensions: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml required: - transferId - to diff --git a/src/OutboundServer/api_template/components/schemas/individualTransferFulfilment.yaml b/src/OutboundServer/api_template/components/schemas/individualTransferFulfilment.yaml index 7b6766944..1ebf8a9b1 100644 --- a/src/OutboundServer/api_template/components/schemas/individualTransferFulfilment.yaml +++ b/src/OutboundServer/api_template/components/schemas/individualTransferFulfilment.yaml @@ -3,11 +3,11 @@ description: A Mojaloop API transfer fulfilment for individual transfers in a bu properties: fulfilment: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/IlpFulfilment.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/IlpFulfilment.yaml description: > Fulfilment of the condition specified with the transaction. Mandatory if transfer has completed successfully. extensionList: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml description: 'Optional extension, specific to deployment.' diff --git a/src/OutboundServer/api_template/components/schemas/individualTransferResult.yaml b/src/OutboundServer/api_template/components/schemas/individualTransferResult.yaml index db03cd567..263716174 100644 --- a/src/OutboundServer/api_template/components/schemas/individualTransferResult.yaml +++ b/src/OutboundServer/api_template/components/schemas/individualTransferResult.yaml @@ -2,26 +2,26 @@ type: object properties: transferId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml to: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml transactionType: $ref: ./transactionType.yaml note: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml quoteId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml quoteResponse: $ref: ./quote.yaml quoteResponseSource: diff --git a/src/OutboundServer/api_template/components/schemas/mojaloopError.yaml b/src/OutboundServer/api_template/components/schemas/mojaloopError.yaml index 83f470fa8..c6a6e8b24 100644 --- a/src/OutboundServer/api_template/components/schemas/mojaloopError.yaml +++ b/src/OutboundServer/api_template/components/schemas/mojaloopError.yaml @@ -2,4 +2,4 @@ type: object properties: errorInformation: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ErrorInformation.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ErrorInformation.yaml diff --git a/src/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml b/src/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml index 79b54a8bd..43e9ea59f 100644 --- a/src/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml +++ b/src/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml @@ -1,2 +1,2 @@ $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionRequestState.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionRequestState.yaml diff --git a/src/OutboundServer/api_template/components/schemas/partiesByIdResponse.yaml b/src/OutboundServer/api_template/components/schemas/partiesByIdResponse.yaml index b2667fad6..b9fa25b03 100644 --- a/src/OutboundServer/api_template/components/schemas/partiesByIdResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/partiesByIdResponse.yaml @@ -4,7 +4,7 @@ properties: party: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/Party.yaml + ../../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/Party.yaml description: Information regarding the requested Party. currentState: $ref: ../schemas/async2SyncCurrentState.yaml diff --git a/src/OutboundServer/api_template/components/schemas/quote.yaml b/src/OutboundServer/api_template/components/schemas/quote.yaml index 43b41e011..de261db5b 100644 --- a/src/OutboundServer/api_template/components/schemas/quote.yaml +++ b/src/OutboundServer/api_template/components/schemas/quote.yaml @@ -1,3 +1,3 @@ description: Mojaloop API response to a quote request $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/QuotesIDPutResponse.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/QuotesIDPutResponse.yaml diff --git a/src/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml b/src/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml index 55d009165..a5a2d40c4 100644 --- a/src/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml +++ b/src/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml @@ -4,10 +4,10 @@ properties: fspId: title: destination DFSP requested to calculate the quote $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml quotesPostRequest: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/QuotesPostRequest.yaml + ../../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/QuotesPostRequest.yaml required: - fspId - quotesPostRequest diff --git a/src/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml b/src/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml index b9ff29b0e..af7811457 100644 --- a/src/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml @@ -8,16 +8,16 @@ properties: properties: transferAmount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml payeeReceiveAmount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml payeeFspFee: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml payeeFspCommission: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml expiration: type: string description: >- @@ -26,16 +26,16 @@ properties: example: '2016-05-24T08:38:08.699-04:00' geoCode: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/GeoCode.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/GeoCode.yaml ilpPacket: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/IlpPacket.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/IlpPacket.yaml condition: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/IlpCondition.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/IlpCondition.yaml extensionList: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml required: - transferAmount - expiration @@ -43,6 +43,6 @@ properties: - condition currentState: $ref: ../schemas/async2SyncCurrentState.yaml -required: +required: - quotes - - currentState \ No newline at end of file + - currentState diff --git a/src/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml b/src/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml index 65de53e9d..b2e305b7c 100644 --- a/src/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml +++ b/src/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml @@ -21,19 +21,19 @@ properties: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml scenario: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml initiator: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml initiatorType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml diff --git a/src/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml b/src/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml index 4121f2ebf..dcef53c19 100644 --- a/src/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml @@ -11,31 +11,31 @@ required: properties: transactionRequestId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml from: $ref: ./transferParty.yaml to: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml scenario: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml initiator: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml initiatorType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml authenticationType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AuthenticationType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AuthenticationType.yaml requestToPayState: $ref: ./mojaloopTransactionRequestState.yaml diff --git a/src/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml b/src/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml index 1ca1638d7..a04ba300b 100644 --- a/src/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml +++ b/src/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml @@ -21,22 +21,22 @@ properties: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml scenario: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml initiator: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml initiatorType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml note: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml diff --git a/src/OutboundServer/api_template/components/schemas/requestToPayTransferResponse.yaml b/src/OutboundServer/api_template/components/schemas/requestToPayTransferResponse.yaml index 34ad58314..6c20eea8a 100644 --- a/src/OutboundServer/api_template/components/schemas/requestToPayTransferResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/requestToPayTransferResponse.yaml @@ -10,7 +10,7 @@ required: properties: transferId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml requestToPayTransactionId: type: string description: >- @@ -22,23 +22,23 @@ properties: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml transactionType: $ref: ./transactionType.yaml note: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml currentState: $ref: ./transferStatus.yaml quoteId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml quoteResponse: $ref: ./quote.yaml quoteResponseSource: diff --git a/src/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml b/src/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml index 221c4a905..5f6ac5db3 100644 --- a/src/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml +++ b/src/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml @@ -3,10 +3,10 @@ type: object properties: fspId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml transfersPostRequest: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransfersPostRequest.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransfersPostRequest.yaml required: - fspId - transfersPostRequest diff --git a/src/OutboundServer/api_template/components/schemas/simpleTransfersPostResponse.yaml b/src/OutboundServer/api_template/components/schemas/simpleTransfersPostResponse.yaml index c0b1307f1..43a373046 100644 --- a/src/OutboundServer/api_template/components/schemas/simpleTransfersPostResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/simpleTransfersPostResponse.yaml @@ -3,7 +3,7 @@ type: object properties: transfer: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransfersIDPutResponse.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransfersIDPutResponse.yaml currentState: $ref: ../schemas/async2SyncCurrentState.yaml required: diff --git a/src/OutboundServer/api_template/components/schemas/transferFulfilment.yaml b/src/OutboundServer/api_template/components/schemas/transferFulfilment.yaml index 5d3c6ec78..b430d3625 100644 --- a/src/OutboundServer/api_template/components/schemas/transferFulfilment.yaml +++ b/src/OutboundServer/api_template/components/schemas/transferFulfilment.yaml @@ -1,3 +1,3 @@ description: A Mojaloop API transfer fulfilment $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransfersIDPutResponse.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransfersIDPutResponse.yaml diff --git a/src/OutboundServer/api_template/components/schemas/transferParty.yaml b/src/OutboundServer/api_template/components/schemas/transferParty.yaml index dd93583eb..75087bb3e 100644 --- a/src/OutboundServer/api_template/components/schemas/transferParty.yaml +++ b/src/OutboundServer/api_template/components/schemas/transferParty.yaml @@ -5,36 +5,36 @@ required: properties: type: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml idType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml idValue: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml idSubValue: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml displayName: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Name.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Name.yaml firstName: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FirstName.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FirstName.yaml middleName: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/MiddleName.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/MiddleName.yaml lastName: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/LastName.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/LastName.yaml dateOfBirth: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/DateOfBirth.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/DateOfBirth.yaml merchantClassificationCode: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/MerchantClassificationCode.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/MerchantClassificationCode.yaml fspId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml extensionList: $ref: ./extensionListEmptiable.yaml diff --git a/src/OutboundServer/api_template/components/schemas/transferRequest.yaml b/src/OutboundServer/api_template/components/schemas/transferRequest.yaml index 7245e8042..23c59321b 100644 --- a/src/OutboundServer/api_template/components/schemas/transferRequest.yaml +++ b/src/OutboundServer/api_template/components/schemas/transferRequest.yaml @@ -19,18 +19,18 @@ properties: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml transactionType: $ref: ./transactionType.yaml note: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml quoteRequestExtensions: $ref: ./extensionListEmptiable.yaml transferRequestExtensions: diff --git a/src/OutboundServer/api_template/components/schemas/transferResponse.yaml b/src/OutboundServer/api_template/components/schemas/transferResponse.yaml index 10018cc7f..3e7f791eb 100644 --- a/src/OutboundServer/api_template/components/schemas/transferResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/transferResponse.yaml @@ -10,7 +10,7 @@ required: properties: transferId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml homeTransactionId: type: string description: >- @@ -22,23 +22,23 @@ properties: $ref: ./transferParty.yaml amountType: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml currency: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml amount: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml transactionType: $ref: ./transactionType.yaml note: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml currentState: $ref: ./transferStatus.yaml quoteId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml quoteResponse: $ref: ./quote.yaml quoteResponseSource: diff --git a/src/OutboundServer/api_template/components/schemas/transferStatusResponse.yaml b/src/OutboundServer/api_template/components/schemas/transferStatusResponse.yaml index cddd347b4..9ff1c539c 100644 --- a/src/OutboundServer/api_template/components/schemas/transferStatusResponse.yaml +++ b/src/OutboundServer/api_template/components/schemas/transferStatusResponse.yaml @@ -6,7 +6,7 @@ required: properties: transferId: $ref: >- - ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml + ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml currentState: $ref: ./transferStatus.yaml fulfil: diff --git a/src/OutboundServer/api_template/paths/parties_Type_ID.yaml b/src/OutboundServer/api_template/paths/parties_Type_ID.yaml index c2fa34638..94df54fd7 100644 --- a/src/OutboundServer/api_template/paths/parties_Type_ID.yaml +++ b/src/OutboundServer/api_template/paths/parties_Type_ID.yaml @@ -1,8 +1,8 @@ parameters: - $ref: >- - ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Type.yaml + ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Type.yaml - $ref: >- - ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/ID.yaml + ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/ID.yaml get: description: >- The HTTP request GET /parties// (or GET /parties///) is used to lookup diff --git a/src/OutboundServer/api_template/paths/parties_Type_ID_SubId.yaml b/src/OutboundServer/api_template/paths/parties_Type_ID_SubId.yaml index c57b4e6a8..4d62e9cae 100644 --- a/src/OutboundServer/api_template/paths/parties_Type_ID_SubId.yaml +++ b/src/OutboundServer/api_template/paths/parties_Type_ID_SubId.yaml @@ -1,10 +1,10 @@ parameters: - $ref: >- - ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Type.yaml + ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Type.yaml - $ref: >- - ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/ID.yaml + ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/ID.yaml - $ref: >- - ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/SubId.yaml + ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/SubId.yaml get: description: >- The HTTP request GET /parties// (or GET /parties///) is used to lookup diff --git a/src/test/__mocks__/@mojaloop/sdk-standard-components.js b/test/__mocks__/@mojaloop/sdk-standard-components.js similarity index 100% rename from src/test/__mocks__/@mojaloop/sdk-standard-components.js rename to test/__mocks__/@mojaloop/sdk-standard-components.js diff --git a/src/test/__mocks__/javascript-state-machine.js b/test/__mocks__/javascript-state-machine.js similarity index 100% rename from src/test/__mocks__/javascript-state-machine.js rename to test/__mocks__/javascript-state-machine.js diff --git a/src/test/__mocks__/redis.js b/test/__mocks__/redis.js similarity index 100% rename from src/test/__mocks__/redis.js rename to test/__mocks__/redis.js diff --git a/src/test/__mocks__/uuidv4.js b/test/__mocks__/uuidv4.js similarity index 100% rename from src/test/__mocks__/uuidv4.js rename to test/__mocks__/uuidv4.js diff --git a/src/test/config/integration.env b/test/config/integration.env similarity index 100% rename from src/test/config/integration.env rename to test/config/integration.env diff --git a/src/test/integration/lib/Outbound/data/quotesPostRequest.json b/test/integration/lib/Outbound/data/quotesPostRequest.json similarity index 100% rename from src/test/integration/lib/Outbound/data/quotesPostRequest.json rename to test/integration/lib/Outbound/data/quotesPostRequest.json diff --git a/src/test/integration/lib/Outbound/data/transfersPostRequest.json b/test/integration/lib/Outbound/data/transfersPostRequest.json similarity index 100% rename from src/test/integration/lib/Outbound/data/transfersPostRequest.json rename to test/integration/lib/Outbound/data/transfersPostRequest.json diff --git a/src/test/integration/lib/Outbound/parties.test.js b/test/integration/lib/Outbound/parties.test.js similarity index 100% rename from src/test/integration/lib/Outbound/parties.test.js rename to test/integration/lib/Outbound/parties.test.js diff --git a/src/test/integration/lib/Outbound/quotes.test.js b/test/integration/lib/Outbound/quotes.test.js similarity index 100% rename from src/test/integration/lib/Outbound/quotes.test.js rename to test/integration/lib/Outbound/quotes.test.js diff --git a/src/test/integration/lib/Outbound/simpleTransfers.test.js b/test/integration/lib/Outbound/simpleTransfers.test.js similarity index 100% rename from src/test/integration/lib/Outbound/simpleTransfers.test.js rename to test/integration/lib/Outbound/simpleTransfers.test.js diff --git a/src/test/integration/lib/cache.test.js b/test/integration/lib/cache.test.js similarity index 97% rename from src/test/integration/lib/cache.test.js rename to test/integration/lib/cache.test.js index 675f83433..29ca831b8 100644 --- a/src/test/integration/lib/cache.test.js +++ b/test/integration/lib/cache.test.js @@ -32,7 +32,7 @@ jest.dontMock('redis'); -const Cache = require('../../../lib/cache'); +const Cache = require('~/lib/cache'); const { Logger } = require('@mojaloop/sdk-standard-components'); const env = require('../testEnv'); @@ -58,14 +58,14 @@ const createCache = async (config) => { describe('Cache', () => { let cache; - beforeEach(async () => { + beforeEach(async () => { cache = await createCache(defaultCacheConfig); }); afterEach(async () => { await cache.disconnect(); }); - + test('Sets and retrieves an object in the cache', async () => { // Arrange const value = {test: true}; diff --git a/src/test/integration/testEnv.js b/test/integration/testEnv.js similarity index 100% rename from src/test/integration/testEnv.js rename to test/integration/testEnv.js diff --git a/src/test/unit/InboundServer.test.js b/test/unit/InboundServer.test.js similarity index 98% rename from src/test/unit/InboundServer.test.js rename to test/unit/InboundServer.test.js index 5cfb7d86b..8aa96d2c9 100644 --- a/src/test/unit/InboundServer.test.js +++ b/test/unit/InboundServer.test.js @@ -18,11 +18,11 @@ const postQuotesBody = require('./data/postQuotesBody'); const putParticipantsBody = require('./data/putParticipantsBody'); const commonHttpHeaders = require('./data/commonHttpHeaders'); -jest.mock('../../lib/cache'); +jest.mock('~/lib/cache'); jest.mock('@mojaloop/sdk-standard-components'); -jest.mock('../../lib/model/lib/requests', () => require('./lib/model/mockedLibRequests')); +jest.mock('~/lib/model/lib/requests', () => require('./lib/model/mockedLibRequests')); -const Cache = require('../../lib/cache'); +const Cache = require('~/lib/cache'); const { Jws, Logger } = require('@mojaloop/sdk-standard-components'); const path = require('path'); const fs = require('fs'); @@ -30,7 +30,7 @@ const os = require('os'); const http = require('http'); const https = require('https'); -const InboundServer = require('../../InboundServer'); +const InboundServer = require('~/InboundServer'); describe('Inbound Server', () => { describe('PUT /parties', () => { diff --git a/src/test/unit/TestServer.test.js b/test/unit/TestServer.test.js similarity index 98% rename from src/test/unit/TestServer.test.js rename to test/unit/TestServer.test.js index 306670136..80c6685e3 100644 --- a/src/test/unit/TestServer.test.js +++ b/test/unit/TestServer.test.js @@ -20,13 +20,13 @@ const commonHttpHeaders = require('./data/commonHttpHeaders'); const WebSocket = require('ws'); const { Logger } = require('@mojaloop/sdk-standard-components'); -jest.mock('../../lib/cache'); +jest.mock('~/lib/cache'); jest.mock('@mojaloop/sdk-standard-components'); -jest.mock('../../lib/model/lib/requests', () => require('./lib/model/mockedLibRequests')); +jest.mock('~/lib/model/lib/requests', () => require('./lib/model/mockedLibRequests')); -const Cache = require('../../lib/cache'); -const InboundServer = require('../../InboundServer'); -const TestServer = require('../../TestServer'); +const Cache = require('~/lib/cache'); +const InboundServer = require('~/InboundServer'); +const TestServer = require('~/TestServer'); const createWsClient = async (port, path) => { const result = new WebSocket(`ws://127.0.0.1:${port}${path}`); diff --git a/src/test/unit/api/accounts/accounts.test.js b/test/unit/api/accounts/accounts.test.js similarity index 100% rename from src/test/unit/api/accounts/accounts.test.js rename to test/unit/api/accounts/accounts.test.js diff --git a/src/test/unit/api/accounts/data/postAccountsBody.json b/test/unit/api/accounts/data/postAccountsBody.json similarity index 100% rename from src/test/unit/api/accounts/data/postAccountsBody.json rename to test/unit/api/accounts/data/postAccountsBody.json diff --git a/src/test/unit/api/accounts/data/postAccountsErrorMojaloopResponse.json b/test/unit/api/accounts/data/postAccountsErrorMojaloopResponse.json similarity index 100% rename from src/test/unit/api/accounts/data/postAccountsErrorMojaloopResponse.json rename to test/unit/api/accounts/data/postAccountsErrorMojaloopResponse.json diff --git a/src/test/unit/api/accounts/data/postAccountsErrorTimeoutResponse.json b/test/unit/api/accounts/data/postAccountsErrorTimeoutResponse.json similarity index 100% rename from src/test/unit/api/accounts/data/postAccountsErrorTimeoutResponse.json rename to test/unit/api/accounts/data/postAccountsErrorTimeoutResponse.json diff --git a/src/test/unit/api/accounts/data/postAccountsSuccessResponse.json b/test/unit/api/accounts/data/postAccountsSuccessResponse.json similarity index 100% rename from src/test/unit/api/accounts/data/postAccountsSuccessResponse.json rename to test/unit/api/accounts/data/postAccountsSuccessResponse.json diff --git a/src/test/unit/api/accounts/data/postAccountsSuccessResponseWithError1.json b/test/unit/api/accounts/data/postAccountsSuccessResponseWithError1.json similarity index 100% rename from src/test/unit/api/accounts/data/postAccountsSuccessResponseWithError1.json rename to test/unit/api/accounts/data/postAccountsSuccessResponseWithError1.json diff --git a/src/test/unit/api/accounts/data/postAccountsSuccessResponseWithError2.json b/test/unit/api/accounts/data/postAccountsSuccessResponseWithError2.json similarity index 100% rename from src/test/unit/api/accounts/data/postAccountsSuccessResponseWithError2.json rename to test/unit/api/accounts/data/postAccountsSuccessResponseWithError2.json diff --git a/src/test/unit/api/accounts/utils.js b/test/unit/api/accounts/utils.js similarity index 100% rename from src/test/unit/api/accounts/utils.js rename to test/unit/api/accounts/utils.js diff --git a/src/test/unit/api/proxy/data/proxyConfig.yaml b/test/unit/api/proxy/data/proxyConfig.yaml similarity index 100% rename from src/test/unit/api/proxy/data/proxyConfig.yaml rename to test/unit/api/proxy/data/proxyConfig.yaml diff --git a/src/test/unit/api/proxy/data/requestBody.json b/test/unit/api/proxy/data/requestBody.json similarity index 100% rename from src/test/unit/api/proxy/data/requestBody.json rename to test/unit/api/proxy/data/requestBody.json diff --git a/src/test/unit/api/proxy/data/requestHeaders.json b/test/unit/api/proxy/data/requestHeaders.json similarity index 100% rename from src/test/unit/api/proxy/data/requestHeaders.json rename to test/unit/api/proxy/data/requestHeaders.json diff --git a/src/test/unit/api/proxy/data/requestQuery.json b/test/unit/api/proxy/data/requestQuery.json similarity index 100% rename from src/test/unit/api/proxy/data/requestQuery.json rename to test/unit/api/proxy/data/requestQuery.json diff --git a/src/test/unit/api/proxy/data/responseBody.json b/test/unit/api/proxy/data/responseBody.json similarity index 100% rename from src/test/unit/api/proxy/data/responseBody.json rename to test/unit/api/proxy/data/responseBody.json diff --git a/src/test/unit/api/proxy/data/responseHeaders.json b/test/unit/api/proxy/data/responseHeaders.json similarity index 100% rename from src/test/unit/api/proxy/data/responseHeaders.json rename to test/unit/api/proxy/data/responseHeaders.json diff --git a/src/test/unit/api/proxy/proxy.test.js b/test/unit/api/proxy/proxy.test.js similarity index 100% rename from src/test/unit/api/proxy/proxy.test.js rename to test/unit/api/proxy/proxy.test.js diff --git a/src/test/unit/api/proxy/utils.js b/test/unit/api/proxy/utils.js similarity index 100% rename from src/test/unit/api/proxy/utils.js rename to test/unit/api/proxy/utils.js diff --git a/src/test/unit/api/transfers/data/getTransfersCommittedResponse.json b/test/unit/api/transfers/data/getTransfersCommittedResponse.json similarity index 100% rename from src/test/unit/api/transfers/data/getTransfersCommittedResponse.json rename to test/unit/api/transfers/data/getTransfersCommittedResponse.json diff --git a/src/test/unit/api/transfers/data/getTransfersErrorNotFound.json b/test/unit/api/transfers/data/getTransfersErrorNotFound.json similarity index 100% rename from src/test/unit/api/transfers/data/getTransfersErrorNotFound.json rename to test/unit/api/transfers/data/getTransfersErrorNotFound.json diff --git a/src/test/unit/api/transfers/data/postQuotesBody.json b/test/unit/api/transfers/data/postQuotesBody.json similarity index 100% rename from src/test/unit/api/transfers/data/postQuotesBody.json rename to test/unit/api/transfers/data/postQuotesBody.json diff --git a/src/test/unit/api/transfers/data/postTransfersBadBody.json b/test/unit/api/transfers/data/postTransfersBadBody.json similarity index 100% rename from src/test/unit/api/transfers/data/postTransfersBadBody.json rename to test/unit/api/transfers/data/postTransfersBadBody.json diff --git a/src/test/unit/api/transfers/data/postTransfersBody.json b/test/unit/api/transfers/data/postTransfersBody.json similarity index 100% rename from src/test/unit/api/transfers/data/postTransfersBody.json rename to test/unit/api/transfers/data/postTransfersBody.json diff --git a/src/test/unit/api/transfers/data/postTransfersErrorMojaloopResponse.json b/test/unit/api/transfers/data/postTransfersErrorMojaloopResponse.json similarity index 100% rename from src/test/unit/api/transfers/data/postTransfersErrorMojaloopResponse.json rename to test/unit/api/transfers/data/postTransfersErrorMojaloopResponse.json diff --git a/src/test/unit/api/transfers/data/postTransfersErrorTimeoutResponse.json b/test/unit/api/transfers/data/postTransfersErrorTimeoutResponse.json similarity index 100% rename from src/test/unit/api/transfers/data/postTransfersErrorTimeoutResponse.json rename to test/unit/api/transfers/data/postTransfersErrorTimeoutResponse.json diff --git a/src/test/unit/api/transfers/data/postTransfersSimpleBody.json b/test/unit/api/transfers/data/postTransfersSimpleBody.json similarity index 100% rename from src/test/unit/api/transfers/data/postTransfersSimpleBody.json rename to test/unit/api/transfers/data/postTransfersSimpleBody.json diff --git a/src/test/unit/api/transfers/data/postTransfersSuccessResponse.json b/test/unit/api/transfers/data/postTransfersSuccessResponse.json similarity index 100% rename from src/test/unit/api/transfers/data/postTransfersSuccessResponse.json rename to test/unit/api/transfers/data/postTransfersSuccessResponse.json diff --git a/src/test/unit/api/transfers/data/putPartiesBody.json b/test/unit/api/transfers/data/putPartiesBody.json similarity index 100% rename from src/test/unit/api/transfers/data/putPartiesBody.json rename to test/unit/api/transfers/data/putPartiesBody.json diff --git a/src/test/unit/api/transfers/data/putQuotesBody.json b/test/unit/api/transfers/data/putQuotesBody.json similarity index 100% rename from src/test/unit/api/transfers/data/putQuotesBody.json rename to test/unit/api/transfers/data/putQuotesBody.json diff --git a/src/test/unit/api/transfers/data/putTransfersBody.json b/test/unit/api/transfers/data/putTransfersBody.json similarity index 100% rename from src/test/unit/api/transfers/data/putTransfersBody.json rename to test/unit/api/transfers/data/putTransfersBody.json diff --git a/src/test/unit/api/transfers/transfers.test.js b/test/unit/api/transfers/transfers.test.js similarity index 100% rename from src/test/unit/api/transfers/transfers.test.js rename to test/unit/api/transfers/transfers.test.js diff --git a/src/test/unit/api/transfers/utils.js b/test/unit/api/transfers/utils.js similarity index 100% rename from src/test/unit/api/transfers/utils.js rename to test/unit/api/transfers/utils.js diff --git a/src/test/unit/api/utils.js b/test/unit/api/utils.js similarity index 88% rename from src/test/unit/api/utils.js rename to test/unit/api/utils.js index c9a20c5e3..ed27a2e53 100644 --- a/src/test/unit/api/utils.js +++ b/test/unit/api/utils.js @@ -2,12 +2,12 @@ const fs = require('fs'); const path = require('path'); const yaml = require('js-yaml'); const supertest = require('supertest'); -const Validate = require('../../../lib/validate'); +const Validate = require('~/lib/validate'); -const InboundServer = require('../../../InboundServer'); -const OutboundServer = require('../../../OutboundServer'); +const InboundServer = require('~/InboundServer'); +const OutboundServer = require('~/OutboundServer'); const { Logger } = require('@mojaloop/sdk-standard-components'); -const Cache = require('../../../lib/cache'); +const Cache = require('~/lib/cache'); /** * Get OpenAPI spec and Validator for specified server @@ -15,7 +15,7 @@ const Cache = require('../../../lib/cache'); * @return {Promise<{apiSpecs: Object, validator: Validator}>} */ const readApiInfo = async (serverType) => { - const specPath = path.join(__dirname, `../../../${serverType}/api.yaml`); + const specPath = path.join(__dirname, `../../../src/${serverType}/api.yaml`); const apiSpecs = yaml.load(fs.readFileSync(specPath)); const validator = new Validate(); await validator.initialise(apiSpecs); diff --git a/src/test/unit/config.test.js b/test/unit/config.test.js similarity index 89% rename from src/test/unit/config.test.js rename to test/unit/config.test.js index 758eb9799..68c7db4db 100644 --- a/src/test/unit/config.test.js +++ b/test/unit/config.test.js @@ -39,25 +39,25 @@ describe('config', () => { it('correctly parses OUTBOUND_ERROR_STATUSCODE_EXTENSION_KEY when set', () => { process.env.OUTBOUND_ERROR_STATUSCODE_EXTENSION_KEY = outErrorStatusKey; - const config = require('../../config'); + const config = require('~/config'); expect(config.outboundErrorStatusCodeExtensionKey).toEqual(outErrorStatusKey); }); it('correctly parses OUTBOUND_ERROR_STATUSCODE_EXTENSION_KEY when NOT set', () => { delete process.env.OUTBOUND_ERROR_STATUSCODE_EXTENSION_KEY; - const config = require('../../config'); + const config = require('~/config'); expect(config.outboundErrorStatusCodeExtensionKey).toBeUndefined(); }); it('correctly parses VALIDATE_INBOUND_PUT_PARTIES_JWS when NOT set', () => { delete process.env.VALIDATE_INBOUND_PUT_PARTIES_JWS; - const config = require('../../config'); + const config = require('~/config'); expect(config.validateInboundPutPartiesJws).toBeFalsy(); }); it('correctly parses VALIDATE_INBOUND_PUT_PARTIES_JWS when set', () => { process.env.VALIDATE_INBOUND_PUT_PARTIES_JWS = 'true'; - const config = require('../../config'); + const config = require('~/config'); expect(config.validateInboundPutPartiesJws).toBeTruthy(); }); @@ -66,7 +66,7 @@ describe('config', () => { const certContent = 'cert-data'; fs.writeFileSync(cert, certContent); process.env.IN_SERVER_CERT_PATH = cert; - const config = require('../../config'); + const config = require('~/config'); const content = config.mutualTLS.inboundRequests.creds.cert.toString(); expect(content).toBe(certContent); }); @@ -82,14 +82,14 @@ describe('config', () => { ]; certs.forEach((cert, index) => fs.writeFileSync(cert, certContent[index])); process.env.IN_CA_CERT_PATH = certs.join(','); - const config = require('../../config'); + const config = require('~/config'); const content = config.mutualTLS.inboundRequests.creds.ca.map(ca => ca.toString()); expect(content).toStrictEqual(certContent); }); it('should parse proxy config yaml file as json object', () => { process.env.PROXY_CONFIG_PATH = path.join(__dirname, './data/testFile.yaml'); - const config = require('../../config'); + const config = require('~/config'); const proxyConfig = require('./data/testFile'); expect(config.proxyConfig).toEqual(proxyConfig); }); @@ -107,12 +107,12 @@ describe('config', () => { }, }; - const parseResourceVersion = require('../../config').__parseResourceVersion; + const parseResourceVersion = require('~/config').__parseResourceVersion; expect(parseResourceVersion('resourceOneName=1.0,resourceTwoName=1.1')).toEqual(resourceVersions); }); it('should throw an err if the resource string is not correctly formed', () => { - const parseResourceVersion = require('../../config').__parseResourceVersion; + const parseResourceVersion = require('~/config').__parseResourceVersion; expect(() => parseResourceVersion('resourceOneName=1.0;resourceTwoName=1.1')).toThrowError(new Error('Resource versions format should be in format: "resouceOneName=1.0,resourceTwoName=1.1"')); }); diff --git a/src/test/unit/data/commonHttpHeaders.json b/test/unit/data/commonHttpHeaders.json similarity index 100% rename from src/test/unit/data/commonHttpHeaders.json rename to test/unit/data/commonHttpHeaders.json diff --git a/src/test/unit/data/defaultConfig.json b/test/unit/data/defaultConfig.json similarity index 100% rename from src/test/unit/data/defaultConfig.json rename to test/unit/data/defaultConfig.json diff --git a/src/test/unit/data/postQuotesBody.json b/test/unit/data/postQuotesBody.json similarity index 100% rename from src/test/unit/data/postQuotesBody.json rename to test/unit/data/postQuotesBody.json diff --git a/src/test/unit/data/putParticipantsBody.json b/test/unit/data/putParticipantsBody.json similarity index 100% rename from src/test/unit/data/putParticipantsBody.json rename to test/unit/data/putParticipantsBody.json diff --git a/src/test/unit/data/putPartiesBody.json b/test/unit/data/putPartiesBody.json similarity index 100% rename from src/test/unit/data/putPartiesBody.json rename to test/unit/data/putPartiesBody.json diff --git a/src/test/unit/data/testFile.json b/test/unit/data/testFile.json similarity index 100% rename from src/test/unit/data/testFile.json rename to test/unit/data/testFile.json diff --git a/src/test/unit/data/testFile.yaml b/test/unit/data/testFile.yaml similarity index 100% rename from src/test/unit/data/testFile.yaml rename to test/unit/data/testFile.yaml diff --git a/src/test/unit/inboundApi/data/mockArguments.json b/test/unit/inboundApi/data/mockArguments.json similarity index 100% rename from src/test/unit/inboundApi/data/mockArguments.json rename to test/unit/inboundApi/data/mockArguments.json diff --git a/src/test/unit/inboundApi/data/mockTransactionRequest.json b/test/unit/inboundApi/data/mockTransactionRequest.json similarity index 100% rename from src/test/unit/inboundApi/data/mockTransactionRequest.json rename to test/unit/inboundApi/data/mockTransactionRequest.json diff --git a/src/test/unit/inboundApi/handlers.test.js b/test/unit/inboundApi/handlers.test.js similarity index 98% rename from src/test/unit/inboundApi/handlers.test.js rename to test/unit/inboundApi/handlers.test.js index 5dd569e63..226f50900 100644 --- a/src/test/unit/inboundApi/handlers.test.js +++ b/test/unit/inboundApi/handlers.test.js @@ -10,13 +10,13 @@ 'use strict'; -jest.mock('../../../lib/model'); +jest.mock('~/lib/model'); -const handlers = require('../../../InboundServer/handlers'); -const Model = require('../../../lib/model').InboundTransfersModel; -const QuotesModel = require('../../../lib/model').QuotesModel; -const PartiesModel = require('../../../lib/model').PartiesModel; -const TransfersModel = require('../../../lib/model').TransfersModel; +const handlers = require('~/InboundServer/handlers'); +const Model = require('~/lib/model').InboundTransfersModel; +const QuotesModel = require('~/lib/model').QuotesModel; +const PartiesModel = require('~/lib/model').PartiesModel; +const TransfersModel = require('~/lib/model').TransfersModel; const mockArguments = require('./data/mockArguments'); const mockTransactionRequestData = require('./data/mockTransactionRequest'); diff --git a/src/test/unit/index.test.js b/test/unit/index.test.js similarity index 98% rename from src/test/unit/index.test.js rename to test/unit/index.test.js index bcc435094..c8569e48f 100644 --- a/src/test/unit/index.test.js +++ b/test/unit/index.test.js @@ -22,7 +22,7 @@ process.env.BACKEND_ENDPOINT = '172.17.0.5:4000'; process.env.CACHE_HOST = '172.17.0.2'; process.env.CACHE_PORT = '6379'; -const index = require('../../index.js'); +const index = require('~/index.js'); describe('index.js', () => { test('WSO2 error events in OutboundServer propagate to top-level server', () => { diff --git a/src/test/unit/lib/cache.test.js b/test/unit/lib/cache.test.js similarity index 99% rename from src/test/unit/lib/cache.test.js rename to test/unit/lib/cache.test.js index 75adaf81c..62c1a95b6 100644 --- a/src/test/unit/lib/cache.test.js +++ b/test/unit/lib/cache.test.js @@ -12,7 +12,7 @@ jest.mock('redis'); -const Cache = require('../../../lib/cache'); +const Cache = require('~/lib/cache'); const { Logger } = require('@mojaloop/sdk-standard-components'); const createCache = async() => { diff --git a/src/test/unit/lib/model/AccountsModel.test.js b/test/unit/lib/model/AccountsModel.test.js similarity index 97% rename from src/test/unit/lib/model/AccountsModel.test.js rename to test/unit/lib/model/AccountsModel.test.js index 02efe8858..a464ddba1 100644 --- a/src/test/unit/lib/model/AccountsModel.test.js +++ b/test/unit/lib/model/AccountsModel.test.js @@ -14,8 +14,8 @@ jest.mock('@mojaloop/sdk-standard-components'); jest.mock('redis'); -const Cache = require('../../../../lib/cache'); -const { AccountsModel } = require('../../../../lib/model'); +const Cache = require('~/lib/cache'); +const { AccountsModel } = require('~/lib/model'); const StateMachine = require('javascript-state-machine'); const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components'); diff --git a/src/test/unit/lib/model/InboundTransfersModel.test.js b/test/unit/lib/model/InboundTransfersModel.test.js similarity index 98% rename from src/test/unit/lib/model/InboundTransfersModel.test.js rename to test/unit/lib/model/InboundTransfersModel.test.js index 663640a5b..f5ddf7c2f 100644 --- a/src/test/unit/lib/model/InboundTransfersModel.test.js +++ b/test/unit/lib/model/InboundTransfersModel.test.js @@ -12,16 +12,16 @@ // we use a mock standard components lib to intercept and mock certain funcs jest.mock('@mojaloop/sdk-standard-components'); jest.mock('redis'); -jest.mock('../../../../lib/model/lib/requests',() => require('./mockedLibRequests')); +jest.mock('~/lib/model/lib/requests',() => require('./mockedLibRequests')); const defaultConfig = require('./data/defaultConfig'); -const Model = require('../../../../lib/model').InboundTransfersModel; +const Model = require('~/lib/model').InboundTransfersModel; const mockArguments = require('./data/mockArguments'); const mockTxnReqquestsArguments = require('./data/mockTxnRequestsArguments'); const { MojaloopRequests, Ilp, Logger } = require('@mojaloop/sdk-standard-components'); -const { BackendRequests, HTTPResponseError } = require('../../../../lib/model/lib/requests'); -const Cache = require('../../../../lib/cache'); -const shared = require('../../../../lib/model/lib/shared'); +const { BackendRequests, HTTPResponseError } = require('~/lib/model/lib/requests'); +const Cache = require('~/lib/cache'); +const shared = require('~/lib/model/lib/shared'); const getTransfersBackendResponse = require('./data/getTransfersBackendResponse'); const getTransfersMojaloopResponse = require('./data/getTransfersMojaloopResponse'); diff --git a/src/test/unit/lib/model/OutboundBulkQuotesModel.test.js b/test/unit/lib/model/OutboundBulkQuotesModel.test.js similarity index 98% rename from src/test/unit/lib/model/OutboundBulkQuotesModel.test.js rename to test/unit/lib/model/OutboundBulkQuotesModel.test.js index 86d35a322..74a6b33e9 100644 --- a/src/test/unit/lib/model/OutboundBulkQuotesModel.test.js +++ b/test/unit/lib/model/OutboundBulkQuotesModel.test.js @@ -14,8 +14,8 @@ jest.mock('@mojaloop/sdk-standard-components'); jest.mock('redis'); -const Cache = require('../../../../lib/cache'); -const Model = require('../../../../lib/model').OutboundBulkQuotesModel; +const Cache = require('~/lib/cache'); +const Model = require('~/lib/model').OutboundBulkQuotesModel; const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components'); const StateMachine = require('javascript-state-machine'); diff --git a/src/test/unit/lib/model/OutboundBulkTransfersModel.test.js b/test/unit/lib/model/OutboundBulkTransfersModel.test.js similarity index 98% rename from src/test/unit/lib/model/OutboundBulkTransfersModel.test.js rename to test/unit/lib/model/OutboundBulkTransfersModel.test.js index 4c4651405..3ae7ebcc5 100644 --- a/src/test/unit/lib/model/OutboundBulkTransfersModel.test.js +++ b/test/unit/lib/model/OutboundBulkTransfersModel.test.js @@ -14,8 +14,8 @@ jest.mock('@mojaloop/sdk-standard-components'); jest.mock('redis'); -const Cache = require('../../../../lib/cache'); -const Model = require('../../../../lib/model').OutboundBulkTransfersModel; +const Cache = require('~/lib/cache'); +const Model = require('~/lib/model').OutboundBulkTransfersModel; const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components'); const StateMachine = require('javascript-state-machine'); diff --git a/src/test/unit/lib/model/OutboundRequestToPayModel.test.js b/test/unit/lib/model/OutboundRequestToPayModel.test.js similarity index 96% rename from src/test/unit/lib/model/OutboundRequestToPayModel.test.js rename to test/unit/lib/model/OutboundRequestToPayModel.test.js index 3b49a7d9f..651f601f5 100644 --- a/src/test/unit/lib/model/OutboundRequestToPayModel.test.js +++ b/test/unit/lib/model/OutboundRequestToPayModel.test.js @@ -14,9 +14,9 @@ jest.mock('@mojaloop/sdk-standard-components'); jest.mock('redis'); -const Cache = require('../../../../lib/cache'); -const Model = require('../../../../lib/model').OutboundRequestToPayModel; -const PartiesModel = require('../../../../lib/model').PartiesModel; +const Cache = require('~/lib/cache'); +const Model = require('~/lib/model').OutboundRequestToPayModel; +const PartiesModel = require('~/lib/model').PartiesModel; const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components'); const StateMachine = require('javascript-state-machine'); diff --git a/src/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js b/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js similarity index 98% rename from src/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js rename to test/unit/lib/model/OutboundRequestToPayTransferModel.test.js index d93a2844b..a37610c03 100644 --- a/src/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js +++ b/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js @@ -14,8 +14,8 @@ jest.mock('@mojaloop/sdk-standard-components'); jest.mock('redis'); -const Cache = require('../../../../lib/cache'); -const Model = require('../../../../lib/model').OutboundRequestToPayTransferModel; +const Cache = require('~/lib/cache'); +const Model = require('~/lib/model').OutboundRequestToPayTransferModel; const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components'); const StateMachine = require('javascript-state-machine'); diff --git a/src/test/unit/lib/model/OutboundTransfersModel.test.js b/test/unit/lib/model/OutboundTransfersModel.test.js similarity index 99% rename from src/test/unit/lib/model/OutboundTransfersModel.test.js rename to test/unit/lib/model/OutboundTransfersModel.test.js index 8a375baeb..866181772 100644 --- a/src/test/unit/lib/model/OutboundTransfersModel.test.js +++ b/test/unit/lib/model/OutboundTransfersModel.test.js @@ -14,9 +14,9 @@ jest.mock('@mojaloop/sdk-standard-components'); jest.mock('redis'); -const Cache = require('../../../../lib/cache'); -const Model = require('../../../../lib/model').OutboundTransfersModel; -const PartiesModel = require('../../../../lib/model').PartiesModel; +const Cache = require('~/lib/cache'); +const Model = require('~/lib/model').OutboundTransfersModel; +const PartiesModel = require('~/lib/model').PartiesModel; const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components'); const StateMachine = require('javascript-state-machine'); diff --git a/src/test/unit/lib/model/PartiesModel.test.js b/test/unit/lib/model/PartiesModel.test.js similarity index 96% rename from src/test/unit/lib/model/PartiesModel.test.js rename to test/unit/lib/model/PartiesModel.test.js index 45ef44a3e..b1b0877fb 100644 --- a/src/test/unit/lib/model/PartiesModel.test.js +++ b/test/unit/lib/model/PartiesModel.test.js @@ -14,19 +14,19 @@ jest.mock('@mojaloop/sdk-standard-components'); const { uuid } = require('uuidv4'); -const Model = require('../../../../lib/model').PartiesModel; -const PSM = require('../../../../lib/model/common').PersistentStateMachine; +const Model = require('~/lib/model').PartiesModel; +const PSM = require('~/lib/model/common').PersistentStateMachine; const { MojaloopRequests } = require('@mojaloop/sdk-standard-components'); const defaultConfig = require('./data/defaultConfig'); const mockLogger = require('../../mockLogger'); -const deferredJob = require('../../../../lib/model/lib').deferredJob; +const deferredJob = require('~/lib/model/lib').deferredJob; const pt = require('promise-timeout'); describe('PartiesModel', () => { let cacheKey; let data; let modelConfig; - + const subId = 123; let handler = null; beforeEach(async () => { @@ -44,7 +44,7 @@ describe('PartiesModel', () => { handler = jest.fn(h); return subId; }), - + // mock publish and call stored handler publish: jest.fn(async (channel, message) => await handler(channel, message, subId)), @@ -53,7 +53,7 @@ describe('PartiesModel', () => { ...defaultConfig }; data = { the: 'mocked data' }; - + cacheKey = 'cache-key'; }); @@ -62,7 +62,7 @@ describe('PartiesModel', () => { const model = await Model.create(data, cacheKey, modelConfig); expect(model.state).toBe('start'); - + // model's methods layout const methods = [ 'run', @@ -75,7 +75,7 @@ describe('PartiesModel', () => { }); describe('getResponse', () => { - + it('should remap currentState', async () => { const model = await Model.create(data, cacheKey, modelConfig); const states = model.allStates(); @@ -85,12 +85,12 @@ describe('PartiesModel', () => { const result = model.getResponse(); expect(result.currentState).toEqual(Model.mapCurrentState[state]); }); - + }); it('should handle unexpected state', async() => { const model = await Model.create(data, cacheKey, modelConfig); - + // simulate lack of state by undefined property delete model.context.data.currentState; @@ -176,9 +176,9 @@ describe('PartiesModel', () => { // check that this.context.data is updated expect(model.context.data).toEqual({ ...message, - // current state will be updated by onAfterTransition which isn't called + // current state will be updated by onAfterTransition which isn't called // when manual invocation of transition handler happens - currentState: 'start' + currentState: 'start' }); // handler should be called only once expect(handler).toBeCalledTimes(1); @@ -195,7 +195,7 @@ describe('PartiesModel', () => { // ensure that cache.unsubscribe does not happened before fire the message expect(cache.unsubscribe).not.toBeCalled(); - + // fire publication with given message const df = deferredJob(cache, channel); setImmediate(() => df.trigger(message)); @@ -250,10 +250,10 @@ describe('PartiesModel', () => { // ensure that cache.unsubscribe does not happened before fire the message expect(cache.unsubscribe).not.toBeCalled(); - + // fire publication with given message const df = deferredJob(cache, channel); - + setTimeout( () => { df.trigger(message); }, // ensure that publication will be far long after timeout should be auto triggered @@ -285,7 +285,7 @@ describe('PartiesModel', () => { }); }); - // fire publication to channel with invalid message + // fire publication to channel with invalid message // should throw the exception from JSON.parse const df = deferredJob(cache, channel); setImmediate(() => df.trigger(undefined)); @@ -328,7 +328,7 @@ describe('PartiesModel', () => { const subIdValue = uuid(); const model = await Model.create(data, cacheKey, modelConfig); - + model.requestAction = jest.fn(); model.getResponse = jest.fn(() => Promise.resolve({the: 'response'})); @@ -349,12 +349,12 @@ describe('PartiesModel', () => { const subIdValue = uuid(); const model = await Model.create(data, cacheKey, modelConfig); - + model.getResponse = jest.fn(() => Promise.resolve({the: 'response'})); - + model.context.data.currentState = 'succeeded'; const result = await model.run({ type, id, subId: subIdValue }); - + expect(result).toEqual({the: 'response'}); expect(model.getResponse).toBeCalledTimes(1); expect(model.context.logger.log).toBeCalledWith('Action called successfully'); @@ -366,12 +366,12 @@ describe('PartiesModel', () => { const subIdValue = uuid(); const model = await Model.create(data, cacheKey, modelConfig); - + model.getResponse = jest.fn(() => Promise.resolve({the: 'response'})); - + model.context.data.currentState = 'errored'; const result = await model.run({ type, id, subId: subIdValue }); - + expect(result).toBeFalsy(); expect(model.getResponse).not.toBeCalled(); expect(model.context.logger.log).toBeCalledWith('State machine in errored state'); @@ -383,7 +383,7 @@ describe('PartiesModel', () => { const subIdValue = uuid(); const model = await Model.create(data, cacheKey, modelConfig); - + model.requestAction = jest.fn(() => { throw new Error('mocked error'); }); model.context.data.currentState = 'start'; @@ -405,7 +405,7 @@ describe('PartiesModel', () => { const subIdValue = uuid(); const model = await Model.create(data, cacheKey, modelConfig); - + model.requestAction = jest.fn(() => { const err = new Error('requestAction failed'); err.requestActionState = 'some'; @@ -413,7 +413,7 @@ describe('PartiesModel', () => { }); model.error = jest.fn(); model.context.data.currentState = 'start'; - + let theError = null; try { await model.run({ type, id, subId: subIdValue }); @@ -431,7 +431,7 @@ describe('PartiesModel', () => { it('should handle input validation for id/subId params', async () => { const type = uuid(); const model = await Model.create(data, cacheKey, modelConfig); - + expect(() => model.run(type)) .rejects.toEqual( new Error('PartiesModel args required at least two string arguments: \'type\' and \'id\'') @@ -465,4 +465,4 @@ describe('PartiesModel', () => { ); }); }); -}); \ No newline at end of file +}); diff --git a/src/test/unit/lib/model/QuotesModel.test.js b/test/unit/lib/model/QuotesModel.test.js similarity index 96% rename from src/test/unit/lib/model/QuotesModel.test.js rename to test/unit/lib/model/QuotesModel.test.js index 236321055..9a529338f 100644 --- a/src/test/unit/lib/model/QuotesModel.test.js +++ b/test/unit/lib/model/QuotesModel.test.js @@ -14,12 +14,12 @@ jest.mock('@mojaloop/sdk-standard-components'); const { uuid } = require('uuidv4'); -const Model = require('../../../../lib/model').QuotesModel; -const PSM = require('../../../../lib/model/common').PersistentStateMachine; +const Model = require('~/lib/model').QuotesModel; +const PSM = require('~/lib/model/common').PersistentStateMachine; const { MojaloopRequests } = require('@mojaloop/sdk-standard-components'); const defaultConfig = require('./data/defaultConfig'); const mockLogger = require('../../mockLogger'); -const deferredJob = require('../../../../lib/model/lib').deferredJob; +const deferredJob = require('~/lib/model/lib').deferredJob; const pt = require('promise-timeout'); const putQuotesResponse = require('./data/putQuotesResponse.json'); @@ -27,7 +27,7 @@ describe('QuotesModel', () => { let cacheKey; let data; let modelConfig; - + const subId = uuid(); let handler = null; beforeEach(async () => { @@ -45,7 +45,7 @@ describe('QuotesModel', () => { handler = jest.fn(h); return subId; }), - + // mock publish and call stored handler publish: jest.fn(async (channel, message) => await handler(channel, message, subId)), @@ -56,7 +56,7 @@ describe('QuotesModel', () => { data = { the: 'mocked data' }; - + cacheKey = `key-quotes-${uuid()}`; }); @@ -65,7 +65,7 @@ describe('QuotesModel', () => { const model = await Model.create(data, cacheKey, modelConfig); expect(model.state).toBe('start'); - + // model's methods layout const methods = [ 'run', @@ -78,7 +78,7 @@ describe('QuotesModel', () => { }); describe('getResponse', () => { - + it('should remap currentState', async () => { const model = await Model.create(data, cacheKey, modelConfig); const states = model.allStates(); @@ -88,12 +88,12 @@ describe('QuotesModel', () => { const result = model.getResponse(); expect(result.currentState).toEqual(Model.mapCurrentState[state]); }); - + }); it('should handle unexpected state', async() => { const model = await Model.create(data, cacheKey, modelConfig); - + // simulate lack of state by undefined property delete model.context.data.currentState; @@ -160,9 +160,9 @@ describe('QuotesModel', () => { // check that this.context.data is updated expect(model.context.data).toEqual({ quotes: { ...message }, - // current state will be updated by onAfterTransition which isn't called + // current state will be updated by onAfterTransition which isn't called // when manual invocation of transition handler happens - currentState: 'start' + currentState: 'start' }); // handler should be called only once expect(handler).toBeCalledTimes(1); @@ -179,7 +179,7 @@ describe('QuotesModel', () => { // ensure that cache.unsubscribe does not happened before fire the message expect(cache.unsubscribe).not.toBeCalled(); - + // fire publication with given message const df = deferredJob(cache, channel); setImmediate(() => df.trigger(message)); @@ -205,7 +205,7 @@ describe('QuotesModel', () => { const onRequestActionPromise = new Promise((resolve, reject) => { // manually invoke transition handler model.onRequestAction(model.fsm, { quoteId, fspId, quote }) - .then(() => reject()) + .then(() => reject()) .catch((err) => { // subscribe should be called only once expect(err instanceof pt.TimeoutError).toBeTruthy(); @@ -231,10 +231,10 @@ describe('QuotesModel', () => { // ensure that cache.unsubscribe does not happened before fire the message expect(cache.unsubscribe).not.toBeCalled(); - + // fire publication with given message const df = deferredJob(cache, channel); - + setTimeout( () => { df.trigger(message); }, // ensure that publication will be far long after timeout should be auto triggered @@ -254,7 +254,7 @@ describe('QuotesModel', () => { const model = await Model.create(data, cacheKey, modelConfig); const { cache } = model.context; - // fire publication to channel with invalid message + // fire publication to channel with invalid message // should throw the exception from JSON.parse const df = deferredJob(cache, channel); setImmediate(() => df.trigger(undefined)); @@ -305,7 +305,7 @@ describe('QuotesModel', () => { const quote = { quoteId }; const model = await Model.create(data, cacheKey, modelConfig); - + model.requestAction = jest.fn(); model.getResponse = jest.fn(() => Promise.resolve({the: 'response'})); @@ -327,12 +327,12 @@ describe('QuotesModel', () => { const quote = { quoteId }; const model = await Model.create(data, cacheKey, modelConfig); - + model.getResponse = jest.fn(() => Promise.resolve({the: 'response'})); - + model.context.data.currentState = 'succeeded'; const result = await model.run({ quoteId, fspId, quote }); - + expect(result).toEqual({the: 'response'}); expect(model.getResponse).toBeCalledTimes(1); expect(model.context.logger.log).toBeCalledWith('Action called successfully'); @@ -345,12 +345,12 @@ describe('QuotesModel', () => { const quote = { quoteId }; const model = await Model.create(data, cacheKey, modelConfig); - + model.getResponse = jest.fn(() => Promise.resolve({the: 'response'})); - + model.context.data.currentState = 'errored'; const result = await model.run({ quoteId, fspId, quote}); - + expect(result).toBeFalsy(); expect(model.getResponse).not.toBeCalled(); expect(model.context.logger.log).toBeCalledWith('State machine in errored state'); @@ -363,7 +363,7 @@ describe('QuotesModel', () => { const quote = { quoteId }; const model = await Model.create(data, cacheKey, modelConfig); - + model.requestAction = jest.fn(() => { throw new Error('mocked error'); }); model.context.data.currentState = 'start'; @@ -387,7 +387,7 @@ describe('QuotesModel', () => { const quote = { quoteId }; const model = await Model.create(data, cacheKey, modelConfig); - + model.requestAction = jest.fn(() => { const err = new Error('requestAction failed'); err.requestActionState = 'some'; @@ -395,7 +395,7 @@ describe('QuotesModel', () => { }); model.error = jest.fn(); model.context.data.currentState = 'start'; - + let theError = null; try { await model.run({ quoteId, fspId, quote }); @@ -412,7 +412,7 @@ describe('QuotesModel', () => { it('should handle input validation for lack of quoteId param', async () => { const model = await Model.create(data, cacheKey, modelConfig); - + expect(() => model.run({})) .rejects.toEqual( new Error('QuotesModel args requires \'quoteId\' is nonempty string and mandatory property') @@ -422,7 +422,7 @@ describe('QuotesModel', () => { it('should handle input validation for not quoteId & quote.quoteId be in sync', async () => { const quoteId = uuid(); const model = await Model.create(data, cacheKey, modelConfig); - + expect(() => model.run({quoteId, quote: { quoteId: uuid()}})) .rejects.toEqual( new Error('QuotesModel args requires properties \'quote.quoteId\' and \'quoteId\' to be the equal in value') @@ -432,7 +432,7 @@ describe('QuotesModel', () => { it('should handle input validation for fspId param', async () => { const quoteId = uuid(); const model = await Model.create(data, cacheKey, modelConfig); - + expect(() => model.run({quoteId, fspId:'' })) .rejects.toEqual( new Error('QuotesModel args requires \'fspId\' to be nonempty string') @@ -467,4 +467,4 @@ describe('QuotesModel', () => { ); }); }); -}); \ No newline at end of file +}); diff --git a/src/test/unit/lib/model/TransfersModel.test.js b/test/unit/lib/model/TransfersModel.test.js similarity index 98% rename from src/test/unit/lib/model/TransfersModel.test.js rename to test/unit/lib/model/TransfersModel.test.js index 1afbeefa6..0b76c584d 100644 --- a/src/test/unit/lib/model/TransfersModel.test.js +++ b/test/unit/lib/model/TransfersModel.test.js @@ -14,12 +14,12 @@ jest.mock('@mojaloop/sdk-standard-components'); const { uuid } = require('uuidv4'); -const Model = require('../../../../lib/model').TransfersModel; -const PSM = require('../../../../lib/model/common').PersistentStateMachine; +const Model = require('~/lib/model').TransfersModel; +const PSM = require('~/lib/model/common').PersistentStateMachine; const { MojaloopRequests } = require('@mojaloop/sdk-standard-components'); const defaultConfig = require('./data/defaultConfig'); const mockLogger = require('../../mockLogger'); -const deferredJob = require('../../../../lib/model/lib').deferredJob; +const deferredJob = require('~/lib/model/lib').deferredJob; const pt = require('promise-timeout'); const putTransfersResponse = require('./data/putTransfersResponse.json'); diff --git a/src/test/unit/lib/model/common/PersistentStateMachine.test.js b/test/unit/lib/model/common/PersistentStateMachine.test.js similarity index 95% rename from src/test/unit/lib/model/common/PersistentStateMachine.test.js rename to test/unit/lib/model/common/PersistentStateMachine.test.js index 47a09855c..cd4d522fd 100644 --- a/src/test/unit/lib/model/common/PersistentStateMachine.test.js +++ b/test/unit/lib/model/common/PersistentStateMachine.test.js @@ -10,21 +10,21 @@ 'use strict'; -const Cache = jest.createMockFromModule('../../../../../lib/cache'); +const Cache = jest.createMockFromModule('~/lib/cache'); -const PSM = require('../../../../../lib/model').PersistentStateMachine; +const PSM = require('~/lib/model').PersistentStateMachine; const mockLogger = require('../../../mockLogger'); describe('PersistentStateMachine', () => { let cache; let data; let smSpec; const key = 'cache-key'; - + const logger = mockLogger({app: 'persistent-state-machine-test'}); function checkPSMLayout(psm, optData) { expect(psm).toBeTruthy(); - + expect(psm.state).toEqual((optData && optData.currentState) || smSpec.init || 'none'); expect(psm.context).toEqual({ @@ -54,7 +54,7 @@ describe('PersistentStateMachine', () => { { name: 'init', from: 'none', to: 'start'}, { name: 'gogo', from: 'start', to: 'end' }, { name: 'error', from: '*', to: 'errored' } - ], + ], methods: { onGogo: async () => { return new Promise( (resolved) => { @@ -70,7 +70,7 @@ describe('PersistentStateMachine', () => { // test data data = { the: 'data' }; - + cache = new Cache({ host: 'dummycachehost', port: 1234, @@ -100,20 +100,20 @@ describe('PersistentStateMachine', () => { expect(psm.state).toEqual('start'); }); - describe('onPendingTransition', () => { + describe('onPendingTransition', () => { it('should throw error if not `error` transition', async () => { const psm = await PSM.create(data, cache, key, logger, smSpec); checkPSMLayout(psm); psm.init(); expect(() => psm.gogo()).toThrowError('Transition \'gogo\' requested while another transition is in progress'); - + }); it('should not throw error if `error` transition called when `gogo` is pending', (done) => { PSM.create(data, cache, key, logger, smSpec).then((psm) => { checkPSMLayout(psm); - + psm.init() .then(() => { expect(psm.state).toEqual('start'); @@ -125,7 +125,7 @@ describe('PersistentStateMachine', () => { .then(done) .catch(shouldNotBeExecuted); }); - }); + }); }); describe('loadFromCache', () => { @@ -163,10 +163,10 @@ describe('PersistentStateMachine', () => { describe('saveToCache', () => { it('should rethrow error from cache.set', async () => { - + // mock to simulate throwing error cache.set = jest.fn(() => { throw new Error('error from cache.set'); }); - + const psm = await PSM.create(data, cache, key, logger, smSpec); checkPSMLayout(psm); await psm.init(); @@ -176,4 +176,4 @@ describe('PersistentStateMachine', () => { }); }); -}); \ No newline at end of file +}); diff --git a/src/test/unit/lib/model/data/authorizationsResponse.json b/test/unit/lib/model/data/authorizationsResponse.json similarity index 100% rename from src/test/unit/lib/model/data/authorizationsResponse.json rename to test/unit/lib/model/data/authorizationsResponse.json diff --git a/src/test/unit/lib/model/data/bulkQuoteRequest.json b/test/unit/lib/model/data/bulkQuoteRequest.json similarity index 100% rename from src/test/unit/lib/model/data/bulkQuoteRequest.json rename to test/unit/lib/model/data/bulkQuoteRequest.json diff --git a/src/test/unit/lib/model/data/bulkQuoteResponse.json b/test/unit/lib/model/data/bulkQuoteResponse.json similarity index 100% rename from src/test/unit/lib/model/data/bulkQuoteResponse.json rename to test/unit/lib/model/data/bulkQuoteResponse.json diff --git a/src/test/unit/lib/model/data/bulkTransferFulfil.json b/test/unit/lib/model/data/bulkTransferFulfil.json similarity index 100% rename from src/test/unit/lib/model/data/bulkTransferFulfil.json rename to test/unit/lib/model/data/bulkTransferFulfil.json diff --git a/src/test/unit/lib/model/data/bulkTransferRequest.json b/test/unit/lib/model/data/bulkTransferRequest.json similarity index 100% rename from src/test/unit/lib/model/data/bulkTransferRequest.json rename to test/unit/lib/model/data/bulkTransferRequest.json diff --git a/src/test/unit/lib/model/data/defaultConfig.json b/test/unit/lib/model/data/defaultConfig.json similarity index 100% rename from src/test/unit/lib/model/data/defaultConfig.json rename to test/unit/lib/model/data/defaultConfig.json diff --git a/src/test/unit/lib/model/data/getBulkTransfersBackendResponse.json b/test/unit/lib/model/data/getBulkTransfersBackendResponse.json similarity index 100% rename from src/test/unit/lib/model/data/getBulkTransfersBackendResponse.json rename to test/unit/lib/model/data/getBulkTransfersBackendResponse.json diff --git a/src/test/unit/lib/model/data/getBulkTransfersMojaloopResponse.json b/test/unit/lib/model/data/getBulkTransfersMojaloopResponse.json similarity index 100% rename from src/test/unit/lib/model/data/getBulkTransfersMojaloopResponse.json rename to test/unit/lib/model/data/getBulkTransfersMojaloopResponse.json diff --git a/src/test/unit/lib/model/data/getTransfersBackendResponse.json b/test/unit/lib/model/data/getTransfersBackendResponse.json similarity index 100% rename from src/test/unit/lib/model/data/getTransfersBackendResponse.json rename to test/unit/lib/model/data/getTransfersBackendResponse.json diff --git a/src/test/unit/lib/model/data/getTransfersMojaloopResponse.json b/test/unit/lib/model/data/getTransfersMojaloopResponse.json similarity index 100% rename from src/test/unit/lib/model/data/getTransfersMojaloopResponse.json rename to test/unit/lib/model/data/getTransfersMojaloopResponse.json diff --git a/src/test/unit/lib/model/data/mockArguments.json b/test/unit/lib/model/data/mockArguments.json similarity index 100% rename from src/test/unit/lib/model/data/mockArguments.json rename to test/unit/lib/model/data/mockArguments.json diff --git a/src/test/unit/lib/model/data/mockTxnRequestsArguments.json b/test/unit/lib/model/data/mockTxnRequestsArguments.json similarity index 100% rename from src/test/unit/lib/model/data/mockTxnRequestsArguments.json rename to test/unit/lib/model/data/mockTxnRequestsArguments.json diff --git a/src/test/unit/lib/model/data/notificationToPayee.json b/test/unit/lib/model/data/notificationToPayee.json similarity index 100% rename from src/test/unit/lib/model/data/notificationToPayee.json rename to test/unit/lib/model/data/notificationToPayee.json diff --git a/src/test/unit/lib/model/data/payeeParty.json b/test/unit/lib/model/data/payeeParty.json similarity index 100% rename from src/test/unit/lib/model/data/payeeParty.json rename to test/unit/lib/model/data/payeeParty.json diff --git a/src/test/unit/lib/model/data/putQuotesResponse.json b/test/unit/lib/model/data/putQuotesResponse.json similarity index 100% rename from src/test/unit/lib/model/data/putQuotesResponse.json rename to test/unit/lib/model/data/putQuotesResponse.json diff --git a/src/test/unit/lib/model/data/putTransfersResponse.json b/test/unit/lib/model/data/putTransfersResponse.json similarity index 100% rename from src/test/unit/lib/model/data/putTransfersResponse.json rename to test/unit/lib/model/data/putTransfersResponse.json diff --git a/src/test/unit/lib/model/data/quoteResponse.json b/test/unit/lib/model/data/quoteResponse.json similarity index 100% rename from src/test/unit/lib/model/data/quoteResponse.json rename to test/unit/lib/model/data/quoteResponse.json diff --git a/src/test/unit/lib/model/data/requestToPayRequest.json b/test/unit/lib/model/data/requestToPayRequest.json similarity index 100% rename from src/test/unit/lib/model/data/requestToPayRequest.json rename to test/unit/lib/model/data/requestToPayRequest.json diff --git a/src/test/unit/lib/model/data/requestToPayTransferRequest.json b/test/unit/lib/model/data/requestToPayTransferRequest.json similarity index 100% rename from src/test/unit/lib/model/data/requestToPayTransferRequest.json rename to test/unit/lib/model/data/requestToPayTransferRequest.json diff --git a/src/test/unit/lib/model/data/transactionRequestResponse.json b/test/unit/lib/model/data/transactionRequestResponse.json similarity index 100% rename from src/test/unit/lib/model/data/transactionRequestResponse.json rename to test/unit/lib/model/data/transactionRequestResponse.json diff --git a/src/test/unit/lib/model/data/transferFulfil.json b/test/unit/lib/model/data/transferFulfil.json similarity index 100% rename from src/test/unit/lib/model/data/transferFulfil.json rename to test/unit/lib/model/data/transferFulfil.json diff --git a/src/test/unit/lib/model/data/transferRequest.json b/test/unit/lib/model/data/transferRequest.json similarity index 100% rename from src/test/unit/lib/model/data/transferRequest.json rename to test/unit/lib/model/data/transferRequest.json diff --git a/src/test/unit/lib/model/mockedLibRequests.js b/test/unit/lib/model/mockedLibRequests.js similarity index 97% rename from src/test/unit/lib/model/mockedLibRequests.js rename to test/unit/lib/model/mockedLibRequests.js index 2d147049e..32c5333c7 100644 --- a/src/test/unit/lib/model/mockedLibRequests.js +++ b/test/unit/lib/model/mockedLibRequests.js @@ -11,7 +11,7 @@ 'use strict'; const util = require('util'); -const { BackendRequests } = jest.requireActual('../../../../lib/model/lib/requests'); +const { BackendRequests } = jest.requireActual('~/lib/model/lib/requests'); const respErrSym = Symbol('ResponseErrorDataSym'); diff --git a/src/test/unit/mockLogger.js b/test/unit/mockLogger.js similarity index 100% rename from src/test/unit/mockLogger.js rename to test/unit/mockLogger.js diff --git a/src/test/unit/outboundApi/data/bulkQuoteRequest.json b/test/unit/outboundApi/data/bulkQuoteRequest.json similarity index 100% rename from src/test/unit/outboundApi/data/bulkQuoteRequest.json rename to test/unit/outboundApi/data/bulkQuoteRequest.json diff --git a/src/test/unit/outboundApi/data/bulkTransferRequest.json b/test/unit/outboundApi/data/bulkTransferRequest.json similarity index 100% rename from src/test/unit/outboundApi/data/bulkTransferRequest.json rename to test/unit/outboundApi/data/bulkTransferRequest.json diff --git a/src/test/unit/outboundApi/data/mockBulkQuoteError.json b/test/unit/outboundApi/data/mockBulkQuoteError.json similarity index 100% rename from src/test/unit/outboundApi/data/mockBulkQuoteError.json rename to test/unit/outboundApi/data/mockBulkQuoteError.json diff --git a/src/test/unit/outboundApi/data/mockBulkTransferError.json b/test/unit/outboundApi/data/mockBulkTransferError.json similarity index 100% rename from src/test/unit/outboundApi/data/mockBulkTransferError.json rename to test/unit/outboundApi/data/mockBulkTransferError.json diff --git a/src/test/unit/outboundApi/data/mockError.json b/test/unit/outboundApi/data/mockError.json similarity index 100% rename from src/test/unit/outboundApi/data/mockError.json rename to test/unit/outboundApi/data/mockError.json diff --git a/src/test/unit/outboundApi/data/mockGetPartiesError.json b/test/unit/outboundApi/data/mockGetPartiesError.json similarity index 100% rename from src/test/unit/outboundApi/data/mockGetPartiesError.json rename to test/unit/outboundApi/data/mockGetPartiesError.json diff --git a/src/test/unit/outboundApi/data/mockRequestToPayError.json b/test/unit/outboundApi/data/mockRequestToPayError.json similarity index 100% rename from src/test/unit/outboundApi/data/mockRequestToPayError.json rename to test/unit/outboundApi/data/mockRequestToPayError.json diff --git a/src/test/unit/outboundApi/data/mockRequestToPayTransferError.json b/test/unit/outboundApi/data/mockRequestToPayTransferError.json similarity index 100% rename from src/test/unit/outboundApi/data/mockRequestToPayTransferError.json rename to test/unit/outboundApi/data/mockRequestToPayTransferError.json diff --git a/src/test/unit/outboundApi/data/requestToPay.json b/test/unit/outboundApi/data/requestToPay.json similarity index 100% rename from src/test/unit/outboundApi/data/requestToPay.json rename to test/unit/outboundApi/data/requestToPay.json diff --git a/src/test/unit/outboundApi/data/requestToPayTransferRequest.json b/test/unit/outboundApi/data/requestToPayTransferRequest.json similarity index 100% rename from src/test/unit/outboundApi/data/requestToPayTransferRequest.json rename to test/unit/outboundApi/data/requestToPayTransferRequest.json diff --git a/src/test/unit/outboundApi/data/transferRequest.json b/test/unit/outboundApi/data/transferRequest.json similarity index 100% rename from src/test/unit/outboundApi/data/transferRequest.json rename to test/unit/outboundApi/data/transferRequest.json diff --git a/src/test/unit/outboundApi/handlers.test.js b/test/unit/outboundApi/handlers.test.js similarity index 99% rename from src/test/unit/outboundApi/handlers.test.js rename to test/unit/outboundApi/handlers.test.js index b0f314f49..4aab981f3 100644 --- a/src/test/unit/outboundApi/handlers.test.js +++ b/test/unit/outboundApi/handlers.test.js @@ -24,9 +24,9 @@ const requestToPayTransferRequest = require('./data/requestToPayTransferRequest' const mockLogger = require('../mockLogger'); const { uuid } = require('uuidv4'); -jest.mock('../../../lib/model'); +jest.mock('~/lib/model'); -const handlers = require('../../../OutboundServer/handlers'); +const handlers = require('~/OutboundServer/handlers'); const { OutboundTransfersModel, OutboundBulkTransfersModel, @@ -36,7 +36,7 @@ const { PartiesModel, QuotesModel, TransfersModel -} = require('../../../lib/model'); +} = require('~/lib/model'); /** * Mock the outbound transfer model to simulate throwing errors