@mojaloop/sdk-scheme-adapter 11.18.12 → 12.0.2

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.
Files changed (255) hide show
  1. package/.circleci/config.yml +619 -0
  2. package/.nvmrc +1 -1
  3. package/.versionrc +1 -0
  4. package/CHANGELOG.md +24 -2
  5. package/CODEOWNERS +2 -0
  6. package/Dockerfile +35 -0
  7. package/LICENSE.md +10 -0
  8. package/PROXY.md +84 -0
  9. package/README.md +228 -0
  10. package/SECURITY.md +18 -0
  11. package/audit-resolve.json +142 -0
  12. package/docker/ml-testing-toolkit/secrets/keygen.sh +5 -0
  13. package/docker/ml-testing-toolkit/secrets/privatekey.pem +27 -0
  14. package/docker/ml-testing-toolkit/secrets/publickey.cer +21 -0
  15. package/docker/ml-testing-toolkit/secrets/tls/createSecrets.sh +29 -0
  16. package/docker/ml-testing-toolkit/secrets/tls/hub_client.csr +28 -0
  17. package/docker/ml-testing-toolkit/secrets/tls/hub_client_cacert.pem +32 -0
  18. package/docker/ml-testing-toolkit/secrets/tls/hub_client_cakey.key +51 -0
  19. package/docker/ml-testing-toolkit/secrets/tls/hub_client_key.key +51 -0
  20. package/docker/ml-testing-toolkit/secrets/tls/hub_server.csr +28 -0
  21. package/docker/ml-testing-toolkit/secrets/tls/hub_server_cacert.pem +32 -0
  22. package/docker/ml-testing-toolkit/secrets/tls/hub_server_cacert.srl +1 -0
  23. package/docker/ml-testing-toolkit/secrets/tls/hub_server_cakey.key +51 -0
  24. package/docker/ml-testing-toolkit/secrets/tls/hub_server_cert.pem +33 -0
  25. package/docker/ml-testing-toolkit/secrets/tls/hub_server_key.key +51 -0
  26. package/docker/ml-testing-toolkit/secrets/tls/openssl.conf +17 -0
  27. package/docker/ml-testing-toolkit/spec_files/api_definitions/central_admin_9.3/api_spec.yaml +2450 -0
  28. package/docker/ml-testing-toolkit/spec_files/api_definitions/central_admin_9.3/response_map.json +96 -0
  29. package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/api_spec.yaml +4187 -0
  30. package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/callback_map.json +542 -0
  31. package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/mockRef.json +83 -0
  32. package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/trigger_templates/transaction_request_followup.json +125 -0
  33. package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/api_spec.yaml +3703 -0
  34. package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/callback_map.json +568 -0
  35. package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/mockRef.json +83 -0
  36. package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/trigger_templates/transaction_request_followup.json +125 -0
  37. package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/api_spec.yaml +983 -0
  38. package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/mockRef.json +38 -0
  39. package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/response_map.json +34 -0
  40. package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/html_template.html +1074 -0
  41. package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/pdf_template.html +765 -0
  42. package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/script.js +98 -0
  43. package/docker/ml-testing-toolkit/spec_files/rules_callback/config.json +3 -0
  44. package/docker/ml-testing-toolkit/spec_files/rules_callback/default.json +426 -0
  45. package/docker/ml-testing-toolkit/spec_files/rules_response/config.json +3 -0
  46. package/docker/ml-testing-toolkit/spec_files/rules_response/default.json +1623 -0
  47. package/docker/ml-testing-toolkit/spec_files/rules_response/default_pisp_rules.json +161 -0
  48. package/docker/ml-testing-toolkit/spec_files/rules_validation/config.json +3 -0
  49. package/docker/ml-testing-toolkit/spec_files/rules_validation/default.json +672 -0
  50. package/docker/ml-testing-toolkit/spec_files/system_config.json +62 -0
  51. package/docker/ml-testing-toolkit/spec_files/user_config.json +45 -0
  52. package/docker/wait4/setup_hosts_file.sh +25 -0
  53. package/docker/wait4/wait4.config.js +71 -0
  54. package/docker/wait4/wait4.js +204 -0
  55. package/docker-compose.yml +67 -0
  56. package/docs/Mojaloop - Modusbox Onboarding functionality.pdf +0 -0
  57. package/docs/dfspInboundApi.yaml +1091 -0
  58. package/jest.config.js +4 -1
  59. package/junit.xml +515 -0
  60. package/package.json +15 -13
  61. package/secrets/jwsSigningKey.key +27 -0
  62. package/secrets/jwsVerificationKeys/mojaloop-sdk.pem +9 -0
  63. package/secrets/jwsVerificationKeys/switch.pem +9 -0
  64. package/sequences.puml +99 -0
  65. package/{InboundServer → src/InboundServer}/api.yaml +0 -0
  66. package/src/InboundServer/api_template.yaml +69 -0
  67. package/{InboundServer → src/InboundServer}/handlers.js +0 -0
  68. package/{InboundServer → src/InboundServer}/index.js +0 -0
  69. package/{InboundServer → src/InboundServer}/middlewares.js +0 -0
  70. package/src/OAuthTestServer/index.js +127 -0
  71. package/{OAuthTestServer → src/OAuthTestServer}/model.js +0 -0
  72. package/{OutboundServer → src/OutboundServer}/api.yaml +0 -0
  73. package/{OutboundServer → src/OutboundServer}/api_interfaces/index.d.ts +1 -17
  74. package/{OutboundServer → src/OutboundServer}/api_interfaces/openapi.d.ts +0 -0
  75. package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/bulkQuoteId.yaml +1 -1
  76. package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/bulkTransferId.yaml +1 -1
  77. package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/requestToPayTransactionId.yaml +1 -1
  78. package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/transferId.yaml +1 -1
  79. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationCompleted.yaml +0 -0
  80. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationError.yaml +0 -0
  81. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationTimeout.yaml +0 -0
  82. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteBadRequest.yaml +0 -0
  83. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteServerError.yaml +0 -0
  84. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteSuccess.yaml +0 -0
  85. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteTimeout.yaml +0 -0
  86. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferBadRequest.yaml +0 -0
  87. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferServerError.yaml +0 -0
  88. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferSuccess.yaml +0 -0
  89. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferTimeout.yaml +0 -0
  90. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/partiesByIdError404.yaml +1 -1
  91. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/partiesByIdSuccess.yaml +0 -0
  92. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/quotesPostSuccess.yaml +0 -0
  93. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/quotesServerError.yaml +0 -0
  94. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPaySuccess.yaml +0 -0
  95. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPayTransferBadRequest.yaml +0 -0
  96. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPayTransferSuccess.yaml +0 -0
  97. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/simpleTransfersPostSuccess.yaml +0 -0
  98. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/simpleTransfersServerError.yaml +0 -0
  99. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferBadRequest.yaml +0 -0
  100. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferServerError.yaml +0 -0
  101. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferSuccess.yaml +0 -0
  102. package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferTimeout.yaml +0 -0
  103. package/src/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml +18 -0
  104. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/accountsCreationState.yaml +0 -0
  105. package/src/OutboundServer/api_template/components/schemas/accountsRequest.yaml +20 -0
  106. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/accountsResponse.yaml +1 -1
  107. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/async2SyncCurrentState.yaml +0 -0
  108. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteErrorResponse.yaml +0 -0
  109. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteRequest.yaml +2 -2
  110. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteResponse.yaml +1 -1
  111. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteStatus.yaml +0 -0
  112. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteStatusResponse.yaml +1 -1
  113. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferErrorResponse.yaml +0 -0
  114. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferRequest.yaml +2 -2
  115. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferResponse.yaml +1 -1
  116. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferStatus.yaml +0 -0
  117. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferStatusResponse.yaml +1 -1
  118. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorAccountsResponse.yaml +0 -0
  119. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorQuotesResponse.yaml +0 -0
  120. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorResponse.yaml +0 -0
  121. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorSimpleTransfersResponse.yaml +0 -0
  122. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorTransferResponse.yaml +0 -0
  123. package/src/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml +6 -0
  124. package/src/OutboundServer/api_template/components/schemas/individualQuote.yaml +32 -0
  125. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualQuoteResult.yaml +5 -5
  126. package/src/OutboundServer/api_template/components/schemas/individualTransfer.yaml +32 -0
  127. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualTransferFulfilment.yaml +2 -2
  128. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualTransferResult.yaml +6 -6
  129. package/src/OutboundServer/api_template/components/schemas/mojaloopError.yaml +5 -0
  130. package/src/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml +2 -0
  131. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/partiesByIdResponse.yaml +2 -2
  132. package/src/OutboundServer/api_template/components/schemas/quote.yaml +3 -0
  133. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/quoteError.yaml +0 -0
  134. package/src/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml +13 -0
  135. package/src/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml +48 -0
  136. package/src/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml +39 -0
  137. package/src/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml +41 -0
  138. package/src/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml +42 -0
  139. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/requestToPayTransferResponse.yaml +6 -6
  140. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/simpleTransferServerError.yaml +0 -0
  141. package/src/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml +12 -0
  142. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/simpleTransfersPostResponse.yaml +1 -1
  143. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transactionType.yaml +0 -0
  144. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptOTP.yaml +0 -0
  145. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptParty.yaml +0 -0
  146. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptQuote.yaml +0 -0
  147. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferError.yaml +0 -0
  148. package/src/OutboundServer/api_template/components/schemas/transferFulfilment.yaml +3 -0
  149. package/src/OutboundServer/api_template/components/schemas/transferParty.yaml +40 -0
  150. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferRequest.yaml +4 -4
  151. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferResponse.yaml +6 -6
  152. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferStatus.yaml +0 -0
  153. package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferStatusResponse.yaml +1 -1
  154. package/{OutboundServer → src/OutboundServer}/api_template/health.yaml +0 -0
  155. package/{OutboundServer → src/OutboundServer}/api_template/openapi.yaml +0 -0
  156. package/{OutboundServer → src/OutboundServer}/api_template/paths/accounts.yaml +0 -0
  157. package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkQuotes.yaml +0 -0
  158. package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkQuotes_bulkQuoteId.yaml +0 -0
  159. package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkTransfers.yaml +0 -0
  160. package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkTransfers_bulkTransferId.yaml +0 -0
  161. package/{OutboundServer → src/OutboundServer}/api_template/paths/parties_Type_ID.yaml +2 -2
  162. package/{OutboundServer → src/OutboundServer}/api_template/paths/parties_Type_ID_SubId.yaml +3 -3
  163. package/{OutboundServer → src/OutboundServer}/api_template/paths/quotes.yaml +0 -0
  164. package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPay.yaml +0 -0
  165. package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPayTransfer.yaml +0 -0
  166. package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPayTransfer_requestToPayTransactionId.yaml +0 -0
  167. package/{OutboundServer → src/OutboundServer}/api_template/paths/simpleTransfers.yaml +0 -0
  168. package/{OutboundServer → src/OutboundServer}/api_template/paths/transfers.yaml +0 -0
  169. package/{OutboundServer → src/OutboundServer}/api_template/paths/transfers_transferId.yaml +0 -0
  170. package/{OutboundServer → src/OutboundServer}/handlers.js +0 -0
  171. package/{OutboundServer → src/OutboundServer}/index.js +0 -0
  172. package/{OutboundServer → src/OutboundServer}/middlewares.js +0 -0
  173. package/{TestServer → src/TestServer}/api.yaml +0 -0
  174. package/{TestServer → src/TestServer}/handlers.js +0 -0
  175. package/{TestServer → src/TestServer}/index.js +0 -0
  176. package/{config.js → src/config.js} +0 -0
  177. package/{index.d.ts → src/index.d.ts} +0 -0
  178. package/{index.js → src/index.js} +0 -0
  179. package/{lib → src/lib}/api/index.js +0 -0
  180. package/{lib → src/lib}/cache.js +0 -0
  181. package/{lib → src/lib}/check.js +0 -0
  182. package/{lib → src/lib}/model/AccountsModel.js +0 -0
  183. package/{lib → src/lib}/model/Async2SyncModel.js +0 -0
  184. package/{lib → src/lib}/model/InboundTransfersModel.js +0 -0
  185. package/{lib → src/lib}/model/OutboundBulkQuotesModel.js +0 -0
  186. package/{lib → src/lib}/model/OutboundBulkTransfersModel.js +0 -0
  187. package/{lib → src/lib}/model/OutboundRequestToPayModel.js +0 -0
  188. package/{lib → src/lib}/model/OutboundRequestToPayTransferModel.js +0 -0
  189. package/{lib → src/lib}/model/OutboundTransfersModel.js +0 -0
  190. package/{lib → src/lib}/model/PartiesModel.js +0 -0
  191. package/{lib → src/lib}/model/ProxyModel/MatchRules/Expression.js +0 -0
  192. package/{lib → src/lib}/model/ProxyModel/MatchRules/Headers.js +0 -0
  193. package/{lib → src/lib}/model/ProxyModel/MatchRules/MatchRule.js +0 -0
  194. package/{lib → src/lib}/model/ProxyModel/MatchRules/Path.js +0 -0
  195. package/{lib → src/lib}/model/ProxyModel/MatchRules/Query.js +0 -0
  196. package/{lib → src/lib}/model/ProxyModel/MatchRules/index.js +0 -0
  197. package/{lib → src/lib}/model/ProxyModel/Route.js +0 -0
  198. package/{lib → src/lib}/model/ProxyModel/configSchema.json +0 -0
  199. package/{lib → src/lib}/model/ProxyModel/index.js +0 -0
  200. package/{lib → src/lib}/model/QuotesModel.js +0 -0
  201. package/{lib → src/lib}/model/TransfersModel.js +0 -0
  202. package/{lib → src/lib}/model/common/BackendError.js +0 -0
  203. package/{lib → src/lib}/model/common/PersistentStateMachine.js +0 -0
  204. package/{lib → src/lib}/model/common/index.js +0 -0
  205. package/{lib → src/lib}/model/index.js +0 -0
  206. package/{lib → src/lib}/model/lib/deferredJob.js +0 -0
  207. package/{lib → src/lib}/model/lib/index.js +0 -0
  208. package/{lib → src/lib}/model/lib/requests/backendRequests.js +0 -0
  209. package/{lib → src/lib}/model/lib/requests/common.js +0 -0
  210. package/{lib → src/lib}/model/lib/requests/index.js +0 -0
  211. package/{lib → src/lib}/model/lib/shared.js +0 -0
  212. package/{lib → src/lib}/randomphrase/index.js +0 -0
  213. package/{lib → src/lib}/randomphrase/words.json +0 -0
  214. package/{lib → src/lib}/router.js +0 -0
  215. package/{lib → src/lib}/validate.js +0 -0
  216. package/test/integration/lib/cache.test.js +3 -3
  217. package/test/unit/InboundServer.test.js +5 -5
  218. package/test/unit/TestServer.test.js +5 -5
  219. package/test/unit/api/utils.js +5 -5
  220. package/test/unit/config.test.js +10 -10
  221. package/test/unit/inboundApi/handlers.test.js +6 -6
  222. package/test/unit/index.test.js +1 -1
  223. package/test/unit/lib/cache.test.js +1 -1
  224. package/test/unit/lib/model/AccountsModel.test.js +2 -2
  225. package/test/unit/lib/model/InboundTransfersModel.test.js +5 -5
  226. package/test/unit/lib/model/OutboundBulkQuotesModel.test.js +2 -2
  227. package/test/unit/lib/model/OutboundBulkTransfersModel.test.js +2 -2
  228. package/test/unit/lib/model/OutboundRequestToPayModel.test.js +3 -3
  229. package/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js +2 -2
  230. package/test/unit/lib/model/OutboundTransfersModel.test.js +3 -3
  231. package/test/unit/lib/model/PartiesModel.test.js +28 -28
  232. package/test/unit/lib/model/QuotesModel.test.js +31 -31
  233. package/test/unit/lib/model/TransfersModel.test.js +3 -3
  234. package/test/unit/lib/model/common/PersistentStateMachine.test.js +13 -13
  235. package/test/unit/lib/model/mockedLibRequests.js +1 -1
  236. package/test/unit/outboundApi/handlers.test.js +3 -3
  237. package/.eslintignore +0 -2
  238. package/InboundServer/api_template.yaml +0 -69
  239. package/OAuthTestServer/index.js +0 -66
  240. package/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml +0 -18
  241. package/OutboundServer/api_template/components/schemas/accountsRequest.yaml +0 -20
  242. package/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml +0 -6
  243. package/OutboundServer/api_template/components/schemas/individualQuote.yaml +0 -32
  244. package/OutboundServer/api_template/components/schemas/individualTransfer.yaml +0 -32
  245. package/OutboundServer/api_template/components/schemas/mojaloopError.yaml +0 -5
  246. package/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml +0 -2
  247. package/OutboundServer/api_template/components/schemas/quote.yaml +0 -3
  248. package/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml +0 -13
  249. package/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml +0 -48
  250. package/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml +0 -39
  251. package/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml +0 -41
  252. package/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml +0 -42
  253. package/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml +0 -12
  254. package/OutboundServer/api_template/components/schemas/transferFulfilment.yaml +0 -3
  255. package/OutboundServer/api_template/components/schemas/transferParty.yaml +0 -40
