@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
@@ -0,0 +1,98 @@
1
+ function now () {
2
+ return new Date().toLocaleDateString()
3
+ }
4
+
5
+ function totalAssertions (testCases) {
6
+ return testCases.reduce((total, curTestCase) => {
7
+ const assertionsInRequest = curTestCase.requests.reduce((assertionCountRequest, curRequest) => {
8
+ return assertionCountRequest + ((curRequest.request.tests && curRequest.request.tests.assertions) ? curRequest.request.tests.assertions.length : 0)
9
+ }, 0)
10
+ return total + assertionsInRequest
11
+ }, 0)
12
+ }
13
+
14
+ function totalPassedAssertions (testCases) {
15
+ return testCases.reduce((total, curTestCase) => {
16
+ const assertionsInRequest = curTestCase.requests.reduce((assertionCountRequest, curRequest) => {
17
+ return assertionCountRequest + ((curRequest.request.tests && curRequest.request.tests.assertions) ? curRequest.request.tests.assertions.length : 0)
18
+ }, 0)
19
+ const passedAssertionsInRequest = curTestCase.requests.reduce((passedAssertionCountRequest, curRequest) => {
20
+ return passedAssertionCountRequest + ((curRequest.request.tests && curRequest.request.tests.passedAssertionsCount) ? curRequest.request.tests.passedAssertionsCount : 0)
21
+ }, 0)
22
+ return total + passedAssertionsInRequest
23
+ }, 0)
24
+ }
25
+
26
+ function totalFailedAssertions (testCases) {
27
+ return totalAssertions(testCases) - totalPassedAssertions(testCases)
28
+ }
29
+
30
+ function totalTestCases (testCases) {
31
+ return testCases.length
32
+ }
33
+
34
+ function failedTestCases (testCases) {
35
+ return testCases.reduce((total, curTestCase) => {
36
+ const assertionsInRequest = curTestCase.requests.reduce((assertionCountRequest, curRequest) => {
37
+ return assertionCountRequest + ((curRequest.request.tests && curRequest.request.tests.assertions) ? curRequest.request.tests.assertions.length : 0)
38
+ }, 0)
39
+ const passedAssertionsInRequest = curTestCase.requests.reduce((passedAssertionCountRequest, curRequest) => {
40
+ return passedAssertionCountRequest + ((curRequest.request.tests && curRequest.request.tests.passedAssertionsCount) ? curRequest.request.tests.passedAssertionsCount : 0)
41
+ }, 0)
42
+ return total + (passedAssertionsInRequest === assertionsInRequest ? 0 : 1)
43
+ }, 0)
44
+ }
45
+
46
+ function totalRequests (testCases) {
47
+ return testCases.reduce((total, curTestCase) => {
48
+ return total + curTestCase.requests.length
49
+ }, 0)
50
+ }
51
+
52
+ function failedRequests (testCases) {
53
+ return testCases.reduce((total, curTestCase) => {
54
+ const faileRequestsCount = curTestCase.requests.reduce((failedRequestCountTemp, curRequest) => {
55
+ return failedRequestCountTemp + ((curRequest.request.tests && curRequest.request.tests.assertions) ? (curRequest.request.tests.assertions.length === curRequest.request.tests.passedAssertionsCount ? 0 : 1) : 0)
56
+ }, 0)
57
+ return total + faileRequestsCount
58
+ }, 0)
59
+ }
60
+
61
+ function testPassPercentage (tests) {
62
+ if (tests && tests.assertions) {
63
+ return Math.round(tests.passedAssertionsCount * 100 / tests.assertions.length)
64
+ } else {
65
+ return 0
66
+ }
67
+ }
68
+
69
+ function ifAllTestsPassedInRequest (request) {
70
+ if (request.tests && request.tests.assertions) {
71
+ return request.tests.passedAssertionsCount === request.tests.assertions.length
72
+ } else {
73
+ return false
74
+ }
75
+ }
76
+
77
+ function ifFailedTestCase (testCase) {
78
+ const failedRequest = testCase.requests.find((item) => {
79
+ if (item.request.tests.assertions) {
80
+ return item.request.tests.passedAssertionsCount !== item.request.tests.assertions.length
81
+ } else {
82
+ return false
83
+ }
84
+ })
85
+ if (failedRequest) {
86
+ return true
87
+ } else {
88
+ return false
89
+ }
90
+ }
91
+
92
+ function jsonStringify (inputObject) {
93
+ return JSON.stringify(inputObject, null, 2)
94
+ }
95
+
96
+ function isAssertionPassed (status) {
97
+ return status === 'SUCCESS'
98
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "activeRulesFile": "default.json"
3
+ }
@@ -0,0 +1,426 @@
1
+ [
2
+ {
3
+ "ruleId": 1,
4
+ "priority": 1,
5
+ "description": "get /parties/{Type}/{ID}",
6
+ "apiVersion": {
7
+ "minorVersion": 0,
8
+ "majorVersion": 1,
9
+ "type": "fspiop",
10
+ "asynchronous": true
11
+ },
12
+ "conditions": {
13
+ "all": [
14
+ {
15
+ "fact": "pathParams",
16
+ "operator": "notEqual",
17
+ "value": "OPAQUE",
18
+ "path": "Type"
19
+ },
20
+ {
21
+ "fact": "pathParams",
22
+ "operator": "equal",
23
+ "value": "1234567890",
24
+ "path": "ID"
25
+ },
26
+ {
27
+ "fact": "operationPath",
28
+ "operator": "equal",
29
+ "value": "/parties/{Type}/{ID}"
30
+ },
31
+ {
32
+ "fact": "method",
33
+ "operator": "equal",
34
+ "value": "get"
35
+ }
36
+ ]
37
+ },
38
+ "event": {
39
+ "method": "put",
40
+ "path": "/parties/{Type}/{ID}",
41
+ "params": {
42
+ "headers": {
43
+ "Content-Type": "application/vnd.interoperability.parties+json;version=1.0",
44
+ "Date": "Wed, 27 May 2020 11:13:34 GMT",
45
+ "X-Forwarded-For": "sed eiusmod sunt",
46
+ "FSPIOP-Source": "{$config.FSPID}",
47
+ "FSPIOP-Destination": "mojaloop-sdk",
48
+ "FSPIOP-Encryption": "magna Excepteur dolore nisi fugiat",
49
+ "FSPIOP-Signature": "nisi",
50
+ "FSPIOP-URI": "veniam reprehenderit anim ut",
51
+ "FSPIOP-HTTP-Method": "PUT",
52
+ "Content-Length": ""
53
+ },
54
+ "body": {
55
+ "party": {
56
+ "partyIdInfo": {
57
+ "partyIdType": "{$request.params.Type}",
58
+ "partyIdentifier": "{$request.params.ID}",
59
+ "fspId": "{$config.FSPID}"
60
+ },
61
+ "merchantClassificationCode": "4321",
62
+ "name": "Justin Trudeau",
63
+ "personalInfo": {
64
+ "complexName": {
65
+ "firstName": "Justin",
66
+ "middleName": "Pierre",
67
+ "lastName": "Trudeau"
68
+ },
69
+ "dateOfBirth": "1980-01-01"
70
+ }
71
+ }
72
+ },
73
+ "scripts": {},
74
+ "delay": 0
75
+ },
76
+ "type": "FIXED_CALLBACK"
77
+ },
78
+ "type": "callback",
79
+ "version": 1
80
+ },
81
+ {
82
+ "ruleId": 2,
83
+ "priority": 1,
84
+ "description": "get /parties/{Type}/{ID}",
85
+ "apiVersion": {
86
+ "minorVersion": 0,
87
+ "majorVersion": 1,
88
+ "type": "fspiop",
89
+ "asynchronous": true
90
+ },
91
+ "conditions": {
92
+ "all": [
93
+ {
94
+ "fact": "pathParams",
95
+ "operator": "notEqual",
96
+ "value": "OPAQUE",
97
+ "path": "Type"
98
+ },
99
+ {
100
+ "fact": "pathParams",
101
+ "operator": "equal",
102
+ "value": "0987654321",
103
+ "path": "ID"
104
+ },
105
+ {
106
+ "fact": "operationPath",
107
+ "operator": "equal",
108
+ "value": "/parties/{Type}/{ID}"
109
+ },
110
+ {
111
+ "fact": "method",
112
+ "operator": "equal",
113
+ "value": "get"
114
+ }
115
+ ]
116
+ },
117
+ "event": {
118
+ "method": "put",
119
+ "path": "/parties/{Type}/{ID}",
120
+ "params": {
121
+ "headers": {
122
+ "Content-Type": "application/vnd.interoperability.parties+json;version=1.0",
123
+ "Date": "Wed, 27 May 2020 11:13:34 GMT",
124
+ "X-Forwarded-For": "sed eiusmod sunt",
125
+ "FSPIOP-Source": "{$config.FSPID}",
126
+ "FSPIOP-Destination": "mojaloop-sdk",
127
+ "FSPIOP-Encryption": "magna Excepteur dolore nisi fugiat",
128
+ "FSPIOP-Signature": "nisi",
129
+ "FSPIOP-URI": "veniam reprehenderit anim ut",
130
+ "FSPIOP-HTTP-Method": "PUT",
131
+ "Content-Length": ""
132
+ },
133
+ "body": {
134
+ "party": {
135
+ "partyIdInfo": {
136
+ "partyIdType": "{$request.params.Type}",
137
+ "partyIdentifier": "{$request.params.ID}",
138
+ "fspId": "{$config.FSPID}"
139
+ },
140
+ "merchantClassificationCode": "4321",
141
+ "name": "Justin Trudeau",
142
+ "personalInfo": {
143
+ "complexName": {
144
+ "firstName": "Justin",
145
+ "middleName": "Pierre",
146
+ "lastName": "Trudeau"
147
+ },
148
+ "dateOfBirth": "1980-01-01"
149
+ }
150
+ }
151
+ },
152
+ "scripts": {},
153
+ "delay": 60000
154
+ },
155
+ "type": "FIXED_CALLBACK"
156
+ },
157
+ "type": "callback",
158
+ "version": 1
159
+ },
160
+ {
161
+ "ruleId": 3,
162
+ "priority": 1,
163
+ "description": "post /quotes",
164
+ "apiVersion": {
165
+ "minorVersion": 0,
166
+ "majorVersion": 1,
167
+ "type": "fspiop",
168
+ "asynchronous": true
169
+ },
170
+ "conditions": {
171
+ "all": [
172
+ {
173
+ "fact": "headers",
174
+ "operator": "equal",
175
+ "value": "timeout-fsp-id",
176
+ "path": "FSPIOP-Destination"
177
+ },
178
+ {
179
+ "fact": "operationPath",
180
+ "operator": "equal",
181
+ "value": "/quotes"
182
+ },
183
+ {
184
+ "fact": "method",
185
+ "operator": "equal",
186
+ "value": "post"
187
+ }
188
+ ]
189
+ },
190
+ "event": {
191
+ "method": "put",
192
+ "path": "/quotes/{ID}",
193
+ "params": {
194
+ "headers": {
195
+ "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0",
196
+ "Date": "Wed, 27 May 2020 11:13:34 GMT",
197
+ "FSPIOP-Source": "{$config.FSPID}",
198
+ "FSPIOP-Destination": "mojaloop-sdk",
199
+ "X-Forwarded-For": "sed eiusmod sunt"
200
+ },
201
+ "body": {
202
+ "transferAmount": {
203
+ "currency": "{$request.body.amount.currency}",
204
+ "amount": "{$request.body.amount.amount}"
205
+ },
206
+ "payeeReceiveAmount": {
207
+ "currency": "USD",
208
+ "amount": "123.45"
209
+ },
210
+ "payeeFspFee": {
211
+ "currency": "USD",
212
+ "amount": "1.45"
213
+ },
214
+ "payeeFspCommission": {
215
+ "currency": "USD",
216
+ "amount": "0"
217
+ },
218
+ "expiration": "2016-05-24T08:38:08.699-04:00",
219
+ "geoCode": {
220
+ "latitude": "+45.4215",
221
+ "longitude": "+75.6972"
222
+ },
223
+ "ilpPacket": "AYIBgQAAAAAAAASwNGxldmVsb25lLmRmc3AxLm1lci45T2RTOF81MDdqUUZERmZlakgyOVc4bXFmNEpLMHlGTFGCAUBQU0svMS4wCk5vbmNlOiB1SXlweUYzY3pYSXBFdzVVc05TYWh3CkVuY3J5cHRpb246IG5vbmUKUGF5bWVudC1JZDogMTMyMzZhM2ItOGZhOC00MTYzLTg0NDctNGMzZWQzZGE5OGE3CgpDb250ZW50LUxlbmd0aDogMTM1CkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbgpTZW5kZXItSWRlbnRpZmllcjogOTI4MDYzOTEKCiJ7XCJmZWVcIjowLFwidHJhbnNmZXJDb2RlXCI6XCJpbnZvaWNlXCIsXCJkZWJpdE5hbWVcIjpcImFsaWNlIGNvb3BlclwiLFwiY3JlZGl0TmFtZVwiOlwibWVyIGNoYW50XCIsXCJkZWJpdElkZW50aWZpZXJcIjpcIjkyODA2MzkxXCJ9IgA",
224
+ "condition": "f5sqb7tBTWPd5Y8BDFdMm9BJR_MNI4isf8p8n4D5pHA",
225
+ "extensionList": {
226
+ "extension": [
227
+ {
228
+ "key": "errorDescription",
229
+ "value": "This is a more detailed error description"
230
+ },
231
+ {
232
+ "key": "errorDescription",
233
+ "value": "This is a more detailed error description"
234
+ }
235
+ ]
236
+ }
237
+ },
238
+ "scripts": {},
239
+ "delay": 60000
240
+ },
241
+ "type": "FIXED_CALLBACK"
242
+ },
243
+ "type": "callback",
244
+ "version": 1
245
+ },
246
+ {
247
+ "ruleId": 4,
248
+ "priority": 1,
249
+ "description": "post /quotes",
250
+ "apiVersion": {
251
+ "minorVersion": 0,
252
+ "majorVersion": 1,
253
+ "type": "fspiop",
254
+ "asynchronous": true
255
+ },
256
+ "conditions": {
257
+ "all": [
258
+ {
259
+ "fact": "operationPath",
260
+ "operator": "equal",
261
+ "value": "/quotes"
262
+ },
263
+ {
264
+ "fact": "method",
265
+ "operator": "equal",
266
+ "value": "post"
267
+ }
268
+ ]
269
+ },
270
+ "event": {
271
+ "method": "put",
272
+ "path": "/quotes/{ID}",
273
+ "params": {
274
+ "headers": {
275
+ "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0",
276
+ "Date": "Wed, 27 May 2020 11:13:34 GMT",
277
+ "FSPIOP-Source": "{$config.FSPID}",
278
+ "FSPIOP-Destination": "mojaloop-sdk",
279
+ "X-Forwarded-For": "sed eiusmod sunt"
280
+ },
281
+ "body": {
282
+ "transferAmount": {
283
+ "currency": "{$request.body.amount.currency}",
284
+ "amount": "{$request.body.amount.amount}"
285
+ },
286
+ "payeeReceiveAmount": {
287
+ "currency": "USD",
288
+ "amount": "123.45"
289
+ },
290
+ "payeeFspFee": {
291
+ "currency": "USD",
292
+ "amount": "1.45"
293
+ },
294
+ "payeeFspCommission": {
295
+ "currency": "USD",
296
+ "amount": "0"
297
+ },
298
+ "expiration": "2016-05-24T08:38:08.699-04:00",
299
+ "geoCode": {
300
+ "latitude": "+45.4215",
301
+ "longitude": "+75.6972"
302
+ },
303
+ "ilpPacket": "AYIBgQAAAAAAAASwNGxldmVsb25lLmRmc3AxLm1lci45T2RTOF81MDdqUUZERmZlakgyOVc4bXFmNEpLMHlGTFGCAUBQU0svMS4wCk5vbmNlOiB1SXlweUYzY3pYSXBFdzVVc05TYWh3CkVuY3J5cHRpb246IG5vbmUKUGF5bWVudC1JZDogMTMyMzZhM2ItOGZhOC00MTYzLTg0NDctNGMzZWQzZGE5OGE3CgpDb250ZW50LUxlbmd0aDogMTM1CkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbgpTZW5kZXItSWRlbnRpZmllcjogOTI4MDYzOTEKCiJ7XCJmZWVcIjowLFwidHJhbnNmZXJDb2RlXCI6XCJpbnZvaWNlXCIsXCJkZWJpdE5hbWVcIjpcImFsaWNlIGNvb3BlclwiLFwiY3JlZGl0TmFtZVwiOlwibWVyIGNoYW50XCIsXCJkZWJpdElkZW50aWZpZXJcIjpcIjkyODA2MzkxXCJ9IgA",
304
+ "condition": "f5sqb7tBTWPd5Y8BDFdMm9BJR_MNI4isf8p8n4D5pHA",
305
+ "extensionList": {
306
+ "extension": [
307
+ {
308
+ "key": "errorDescription",
309
+ "value": "This is a more detailed error description"
310
+ },
311
+ {
312
+ "key": "errorDescription",
313
+ "value": "This is a more detailed error description"
314
+ }
315
+ ]
316
+ }
317
+ },
318
+ "scripts": {}
319
+ },
320
+ "type": "FIXED_CALLBACK"
321
+ },
322
+ "type": "callback",
323
+ "version": 1
324
+ },
325
+ {
326
+ "ruleId": 5,
327
+ "priority": 1,
328
+ "description": "post /transfers timeout",
329
+ "apiVersion": {
330
+ "minorVersion": 0,
331
+ "majorVersion": 1,
332
+ "type": "fspiop",
333
+ "asynchronous": true
334
+ },
335
+ "conditions": {
336
+ "all": [
337
+ {
338
+ "fact": "headers",
339
+ "operator": "equal",
340
+ "value": "timeout-fsp-id-transfer",
341
+ "path": "FSPIOP-Destination"
342
+ },
343
+ {
344
+ "fact": "operationPath",
345
+ "operator": "equal",
346
+ "value": "/transfers"
347
+ },
348
+ {
349
+ "fact": "method",
350
+ "operator": "equal",
351
+ "value": "post"
352
+ }
353
+ ]
354
+ },
355
+ "event": {
356
+ "method": "put",
357
+ "path": "/transfers/{ID}",
358
+ "params": {
359
+ "headers": {
360
+ "Content-Type": "application/vnd.interoperability.transfers+json;version=1.0",
361
+ "Date": "Wed, 27 May 2020 11:13:34 GMT",
362
+ "FSPIOP-Source": "{$config.FSPID}",
363
+ "FSPIOP-Destination": "mojaloop-sdk",
364
+ "X-Forwarded-For": "sed eiusmod sunt"
365
+ },
366
+ "body": {
367
+ "fulfilment": "WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8",
368
+ "transferState": "COMMITTED",
369
+ "completedTimestamp": "2021-05-24T08:38:08.699-04:00"
370
+ },
371
+ "scripts": {},
372
+ "delay": 60000
373
+ },
374
+ "type": "FIXED_CALLBACK"
375
+ },
376
+ "type": "callback",
377
+ "version": 1
378
+ },
379
+ {
380
+ "ruleId": 6,
381
+ "priority": 1,
382
+ "description": "post /transfers",
383
+ "apiVersion": {
384
+ "minorVersion": 0,
385
+ "majorVersion": 1,
386
+ "type": "fspiop",
387
+ "asynchronous": true
388
+ },
389
+ "conditions": {
390
+ "all": [
391
+ {
392
+ "fact": "operationPath",
393
+ "operator": "equal",
394
+ "value": "/transfers"
395
+ },
396
+ {
397
+ "fact": "method",
398
+ "operator": "equal",
399
+ "value": "post"
400
+ }
401
+ ]
402
+ },
403
+ "event": {
404
+ "method": "put",
405
+ "path": "/transfers/{ID}",
406
+ "params": {
407
+ "headers": {
408
+ "Content-Type": "application/vnd.interoperability.transfers+json;version=1.0",
409
+ "Date": "Wed, 27 May 2020 11:13:34 GMT",
410
+ "FSPIOP-Source": "{$config.FSPID}",
411
+ "FSPIOP-Destination": "mojaloop-sdk",
412
+ "X-Forwarded-For": "sed eiusmod sunt"
413
+ },
414
+ "body": {
415
+ "fulfilment": "WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8",
416
+ "transferState": "COMMITTED",
417
+ "completedTimestamp": "2021-05-24T08:38:08.699-04:00"
418
+ },
419
+ "scripts": {}
420
+ },
421
+ "type": "FIXED_CALLBACK"
422
+ },
423
+ "type": "callback",
424
+ "version": 1
425
+ }
426
+ ]
@@ -0,0 +1,3 @@
1
+ {
2
+ "activeRulesFile": "default.json"
3
+ }