@mojaloop/sdk-scheme-adapter 12.0.0 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +619 -0
- package/.env.example +13 -0
- package/.nvmrc +1 -1
- package/.versionrc +1 -0
- package/CHANGELOG.md +28 -2
- package/CODEOWNERS +2 -0
- package/Dockerfile +35 -0
- package/LICENSE.md +10 -0
- package/PROXY.md +84 -0
- package/README.md +228 -0
- package/SECURITY.md +18 -0
- package/audit-resolve.json +45 -0
- package/docker/ml-testing-toolkit/secrets/keygen.sh +5 -0
- package/docker/ml-testing-toolkit/secrets/privatekey.pem +27 -0
- package/docker/ml-testing-toolkit/secrets/publickey.cer +21 -0
- package/docker/ml-testing-toolkit/secrets/tls/createSecrets.sh +29 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_client.csr +28 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_client_cacert.pem +32 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_client_cakey.key +51 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_client_key.key +51 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server.csr +28 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_cacert.pem +32 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_cacert.srl +1 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_cakey.key +51 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_cert.pem +33 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_key.key +51 -0
- package/docker/ml-testing-toolkit/secrets/tls/openssl.conf +17 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/central_admin_9.3/api_spec.yaml +2450 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/central_admin_9.3/response_map.json +96 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/api_spec.yaml +4187 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/callback_map.json +542 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/mockRef.json +83 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/trigger_templates/transaction_request_followup.json +125 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/api_spec.yaml +3703 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/callback_map.json +568 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/mockRef.json +83 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/trigger_templates/transaction_request_followup.json +125 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/api_spec.yaml +983 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/mockRef.json +38 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/response_map.json +34 -0
- package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/html_template.html +1074 -0
- package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/pdf_template.html +765 -0
- package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/script.js +98 -0
- package/docker/ml-testing-toolkit/spec_files/rules_callback/config.json +3 -0
- package/docker/ml-testing-toolkit/spec_files/rules_callback/default.json +426 -0
- package/docker/ml-testing-toolkit/spec_files/rules_response/config.json +3 -0
- package/docker/ml-testing-toolkit/spec_files/rules_response/default.json +1623 -0
- package/docker/ml-testing-toolkit/spec_files/rules_response/default_pisp_rules.json +161 -0
- package/docker/ml-testing-toolkit/spec_files/rules_validation/config.json +3 -0
- package/docker/ml-testing-toolkit/spec_files/rules_validation/default.json +672 -0
- package/docker/ml-testing-toolkit/spec_files/system_config.json +62 -0
- package/docker/ml-testing-toolkit/spec_files/user_config.json +45 -0
- package/docker/wait4/setup_hosts_file.sh +25 -0
- package/docker/wait4/wait4.config.js +71 -0
- package/docker/wait4/wait4.js +204 -0
- package/docker-compose.yml +67 -0
- package/docs/Mojaloop - Modusbox Onboarding functionality.pdf +0 -0
- package/docs/dfspInboundApi.yaml +1091 -0
- package/jest.config.js +4 -1
- package/package.json +17 -17
- package/secrets/jwsSigningKey.key +27 -0
- package/secrets/jwsVerificationKeys/mojaloop-sdk.pem +9 -0
- package/secrets/jwsVerificationKeys/switch.pem +9 -0
- package/sequences.puml +99 -0
- package/src/ControlAgent/index.js +221 -0
- package/{TestServer → src/ControlServer}/handlers.js +0 -0
- package/src/ControlServer/index.js +294 -0
- package/{InboundServer → src/InboundServer}/api.yaml +0 -0
- package/src/InboundServer/api_template.yaml +69 -0
- package/{InboundServer → src/InboundServer}/handlers.js +0 -0
- package/{InboundServer → src/InboundServer}/index.js +33 -1
- package/{InboundServer → src/InboundServer}/middlewares.js +0 -0
- package/src/OAuthTestServer/index.js +127 -0
- package/{OAuthTestServer → src/OAuthTestServer}/model.js +0 -0
- package/{OutboundServer → src/OutboundServer}/api.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_interfaces/index.d.ts +0 -0
- package/{OutboundServer → src/OutboundServer}/api_interfaces/openapi.d.ts +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/bulkQuoteId.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/bulkTransferId.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/requestToPayTransactionId.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/transferId.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationCompleted.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationTimeout.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteBadRequest.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteTimeout.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferBadRequest.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferTimeout.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/partiesByIdError404.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/partiesByIdSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/quotesPostSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/quotesServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPaySuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPayTransferBadRequest.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPayTransferSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/simpleTransfersPostSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/simpleTransfersServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferBadRequest.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferTimeout.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml +18 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/accountsCreationState.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/accountsRequest.yaml +20 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/accountsResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/async2SyncCurrentState.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteErrorResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteRequest.yaml +2 -2
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteStatus.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteStatusResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferErrorResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferRequest.yaml +2 -2
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferStatus.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferStatusResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorAccountsResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorQuotesResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorSimpleTransfersResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorTransferResponse.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml +6 -0
- package/src/OutboundServer/api_template/components/schemas/individualQuote.yaml +32 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualQuoteResult.yaml +5 -5
- package/src/OutboundServer/api_template/components/schemas/individualTransfer.yaml +32 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualTransferFulfilment.yaml +2 -2
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualTransferResult.yaml +6 -6
- package/src/OutboundServer/api_template/components/schemas/mojaloopError.yaml +5 -0
- package/src/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml +2 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/partiesByIdResponse.yaml +1 -1
- package/src/OutboundServer/api_template/components/schemas/quote.yaml +3 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/quoteError.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml +13 -0
- package/src/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml +48 -0
- package/src/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml +39 -0
- package/src/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml +41 -0
- package/src/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml +42 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/requestToPayTransferResponse.yaml +6 -6
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/simpleTransferServerError.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml +12 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/simpleTransfersPostResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transactionType.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptOTP.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptParty.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptQuote.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferError.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/transferFulfilment.yaml +3 -0
- package/src/OutboundServer/api_template/components/schemas/transferParty.yaml +40 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferRequest.yaml +4 -4
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferResponse.yaml +6 -6
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferStatus.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferStatusResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/health.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/openapi.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/accounts.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkQuotes.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkQuotes_bulkQuoteId.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkTransfers.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkTransfers_bulkTransferId.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/parties_Type_ID.yaml +2 -2
- package/{OutboundServer → src/OutboundServer}/api_template/paths/parties_Type_ID_SubId.yaml +3 -3
- package/{OutboundServer → src/OutboundServer}/api_template/paths/quotes.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPay.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPayTransfer.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPayTransfer_requestToPayTransactionId.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/simpleTransfers.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/transfers.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/transfers_transferId.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/handlers.js +0 -0
- package/{OutboundServer → src/OutboundServer}/index.js +15 -0
- package/{OutboundServer → src/OutboundServer}/middlewares.js +0 -0
- package/{TestServer → src/TestServer}/api.yaml +0 -0
- package/src/TestServer/handlers.js +63 -0
- package/{TestServer → src/TestServer}/index.js +31 -0
- package/{config.js → src/config.js} +6 -0
- package/{index.d.ts → src/index.d.ts} +0 -0
- package/{index.js → src/index.js} +0 -0
- package/{lib → src/lib}/api/index.js +0 -0
- package/{lib → src/lib}/cache.js +0 -0
- package/{lib → src/lib}/check.js +0 -0
- package/{lib → src/lib}/model/AccountsModel.js +0 -0
- package/{lib → src/lib}/model/Async2SyncModel.js +0 -0
- package/{lib → src/lib}/model/InboundTransfersModel.js +0 -0
- package/{lib → src/lib}/model/OutboundBulkQuotesModel.js +0 -0
- package/{lib → src/lib}/model/OutboundBulkTransfersModel.js +0 -0
- package/{lib → src/lib}/model/OutboundRequestToPayModel.js +0 -0
- package/{lib → src/lib}/model/OutboundRequestToPayTransferModel.js +0 -0
- package/{lib → src/lib}/model/OutboundTransfersModel.js +0 -0
- package/{lib → src/lib}/model/PartiesModel.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/Expression.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/Headers.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/MatchRule.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/Path.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/Query.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/index.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/Route.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/configSchema.json +0 -0
- package/{lib → src/lib}/model/ProxyModel/index.js +0 -0
- package/{lib → src/lib}/model/QuotesModel.js +0 -0
- package/{lib → src/lib}/model/TransfersModel.js +0 -0
- package/{lib → src/lib}/model/common/BackendError.js +0 -0
- package/{lib → src/lib}/model/common/PersistentStateMachine.js +0 -0
- package/{lib → src/lib}/model/common/index.js +0 -0
- package/{lib → src/lib}/model/index.js +0 -0
- package/{lib → src/lib}/model/lib/deferredJob.js +0 -0
- package/{lib → src/lib}/model/lib/index.js +0 -0
- package/{lib → src/lib}/model/lib/requests/backendRequests.js +0 -0
- package/{lib → src/lib}/model/lib/requests/common.js +0 -0
- package/{lib → src/lib}/model/lib/requests/index.js +0 -0
- package/{lib → src/lib}/model/lib/shared.js +0 -0
- package/{lib → src/lib}/randomphrase/index.js +0 -0
- package/{lib → src/lib}/randomphrase/words.json +0 -0
- package/{lib → src/lib}/router.js +0 -0
- package/{lib → src/lib}/validate.js +0 -0
- package/test/config/integration.env +9 -0
- package/test/integration/lib/cache.test.js +3 -3
- package/test/unit/ControlClient.test.js +113 -0
- package/test/unit/ControlServer/events.js +41 -0
- package/test/unit/ControlServer/index.js +231 -0
- package/test/unit/ControlServer.test.js +126 -0
- package/test/unit/InboundServer.test.js +5 -5
- package/test/unit/TestServer.test.js +5 -5
- package/test/unit/api/utils.js +5 -5
- package/test/unit/config.test.js +11 -10
- package/test/unit/inboundApi/handlers.test.js +6 -6
- package/test/unit/index.test.js +2 -1
- package/test/unit/lib/cache.test.js +1 -1
- package/test/unit/lib/model/AccountsModel.test.js +2 -2
- package/test/unit/lib/model/InboundTransfersModel.test.js +5 -5
- package/test/unit/lib/model/OutboundBulkQuotesModel.test.js +2 -2
- package/test/unit/lib/model/OutboundBulkTransfersModel.test.js +2 -2
- package/test/unit/lib/model/OutboundRequestToPayModel.test.js +3 -3
- package/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js +2 -2
- package/test/unit/lib/model/OutboundTransfersModel.test.js +3 -3
- package/test/unit/lib/model/PartiesModel.test.js +28 -28
- package/test/unit/lib/model/QuotesModel.test.js +31 -31
- package/test/unit/lib/model/TransfersModel.test.js +3 -3
- package/test/unit/lib/model/common/PersistentStateMachine.test.js +13 -13
- package/test/unit/lib/model/mockedLibRequests.js +1 -1
- package/test/unit/outboundApi/handlers.test.js +3 -3
- package/.eslintignore +0 -2
- package/InboundServer/api_template.yaml +0 -69
- package/OAuthTestServer/index.js +0 -66
- package/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml +0 -18
- package/OutboundServer/api_template/components/schemas/accountsRequest.yaml +0 -20
- package/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml +0 -6
- package/OutboundServer/api_template/components/schemas/individualQuote.yaml +0 -32
- package/OutboundServer/api_template/components/schemas/individualTransfer.yaml +0 -32
- package/OutboundServer/api_template/components/schemas/mojaloopError.yaml +0 -5
- package/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml +0 -2
- package/OutboundServer/api_template/components/schemas/quote.yaml +0 -3
- package/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml +0 -13
- package/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml +0 -48
- package/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml +0 -39
- package/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml +0 -41
- package/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml +0 -42
- package/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml +0 -12
- package/OutboundServer/api_template/components/schemas/transferFulfilment.yaml +0 -3
- package/OutboundServer/api_template/components/schemas/transferParty.yaml +0 -40
package/OAuthTestServer/index.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**************************************************************************
|
|
2
|
-
* (C) Copyright ModusBox Inc. 2019 - All rights reserved. *
|
|
3
|
-
* *
|
|
4
|
-
* This file is made available under the terms of the license agreement *
|
|
5
|
-
* specified in the corresponding source code repository. *
|
|
6
|
-
* *
|
|
7
|
-
* ORIGINAL AUTHOR: *
|
|
8
|
-
* Yevhen Kyriukha - yevhen.kyriukha@modusbox.com *
|
|
9
|
-
**************************************************************************/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
const http = require('http');
|
|
14
|
-
const Koa = require('koa');
|
|
15
|
-
const koaBody = require('koa-body');
|
|
16
|
-
const OAuthServer = require('koa2-oauth-server');
|
|
17
|
-
const { InMemoryCache } = require('./model');
|
|
18
|
-
|
|
19
|
-
class OAuthTestServer {
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {Object} conf
|
|
23
|
-
* @param {number} conf.port OAuth server listen port
|
|
24
|
-
* @param {string} conf.clientKey Customer Key
|
|
25
|
-
* @param {String} conf.clientSecret Customer Secret
|
|
26
|
-
* @param {Logger} conf.logger Logger
|
|
27
|
-
*/
|
|
28
|
-
constructor({ port, clientKey, clientSecret, logger }) {
|
|
29
|
-
this._api = null;
|
|
30
|
-
this._port = port;
|
|
31
|
-
this._logger = logger;
|
|
32
|
-
this._api = OAuthTestServer._SetupApi({ clientKey, clientSecret });
|
|
33
|
-
this._server = http.createServer(this._api.callback());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async start() {
|
|
37
|
-
if (this._server.listening) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
await new Promise((resolve) => this._server.listen(this._port, resolve));
|
|
41
|
-
this._logger.push({ port: this._port }).log('Serving OAuth2 Test Server');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async stop() {
|
|
45
|
-
await new Promise(resolve => this._server.close(resolve));
|
|
46
|
-
this._logger.log('OAuth2 Test Server shut down complete');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
static _SetupApi({ clientKey, clientSecret }) {
|
|
50
|
-
const result = new Koa();
|
|
51
|
-
|
|
52
|
-
result.oauth = new OAuthServer({
|
|
53
|
-
model: new InMemoryCache({ clientKey, clientSecret }),
|
|
54
|
-
accessTokenLifetime: 60 * 60,
|
|
55
|
-
allowBearerTokensInQueryString: true,
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
result.use(koaBody());
|
|
59
|
-
result.use(result.oauth.token());
|
|
60
|
-
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
module.exports = OAuthTestServer;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type: array
|
|
2
|
-
items:
|
|
3
|
-
type: object
|
|
4
|
-
required:
|
|
5
|
-
- idType
|
|
6
|
-
- idValue
|
|
7
|
-
properties:
|
|
8
|
-
idType:
|
|
9
|
-
$ref: >-
|
|
10
|
-
../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml
|
|
11
|
-
idValue:
|
|
12
|
-
$ref: >-
|
|
13
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml
|
|
14
|
-
idSubValue:
|
|
15
|
-
$ref: >-
|
|
16
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml
|
|
17
|
-
error:
|
|
18
|
-
$ref: ./errorResponse.yaml
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type: array
|
|
2
|
-
items:
|
|
3
|
-
type: object
|
|
4
|
-
required:
|
|
5
|
-
- idType
|
|
6
|
-
- idValue
|
|
7
|
-
- currency
|
|
8
|
-
properties:
|
|
9
|
-
idType:
|
|
10
|
-
$ref: >-
|
|
11
|
-
../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml
|
|
12
|
-
idValue:
|
|
13
|
-
$ref: >-
|
|
14
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml
|
|
15
|
-
idSubValue:
|
|
16
|
-
$ref: >-
|
|
17
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml
|
|
18
|
-
currency:
|
|
19
|
-
$ref: >-
|
|
20
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
title: IndividualQuote
|
|
2
|
-
type: object
|
|
3
|
-
description: Data model for the complex type 'individualQuote'.
|
|
4
|
-
properties:
|
|
5
|
-
quoteId:
|
|
6
|
-
$ref: >-
|
|
7
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
|
|
8
|
-
to:
|
|
9
|
-
$ref: ./transferParty.yaml
|
|
10
|
-
amountType:
|
|
11
|
-
$ref: >-
|
|
12
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml
|
|
13
|
-
currency:
|
|
14
|
-
$ref: >-
|
|
15
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
|
|
16
|
-
amount:
|
|
17
|
-
$ref: >-
|
|
18
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml
|
|
19
|
-
transactionType:
|
|
20
|
-
$ref: ./transactionType.yaml
|
|
21
|
-
note:
|
|
22
|
-
$ref: >-
|
|
23
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml
|
|
24
|
-
extensions:
|
|
25
|
-
$ref: >-
|
|
26
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml
|
|
27
|
-
required:
|
|
28
|
-
- quoteId
|
|
29
|
-
- to
|
|
30
|
-
- amountType
|
|
31
|
-
- currency
|
|
32
|
-
- transactionType
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
title: IndividualTransfer
|
|
2
|
-
type: object
|
|
3
|
-
description: Data model for the complex type 'individualTransfer'.
|
|
4
|
-
properties:
|
|
5
|
-
transferId:
|
|
6
|
-
$ref: >-
|
|
7
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
|
|
8
|
-
to:
|
|
9
|
-
$ref: ./transferParty.yaml
|
|
10
|
-
amountType:
|
|
11
|
-
$ref: >-
|
|
12
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml
|
|
13
|
-
currency:
|
|
14
|
-
$ref: >-
|
|
15
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
|
|
16
|
-
amount:
|
|
17
|
-
$ref: >-
|
|
18
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml
|
|
19
|
-
transactionType:
|
|
20
|
-
$ref: ./transactionType.yaml
|
|
21
|
-
note:
|
|
22
|
-
$ref: >-
|
|
23
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml
|
|
24
|
-
extensions:
|
|
25
|
-
$ref: >-
|
|
26
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml
|
|
27
|
-
required:
|
|
28
|
-
- transferId
|
|
29
|
-
- to
|
|
30
|
-
- amountType
|
|
31
|
-
- currency
|
|
32
|
-
- transactionType
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
title: QuotesPostRequest
|
|
2
|
-
type: object
|
|
3
|
-
properties:
|
|
4
|
-
fspId:
|
|
5
|
-
title: destination DFSP requested to calculate the quote
|
|
6
|
-
$ref: >-
|
|
7
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml
|
|
8
|
-
quotesPostRequest:
|
|
9
|
-
$ref: >-
|
|
10
|
-
../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/QuotesPostRequest.yaml
|
|
11
|
-
required:
|
|
12
|
-
- fspId
|
|
13
|
-
- quotesPostRequest
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
title: QuotesPostResponse
|
|
2
|
-
type: object
|
|
3
|
-
properties:
|
|
4
|
-
quotes:
|
|
5
|
-
title: QuotesIDPutResponse
|
|
6
|
-
type: object
|
|
7
|
-
description: 'The object sent in the PUT /quotes/{ID} callback.'
|
|
8
|
-
properties:
|
|
9
|
-
transferAmount:
|
|
10
|
-
$ref: >-
|
|
11
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml
|
|
12
|
-
payeeReceiveAmount:
|
|
13
|
-
$ref: >-
|
|
14
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml
|
|
15
|
-
payeeFspFee:
|
|
16
|
-
$ref: >-
|
|
17
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml
|
|
18
|
-
payeeFspCommission:
|
|
19
|
-
$ref: >-
|
|
20
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Money.yaml
|
|
21
|
-
expiration:
|
|
22
|
-
type: string
|
|
23
|
-
description: >-
|
|
24
|
-
Date and time until when the quotation is valid and can be honored when
|
|
25
|
-
used in the subsequent transaction.
|
|
26
|
-
example: '2016-05-24T08:38:08.699-04:00'
|
|
27
|
-
geoCode:
|
|
28
|
-
$ref: >-
|
|
29
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/GeoCode.yaml
|
|
30
|
-
ilpPacket:
|
|
31
|
-
$ref: >-
|
|
32
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/IlpPacket.yaml
|
|
33
|
-
condition:
|
|
34
|
-
$ref: >-
|
|
35
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/IlpCondition.yaml
|
|
36
|
-
extensionList:
|
|
37
|
-
$ref: >-
|
|
38
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ExtensionList.yaml
|
|
39
|
-
required:
|
|
40
|
-
- transferAmount
|
|
41
|
-
- expiration
|
|
42
|
-
- ilpPacket
|
|
43
|
-
- condition
|
|
44
|
-
currentState:
|
|
45
|
-
$ref: ../schemas/async2SyncCurrentState.yaml
|
|
46
|
-
required:
|
|
47
|
-
- quotes
|
|
48
|
-
- currentState
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
type: object
|
|
2
|
-
required:
|
|
3
|
-
- homeTransactionId
|
|
4
|
-
- from
|
|
5
|
-
- to
|
|
6
|
-
- amountType
|
|
7
|
-
- currency
|
|
8
|
-
- amount
|
|
9
|
-
- scenario
|
|
10
|
-
- initiator
|
|
11
|
-
- initiatorType
|
|
12
|
-
properties:
|
|
13
|
-
homeTransactionId:
|
|
14
|
-
type: string
|
|
15
|
-
description: >-
|
|
16
|
-
Transaction ID from the DFSP backend, used to reconcile transactions
|
|
17
|
-
between the Switch and DFSP backend systems.
|
|
18
|
-
from:
|
|
19
|
-
$ref: ./transferParty.yaml
|
|
20
|
-
to:
|
|
21
|
-
$ref: ./transferParty.yaml
|
|
22
|
-
amountType:
|
|
23
|
-
$ref: >-
|
|
24
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml
|
|
25
|
-
currency:
|
|
26
|
-
$ref: >-
|
|
27
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
|
|
28
|
-
amount:
|
|
29
|
-
$ref: >-
|
|
30
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml
|
|
31
|
-
scenario:
|
|
32
|
-
$ref: >-
|
|
33
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml
|
|
34
|
-
initiator:
|
|
35
|
-
$ref: >-
|
|
36
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml
|
|
37
|
-
initiatorType:
|
|
38
|
-
$ref: >-
|
|
39
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
type: object
|
|
2
|
-
required:
|
|
3
|
-
- transactionRequestId
|
|
4
|
-
- from
|
|
5
|
-
- to
|
|
6
|
-
- amountType
|
|
7
|
-
- currency
|
|
8
|
-
- amount
|
|
9
|
-
- transactionType
|
|
10
|
-
- requestToPayState
|
|
11
|
-
properties:
|
|
12
|
-
transactionRequestId:
|
|
13
|
-
$ref: >-
|
|
14
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
|
|
15
|
-
from:
|
|
16
|
-
$ref: ./transferParty.yaml
|
|
17
|
-
to:
|
|
18
|
-
$ref: ./transferParty.yaml
|
|
19
|
-
amountType:
|
|
20
|
-
$ref: >-
|
|
21
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml
|
|
22
|
-
currency:
|
|
23
|
-
$ref: >-
|
|
24
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
|
|
25
|
-
amount:
|
|
26
|
-
$ref: >-
|
|
27
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml
|
|
28
|
-
scenario:
|
|
29
|
-
$ref: >-
|
|
30
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml
|
|
31
|
-
initiator:
|
|
32
|
-
$ref: >-
|
|
33
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml
|
|
34
|
-
initiatorType:
|
|
35
|
-
$ref: >-
|
|
36
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml
|
|
37
|
-
authenticationType:
|
|
38
|
-
$ref: >-
|
|
39
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AuthenticationType.yaml
|
|
40
|
-
requestToPayState:
|
|
41
|
-
$ref: ./mojaloopTransactionRequestState.yaml
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
type: object
|
|
2
|
-
required:
|
|
3
|
-
- requestToPayTransactionId
|
|
4
|
-
- from
|
|
5
|
-
- to
|
|
6
|
-
- amountType
|
|
7
|
-
- currency
|
|
8
|
-
- amount
|
|
9
|
-
- scenario
|
|
10
|
-
- initiator
|
|
11
|
-
- initiatorType
|
|
12
|
-
properties:
|
|
13
|
-
requestToPayTransactionId:
|
|
14
|
-
type: string
|
|
15
|
-
description: >-
|
|
16
|
-
Transaction ID from the DFSP backend, used to reconcile transactions
|
|
17
|
-
between the Switch and DFSP backend systems.
|
|
18
|
-
from:
|
|
19
|
-
$ref: ./transferParty.yaml
|
|
20
|
-
to:
|
|
21
|
-
$ref: ./transferParty.yaml
|
|
22
|
-
amountType:
|
|
23
|
-
$ref: >-
|
|
24
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml
|
|
25
|
-
currency:
|
|
26
|
-
$ref: >-
|
|
27
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
|
|
28
|
-
amount:
|
|
29
|
-
$ref: >-
|
|
30
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml
|
|
31
|
-
scenario:
|
|
32
|
-
$ref: >-
|
|
33
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionType.yaml
|
|
34
|
-
initiator:
|
|
35
|
-
$ref: >-
|
|
36
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiator.yaml
|
|
37
|
-
initiatorType:
|
|
38
|
-
$ref: >-
|
|
39
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml
|
|
40
|
-
note:
|
|
41
|
-
$ref: >-
|
|
42
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
title: SimpleTransfersPostRequest
|
|
2
|
-
type: object
|
|
3
|
-
properties:
|
|
4
|
-
fspId:
|
|
5
|
-
$ref: >-
|
|
6
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml
|
|
7
|
-
transfersPostRequest:
|
|
8
|
-
$ref: >-
|
|
9
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransfersPostRequest.yaml
|
|
10
|
-
required:
|
|
11
|
-
- fspId
|
|
12
|
-
- transfersPostRequest
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
type: object
|
|
2
|
-
required:
|
|
3
|
-
- idType
|
|
4
|
-
- idValue
|
|
5
|
-
properties:
|
|
6
|
-
type:
|
|
7
|
-
$ref: >-
|
|
8
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/TransactionInitiatorType.yaml
|
|
9
|
-
idType:
|
|
10
|
-
$ref: >-
|
|
11
|
-
../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml
|
|
12
|
-
idValue:
|
|
13
|
-
$ref: >-
|
|
14
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml
|
|
15
|
-
idSubValue:
|
|
16
|
-
$ref: >-
|
|
17
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml
|
|
18
|
-
displayName:
|
|
19
|
-
$ref: >-
|
|
20
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Name.yaml
|
|
21
|
-
firstName:
|
|
22
|
-
$ref: >-
|
|
23
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FirstName.yaml
|
|
24
|
-
middleName:
|
|
25
|
-
$ref: >-
|
|
26
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/MiddleName.yaml
|
|
27
|
-
lastName:
|
|
28
|
-
$ref: >-
|
|
29
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/LastName.yaml
|
|
30
|
-
dateOfBirth:
|
|
31
|
-
$ref: >-
|
|
32
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/DateOfBirth.yaml
|
|
33
|
-
merchantClassificationCode:
|
|
34
|
-
$ref: >-
|
|
35
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/MerchantClassificationCode.yaml
|
|
36
|
-
fspId:
|
|
37
|
-
$ref: >-
|
|
38
|
-
../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/FspId.yaml
|
|
39
|
-
extensionList:
|
|
40
|
-
$ref: ./extensionListEmptiable.yaml
|