@@ -10,7 +10,7 @@ required:
10
10
  properties:
11
11
  transferId:
12
12
  $ref: >-
13
- ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
13
+ ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
14
14
  homeTransactionId:
15
15
  type: string
16
16
  description: >-
@@ -22,23 +22,23 @@ properties:
22
22
  $ref: ./transferParty.yaml
23
23
  amountType:
24
24
  $ref: >-
25
- ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml
25
+ ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/AmountType.yaml
26
26
  currency:
27
27
  $ref: >-
28
- ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
28
+ ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
29
29
  amount:
30
30
  $ref: >-
31
- ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml
31
+ ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Amount.yaml
32
32
  transactionType:
33
33
  $ref: ./transactionType.yaml
34
34
  note:
35
35
  $ref: >-
36
- ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml
36
+ ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Note.yaml
37
37
  currentState:
38
38
  $ref: ./transferStatus.yaml
39
39
  quoteId:
40
40
  $ref: >-
41
- ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
41
+ ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
42
42
  quoteResponse:
43
43
  $ref: ./quote.yaml
44
44
  quoteResponseSource:
@@ -6,7 +6,7 @@ required:
6
6
  properties:
7
7
  transferId:
8
8
  $ref: >-
9
- ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
9
+ ../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
10
10
  currentState:
