@felloh-org/lambda-wrapper 1.11.99 → 1.11.101

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 (421) hide show
  1. package/.github/workflows/release.yml +1 -1
  2. package/dist/index.js +1 -987
  3. package/package.json +17 -6
  4. package/webpack.config.js +36 -0
  5. package/dist/config/dependencies.js +0 -58
  6. package/dist/dependency-injection/dependency-aware.js +0 -43
  7. package/dist/dependency-injection/dependency-injection.js +0 -135
  8. package/dist/entity/acquirer/adjustment/index.js +0 -128
  9. package/dist/entity/acquirer/band/index.js +0 -60
  10. package/dist/entity/acquirer/band_rate/index.js +0 -65
  11. package/dist/entity/acquirer/batch/index.js +0 -165
  12. package/dist/entity/acquirer/bin/index.js +0 -142
  13. package/dist/entity/acquirer/bin-rules/index.js +0 -231
  14. package/dist/entity/acquirer/bin-type-grouping/index.js +0 -56
  15. package/dist/entity/acquirer/country-type/index.js +0 -44
  16. package/dist/entity/acquirer/fee/index.js +0 -127
  17. package/dist/entity/acquirer/index.js +0 -22
  18. package/dist/entity/acquirer/organisation-band/index.js +0 -61
  19. package/dist/entity/acquirer/transaction-settlement/index.js +0 -123
  20. package/dist/entity/agent-data/booking/index.js +0 -346
  21. package/dist/entity/agent-data/booking-bank-transaction/index.js +0 -68
  22. package/dist/entity/agent-data/booking-component/index.js +0 -153
  23. package/dist/entity/agent-data/booking-component-type/index.js +0 -42
  24. package/dist/entity/agent-data/booking-package-type/index.js +0 -38
  25. package/dist/entity/agent-data/index.js +0 -28
  26. package/dist/entity/agent-data/supplier/index.js +0 -87
  27. package/dist/entity/agent-data/supplier-type/index.js +0 -42
  28. package/dist/entity/aisp/gocardless-account/index.js +0 -142
  29. package/dist/entity/aisp/gocardless-agreement/index.js +0 -73
  30. package/dist/entity/aisp/gocardless-requisition/index.js +0 -132
  31. package/dist/entity/aisp/index.js +0 -20
  32. package/dist/entity/aisp/transaction/index.js +0 -231
  33. package/dist/entity/bank/account/index.js +0 -96
  34. package/dist/entity/bank/adjustment/index.js +0 -168
  35. package/dist/entity/bank/adjustment-batch/index.js +0 -83
  36. package/dist/entity/bank/amendment/index.js +0 -161
  37. package/dist/entity/bank/beneficiary/index.js +0 -125
  38. package/dist/entity/bank/currency/index.js +0 -66
  39. package/dist/entity/bank/disbursal/index.js +0 -210
  40. package/dist/entity/bank/index.js +0 -34
  41. package/dist/entity/bank/ledger/index.js +0 -212
  42. package/dist/entity/bank/settled-transaction/index.js +0 -117
  43. package/dist/entity/bank/transaction-batch/index.js +0 -93
  44. package/dist/entity/bank/vendor/index.js +0 -56
  45. package/dist/entity/basis-theory/index.js +0 -14
  46. package/dist/entity/basis-theory/token/index.js +0 -133
  47. package/dist/entity/index.js +0 -42
  48. package/dist/entity/nuapay/account/index.js +0 -95
  49. package/dist/entity/nuapay/balance/index.js +0 -63
  50. package/dist/entity/nuapay/beneficiary/index.js +0 -59
  51. package/dist/entity/nuapay/index.js +0 -20
  52. package/dist/entity/nuapay/transaction/index.js +0 -119
  53. package/dist/entity/nuvei/batch/index.js +0 -84
  54. package/dist/entity/nuvei/index.js +0 -20
  55. package/dist/entity/nuvei/merchant/index.js +0 -55
  56. package/dist/entity/nuvei/transaction/index.js +0 -229
  57. package/dist/entity/nuvei/transaction-metadata/index.js +0 -283
  58. package/dist/entity/operations/fingerprint-exclusion/index.js +0 -38
  59. package/dist/entity/operations/index.js +0 -14
  60. package/dist/entity/operations/ip-exclusion/index.js +0 -38
  61. package/dist/entity/payment/chargeback/index.js +0 -141
  62. package/dist/entity/payment/credit-note/index.js +0 -184
  63. package/dist/entity/payment/customer/index.js +0 -197
  64. package/dist/entity/payment/ecommerce/index.js +0 -321
  65. package/dist/entity/payment/index.js +0 -60
  66. package/dist/entity/payment/organisation-payment-provider/index.js +0 -233
  67. package/dist/entity/payment/organisation-payment-provider-method/index.js +0 -63
  68. package/dist/entity/payment/organisation-tokenisation-provider/index.js +0 -79
  69. package/dist/entity/payment/payment-link/index.js +0 -424
  70. package/dist/entity/payment/payment-link-type/index.js +0 -38
  71. package/dist/entity/payment/payment-provider/index.js +0 -89
  72. package/dist/entity/payment/refund/index.js +0 -210
  73. package/dist/entity/payment/refund-status/index.js +0 -44
  74. package/dist/entity/payment/tokenisation-provider/index.js +0 -51
  75. package/dist/entity/payment/transaction/index.js +0 -546
  76. package/dist/entity/payment/transaction-event/index.js +0 -81
  77. package/dist/entity/payment/transaction-event-type/index.js +0 -49
  78. package/dist/entity/payment/transaction-metadata/index.js +0 -158
  79. package/dist/entity/payment/transaction-method/index.js +0 -38
  80. package/dist/entity/payment/transaction-rate/index.js +0 -140
  81. package/dist/entity/payment/transaction-reason/index.js +0 -60
  82. package/dist/entity/payment/transaction-risk/index.js +0 -143
  83. package/dist/entity/payment/transaction-source/index.js +0 -38
  84. package/dist/entity/payment/transaction-status/index.js +0 -48
  85. package/dist/entity/payment/transaction-surcharge/index.js +0 -87
  86. package/dist/entity/payment/transaction-type/index.js +0 -38
  87. package/dist/entity/reference/country/index.js +0 -45
  88. package/dist/entity/reference/index.js +0 -14
  89. package/dist/entity/saltedge/account/index.js +0 -182
  90. package/dist/entity/saltedge/connection/index.js +0 -133
  91. package/dist/entity/saltedge/customer/index.js +0 -70
  92. package/dist/entity/saltedge/index.js +0 -22
  93. package/dist/entity/saltedge/lead/index.js +0 -75
  94. package/dist/entity/saltedge/transaction/index.js +0 -327
  95. package/dist/entity/scratch/abta-members/index.js +0 -282
  96. package/dist/entity/scratch/index.js +0 -14
  97. package/dist/entity/token/index.js +0 -14
  98. package/dist/entity/token/token/index.js +0 -143
  99. package/dist/entity/total-processing/index.js +0 -16
  100. package/dist/entity/total-processing/transaction/index.js +0 -174
  101. package/dist/entity/total-processing/transaction-metadata/index.js +0 -137
  102. package/dist/entity/trust-payments/account-fees/index.js +0 -94
  103. package/dist/entity/trust-payments/adjustment/index.js +0 -113
  104. package/dist/entity/trust-payments/batch/index.js +0 -84
  105. package/dist/entity/trust-payments/chargeback/index.js +0 -128
  106. package/dist/entity/trust-payments/index.js +0 -28
  107. package/dist/entity/trust-payments/ingested-data/index.js +0 -56
  108. package/dist/entity/trust-payments/merchant/index.js +0 -139
  109. package/dist/entity/trust-payments/transaction/index.js +0 -183
  110. package/dist/entity/trust-payments/transaction-charges/index.js +0 -81
  111. package/dist/entity/user/feature/index.js +0 -87
  112. package/dist/entity/user/index.js +0 -42
  113. package/dist/entity/user/login-link/index.js +0 -82
  114. package/dist/entity/user/mailer-log/index.js +0 -75
  115. package/dist/entity/user/organisation/index.js +0 -242
  116. package/dist/entity/user/organisation-feature/index.js +0 -68
  117. package/dist/entity/user/organisation-partner/index.js +0 -66
  118. package/dist/entity/user/organisation-payout-config/index.js +0 -96
  119. package/dist/entity/user/organisation-type/index.js +0 -43
  120. package/dist/entity/user/organisation-webhook/index.js +0 -119
  121. package/dist/entity/user/role/index.js +0 -124
  122. package/dist/entity/user/user/index.js +0 -218
  123. package/dist/entity/user/user-activity/index.js +0 -116
  124. package/dist/entity/user/user-role/index.js +0 -82
  125. package/dist/entity/user/webhook-log/index.js +0 -89
  126. package/dist/entity/user/webhook-types/index.js +0 -119
  127. package/dist/enums/payment-initation-types/index.js +0 -11
  128. package/dist/event/base-event/index.js +0 -76
  129. package/dist/event/csv/email/index.js +0 -23
  130. package/dist/event/index.js +0 -55
  131. package/dist/event/posc/request/index.js +0 -23
  132. package/dist/event/transaction/complete/email/index.js +0 -23
  133. package/dist/event/transaction/complete/index.js +0 -23
  134. package/dist/event/transaction/refund-request/index.js +0 -23
  135. package/dist/event/user/password/changed/index.js +0 -23
  136. package/dist/event/user/password/reset/index.js +0 -23
  137. package/dist/event/user/registration/index.js +0 -23
  138. package/dist/event/user/sandbox-registration/index.js +0 -23
  139. package/dist/migration/acquirer/1686830639312-acquirer_entities.js +0 -21
  140. package/dist/migration/acquirer/1686833169652-acquirer_batch_relation.js +0 -23
  141. package/dist/migration/acquirer/1686834512382-acquirer_batch_remove_organisation.js +0 -14
  142. package/dist/migration/acquirer/1686913849538-acquirer_batch_in_trust.js +0 -12
  143. package/dist/migration/acquirer/1692102029462-acquirer_adjustment.js +0 -19
  144. package/dist/migration/acquirer/1692873462263-acquirer_bin_list.js +0 -13
  145. package/dist/migration/acquirer/1692877747460-acquirer_bin_rules.js +0 -15
  146. package/dist/migration/acquirer/1692878000108-acquirer_bin_rules_nullable.js +0 -15
  147. package/dist/migration/acquirer/1705493819447-bin_rules_country.js +0 -19
  148. package/dist/migration/acquirer/1708596720562-bandings.js +0 -25
  149. package/dist/migration/acquirer/1708598335438-band_rate.js +0 -17
  150. package/dist/migration/acquirer/1708605040113-transaction_rate.js +0 -19
  151. package/dist/migration/acquirer/1708609916248-bin_type_grouping.js +0 -13
  152. package/dist/migration/acquirer/1708616903284-field_length.js +0 -25
  153. package/dist/migration/acquirer/1709030948477-update_precission_fee.js +0 -19
  154. package/dist/migration/acquirer/1709822228302-update_precission_band_rate.js +0 -13
  155. package/dist/migration/agent-data/1642121041760-inital.js +0 -15
  156. package/dist/migration/agent-data/1642121610577-organisation-suppliers.js +0 -13
  157. package/dist/migration/agent-data/1642121681610-organisation-suppliers-type.js +0 -13
  158. package/dist/migration/agent-data/1642122014731-booking-component-type.js +0 -13
  159. package/dist/migration/agent-data/1642505882721-booking-fields.js +0 -29
  160. package/dist/migration/agent-data/1642508385880-booking-id.js +0 -19
  161. package/dist/migration/agent-data/1642771380681-add-supplier-detail.js +0 -17
  162. package/dist/migration/agent-data/1642771909248-swap-uuid.js +0 -41
  163. package/dist/migration/agent-data/1656410109048-booking_gross.js +0 -13
  164. package/dist/migration/agent-data/1656411834978-booking_nullables.js +0 -13
  165. package/dist/migration/agent-data/1656421768668-booking_components.js +0 -27
  166. package/dist/migration/agent-data/1656422133900-booking_components_organisation.js +0 -15
  167. package/dist/migration/agent-data/1659707743290-booking_soft_delete.js +0 -13
  168. package/dist/migration/agent-data/1660137703368-booking-index.js +0 -13
  169. package/dist/migration/agent-data/1660741384852-bookings_is_temporary.js +0 -12
  170. package/dist/migration/agent-data/1664181706131-ecom.js +0 -19
  171. package/dist/migration/agent-data/1664790996613-payment_link_soft_delete.js +0 -13
  172. package/dist/migration/agent-data/1676565874446-booking-currency.js +0 -13
  173. package/dist/migration/agent-data/1680598468694-create-booking-package-type-table.js +0 -19
  174. package/dist/migration/agent-data/1683899996464-booking_atol_receipt_number.js +0 -13
  175. package/dist/migration/agent-data/1684158044886-booking_bank_transaction.js +0 -17
  176. package/dist/migration/aisp/1710334149128-aisp_agreement.js +0 -17
  177. package/dist/migration/aisp/1710340812651-aisp_requisition.js +0 -19
  178. package/dist/migration/aisp/1710342798216-aisp_commenced_completed.js +0 -15
  179. package/dist/migration/aisp/1710349579447-aisp_account.js +0 -17
  180. package/dist/migration/aisp/1710350514324-balancesandcurrencies.js +0 -17
  181. package/dist/migration/aisp/1710362598295-transaction_aisp.js +0 -21
  182. package/dist/migration/aisp/1710370387188-account_organisation.js +0 -15
  183. package/dist/migration/aisp/1710371316539-add_nickname.js +0 -13
  184. package/dist/migration/aisp/1710372510335-institution_name.js +0 -13
  185. package/dist/migration/aisp/1712138801073-aisp_type_code.js +0 -13
  186. package/dist/migration/aisp/1713354543529-transaction_batch_link.js +0 -15
  187. package/dist/migration/aisp/1713365208792-found_customer_account.js +0 -13
  188. package/dist/migration/bank/1642313073694-bank-initial.js +0 -15
  189. package/dist/migration/bank/1645101410250-bank_disbursal.js +0 -28
  190. package/dist/migration/bank/1645102501719-bank_disbursal_unique.js +0 -17
  191. package/dist/migration/bank/1645103420324-ledger.js +0 -19
  192. package/dist/migration/bank/1645103864454-ledger-defaults.js +0 -15
  193. package/dist/migration/bank/1645108723739-bank-settled-transaction.js +0 -19
  194. package/dist/migration/bank/1651658976210-batches.js +0 -17
  195. package/dist/migration/bank/1651659772400-batches_id_chage.js +0 -25
  196. package/dist/migration/bank/1651660836295-batches_completed_at.js +0 -13
  197. package/dist/migration/bank/1651671204869-beneficiary.js +0 -17
  198. package/dist/migration/bank/1657625543494-amendment.js +0 -19
  199. package/dist/migration/bank/1657630420519-amendment_undertaken_at.js +0 -12
  200. package/dist/migration/bank/1657630681583-vendor.js +0 -17
  201. package/dist/migration/bank/1657631323026-ammed_supplier_ref.js +0 -12
  202. package/dist/migration/bank/1657637492675-transaction-provider-metadata.js +0 -13
  203. package/dist/migration/bank/1657711121280-adjustment.js +0 -17
  204. package/dist/migration/bank/1657713850640-ledger_adjustment.js +0 -15
  205. package/dist/migration/bank/1658999065280-currency_table.js +0 -13
  206. package/dist/migration/bank/1664879624602-currency-metadata.js +0 -18
  207. package/dist/migration/bank/1665571290711-disbursement_provider_reference.js +0 -13
  208. package/dist/migration/bank/1665652395554-disbursement_ledgered.js +0 -13
  209. package/dist/migration/bank/1670517416837-disbursal_manual_review.js +0 -13
  210. package/dist/migration/bank/1670929960647-disbursal_updated_legacy_system.js +0 -13
  211. package/dist/migration/bank/1686303842122-bank_setlement_amount_and_currency.js +0 -17
  212. package/dist/migration/bank/1714140033660-adjustment_batch.js +0 -19
  213. package/dist/migration/bank/1714381892560-adjustment_column_fix.js +0 -19
  214. package/dist/migration/basis-theory/1704976983106-basis_theory.js +0 -13
  215. package/dist/migration/basis-theory/1705322282519-basis_theory_token_store.js +0 -15
  216. package/dist/migration/basis-theory/1705327854669-basis_theory_token_customer.js +0 -19
  217. package/dist/migration/basis-theory/1705330136016-basis_theory_token_bin_brand.js +0 -15
  218. package/dist/migration/nuapay/1642200051764-initial.js +0 -13
  219. package/dist/migration/nuapay/1642201303413-add-fields-nuapay.js +0 -15
  220. package/dist/migration/nuapay/1642282666475-add-nuapay-account.js +0 -13
  221. package/dist/migration/nuapay/1642283420696-fix-iban-length.js +0 -15
  222. package/dist/migration/nuapay/1642283781684-account-relation.js +0 -15
  223. package/dist/migration/nuapay/1642286393959-beneficiary.js +0 -13
  224. package/dist/migration/nuapay/1642316424390-account-ibans.js +0 -21
  225. package/dist/migration/nuapay/1642318117667-cleanup-beneficaries.js +0 -23
  226. package/dist/migration/nuapay/1642365244026-nullable-bic.js +0 -13
  227. package/dist/migration/nuapay/1642366232568-remove-bic.js +0 -13
  228. package/dist/migration/nuapay/1642370449589-transaction.js +0 -17
  229. package/dist/migration/nuvei/1658229415800-nuvei-transaction-schema.js +0 -13
  230. package/dist/migration/nuvei/1668703920070-nuvei-transaction-id-extend-length.js +0 -13
  231. package/dist/migration/nuvei/1669564062461-create_nuvei_transaction_metadata_table.js +0 -16
  232. package/dist/migration/nuvei/1670420255443-add-nuvei-webhook-additional-columns-to-trnasaction-metadata.js +0 -41
  233. package/dist/migration/nuvei/1670932754369-add_nuvei_transaction_id_column.js +0 -51
  234. package/dist/migration/nuvei/1671555132026-nuvei_batch_and_merchant.js +0 -17
  235. package/dist/migration/nuvei/1673268042534-nuvei-transaction-metadata-increase-avs-column-size.js +0 -13
  236. package/dist/migration/nuvei/1673432057176-nuvei-transaction-metadata-make-card-type-nullable.js +0 -13
  237. package/dist/migration/nuvei/1673532192232-make-merchant-columns-and-session-token-nullable-nuvei-trnsaction.js +0 -17
  238. package/dist/migration/operations/1695811546501-ip_exclusion_list.js +0 -13
  239. package/dist/migration/operations/1695820446445-fingerprint.js +0 -15
  240. package/dist/migration/payment/1642120204899-inital.js +0 -21
  241. package/dist/migration/payment/1642514728358-payment-link-updates.js +0 -39
  242. package/dist/migration/payment/1642516017835-payment-link-add-booking.js +0 -15
  243. package/dist/migration/payment/1642519453365-transaction.js +0 -63
  244. package/dist/migration/payment/1642520774562-transaction-payment-link.js +0 -15
  245. package/dist/migration/payment/1642533711013-transaction-metadata.js +0 -15
  246. package/dist/migration/payment/1642540883807-transaction-event.js +0 -27
  247. package/dist/migration/payment/1642805897210-payment-link-customer.js +0 -13
  248. package/dist/migration/payment/1643717852114-payment-providers.js +0 -19
  249. package/dist/migration/payment/1643718714719-payment-providers-method.js +0 -15
  250. package/dist/migration/payment/1643719203328-payment-providers-method.js +0 -22
  251. package/dist/migration/payment/1644395533722-transaction_provider.js +0 -15
  252. package/dist/migration/payment/1644396011044-transaction_provider_ref.js +0 -13
  253. package/dist/migration/payment/1647251762169-payment_link_methods.js +0 -15
  254. package/dist/migration/payment/1647271619083-payment_link_moto.js +0 -13
  255. package/dist/migration/payment/1647292573651-provider_secret_length.js +0 -15
  256. package/dist/migration/payment/1647294601399-provider_secret_length.js +0 -15
  257. package/dist/migration/payment/1647428635630-transaction_organisation_payment_provider.js +0 -15
  258. package/dist/migration/payment/1647437109221-transaction_message.js +0 -13
  259. package/dist/migration/payment/1647437500834-transaction_updated_at.js +0 -13
  260. package/dist/migration/payment/1649925229394-add_payment_link_status.js +0 -13
  261. package/dist/migration/payment/1650357812532-payment_chargeback.js +0 -15
  262. package/dist/migration/payment/1650974827938-update_to_with_timezones.js +0 -49
  263. package/dist/migration/payment/1651050178971-update_to_with_timestamp.js +0 -59
  264. package/dist/migration/payment/1651747895363-transaction_charges.js +0 -13
  265. package/dist/migration/payment/1653296149259-transaction_source.js +0 -17
  266. package/dist/migration/payment/1656341396697-payment_link_descriptions.js +0 -17
  267. package/dist/migration/payment/1656341762925-description_not_null.js +0 -13
  268. package/dist/migration/payment/1657616863683-payment-provider-public-creds.js +0 -13
  269. package/dist/migration/payment/1658478874188-payment-provider-active-weighting.js +0 -19
  270. package/dist/migration/payment/1658483667045-payment-provider-payment-method.js +0 -18
  271. package/dist/migration/payment/1658998508532-transactions_currency.js +0 -13
  272. package/dist/migration/payment/1658998881887-all_currencies.js +0 -23
  273. package/dist/migration/payment/1659431411240-organisation-payment-provider-enable-soft-delete.js +0 -15
  274. package/dist/migration/payment/1659527810407-organisation-payment-provider-name.js +0 -26
  275. package/dist/migration/payment/1661262743555-organisation-payment-provider-method-weight.js +0 -25
  276. package/dist/migration/payment/1661876528683-organisation-payment-provider-cleanup-weight-attr.js +0 -13
  277. package/dist/migration/payment/1662027037400-nullable_payment_link_urls.js +0 -17
  278. package/dist/migration/payment/1664283726285-organisation-payment-provider-currency.js +0 -19
  279. package/dist/migration/payment/1664285327423-organisation-payment-provider-currency-populate.js +0 -17
  280. package/dist/migration/payment/1665959547444-transaction_reason.js +0 -13
  281. package/dist/migration/payment/1666878091167-credit_note.js +0 -19
  282. package/dist/migration/payment/1666880510631-credit_notes_customer_name.js +0 -13
  283. package/dist/migration/payment/1666947609074-credit_notes_short_id.js +0 -13
  284. package/dist/migration/payment/1667918366826-insert_applepay_and_googlepay_transaction_types.js +0 -14
  285. package/dist/migration/payment/1667925229730-organisation_payment_provider_add_applepay_googlepay_columns.js +0 -15
  286. package/dist/migration/payment/1669031343148-ecommerce_deleted_at.js +0 -13
  287. package/dist/migration/payment/1669040104944-ecommerce_transaction.js +0 -15
  288. package/dist/migration/payment/1669300217086-preauth.js +0 -15
  289. package/dist/migration/payment/1670494400647-payment_link_metadata.js +0 -13
  290. package/dist/migration/payment/1671012060001-transaction_assigned_at.js +0 -13
  291. package/dist/migration/payment/1676992104022-create-payment-link-type-table.js +0 -21
  292. package/dist/migration/payment/1689673317316-customer_entity.js +0 -21
  293. package/dist/migration/payment/1690368777929-customer_organisation.js +0 -13
  294. package/dist/migration/payment/1690368949313-customer_organisation_notnull.js +0 -15
  295. package/dist/migration/payment/1692783372591-tokenisation_provider.js +0 -13
  296. package/dist/migration/payment/1692784096414-tokenisation_provider_links.js +0 -21
  297. package/dist/migration/payment/1695209857606-refund.js +0 -23
  298. package/dist/migration/payment/1695368446155-refund_org.js +0 -15
  299. package/dist/migration/payment/1695734492122-transaction_tracing.js +0 -15
  300. package/dist/migration/payment/1695986876527-refund_failure_reason.js +0 -15
  301. package/dist/migration/payment/1698312655310-swap_pk_refunds.js +0 -23
  302. package/dist/migration/payment/1701960843276-customer_fields.js +0 -19
  303. package/dist/migration/payment/1702583802282-status_grouping.js +0 -13
  304. package/dist/migration/payment/1704881345200-surcharge_table.js +0 -15
  305. package/dist/migration/payment/1705495053739-org_tokenisation_provider.js +0 -17
  306. package/dist/migration/payment/1707862771162-transaction_ris.js +0 -16
  307. package/dist/migration/payment/1707863333445-transaction_risk_fix.js +0 -13
  308. package/dist/migration/reference/1660724885440-countries.js +0 -13
  309. package/dist/migration/saltedge/1674567015124-saltedge_entities.js +0 -41
  310. package/dist/migration/saltedge/1674569837946-saltedge_last_updated_at.js +0 -13
  311. package/dist/migration/saltedge/1674572364647-saltedge_update_transaction_ibans.js +0 -21
  312. package/dist/migration/saltedge/1678721742595-saltedge_currencies.js +0 -17
  313. package/dist/migration/saltedge/1679405632954-saltedge_lead.js +0 -15
  314. package/dist/migration/saltedge/1679499976511-connection_to_lead.js +0 -17
  315. package/dist/migration/saltedge/1679500440910-account_to_lead.js +0 -15
  316. package/dist/migration/saltedge/1679670597259-saltedge_connection_status.js +0 -13
  317. package/dist/migration/saltedge/1680523636126-saltedge_tx_updates.js +0 -33
  318. package/dist/migration/saltedge/1680526517354-saltedge_tx_type_nullable.js +0 -15
  319. package/dist/migration/saltedge/1680530730952-saltedge_tx_disbursal.js +0 -15
  320. package/dist/migration/saltedge/1686156816151-saltedge_multi_account.js +0 -21
  321. package/dist/migration/saltedge/1686157077928-saltedge_multi_account_fix.js +0 -19
  322. package/dist/migration/saltedge/1686218317938-saltedge_account_nickname.js +0 -13
  323. package/dist/migration/saltedge/1699281692894-ai_fields.js +0 -23
  324. package/dist/migration/scratch/1651181353263-scratch_abta_members.js +0 -13
  325. package/dist/migration/scratch/1651183064044-scratch_abta_members_fix.js +0 -19
  326. package/dist/migration/scratch/1651183188924-scratch_abta_members_length_fix.js +0 -19
  327. package/dist/migration/scratch/1651187490208-scratch_abta_members_financials.js +0 -23
  328. package/dist/migration/scratch/1651223911459-scratch_abta_members_company_number.js +0 -13
  329. package/dist/migration/scratch/1651225059114-scratch_abta_members_atol.js +0 -14
  330. package/dist/migration/scratch/1651225316981-scratch_abta_members_atol_fix.js +0 -15
  331. package/dist/migration/scratch/1651241112556-scratch_abta_members_atol_group.js +0 -13
  332. package/dist/migration/scratch/1651241351537-scratch_abta_members_atol_tta_id.js +0 -15
  333. package/dist/migration/token/1645613145774-token.js +0 -15
  334. package/dist/migration/token/1645618345963-token_secret_length.js +0 -15
  335. package/dist/migration/token/1645621420506-token_user.js +0 -17
  336. package/dist/migration/token/1656064704919-token_entity_timezones.js +0 -21
  337. package/dist/migration/total-processing/1644309449035-tpro_transactions.js +0 -13
  338. package/dist/migration/total-processing/1644411639660-total_processing_entity.js +0 -13
  339. package/dist/migration/total-processing/1644842797566-relations.js +0 -19
  340. package/dist/migration/total-processing/1644926407236-tp_rec_nullable.js +0 -13
  341. package/dist/migration/total-processing/1644933594682-tp_rec_status.js +0 -13
  342. package/dist/migration/total-processing/1645010756173-tp_transaction_metadata.js +0 -15
  343. package/dist/migration/total-processing/1663945952356-tpmessagecode.js +0 -15
  344. package/dist/migration/total-processing/1664533758035-tp_transaction_batch_number.js +0 -13
  345. package/dist/migration/total-processing/1669385847562-tp_transaction_id.js +0 -13
  346. package/dist/migration/total-processing/1689160105601-total_uuid.js +0 -13
  347. package/dist/migration/total-processing/1689161863334-total_nullable_merchant_account_number.js +0 -12
  348. package/dist/migration/trust-payments/1644016335590-tp_merchants.js +0 -13
  349. package/dist/migration/trust-payments/1644018105481-tp_add_batch.js +0 -15
  350. package/dist/migration/trust-payments/1644020330502-tp_transaction.js +0 -17
  351. package/dist/migration/trust-payments/1644791277717-chargeback.js +0 -15
  352. package/dist/migration/trust-payments/1648137333608-trust_chargeback_due.js +0 -13
  353. package/dist/migration/trust-payments/1648204597084-trust_ftp_log.js +0 -13
  354. package/dist/migration/trust-payments/1648218902763-trust_charges.js +0 -15
  355. package/dist/migration/trust-payments/1648717679150-trust_account_fees.js +0 -15
  356. package/dist/migration/trust-payments/1653905489904-trust_adjustment.js +0 -13
  357. package/dist/migration/trust-payments/1653905701399-trust_adjustment_merchant_number.js +0 -15
  358. package/dist/migration/trust-payments/1653911779226-trust_adjustment_bank_ref.js +0 -15
  359. package/dist/migration/trust-payments/1660211087722-trust_in_omnipay.js +0 -13
  360. package/dist/migration/trust-payments/1663666433231-trust_rolling_reserve.js +0 -13
  361. package/dist/migration/trust-payments/1664533949460-trust_transaction_batch_number_fix.js +0 -15
  362. package/dist/migration/trust-payments/1686301976291-trust_settlement_amount.js +0 -13
  363. package/dist/migration/trust-payments/1686303440691-trust_settlement_currency.js +0 -13
  364. package/dist/migration/trust-payments/1688382475027-trust_always_scrape.js +0 -13
  365. package/dist/migration/trust-payments/1688382817741-trust_import_transactions.js +0 -13
  366. package/dist/migration/trust-payments/1688461589610-trust_organisation_mapping.js +0 -15
  367. package/dist/migration/user/1641774481300-initial.js +0 -27
  368. package/dist/migration/user/1641829697638-add_parent_org.js +0 -25
  369. package/dist/migration/user/1641901624008-add_roles.js +0 -21
  370. package/dist/migration/user/1641903059924-add_roles_kyc.js +0 -13
  371. package/dist/migration/user/1641903425025-roles-defaults.js +0 -15
  372. package/dist/migration/user/1641939221103-feature.js +0 -13
  373. package/dist/migration/user/1642019067334-organisation-feature.js +0 -17
  374. package/dist/migration/user/1642078564295-user-activity-relation.js +0 -16
  375. package/dist/migration/user/1642207858247-fix-user-constraint.js +0 -19
  376. package/dist/migration/user/1643154226214-user-cognito-sub.js +0 -15
  377. package/dist/migration/user/1643195417761-user-nullable-mobile.js +0 -13
  378. package/dist/migration/user/1643296114720-user-login-link.js +0 -15
  379. package/dist/migration/user/1643323827662-login-link-used.js +0 -13
  380. package/dist/migration/user/1645621100580-user_is_api_user.js +0 -13
  381. package/dist/migration/user/1651582800086-organisation_image.js +0 -13
  382. package/dist/migration/user/1656057725099-timezoned_users.js +0 -22
  383. package/dist/migration/user/1656062997392-nullable_user_email.js +0 -13
  384. package/dist/migration/user/1656063685417-nullable_user_names.js +0 -15
  385. package/dist/migration/user/1658920205370-org_legacy_id.js +0 -13
  386. package/dist/migration/user/1659017405242-password_changed.js +0 -12
  387. package/dist/migration/user/1659017792935-audit.js +0 -27
  388. package/dist/migration/user/1659081328054-uuid_id_string.js +0 -19
  389. package/dist/migration/user/1660126405407-webhooks.js +0 -26
  390. package/dist/migration/user/1660170110686-webhook_child_orgs.js +0 -21
  391. package/dist/migration/user/1664880667093-organisation_payout_config.js +0 -15
  392. package/dist/migration/user/1669151569675-organisation_type.js +0 -17
  393. package/dist/migration/user/1684418112293-org_unpaid_invoice.js +0 -13
  394. package/dist/migration/user/1684765687786-org_partner_table.js +0 -17
  395. package/dist/migration/user/1688040388864-org_billing_enabled.js +0 -13
  396. package/dist/migration/user/1692182636537-organisation_archive.js +0 -13
  397. package/dist/migration/user/1694768586499-feature_descriptions.js +0 -13
  398. package/dist/migration/user/1694771670423-feature_is_beta.js +0 -13
  399. package/dist/migration/user/1695127749722-dependent_feature.js +0 -13
  400. package/dist/migration/user/1696844776497-webhook_log.js +0 -15
  401. package/dist/migration/user/1704271899435-webhook_response.js +0 -15
  402. package/dist/migration/user/1712740853812-surcharging_enabled.js +0 -13
  403. package/dist/model/index.js +0 -45
  404. package/dist/model/response/index.js +0 -159
  405. package/dist/model/response/status-codes.js +0 -74
  406. package/dist/model/status/index.js +0 -80
  407. package/dist/model/webhook/refund/index.js +0 -30
  408. package/dist/model/webhook/transaction/index.js +0 -50
  409. package/dist/service/audit-logger.js +0 -37
  410. package/dist/service/authentication.js +0 -168
  411. package/dist/service/event-bridge.js +0 -41
  412. package/dist/service/http.js +0 -53
  413. package/dist/service/logger.js +0 -238
  414. package/dist/service/payment-initiation-object/index.js +0 -101
  415. package/dist/service/request.js +0 -355
  416. package/dist/service/secrets.js +0 -44
  417. package/dist/service/user.js +0 -74
  418. package/dist/service/warehouse.js +0 -99
  419. package/dist/util/lambda-termination.js +0 -39
  420. package/dist/util/promisified-delay.js +0 -59
  421. package/dist/wrapper/index.js +0 -145
@@ -1,355 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.REQUEST_TYPES = exports.HTTP_METHODS_WITH_PAYLOADS = exports.HTTP_METHODS_WITHOUT_PAYLOADS = void 0;
7
-
8
- var _querystring = _interopRequireDefault(require("querystring"));
9
-
10
- var _moment = _interopRequireDefault(require("moment"));
11
-
12
- var _useragent = _interopRequireDefault(require("useragent"));
13
-
14
- var _validate = _interopRequireDefault(require("validate.js/validate"));
15
-
16
- var _xml2js = _interopRequireDefault(require("xml2js"));
17
-
18
- var _dependencies = require("../config/dependencies");
19
-
20
- var _dependencyAware = _interopRequireDefault(require("../dependency-injection/dependency-aware"));
21
-
22
- var _response = _interopRequireDefault(require("../model/response"));
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
- /* eslint-disable class-methods-use-this */
27
-
28
- /* eslint-disable sonarjs/no-duplicate-string */
29
- _validate.default.extend(_validate.default.validators.datetime, {
30
- parse: value => +_moment.default.utc(value),
31
- format: (value, options) => _moment.default.utc(value).format(options.dateOnly ? 'YYYY-MM-DD' : 'YYYY-MM-DD hh:mm:ss')
32
- });
33
-
34
- const REQUEST_TYPES = exports.REQUEST_TYPES = {
35
- DELETE: 'DELETE',
36
- GET: 'GET',
37
- HEAD: 'HEAD',
38
- OPTIONS: 'OPTIONS',
39
- PATCH: 'PATCH',
40
- POST: 'POST',
41
- PUT: 'PUT'
42
- };
43
- const HTTP_METHODS_WITHOUT_PAYLOADS = exports.HTTP_METHODS_WITHOUT_PAYLOADS = [REQUEST_TYPES.DELETE, REQUEST_TYPES.GET, REQUEST_TYPES.HEAD, REQUEST_TYPES.OPTIONS];
44
- const HTTP_METHODS_WITH_PAYLOADS = exports.HTTP_METHODS_WITH_PAYLOADS = [REQUEST_TYPES.PATCH, REQUEST_TYPES.POST, REQUEST_TYPES.PUT];
45
- /**
46
- * RequestService class
47
- */
48
-
49
- class Request extends _dependencyAware.default {
50
- /**
51
- * Get a parameter from the request.
52
- *
53
- * @param parameter
54
- * @param ifNull
55
- * @param requestType
56
- */
57
- get(parameter, ifNull = null, requestType = null) {
58
- const queryParameters = this.getAll(requestType);
59
-
60
- if (queryParameters === null) {
61
- return ifNull;
62
- }
63
-
64
- return typeof queryParameters[parameter] !== 'undefined' ? queryParameters[parameter] : ifNull;
65
- }
66
- /**
67
- * Get all HTTP headers included in the request.
68
- *
69
- * @returns {object} An object with a key for each header.
70
- */
71
-
72
-
73
- getAllHeaders() {
74
- return { ...this.getContainer().getEvent().headers
75
- };
76
- }
77
- /**
78
- * Get an HTTP header from the request.
79
- *
80
- * The header name is case-insensitive.
81
- *
82
- * @param {string} name The name of the header.
83
- * @param {string} [whenMissing] Value to return if the header is missing.
84
- * (default: empty string)
85
- *
86
- * @returns {string}
87
- */
88
-
89
-
90
- getHeader(name, whenMissing = '') {
91
- const headers = this.getAllHeaders();
92
-
93
- if (!headers) {
94
- return whenMissing;
95
- }
96
-
97
- const lowerName = name.toLowerCase();
98
- const key = Object.keys(headers).find(k => k.toLowerCase() === lowerName);
99
- return key && headers[key] || whenMissing;
100
- }
101
- /**
102
- * Get authorization token
103
- *
104
- * @returns {*}
105
- */
106
-
107
-
108
- getAuthorizationToken() {
109
- const authorization = this.getHeader('Authorization');
110
-
111
- if (!authorization) {
112
- return null;
113
- }
114
-
115
- const tokenParts = authorization.split(' ');
116
- const tokenValue = tokenParts[1];
117
-
118
- if (!(tokenParts[0].toLowerCase() === 'bearer' && tokenValue)) {
119
- return null;
120
- }
121
-
122
- return tokenValue;
123
- }
124
- /**
125
- * Get a path parameter
126
- *
127
- * @param parameter
128
- * @param ifNull mixed
129
- */
130
-
131
-
132
- getPathParameter(parameter = null, ifNull = {}) {
133
- const event = this.getContainer().getEvent(); // If no parameter has been requested, return all path parameters
134
-
135
- if (parameter === null && typeof event.pathParameters === 'object') {
136
- return event.pathParameters;
137
- } // If a specifc parameter has been requested, return the parameter if it exists
138
-
139
-
140
- if (typeof parameter === 'string' && typeof event.pathParameters === 'object' && event.pathParameters !== null && typeof event.pathParameters[parameter] !== 'undefined') {
141
- return event.pathParameters[parameter];
142
- }
143
-
144
- return ifNull;
145
- }
146
- /**
147
- * Get all request parameters
148
- *
149
- * @param requestType
150
- * @returns {{}}
151
- */
152
- // eslint-disable-next-line sonarjs/cognitive-complexity
153
-
154
-
155
- getAll(requestType = null) {
156
- const event = this.getContainer().getEvent();
157
-
158
- if (HTTP_METHODS_WITHOUT_PAYLOADS.includes(event.httpMethod) || HTTP_METHODS_WITHOUT_PAYLOADS.includes(requestType)) {
159
- // get simple parameters
160
- const params = { ...event.queryStringParameters
161
- }; // add array parameters as arrays
162
-
163
- Object.keys(params).filter(key => key.endsWith('[]')).forEach(key => {
164
- params[key] = event.multiValueQueryStringParameters[key];
165
- });
166
- return params;
167
- }
168
-
169
- if (HTTP_METHODS_WITH_PAYLOADS.includes(event.httpMethod) || HTTP_METHODS_WITH_PAYLOADS.includes(requestType)) {
170
- const contentType = this.getHeader('Content-Type', this.getHeader('content-type'));
171
- let queryParameters = {};
172
-
173
- if (contentType.includes('application/x-www-form-urlencoded')) {
174
- queryParameters = _querystring.default.parse(event.body);
175
- }
176
-
177
- if (contentType.includes('application/json')) {
178
- try {
179
- if (typeof event.body === 'object') {
180
- queryParameters = event.body;
181
- } else {
182
- queryParameters = JSON.parse(event.body);
183
- }
184
- } catch (error) {
185
- console.log('application/json parse error', error);
186
- queryParameters = {};
187
- }
188
- }
189
-
190
- if (contentType.includes('text/xml')) {
191
- _xml2js.default.parseString(event.body, (error, result) => {
192
- queryParameters = error ? {} : result;
193
- });
194
- }
195
-
196
- if (contentType.includes('multipart/form-data')) {
197
- queryParameters = this.parseForm(true);
198
- }
199
-
200
- return queryParameters;
201
- }
202
-
203
- return null;
204
- }
205
- /**
206
- * Fetch the request IP address
207
- *
208
- * @returns {*}
209
- */
210
-
211
-
212
- getIp() {
213
- const event = this.getContainer().getEvent();
214
-
215
- if (typeof event.requestContext !== 'undefined' && typeof event.requestContext.identity !== 'undefined' && typeof event.requestContext.identity.sourceIp !== 'undefined') {
216
- return event.requestContext.identity.sourceIp;
217
- }
218
-
219
- return null;
220
- }
221
- /**
222
- * Get user agent
223
- *
224
- * @returns {*}
225
- */
226
-
227
-
228
- getUserBrowserAndDevice() {
229
- const userAgent = this.getHeader('user-agent', null);
230
-
231
- if (userAgent === null) {
232
- return null;
233
- }
234
-
235
- try {
236
- const agent = _useragent.default.parse(userAgent);
237
-
238
- const os = agent.os.toJSON();
239
- return {
240
- 'browser-type': agent.family,
241
- 'browser-version': agent.toVersion(),
242
- 'device-type': agent.device.family,
243
- 'operating-system': os.family,
244
- 'operating-system-version': agent.os.toVersion()
245
- };
246
- } catch (error) {
247
- this.getContainer().get(_dependencies.DEFINITIONS.LOGGER).label('user-agent-parsing-failed');
248
- return null;
249
- }
250
- }
251
- /**
252
- * Test a request against validation constraints
253
- *
254
- * @param constraints
255
- * @returns {Promise<any>}
256
- */
257
-
258
-
259
- validateAgainstConstraints(constraints) {
260
- const Logger = this.getContainer().get(_dependencies.DEFINITIONS.LOGGER);
261
- return new Promise((resolve, reject) => {
262
- const validation = (0, _validate.default)(this.getAll(), constraints);
263
-
264
- if (typeof validation === 'undefined') {
265
- resolve();
266
- } else {
267
- Logger.label('request-validation-failed');
268
- const validationErrorResponse = new _response.default({}, 422);
269
- Object.keys(validation).forEach(validationKey => {
270
- validation[validationKey].forEach(message => {
271
- validationErrorResponse.addError({
272
- title: 'Validation Error',
273
- message,
274
- documentation_url: 'https://developers.felloh.com/errors#error-responses',
275
- type: 'validation',
276
- code: `validation.${validationKey}`
277
- });
278
- });
279
- });
280
- reject(validationErrorResponse);
281
- }
282
- });
283
- }
284
- /**
285
- * Fetch the request multipart form
286
- *
287
- * @param useBuffer
288
- * @returns {*}
289
- */
290
-
291
-
292
- parseForm(useBuffer) {
293
- const event = this.getContainer().getEvent();
294
- const boundary = this.getBoundary(event);
295
- const body = event.isBase64Encoded ? Buffer.from(event.body, 'base64').toString('binary').trim() : event.body;
296
- const result = {};
297
- body.split(boundary).forEach(item => {
298
- if (/filename=".+"/g.test(item)) {
299
- result[item.match(/name=".+";/g)[0].slice(6, -2)] = {
300
- type: 'file',
301
- filename: item.match(/filename=".+"/g)[0].slice(10, -1),
302
- contentType: item.match(/Content-Type:\s.+/g)[0].slice(14),
303
- content: useBuffer ? Buffer.from(item.slice(item.search(/Content-Type:\s.+/g) + item.match(/Content-Type:\s.+/g)[0].length + 4, -4), 'binary') : item.slice(item.search(/Content-Type:\s.+/g) + item.match(/Content-Type:\s.+/g)[0].length + 4, -4)
304
- };
305
- } else if (/name=".+"/g.test(item)) {
306
- result[item.match(/name=".+"/g)[0].slice(6, -1)] = item.slice(item.search(/name=".+"/g) + item.match(/name=".+"/g)[0].length + 4, -4);
307
- }
308
- });
309
- return result;
310
- }
311
- /**
312
- * Fetch the request AWS event Records
313
- *
314
- * @returns {*}
315
- */
316
-
317
-
318
- getAWSRecords() {
319
- const event = this.getContainer().getEvent();
320
- const eventRecord = event.Records && event.Records[0];
321
-
322
- if (typeof event.Records !== 'undefined' && typeof event.Records[0] !== 'undefined' && typeof eventRecord.eventSource !== 'undefined') {
323
- return eventRecord;
324
- }
325
-
326
- return null;
327
- }
328
- /**
329
- * Gets a value independently from
330
- * the case of the key
331
- *
332
- * @param object
333
- * @param key
334
- */
335
-
336
-
337
- getValueIgnoringKeyCase(object, key) {
338
- const foundKey = Object.keys(object).find(currentKey => currentKey.toLocaleLowerCase() === key.toLowerCase());
339
- return object[foundKey];
340
- }
341
- /**
342
- * Returns the content type
343
- * assoiated with the request
344
- *
345
- * @param event
346
- */
347
-
348
-
349
- getBoundary(event) {
350
- return this.getValueIgnoringKeyCase(event.headers, 'Content-Type').split('=')[1];
351
- }
352
-
353
- }
354
-
355
- exports.default = Request;
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _clientSecretsManager = require("@aws-sdk/client-secrets-manager");
9
-
10
- var _dependencyAware = _interopRequireDefault(require("../dependency-injection/dependency-aware"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const client = new _clientSecretsManager.SecretsManagerClient({
15
- region: process.env.REGION
16
- });
17
- const cache = {};
18
- /**
19
- * Event Bridge Service
20
- */
21
-
22
- class Secrets extends _dependencyAware.default {
23
- constructor() {
24
- super();
25
- this.initalised = false;
26
- }
27
-
28
- async get(arn) {
29
- this.initalised = true;
30
-
31
- if (cache[arn]) {
32
- return cache[arn];
33
- }
34
-
35
- const response = await client.send(new _clientSecretsManager.GetSecretValueCommand({
36
- SecretId: arn
37
- }));
38
- cache[arn] = JSON.parse(response.SecretString);
39
- return cache[arn];
40
- }
41
-
42
- }
43
-
44
- exports.default = Secrets;
@@ -1,74 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _dependencies = require("../config/dependencies");
9
-
10
- var _dependencyAware = _interopRequireDefault(require("../dependency-injection/dependency-aware"));
11
-
12
- var _user = _interopRequireDefault(require("../entity/user/user"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- // eslint-disable-next-line import/no-named-as-default,import/no-named-as-default-member
17
-
18
- /**
19
- * User Service class
20
- */
21
- class User extends _dependencyAware.default {
22
- constructor(di) {
23
- super(di);
24
- this.initialised = false;
25
- const that = this;
26
-
27
- this.initialise = async () => {
28
- if (that.initialised === false) {
29
- const warehouse = di.get(_dependencies.DEFINITIONS.WAREHOUSE);
30
- that.connection = await warehouse.connect();
31
- this.initialised = true;
32
- this.userRepository = await that.connection.getRepository(_user.default);
33
- }
34
- };
35
- }
36
- /**
37
- * Fetch
38
- * @returns {Promise<*>}
39
- */
40
-
41
-
42
- async getUser() {
43
- await this.initialise();
44
-
45
- if (typeof process.env.IS_OFFLINE !== 'undefined') {
46
- var _this$di$getEvent$req, _this$di$getEvent$req2, _this$di$getEvent$req3, _this$di$getEvent$req4, _this$di$getEvent$req5, _this$di$getEvent$req6;
47
-
48
- const sub = (_this$di$getEvent$req = this.di.getEvent().requestContext) === null || _this$di$getEvent$req === void 0 ? void 0 : (_this$di$getEvent$req2 = _this$di$getEvent$req.authorizer) === null || _this$di$getEvent$req2 === void 0 ? void 0 : (_this$di$getEvent$req3 = _this$di$getEvent$req2.claims) === null || _this$di$getEvent$req3 === void 0 ? void 0 : _this$di$getEvent$req3.sub;
49
-
50
- if (typeof sub !== 'undefined') {
51
- return this.userRepository.findOne({
52
- cognito_sub: sub
53
- }, {
54
- relations: ['organisations']
55
- });
56
- }
57
-
58
- const userID = (_this$di$getEvent$req4 = this.di.getEvent().requestContext) === null || _this$di$getEvent$req4 === void 0 ? void 0 : (_this$di$getEvent$req5 = _this$di$getEvent$req4.authorizer) === null || _this$di$getEvent$req5 === void 0 ? void 0 : (_this$di$getEvent$req6 = _this$di$getEvent$req5.claims) === null || _this$di$getEvent$req6 === void 0 ? void 0 : _this$di$getEvent$req6.user_id;
59
-
60
- if (typeof userID !== 'undefined') {
61
- return this.userRepository.findOne({
62
- id: userID
63
- }, {
64
- relations: ['organisations']
65
- });
66
- }
67
- }
68
-
69
- return JSON.parse(this.di.getEvent().requestContext.authorizer.user);
70
- }
71
-
72
- }
73
-
74
- exports.default = User;
@@ -1,99 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _typeorm = require("typeorm");
9
-
10
- var _typeormAuroraDataApiDriver = _interopRequireDefault(require("typeorm-aurora-data-api-driver"));
11
-
12
- var _dependencies = require("../config/dependencies");
13
-
14
- var _dependencyAware = _interopRequireDefault(require("../dependency-injection/dependency-aware"));
15
-
16
- var _entity = _interopRequireDefault(require("../entity"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- // eslint-disable-line no-unused-vars
21
-
22
- /**
23
- * Warehouse Service
24
- */
25
- class Warehouse extends _dependencyAware.default {
26
- /**
27
- * Warehouse Constructor
28
- */
29
- constructor(di) {
30
- super(di);
31
- this.connection = null;
32
- }
33
- /**
34
- * Connect to the warehouse
35
- * @param database
36
- * @param cache
37
- * @returns {Promise<null>}
38
- */
39
-
40
-
41
- async connect(database = null, cache = true) {
42
- if (this.connection && cache === true) {
43
- return this.connection;
44
- }
45
-
46
- try {
47
- this.connection = await (0, _typeorm.getConnection)();
48
- } catch (error) {
49
- const connectionParams = {
50
- entities: _entity.default,
51
- schema: process.env.WAREHOUSE_SCHEMA,
52
- logging: process.env.DB_LOGGING !== 'undefined' && process.env.DB_LOGGING === 'true'
53
- };
54
-
55
- if (process.env.WAREHOUSE_TYPE === 'postgres-ssm') {
56
- const secretsManager = this.di.get(_dependencies.DEFINITIONS.SECRETS);
57
- const credentials = await secretsManager.get(process.env.DB_CREDS_ARN);
58
- connectionParams.type = credentials.engine;
59
- connectionParams.host = credentials.host;
60
- connectionParams.port = credentials.port;
61
- connectionParams.username = credentials.username;
62
- connectionParams.password = credentials.password;
63
- connectionParams.database = database || credentials.dbname;
64
- connectionParams.ssl = true;
65
- } else if (process.env.WAREHOUSE_TYPE === 'postgres') {
66
- connectionParams.type = 'postgres';
67
- connectionParams.host = process.env.WAREHOUSE_HOST;
68
- connectionParams.port = 5432;
69
- connectionParams.username = process.env.WAREHOUSE_USERNAME;
70
- connectionParams.password = process.env.WAREHOUSE_PASSWORD;
71
- connectionParams.database = database || process.env.WAREHOUSE_DATABASE;
72
- connectionParams.ssl = true;
73
- } else {
74
- connectionParams.type = 'aurora-data-api-pg';
75
- connectionParams.secretArn = process.env.WAREHOUSE_SECRET_ARN;
76
- connectionParams.resourceArn = process.env.WAREHOUSE_ARN;
77
- connectionParams.region = process.env.REGION;
78
- connectionParams.database = database || process.env.WAREHOUSE_DATABASE;
79
- }
80
-
81
- this.connection = await (0, _typeorm.createConnection)(connectionParams);
82
- }
83
-
84
- return this.connection;
85
- }
86
- /**
87
- * Check that a connection can be made to the DB
88
- * @returns {Promise<void>}
89
- */
90
-
91
-
92
- async status() {
93
- await this.connect();
94
- await this.connection.manager.query('SELECT schema_name FROM information_schema.schemata');
95
- }
96
-
97
- }
98
-
99
- exports.default = Warehouse;
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- /**
9
- *
10
- */
11
- class LambdaTermination extends Error {
12
- /**
13
- * Triggers a Lambda Termination.
14
- * Offers developer details (that are logged)
15
- * an code for the Lambda and a front facing
16
- * consumer message.
17
- *
18
- * @param {object|string} internal
19
- * @param {number?} code
20
- * @param {object|string?} body
21
- * @param details
22
- */
23
- constructor(internal, code = 500, body = null, details = 'unknown error') {
24
- let stringified = internal;
25
-
26
- if (typeof internal !== 'string') {
27
- stringified = JSON.stringify(internal);
28
- }
29
-
30
- super(stringified);
31
- this.internal = internal;
32
- this.code = code;
33
- this.body = body || 'unknown error';
34
- this.details = details;
35
- }
36
-
37
- }
38
-
39
- exports.default = LambdaTermination;
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- const STANDARD_LATENCY_DELAYS = {
8
- 2000: 70,
9
- 3500: 15,
10
- 4000: 10,
11
- 5000: 5
12
- };
13
- const HIGH_LATENCY_DELAYS = {
14
- 2000: 65,
15
- 3500: 15,
16
- 4000: 9,
17
- 5000: 5,
18
- 10000: 5,
19
- 20000: 1
20
- };
21
- /**
22
- * PromisifiedDelay class
23
- */
24
-
25
- class PromisifiedDelay {
26
- /**
27
- * PromisifiedDelay constructor
28
- *
29
- * @param highLatency
30
- */
31
- constructor(highLatency = true) {
32
- this.delays = [];
33
- const delayArray = highLatency === true ? HIGH_LATENCY_DELAYS : STANDARD_LATENCY_DELAYS;
34
- Object.keys(delayArray).forEach(delayDuration => {
35
- const delayIterations = delayArray[delayDuration];
36
-
37
- for (let i = 0; i < delayIterations; i += 1) {
38
- this.delays.push(delayDuration);
39
- }
40
- });
41
- }
42
- /**
43
- * Create a promisified delay
44
- *
45
- * @returns {Promise<any>}
46
- */
47
-
48
-
49
- get() {
50
- return new Promise(resolve => {
51
- setTimeout(() => {
52
- resolve();
53
- }, this.delays[Math.floor(Math.random() * this.delays.length)]);
54
- });
55
- }
56
-
57
- }
58
-
59
- exports.default = PromisifiedDelay;