11
11
  $ref: ./transferStatus.yaml
12
12
  fulfil:
@@ -1,8 +1,8 @@
1
1
  parameters:
2
2
  - $ref: >-
3
- ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Type.yaml
3
+ ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Type.yaml
4
4
  - $ref: >-
5
- ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/ID.yaml
5
+ ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/ID.yaml
6
6
  get:
7
7
  description: >-
8
8
  The HTTP request GET /parties// (or GET /parties///) is used to lookup
@@ -1,10 +1,10 @@
1
1
  parameters:
2
2
  - $ref: >-
3
- ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Type.yaml
3
+ ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Type.yaml
4
4
  - $ref: >-
5
- ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/ID.yaml
5
+ ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/ID.yaml
6
6
  - $ref: >-
7
- ../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/SubId.yaml
7
+ ../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/SubId.yaml
8
8
  get:
9
9
  description: >-
10
10
  The HTTP request GET /parties// (or GET /parties///) is used to lookup
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -32,7 +32,7 @@
32
32
 
33
33
  jest.dontMock('redis');
34
34
 
35
- const Cache = require('../../../lib/cache');
35
+ const Cache = require('~/lib/cache');
36
36
  const { Logger } = require('@mojaloop/sdk-standard-components');
37
37
  const env = require('../testEnv');
38
38
 
@@ -58,14 +58,14 @@ const createCache = async (config) => {
58
58
  describe('Cache', () => {
59
59
  let cache;
60
60
 
61
- beforeEach(async () => {
61
+ beforeEach(async () => {
62
62
  cache = await createCache(defaultCacheConfig);
63
63
  });
64
64
 
65
65
  afterEach(async () => {
66
66
  await cache.disconnect();
67
67
  });
68
-
68
+
69
69
  test('Sets and retrieves an object in the cache', async () => {
70
70
  // Arrange
71
71
  const value = {test: true};
@@ -18,11 +18,11 @@ const postQuotesBody = require('./data/postQuotesBody');
18
18
  const putParticipantsBody = require('./data/putParticipantsBody');
19
19
  const commonHttpHeaders = require('./data/commonHttpHeaders');
20
20
 
21
- jest.mock('../../lib/cache');
21
+ jest.mock('~/lib/cache');
22
22
  jest.mock('@mojaloop/sdk-standard-components');
23
- jest.mock('../../lib/model/lib/requests', () => require('./lib/model/mockedLibRequests'));
23
+ jest.mock('~/lib/model/lib/requests', () => require('./lib/model/mockedLibRequests'));
24
24
 
25
- const Cache = require('../../lib/cache');
25
+ const Cache = require('~/lib/cache');
26
26
  const { Jws, Logger } = require('@mojaloop/sdk-standard-components');
27
27
  const path = require('path');
28
28
  const fs = require('fs');
@@ -30,7 +30,7 @@ const os = require('os');
30
30
  const http = require('http');
31
31
  const https = require('https');
32
32
 
33
- const InboundServer = require('../../InboundServer');
33
+ const InboundServer = require('~/InboundServer');
34
34
 
35
35
  describe('Inbound Server', () => {
36
36
  describe('PUT /parties', () => {
@@ -376,7 +376,7 @@ describe('Inbound Server', () => {
376
376
 
377
377
  afterEach(async () => {
378
378
  await svr.stop();
379
- fs.rmdirSync(keysDir, { recursive: true });
379
+ fs.rmSync(keysDir, { recursive: true });
380
380
  });
381
381
 
382
382
  it('updates server configuration when a new JWS verification key '
@@ -20,13 +20,13 @@ const commonHttpHeaders = require('./data/commonHttpHeaders');
20
20
  const WebSocket = require('ws');
21
21
  const { Logger } = require('@mojaloop/sdk-standard-components');
22
22
 
23
- jest.mock('../../lib/cache');
23
+ jest.mock('~/lib/cache');
24
24
  jest.mock('@mojaloop/sdk-standard-components');
25
- jest.mock('../../lib/model/lib/requests', () => require('./lib/model/mockedLibRequests'));
25
+ jest.mock('~/lib/model/lib/requests', () => require('./lib/model/mockedLibRequests'));
26
26
 
27
- const Cache = require('../../lib/cache');
28
- const InboundServer = require('../../InboundServer');
29
- const TestServer = require('../../TestServer');
27
+ const Cache = require('~/lib/cache');
28
+ const InboundServer = require('~/InboundServer');
29
+ const TestServer = require('~/TestServer');
30
30
 
31
31
  const createWsClient = async (port, path) => {
32
32
  const result = new WebSocket(`ws://127.0.0.1:${port}${path}`);
@@ -2,12 +2,12 @@ const fs = require('fs');
2
2
  const path = require('path');
3
3
  const yaml = require('js-yaml');
4
4
  const supertest = require('supertest');
5
- const Validate = require('../../../lib/validate');
5
+ const Validate = require('~/lib/validate');
6
6
 
7
- const InboundServer = require('../../../InboundServer');
8
- const OutboundServer = require('../../../OutboundServer');
7
+ const InboundServer = require('~/InboundServer');
8
+ const OutboundServer = require('~/OutboundServer');
9
9
  const { Logger } = require('@mojaloop/sdk-standard-components');
10
- const Cache = require('../../../lib/cache');
10
+ const Cache = require('~/lib/cache');
11
11
 
12
12
  /**
13
13
  * Get OpenAPI spec and Validator for specified server
@@ -15,7 +15,7 @@ const Cache = require('../../../lib/cache');
15
15
  * @return {Promise<{apiSpecs: Object, validator: Validator}>}
16
16
  */
17
17
  const readApiInfo = async (serverType) => {
18
- const specPath = path.join(__dirname, `../../../${serverType}/api.yaml`);
18
+ const specPath = path.join(__dirname, `../../../src/${serverType}/api.yaml`);
19
19
  const apiSpecs = yaml.load(fs.readFileSync(specPath));
20
20
  const validator = new Validate();
21
21
  await validator.initialise(apiSpecs);
@@ -33,31 +33,31 @@ describe('config', () => {
33
33
 
34
34
  afterEach(() => {
35
35
  process.env = { ...env };
36
- fs.rmdirSync(certDir, { recursive: true });
36
+ fs.rmSync(certDir, { recursive: true });
37
37
  jest.resetModules();
38
38
  });
39
39
 
40
40
  it('correctly parses OUTBOUND_ERROR_STATUSCODE_EXTENSION_KEY when set', () => {
41
41
  process.env.OUTBOUND_ERROR_STATUSCODE_EXTENSION_KEY = outErrorStatusKey;
42
- const config = require('../../config');
42
+ const config = require('~/config');
43
43
  expect(config.outboundErrorStatusCodeExtensionKey).toEqual(outErrorStatusKey);
44
44
  });
45
45
 
46
46
  it('correctly parses OUTBOUND_ERROR_STATUSCODE_EXTENSION_KEY when NOT set', () => {
47
47
  delete process.env.OUTBOUND_ERROR_STATUSCODE_EXTENSION_KEY;
48
- const config = require('../../config');
48
+ const config = require('~/config');
49
49
  expect(config.outboundErrorStatusCodeExtensionKey).toBeUndefined();
50
50
  });
51
51
 
52
52
  it('correctly parses VALIDATE_INBOUND_PUT_PARTIES_JWS when NOT set', () => {
53
53
  delete process.env.VALIDATE_INBOUND_PUT_PARTIES_JWS;
54
- const config = require('../../config');
54
+ const config = require('~/config');
55
55
  expect(config.validateInboundPutPartiesJws).toBeFalsy();
56
56
  });
57
57
 
58
58
  it('correctly parses VALIDATE_INBOUND_PUT_PARTIES_JWS when set', () => {
59
59
  process.env.VALIDATE_INBOUND_PUT_PARTIES_JWS = 'true';
60
- const config = require('../../config');
60
+ const config = require('~/config');
61
61
  expect(config.validateInboundPutPartiesJws).toBeTruthy();
62
62
  });
63
63
 
@@ -66,7 +66,7 @@ describe('config', () => {
66
66
  const certContent = 'cert-data';
67
67
  fs.writeFileSync(cert, certContent);
68
68
  process.env.IN_SERVER_CERT_PATH = cert;
69
- const config = require('../../config');
69
+ const config = require('~/config');
70
70
  const content = config.mutualTLS.inboundRequests.creds.cert.toString();
71
71
  expect(content).toBe(certContent);
72
72
  });
@@ -82,14 +82,14 @@ describe('config', () => {
82
82
  ];
83
83
  certs.forEach((cert, index) => fs.writeFileSync(cert, certContent[index]));
84
84
  process.env.IN_CA_CERT_PATH = certs.join(',');
85
- const config = require('../../config');
85
+ const config = require('~/config');
86
86
  const content = config.mutualTLS.inboundRequests.creds.ca.map(ca => ca.toString());
87
87
  expect(content).toStrictEqual(certContent);
88
88
  });
89
89
 
90
90
  it('should parse proxy config yaml file as json object', () => {
91
91
  process.env.PROXY_CONFIG_PATH = path.join(__dirname, './data/testFile.yaml');
92
- const config = require('../../config');
92
+ const config = require('~/config');
93
93
  const proxyConfig = require('./data/testFile');
94
94
  expect(config.proxyConfig).toEqual(proxyConfig);
95
95
  });
@@ -107,12 +107,12 @@ describe('config', () => {
107
107
  },
108
108
 
109
109
  };
110
- const parseResourceVersion = require('../../config').__parseResourceVersion;
110
+ const parseResourceVersion = require('~/config').__parseResourceVersion;
111
111
  expect(parseResourceVersion('resourceOneName=1.0,resourceTwoName=1.1')).toEqual(resourceVersions);
112
112
  });
113
113
 
114
114
  it('should throw an err if the resource string is not correctly formed', () => {
115
- const parseResourceVersion = require('../../config').__parseResourceVersion;
115
+ const parseResourceVersion = require('~/config').__parseResourceVersion;
116
116
  expect(() => parseResourceVersion('resourceOneName=1.0;resourceTwoName=1.1')).toThrowError(new Error('Resource versions format should be in format: "resouceOneName=1.0,resourceTwoName=1.1"'));
117
117
  });
118
118
 
@@ -10,13 +10,13 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- jest.mock('../../../lib/model');
13
+ jest.mock('~/lib/model');
14
14
 
15
- const handlers = require('../../../InboundServer/handlers');
16
- const Model = require('../../../lib/model').InboundTransfersModel;
17
- const QuotesModel = require('../../../lib/model').QuotesModel;
18
- const PartiesModel = require('../../../lib/model').PartiesModel;
19
- const TransfersModel = require('../../../lib/model').TransfersModel;
15
+ const handlers = require('~/InboundServer/handlers');
16
+ const Model = require('~/lib/model').InboundTransfersModel;
17
+ const QuotesModel = require('~/lib/model').QuotesModel;
18
+ const PartiesModel = require('~/lib/model').PartiesModel;
19
+ const TransfersModel = require('~/lib/model').TransfersModel;
20
20
 
21
21
  const mockArguments = require('./data/mockArguments');
22
22
  const mockTransactionRequestData = require('./data/mockTransactionRequest');
@@ -22,7 +22,7 @@ process.env.BACKEND_ENDPOINT = '172.17.0.5:4000';
22
22
  process.env.CACHE_HOST = '172.17.0.2';
23
23
  process.env.CACHE_PORT = '6379';
24
24
 
25
- const index = require('../../index.js');
25
+ const index = require('~/index.js');
26
26
 
27
27
  describe('index.js', () => {
28
28
  test('WSO2 error events in OutboundServer propagate to top-level server', () => {
@@ -12,7 +12,7 @@
12
12
 
13
13
  jest.mock('redis');
14
14
 
15
- const Cache = require('../../../lib/cache');
15
+ const Cache = require('~/lib/cache');
16
16
  const { Logger } = require('@mojaloop/sdk-standard-components');
17
17
 
18
18
  const createCache = async() => {
@@ -14,8 +14,8 @@
14
14
  jest.mock('@mojaloop/sdk-standard-components');
15
15
  jest.mock('redis');
16
16
 
17
- const Cache = require('../../../../lib/cache');
18
- const { AccountsModel } = require('../../../../lib/model');
17
+ const Cache = require('~/lib/cache');
18
+ const { AccountsModel } = require('~/lib/model');
19
19
 
20
20
  const StateMachine = require('javascript-state-machine');
21
21
  const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components');
@@ -12,16 +12,16 @@
12
12
  // we use a mock standard components lib to intercept and mock certain funcs
13
13
  jest.mock('@mojaloop/sdk-standard-components');
14
14
  jest.mock('redis');
15
- jest.mock('../../../../lib/model/lib/requests',() => require('./mockedLibRequests'));
15
+ jest.mock('~/lib/model/lib/requests',() => require('./mockedLibRequests'));
16
16
 
17
17
  const defaultConfig = require('./data/defaultConfig');
18
- const Model = require('../../../../lib/model').InboundTransfersModel;
18
+ const Model = require('~/lib/model').InboundTransfersModel;
19
19
  const mockArguments = require('./data/mockArguments');
20
20
  const mockTxnReqquestsArguments = require('./data/mockTxnRequestsArguments');
21
21
  const { MojaloopRequests, Ilp, Logger } = require('@mojaloop/sdk-standard-components');
22
- const { BackendRequests, HTTPResponseError } = require('../../../../lib/model/lib/requests');
23
- const Cache = require('../../../../lib/cache');
24
- const shared = require('../../../../lib/model/lib/shared');
22
+ const { BackendRequests, HTTPResponseError } = require('~/lib/model/lib/requests');
23
+ const Cache = require('~/lib/cache');
24
+ const shared = require('~/lib/model/lib/shared');
25
25
 
26
26
  const getTransfersBackendResponse = require('./data/getTransfersBackendResponse');
27
27
  const getTransfersMojaloopResponse = require('./data/getTransfersMojaloopResponse');
@@ -14,8 +14,8 @@
14
14
  jest.mock('@mojaloop/sdk-standard-components');
15
15
  jest.mock('redis');
16
16
 
17
- const Cache = require('../../../../lib/cache');
18
- const Model = require('../../../../lib/model').OutboundBulkQuotesModel;
17
+ const Cache = require('~/lib/cache');
18
+ const Model = require('~/lib/model').OutboundBulkQuotesModel;
19
19
 
20
20
  const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components');
21
21
  const StateMachine = require('javascript-state-machine');
@@ -14,8 +14,8 @@
14
14
  jest.mock('@mojaloop/sdk-standard-components');
15
15
  jest.mock('redis');
16
16
 
17
- const Cache = require('../../../../lib/cache');
18
- const Model = require('../../../../lib/model').OutboundBulkTransfersModel;
17
+ const Cache = require('~/lib/cache');
18
+ const Model = require('~/lib/model').OutboundBulkTransfersModel;
19
19
 
20
20
  const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components');
21
21
  const StateMachine = require('javascript-state-machine');
@@ -14,9 +14,9 @@
14
14
  jest.mock('@mojaloop/sdk-standard-components');
15
15
  jest.mock('redis');
16
16
 
17
- const Cache = require('../../../../lib/cache');
18
- const Model = require('../../../../lib/model').OutboundRequestToPayModel;
19
- const PartiesModel = require('../../../../lib/model').PartiesModel;
17
+ const Cache = require('~/lib/cache');
18
+ const Model = require('~/lib/model').OutboundRequestToPayModel;
19
+ const PartiesModel = require('~/lib/model').PartiesModel;
20
20
 
21
21
  const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components');
22
22
  const StateMachine = require('javascript-state-machine');
@@ -14,8 +14,8 @@
14
14
  jest.mock('@mojaloop/sdk-standard-components');
15
15
  jest.mock('redis');
16
16
 
17
- const Cache = require('../../../../lib/cache');
18
- const Model = require('../../../../lib/model').OutboundRequestToPayTransferModel;
17
+ const Cache = require('~/lib/cache');
18
+ const Model = require('~/lib/model').OutboundRequestToPayTransferModel;
19
19
 
20
20
  const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components');
21
21
  const StateMachine = require('javascript-state-machine');
@@ -14,9 +14,9 @@
14
14
  jest.mock('@mojaloop/sdk-standard-components');
15
15
  jest.mock('redis');
16
16
 
17
- const Cache = require('../../../../lib/cache');
18
- const Model = require('../../../../lib/model').OutboundTransfersModel;
19
- const PartiesModel = require('../../../../lib/model').PartiesModel;
17
+ const Cache = require('~/lib/cache');
18
+ const Model = require('~/lib/model').OutboundTransfersModel;
19
+ const PartiesModel = require('~/lib/model').PartiesModel;
20
20
 
21
21
  const { MojaloopRequests, Logger } = require('@mojaloop/sdk-standard-components');
22
22
  const StateMachine = require('javascript-state-machine');