@moovio/sdk 0.11.5 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) hide show
  1. package/FUNCTIONS.md +1 -82
  2. package/README.md +13 -505
  3. package/bin/mcp-server.js +1920 -1583
  4. package/bin/mcp-server.js.map +160 -150
  5. package/docs/sdks/accounts/README.md +16 -180
  6. package/docs/sdks/adjustments/README.md +6 -6
  7. package/docs/sdks/applepay/README.md +12 -12
  8. package/docs/sdks/bankaccounts/README.md +36 -36
  9. package/docs/sdks/branding/README.md +8 -8
  10. package/docs/sdks/capabilities/README.md +10 -10
  11. package/docs/sdks/cardissuing/README.md +22 -38
  12. package/docs/sdks/cards/README.md +10 -40
  13. package/docs/sdks/disputes/README.md +54 -54
  14. package/docs/sdks/enrichedprofile/README.md +2 -2
  15. package/docs/sdks/feeplans/README.md +16 -16
  16. package/docs/sdks/files/README.md +8 -8
  17. package/docs/sdks/industries/README.md +4 -4
  18. package/docs/sdks/issuingtransactions/README.md +16 -16
  19. package/docs/sdks/onboarding/README.md +2 -170
  20. package/docs/sdks/paymentlinks/README.md +16 -74
  21. package/docs/sdks/paymentmethods/README.md +6 -6
  22. package/docs/sdks/receipts/README.md +4 -14
  23. package/docs/sdks/representatives/README.md +18 -26
  24. package/docs/sdks/scheduling/README.md +34 -34
  25. package/docs/sdks/sweeps/README.md +22 -22
  26. package/docs/sdks/transfers/README.md +50 -96
  27. package/docs/sdks/underwriting/README.md +30 -30
  28. package/docs/sdks/wallets/README.md +6 -6
  29. package/docs/sdks/wallettransactions/README.md +10 -10
  30. package/funcs/accountTerminalApplicationsGet.js +2 -0
  31. package/funcs/accountTerminalApplicationsGet.js.map +1 -1
  32. package/funcs/accountTerminalApplicationsGetConfiguration.js +2 -0
  33. package/funcs/accountTerminalApplicationsGetConfiguration.js.map +1 -1
  34. package/funcs/accountTerminalApplicationsLink.js +2 -0
  35. package/funcs/accountTerminalApplicationsLink.js.map +1 -1
  36. package/funcs/accountTerminalApplicationsList.js +2 -0
  37. package/funcs/accountTerminalApplicationsList.js.map +1 -1
  38. package/funcs/accountsAssignCountries.js +2 -0
  39. package/funcs/accountsAssignCountries.js.map +1 -1
  40. package/funcs/accountsCreate.js +2 -0
  41. package/funcs/accountsCreate.js.map +1 -1
  42. package/funcs/accountsDisconnect.js +2 -0
  43. package/funcs/accountsDisconnect.js.map +1 -1
  44. package/funcs/accountsGet.js +2 -0
  45. package/funcs/accountsGet.js.map +1 -1
  46. package/funcs/accountsGetCountries.js +2 -0
  47. package/funcs/accountsGetCountries.js.map +1 -1
  48. package/funcs/accountsGetMerchantProcessingAgreement.js +2 -0
  49. package/funcs/accountsGetMerchantProcessingAgreement.js.map +1 -1
  50. package/funcs/accountsGetTermsOfServiceToken.js +2 -0
  51. package/funcs/accountsGetTermsOfServiceToken.js.map +1 -1
  52. package/funcs/accountsList.js +2 -0
  53. package/funcs/accountsList.js.map +1 -1
  54. package/funcs/accountsUpdate.js +2 -0
  55. package/funcs/accountsUpdate.js.map +1 -1
  56. package/funcs/adjustmentsGet.js +2 -0
  57. package/funcs/adjustmentsGet.js.map +1 -1
  58. package/funcs/adjustmentsList.js +2 -0
  59. package/funcs/adjustmentsList.js.map +1 -1
  60. package/funcs/applePayCreateSession.js +2 -0
  61. package/funcs/applePayCreateSession.js.map +1 -1
  62. package/funcs/applePayGetMerchantDomains.js +2 -0
  63. package/funcs/applePayGetMerchantDomains.js.map +1 -1
  64. package/funcs/applePayLinkToken.js +2 -0
  65. package/funcs/applePayLinkToken.js.map +1 -1
  66. package/funcs/applePayRegisterMerchantDomains.js +2 -0
  67. package/funcs/applePayRegisterMerchantDomains.js.map +1 -1
  68. package/funcs/applePayUpdateMerchantDomains.js +2 -0
  69. package/funcs/applePayUpdateMerchantDomains.js.map +1 -1
  70. package/funcs/authenticationCreateAccessToken.js +2 -0
  71. package/funcs/authenticationCreateAccessToken.js.map +1 -1
  72. package/funcs/authenticationRevokeAccessToken.js +2 -0
  73. package/funcs/authenticationRevokeAccessToken.js.map +1 -1
  74. package/funcs/avatarsGet.js +2 -0
  75. package/funcs/avatarsGet.js.map +1 -1
  76. package/funcs/bankAccountsCompleteMicroDeposits.js +2 -0
  77. package/funcs/bankAccountsCompleteMicroDeposits.js.map +1 -1
  78. package/funcs/bankAccountsCompleteVerification.js +2 -0
  79. package/funcs/bankAccountsCompleteVerification.js.map +1 -1
  80. package/funcs/bankAccountsDisable.js +2 -0
  81. package/funcs/bankAccountsDisable.js.map +1 -1
  82. package/funcs/bankAccountsGet.js +2 -0
  83. package/funcs/bankAccountsGet.js.map +1 -1
  84. package/funcs/bankAccountsGetVerification.js +2 -0
  85. package/funcs/bankAccountsGetVerification.js.map +1 -1
  86. package/funcs/bankAccountsInitiateMicroDeposits.js +2 -0
  87. package/funcs/bankAccountsInitiateMicroDeposits.js.map +1 -1
  88. package/funcs/bankAccountsInitiateVerification.js +2 -0
  89. package/funcs/bankAccountsInitiateVerification.js.map +1 -1
  90. package/funcs/bankAccountsLink.js +2 -0
  91. package/funcs/bankAccountsLink.js.map +1 -1
  92. package/funcs/bankAccountsList.js +2 -0
  93. package/funcs/bankAccountsList.js.map +1 -1
  94. package/funcs/brandingCreate.js +2 -0
  95. package/funcs/brandingCreate.js.map +1 -1
  96. package/funcs/brandingGet.js +2 -0
  97. package/funcs/brandingGet.js.map +1 -1
  98. package/funcs/brandingUpdate.js +2 -0
  99. package/funcs/brandingUpdate.js.map +1 -1
  100. package/funcs/brandingUpsert.js +2 -0
  101. package/funcs/brandingUpsert.js.map +1 -1
  102. package/funcs/capabilitiesDisable.js +2 -0
  103. package/funcs/capabilitiesDisable.js.map +1 -1
  104. package/funcs/capabilitiesGet.js +2 -0
  105. package/funcs/capabilitiesGet.js.map +1 -1
  106. package/funcs/capabilitiesList.js +2 -0
  107. package/funcs/capabilitiesList.js.map +1 -1
  108. package/funcs/capabilitiesRequest.js +2 -0
  109. package/funcs/capabilitiesRequest.js.map +1 -1
  110. package/funcs/cardIssuingGet.js +2 -0
  111. package/funcs/cardIssuingGet.js.map +1 -1
  112. package/funcs/cardIssuingGetFull.js +2 -0
  113. package/funcs/cardIssuingGetFull.js.map +1 -1
  114. package/funcs/cardIssuingList.js +2 -0
  115. package/funcs/cardIssuingList.js.map +1 -1
  116. package/funcs/cardIssuingRequest.js +2 -0
  117. package/funcs/cardIssuingRequest.js.map +1 -1
  118. package/funcs/cardIssuingUpdate.js +2 -0
  119. package/funcs/cardIssuingUpdate.js.map +1 -1
  120. package/funcs/cardsDisable.js +2 -0
  121. package/funcs/cardsDisable.js.map +1 -1
  122. package/funcs/cardsGet.js +2 -0
  123. package/funcs/cardsGet.js.map +1 -1
  124. package/funcs/cardsLink.js +2 -0
  125. package/funcs/cardsLink.js.map +1 -1
  126. package/funcs/cardsList.js +2 -0
  127. package/funcs/cardsList.js.map +1 -1
  128. package/funcs/cardsUpdate.js +2 -0
  129. package/funcs/cardsUpdate.js.map +1 -1
  130. package/funcs/disputesAccept.js +2 -0
  131. package/funcs/disputesAccept.js.map +1 -1
  132. package/funcs/disputesDeleteEvidence.js +2 -0
  133. package/funcs/disputesDeleteEvidence.js.map +1 -1
  134. package/funcs/disputesGet.js +2 -0
  135. package/funcs/disputesGet.js.map +1 -1
  136. package/funcs/disputesGetEvidence.js +2 -0
  137. package/funcs/disputesGetEvidence.js.map +1 -1
  138. package/funcs/disputesGetEvidenceData.js +2 -0
  139. package/funcs/disputesGetEvidenceData.js.map +1 -1
  140. package/funcs/disputesList.js +2 -0
  141. package/funcs/disputesList.js.map +1 -1
  142. package/funcs/disputesListEvidence.js +2 -0
  143. package/funcs/disputesListEvidence.js.map +1 -1
  144. package/funcs/disputesSubmitEvidence.js +2 -0
  145. package/funcs/disputesSubmitEvidence.js.map +1 -1
  146. package/funcs/disputesUpdateEvidence.js +2 -0
  147. package/funcs/disputesUpdateEvidence.js.map +1 -1
  148. package/funcs/disputesUploadEvidenceFile.js +2 -0
  149. package/funcs/disputesUploadEvidenceFile.js.map +1 -1
  150. package/funcs/disputesUploadEvidenceText.js +2 -0
  151. package/funcs/disputesUploadEvidenceText.js.map +1 -1
  152. package/funcs/endToEndEncryptionGenerateKey.js +2 -0
  153. package/funcs/endToEndEncryptionGenerateKey.js.map +1 -1
  154. package/funcs/endToEndEncryptionTestEncryptedToken.js +2 -0
  155. package/funcs/endToEndEncryptionTestEncryptedToken.js.map +1 -1
  156. package/funcs/enrichedAddressGet.js +2 -0
  157. package/funcs/enrichedAddressGet.js.map +1 -1
  158. package/funcs/enrichedProfileGet.js +2 -0
  159. package/funcs/enrichedProfileGet.js.map +1 -1
  160. package/funcs/feePlansCreateFeePlanAgreements.js +2 -0
  161. package/funcs/feePlansCreateFeePlanAgreements.js.map +1 -1
  162. package/funcs/feePlansListFeePlanAgreements.js +2 -0
  163. package/funcs/feePlansListFeePlanAgreements.js.map +1 -1
  164. package/funcs/feePlansListFeePlans.js +2 -0
  165. package/funcs/feePlansListFeePlans.js.map +1 -1
  166. package/funcs/feePlansListFeesFetch.js +2 -0
  167. package/funcs/feePlansListFeesFetch.js.map +1 -1
  168. package/funcs/feePlansListPartnerPricing.js +2 -0
  169. package/funcs/feePlansListPartnerPricing.js.map +1 -1
  170. package/funcs/feePlansListPartnerPricingAgreements.js +2 -0
  171. package/funcs/feePlansListPartnerPricingAgreements.js.map +1 -1
  172. package/funcs/feePlansRetrieveFees.js +2 -0
  173. package/funcs/feePlansRetrieveFees.js.map +1 -1
  174. package/funcs/filesGet.js +2 -0
  175. package/funcs/filesGet.js.map +1 -1
  176. package/funcs/filesList.js +2 -0
  177. package/funcs/filesList.js.map +1 -1
  178. package/funcs/filesUpload.js +2 -0
  179. package/funcs/filesUpload.js.map +1 -1
  180. package/funcs/industriesList.d.ts +2 -2
  181. package/funcs/industriesList.js +4 -2
  182. package/funcs/industriesList.js.map +1 -1
  183. package/funcs/institutionsSearch.js +2 -0
  184. package/funcs/institutionsSearch.js.map +1 -1
  185. package/funcs/issuingTransactionsGet.js +2 -0
  186. package/funcs/issuingTransactionsGet.js.map +1 -1
  187. package/funcs/issuingTransactionsGetAuthorization.js +2 -0
  188. package/funcs/issuingTransactionsGetAuthorization.js.map +1 -1
  189. package/funcs/issuingTransactionsList.js +2 -0
  190. package/funcs/issuingTransactionsList.js.map +1 -1
  191. package/funcs/issuingTransactionsListAuthorizationEvents.js +2 -0
  192. package/funcs/issuingTransactionsListAuthorizationEvents.js.map +1 -1
  193. package/funcs/issuingTransactionsListAuthorizations.js +2 -0
  194. package/funcs/issuingTransactionsListAuthorizations.js.map +1 -1
  195. package/funcs/onboardingCreateInvite.js +2 -0
  196. package/funcs/onboardingCreateInvite.js.map +1 -1
  197. package/funcs/onboardingGetInvite.js +2 -0
  198. package/funcs/onboardingGetInvite.js.map +1 -1
  199. package/funcs/onboardingListInvites.js +2 -0
  200. package/funcs/onboardingListInvites.js.map +1 -1
  201. package/funcs/onboardingRevokeInvite.js +2 -0
  202. package/funcs/onboardingRevokeInvite.js.map +1 -1
  203. package/funcs/paymentLinksCreate.js +2 -0
  204. package/funcs/paymentLinksCreate.js.map +1 -1
  205. package/funcs/paymentLinksDisable.js +2 -0
  206. package/funcs/paymentLinksDisable.js.map +1 -1
  207. package/funcs/paymentLinksGet.js +2 -0
  208. package/funcs/paymentLinksGet.js.map +1 -1
  209. package/funcs/paymentLinksGetQRCode.js +2 -0
  210. package/funcs/paymentLinksGetQRCode.js.map +1 -1
  211. package/funcs/paymentLinksList.js +2 -0
  212. package/funcs/paymentLinksList.js.map +1 -1
  213. package/funcs/paymentLinksUpdate.js +2 -0
  214. package/funcs/paymentLinksUpdate.js.map +1 -1
  215. package/funcs/paymentMethodsGet.js +2 -0
  216. package/funcs/paymentMethodsGet.js.map +1 -1
  217. package/funcs/paymentMethodsList.js +2 -0
  218. package/funcs/paymentMethodsList.js.map +1 -1
  219. package/funcs/pingPing.js +2 -0
  220. package/funcs/pingPing.js.map +1 -1
  221. package/funcs/receiptsCreate.js +2 -0
  222. package/funcs/receiptsCreate.js.map +1 -1
  223. package/funcs/receiptsList.js +2 -0
  224. package/funcs/receiptsList.js.map +1 -1
  225. package/funcs/representativesCreate.js +2 -0
  226. package/funcs/representativesCreate.js.map +1 -1
  227. package/funcs/representativesDelete.js +2 -0
  228. package/funcs/representativesDelete.js.map +1 -1
  229. package/funcs/representativesGet.js +2 -0
  230. package/funcs/representativesGet.js.map +1 -1
  231. package/funcs/representativesList.js +2 -0
  232. package/funcs/representativesList.js.map +1 -1
  233. package/funcs/representativesUpdate.js +2 -0
  234. package/funcs/representativesUpdate.js.map +1 -1
  235. package/funcs/schedulingCancel.js +2 -0
  236. package/funcs/schedulingCancel.js.map +1 -1
  237. package/funcs/schedulingCreate.js +2 -0
  238. package/funcs/schedulingCreate.js.map +1 -1
  239. package/funcs/schedulingGet.js +2 -0
  240. package/funcs/schedulingGet.js.map +1 -1
  241. package/funcs/schedulingGetOccurrance.js +2 -0
  242. package/funcs/schedulingGetOccurrance.js.map +1 -1
  243. package/funcs/schedulingList.js +2 -0
  244. package/funcs/schedulingList.js.map +1 -1
  245. package/funcs/schedulingUpdate.js +2 -0
  246. package/funcs/schedulingUpdate.js.map +1 -1
  247. package/funcs/sweepsCreateConfig.js +2 -0
  248. package/funcs/sweepsCreateConfig.js.map +1 -1
  249. package/funcs/sweepsGet.js +2 -0
  250. package/funcs/sweepsGet.js.map +1 -1
  251. package/funcs/sweepsGetConfig.js +2 -0
  252. package/funcs/sweepsGetConfig.js.map +1 -1
  253. package/funcs/sweepsList.js +2 -0
  254. package/funcs/sweepsList.js.map +1 -1
  255. package/funcs/sweepsListConfigs.js +2 -0
  256. package/funcs/sweepsListConfigs.js.map +1 -1
  257. package/funcs/sweepsUpdateConfig.js +2 -0
  258. package/funcs/sweepsUpdateConfig.js.map +1 -1
  259. package/funcs/terminalApplicationsCreate.js +2 -0
  260. package/funcs/terminalApplicationsCreate.js.map +1 -1
  261. package/funcs/terminalApplicationsDelete.js +2 -0
  262. package/funcs/terminalApplicationsDelete.js.map +1 -1
  263. package/funcs/terminalApplicationsGet.js +2 -0
  264. package/funcs/terminalApplicationsGet.js.map +1 -1
  265. package/funcs/terminalApplicationsList.js +2 -0
  266. package/funcs/terminalApplicationsList.js.map +1 -1
  267. package/funcs/transfersCreate.js +2 -0
  268. package/funcs/transfersCreate.js.map +1 -1
  269. package/funcs/transfersCreateCancellation.js +2 -0
  270. package/funcs/transfersCreateCancellation.js.map +1 -1
  271. package/funcs/transfersCreateReversal.js +2 -0
  272. package/funcs/transfersCreateReversal.js.map +1 -1
  273. package/funcs/transfersGenerateOptions.js +2 -0
  274. package/funcs/transfersGenerateOptions.js.map +1 -1
  275. package/funcs/transfersGet.js +2 -0
  276. package/funcs/transfersGet.js.map +1 -1
  277. package/funcs/transfersGetCancellation.js +2 -0
  278. package/funcs/transfersGetCancellation.js.map +1 -1
  279. package/funcs/transfersGetRefund.js +2 -0
  280. package/funcs/transfersGetRefund.js.map +1 -1
  281. package/funcs/transfersInitiateRefund.js +2 -0
  282. package/funcs/transfersInitiateRefund.js.map +1 -1
  283. package/funcs/transfersList.js +2 -0
  284. package/funcs/transfersList.js.map +1 -1
  285. package/funcs/transfersListRefunds.js +2 -0
  286. package/funcs/transfersListRefunds.js.map +1 -1
  287. package/funcs/transfersUpdate.js +2 -0
  288. package/funcs/transfersUpdate.js.map +1 -1
  289. package/funcs/underwritingGet.js +2 -0
  290. package/funcs/underwritingGet.js.map +1 -1
  291. package/funcs/underwritingUpsert.js +2 -0
  292. package/funcs/underwritingUpsert.js.map +1 -1
  293. package/funcs/walletTransactionsGet.js +2 -0
  294. package/funcs/walletTransactionsGet.js.map +1 -1
  295. package/funcs/walletTransactionsList.js +2 -0
  296. package/funcs/walletTransactionsList.js.map +1 -1
  297. package/funcs/walletsGet.js +2 -0
  298. package/funcs/walletsGet.js.map +1 -1
  299. package/funcs/walletsList.js +2 -0
  300. package/funcs/walletsList.js.map +1 -1
  301. package/hooks/types.d.ts +2 -0
  302. package/hooks/types.d.ts.map +1 -1
  303. package/index.d.ts +2 -0
  304. package/index.d.ts.map +1 -1
  305. package/index.js +3 -1
  306. package/index.js.map +1 -1
  307. package/jsr.json +1 -1
  308. package/lib/config.d.ts +7 -3
  309. package/lib/config.d.ts.map +1 -1
  310. package/lib/config.js +3 -3
  311. package/lib/config.js.map +1 -1
  312. package/lib/sdks.d.ts +1 -0
  313. package/lib/sdks.d.ts.map +1 -1
  314. package/lib/sdks.js +3 -3
  315. package/lib/sdks.js.map +1 -1
  316. package/mcp-server/cli/start/impl.js +4 -4
  317. package/mcp-server/cli/start/impl.js.map +1 -1
  318. package/mcp-server/mcp-server.js +1 -1
  319. package/mcp-server/server.js +1 -1
  320. package/mcp-server/tools/industriesList.js +2 -2
  321. package/models/components/enrichedindustries.d.ts +3 -3
  322. package/models/components/enrichedindustries.js +3 -3
  323. package/models/components/index.d.ts +2 -1
  324. package/models/components/index.d.ts.map +1 -1
  325. package/models/components/index.js +2 -1
  326. package/models/components/index.js.map +1 -1
  327. package/models/components/industrytaxonomy.d.ts +55 -0
  328. package/models/components/industrytaxonomy.d.ts.map +1 -0
  329. package/models/components/{enrichedindustry.js → industrytaxonomy.js} +27 -25
  330. package/models/components/industrytaxonomy.js.map +1 -0
  331. package/models/components/sweep.d.ts +6 -0
  332. package/models/components/sweep.d.ts.map +1 -1
  333. package/models/components/sweep.js +3 -0
  334. package/models/components/sweep.js.map +1 -1
  335. package/models/components/sweepsubtotal.d.ts +44 -0
  336. package/models/components/sweepsubtotal.d.ts.map +1 -0
  337. package/models/components/sweepsubtotal.js +75 -0
  338. package/models/components/sweepsubtotal.js.map +1 -0
  339. package/package.json +2 -2
  340. package/sdk/industries.d.ts +2 -2
  341. package/sdk/industries.js +2 -2
  342. package/src/funcs/accountTerminalApplicationsGet.ts +2 -0
  343. package/src/funcs/accountTerminalApplicationsGetConfiguration.ts +2 -0
  344. package/src/funcs/accountTerminalApplicationsLink.ts +2 -0
  345. package/src/funcs/accountTerminalApplicationsList.ts +2 -0
  346. package/src/funcs/accountsAssignCountries.ts +2 -0
  347. package/src/funcs/accountsCreate.ts +2 -0
  348. package/src/funcs/accountsDisconnect.ts +2 -0
  349. package/src/funcs/accountsGet.ts +2 -0
  350. package/src/funcs/accountsGetCountries.ts +2 -0
  351. package/src/funcs/accountsGetMerchantProcessingAgreement.ts +2 -0
  352. package/src/funcs/accountsGetTermsOfServiceToken.ts +2 -0
  353. package/src/funcs/accountsList.ts +2 -0
  354. package/src/funcs/accountsUpdate.ts +2 -0
  355. package/src/funcs/adjustmentsGet.ts +2 -0
  356. package/src/funcs/adjustmentsList.ts +2 -0
  357. package/src/funcs/applePayCreateSession.ts +2 -0
  358. package/src/funcs/applePayGetMerchantDomains.ts +2 -0
  359. package/src/funcs/applePayLinkToken.ts +2 -0
  360. package/src/funcs/applePayRegisterMerchantDomains.ts +2 -0
  361. package/src/funcs/applePayUpdateMerchantDomains.ts +2 -0
  362. package/src/funcs/authenticationCreateAccessToken.ts +2 -0
  363. package/src/funcs/authenticationRevokeAccessToken.ts +2 -0
  364. package/src/funcs/avatarsGet.ts +2 -0
  365. package/src/funcs/bankAccountsCompleteMicroDeposits.ts +2 -0
  366. package/src/funcs/bankAccountsCompleteVerification.ts +2 -0
  367. package/src/funcs/bankAccountsDisable.ts +2 -0
  368. package/src/funcs/bankAccountsGet.ts +2 -0
  369. package/src/funcs/bankAccountsGetVerification.ts +2 -0
  370. package/src/funcs/bankAccountsInitiateMicroDeposits.ts +2 -0
  371. package/src/funcs/bankAccountsInitiateVerification.ts +2 -0
  372. package/src/funcs/bankAccountsLink.ts +2 -0
  373. package/src/funcs/bankAccountsList.ts +2 -0
  374. package/src/funcs/brandingCreate.ts +2 -0
  375. package/src/funcs/brandingGet.ts +2 -0
  376. package/src/funcs/brandingUpdate.ts +2 -0
  377. package/src/funcs/brandingUpsert.ts +2 -0
  378. package/src/funcs/capabilitiesDisable.ts +2 -0
  379. package/src/funcs/capabilitiesGet.ts +2 -0
  380. package/src/funcs/capabilitiesList.ts +2 -0
  381. package/src/funcs/capabilitiesRequest.ts +2 -0
  382. package/src/funcs/cardIssuingGet.ts +2 -0
  383. package/src/funcs/cardIssuingGetFull.ts +2 -0
  384. package/src/funcs/cardIssuingList.ts +2 -0
  385. package/src/funcs/cardIssuingRequest.ts +2 -0
  386. package/src/funcs/cardIssuingUpdate.ts +2 -0
  387. package/src/funcs/cardsDisable.ts +2 -0
  388. package/src/funcs/cardsGet.ts +2 -0
  389. package/src/funcs/cardsLink.ts +2 -0
  390. package/src/funcs/cardsList.ts +2 -0
  391. package/src/funcs/cardsUpdate.ts +2 -0
  392. package/src/funcs/disputesAccept.ts +2 -0
  393. package/src/funcs/disputesDeleteEvidence.ts +2 -0
  394. package/src/funcs/disputesGet.ts +2 -0
  395. package/src/funcs/disputesGetEvidence.ts +2 -0
  396. package/src/funcs/disputesGetEvidenceData.ts +2 -0
  397. package/src/funcs/disputesList.ts +2 -0
  398. package/src/funcs/disputesListEvidence.ts +2 -0
  399. package/src/funcs/disputesSubmitEvidence.ts +2 -0
  400. package/src/funcs/disputesUpdateEvidence.ts +2 -0
  401. package/src/funcs/disputesUploadEvidenceFile.ts +2 -0
  402. package/src/funcs/disputesUploadEvidenceText.ts +2 -0
  403. package/src/funcs/endToEndEncryptionGenerateKey.ts +2 -0
  404. package/src/funcs/endToEndEncryptionTestEncryptedToken.ts +2 -0
  405. package/src/funcs/enrichedAddressGet.ts +2 -0
  406. package/src/funcs/enrichedProfileGet.ts +2 -0
  407. package/src/funcs/feePlansCreateFeePlanAgreements.ts +2 -0
  408. package/src/funcs/feePlansListFeePlanAgreements.ts +2 -0
  409. package/src/funcs/feePlansListFeePlans.ts +2 -0
  410. package/src/funcs/feePlansListFeesFetch.ts +2 -0
  411. package/src/funcs/feePlansListPartnerPricing.ts +2 -0
  412. package/src/funcs/feePlansListPartnerPricingAgreements.ts +2 -0
  413. package/src/funcs/feePlansRetrieveFees.ts +2 -0
  414. package/src/funcs/filesGet.ts +2 -0
  415. package/src/funcs/filesList.ts +2 -0
  416. package/src/funcs/filesUpload.ts +2 -0
  417. package/src/funcs/industriesList.ts +4 -2
  418. package/src/funcs/institutionsSearch.ts +2 -0
  419. package/src/funcs/issuingTransactionsGet.ts +2 -0
  420. package/src/funcs/issuingTransactionsGetAuthorization.ts +2 -0
  421. package/src/funcs/issuingTransactionsList.ts +2 -0
  422. package/src/funcs/issuingTransactionsListAuthorizationEvents.ts +2 -0
  423. package/src/funcs/issuingTransactionsListAuthorizations.ts +2 -0
  424. package/src/funcs/onboardingCreateInvite.ts +2 -0
  425. package/src/funcs/onboardingGetInvite.ts +2 -0
  426. package/src/funcs/onboardingListInvites.ts +2 -0
  427. package/src/funcs/onboardingRevokeInvite.ts +2 -0
  428. package/src/funcs/paymentLinksCreate.ts +2 -0
  429. package/src/funcs/paymentLinksDisable.ts +2 -0
  430. package/src/funcs/paymentLinksGet.ts +2 -0
  431. package/src/funcs/paymentLinksGetQRCode.ts +2 -0
  432. package/src/funcs/paymentLinksList.ts +2 -0
  433. package/src/funcs/paymentLinksUpdate.ts +2 -0
  434. package/src/funcs/paymentMethodsGet.ts +2 -0
  435. package/src/funcs/paymentMethodsList.ts +2 -0
  436. package/src/funcs/pingPing.ts +2 -0
  437. package/src/funcs/receiptsCreate.ts +2 -0
  438. package/src/funcs/receiptsList.ts +2 -0
  439. package/src/funcs/representativesCreate.ts +2 -0
  440. package/src/funcs/representativesDelete.ts +2 -0
  441. package/src/funcs/representativesGet.ts +2 -0
  442. package/src/funcs/representativesList.ts +2 -0
  443. package/src/funcs/representativesUpdate.ts +2 -0
  444. package/src/funcs/schedulingCancel.ts +2 -0
  445. package/src/funcs/schedulingCreate.ts +2 -0
  446. package/src/funcs/schedulingGet.ts +2 -0
  447. package/src/funcs/schedulingGetOccurrance.ts +2 -0
  448. package/src/funcs/schedulingList.ts +2 -0
  449. package/src/funcs/schedulingUpdate.ts +2 -0
  450. package/src/funcs/sweepsCreateConfig.ts +2 -0
  451. package/src/funcs/sweepsGet.ts +2 -0
  452. package/src/funcs/sweepsGetConfig.ts +2 -0
  453. package/src/funcs/sweepsList.ts +2 -0
  454. package/src/funcs/sweepsListConfigs.ts +2 -0
  455. package/src/funcs/sweepsUpdateConfig.ts +2 -0
  456. package/src/funcs/terminalApplicationsCreate.ts +2 -0
  457. package/src/funcs/terminalApplicationsDelete.ts +2 -0
  458. package/src/funcs/terminalApplicationsGet.ts +2 -0
  459. package/src/funcs/terminalApplicationsList.ts +2 -0
  460. package/src/funcs/transfersCreate.ts +2 -0
  461. package/src/funcs/transfersCreateCancellation.ts +2 -0
  462. package/src/funcs/transfersCreateReversal.ts +2 -0
  463. package/src/funcs/transfersGenerateOptions.ts +2 -0
  464. package/src/funcs/transfersGet.ts +2 -0
  465. package/src/funcs/transfersGetCancellation.ts +2 -0
  466. package/src/funcs/transfersGetRefund.ts +2 -0
  467. package/src/funcs/transfersInitiateRefund.ts +2 -0
  468. package/src/funcs/transfersList.ts +2 -0
  469. package/src/funcs/transfersListRefunds.ts +2 -0
  470. package/src/funcs/transfersUpdate.ts +2 -0
  471. package/src/funcs/underwritingGet.ts +2 -0
  472. package/src/funcs/underwritingUpsert.ts +2 -0
  473. package/src/funcs/walletTransactionsGet.ts +2 -0
  474. package/src/funcs/walletTransactionsList.ts +2 -0
  475. package/src/funcs/walletsGet.ts +2 -0
  476. package/src/funcs/walletsList.ts +2 -0
  477. package/src/hooks/types.ts +2 -0
  478. package/src/index.ts +2 -0
  479. package/src/lib/config.ts +7 -3
  480. package/src/lib/sdks.ts +10 -4
  481. package/src/mcp-server/cli/start/impl.ts +4 -4
  482. package/src/mcp-server/mcp-server.ts +1 -1
  483. package/src/mcp-server/server.ts +1 -1
  484. package/src/mcp-server/tools/industriesList.ts +2 -2
  485. package/src/models/components/enrichedindustries.ts +9 -9
  486. package/src/models/components/index.ts +2 -1
  487. package/src/models/components/industrytaxonomy.ts +100 -0
  488. package/src/models/components/sweep.ts +13 -0
  489. package/src/models/components/sweepsubtotal.ts +90 -0
  490. package/src/sdk/industries.ts +2 -2
  491. package/test/README.md +2 -0
  492. package/test/index.ts +1 -0
  493. package/test/package.json +25 -0
  494. package/test/setup.ts +119 -0
  495. package/test/tests/accounts.test.ts +127 -0
  496. package/test/tests/bankAccounts.test.ts +171 -0
  497. package/test/tests/capabilities.test.ts +147 -0
  498. package/test/tests/cards.test.ts +168 -0
  499. package/test/tests/paymentMethods.test.ts +55 -0
  500. package/test/tests/representatives.test.ts +83 -0
  501. package/test/tests/transfers.test.ts +122 -0
  502. package/test/tests/wallets.test.ts +31 -0
  503. package/test/tsconfig.json +30 -0
  504. package/test/utils/utils.ts +276 -0
  505. package/models/components/enrichedindustry.d.ts +0 -47
  506. package/models/components/enrichedindustry.d.ts.map +0 -1
  507. package/models/components/enrichedindustry.js.map +0 -1
  508. package/src/models/components/enrichedindustry.ts +0 -90
@@ -0,0 +1,127 @@
1
+ import { expect, test, describe, beforeAll } from "bun:test";
2
+ import { Chance } from "chance";
3
+ import { moov } from "../setup";
4
+ import { createAccount } from "../utils/utils";
5
+ import type { Account, AccountType } from "../../models/components";
6
+ const chance = new Chance();
7
+
8
+ let account: Account;
9
+
10
+ describe("Accounts", () => {
11
+ describe("Account creation", () => {
12
+ test("should create an account", async () => {
13
+ const legalBusinessName = `${chance.company()} ${new Date().getTime()}`;
14
+ const acc = await createAccount({
15
+ profile: {
16
+ business: {
17
+ legalBusinessName,
18
+ },
19
+ },
20
+ });
21
+
22
+ expect(acc).toBeDefined();
23
+ expect(acc.accountID).toBeDefined();
24
+ expect(acc.displayName).toEqual(legalBusinessName);
25
+ account = acc;
26
+ });
27
+ describe("Failure cases", () => {
28
+ test("should fail if the account type is not supported", async () => {
29
+ await expect(() =>
30
+ createAccount({
31
+ accountType: "not-a-valid-account-type" as AccountType,
32
+ }),
33
+ ).toThrowError();
34
+ });
35
+ });
36
+
37
+ test("should fail if we pass an empty business profile", async () => {
38
+ await expect(() =>
39
+ createAccount({
40
+ profile: {},
41
+ }),
42
+ ).toThrow();
43
+ // @TODO: Once error hanling is 100% consistent, we should be able to narrow this assertion
44
+ // Right now it's throwing a Zod validation error, but it should be a custom error instead
45
+ // ).toThrowError('API error occurred: {"error":{"profile":"business profile is required for business account"}}');
46
+ });
47
+ });
48
+
49
+ describe("Account-dependent tests", () => {
50
+ beforeAll(async () => {
51
+ if (!account) {
52
+ account = await createAccount();
53
+ }
54
+ });
55
+
56
+ describe("Account listing", () => {
57
+ test("should be able to list accounts", async () => {
58
+ const { result } = await moov.accounts.list({
59
+ name: account.displayName,
60
+ });
61
+ expect(result).toBeDefined();
62
+ expect(result.length).toBeGreaterThan(0);
63
+ expect(result[0].accountID).toEqual(account.accountID);
64
+ });
65
+
66
+ test("Should be able to filter accounts by type and status", async () => {
67
+ const { result } = await moov.accounts.list({
68
+ type: "business",
69
+ capabilityStatus: "pending",
70
+ });
71
+ expect(result).toBeDefined();
72
+ expect(result.length).toBeGreaterThan(0);
73
+ const { result: result2 } = await moov.accounts.list({
74
+ type: "individual",
75
+ capabilityStatus: "enabled",
76
+ });
77
+ expect(result2).toBeDefined();
78
+ expect(result2.length).toBeGreaterThan(0);
79
+ });
80
+
81
+ test("should be able to filter accounts by capability", async () => {
82
+ const { result } = await moov.accounts.list({
83
+ capability: "transfers",
84
+ });
85
+ expect(result).toBeDefined();
86
+ expect(result.length).toBeGreaterThan(0);
87
+ const { result: result2 } = await moov.accounts.list({
88
+ capability: "collect-funds",
89
+ });
90
+ expect(result2).toBeDefined();
91
+ expect(result2.length).toBeGreaterThan(0);
92
+ });
93
+ });
94
+
95
+ test("should be able to get an account", async () => {
96
+ const { result } = await moov.accounts.get({ accountID: account.accountID });
97
+ expect(result).toBeDefined();
98
+ expect(result.accountID).toEqual(account.accountID);
99
+ });
100
+
101
+ test("should be able to update an account", async () => {
102
+ const legalBusinessName = chance.company();
103
+ const { result } = await moov.accounts.update({
104
+ accountID: account.accountID,
105
+ createAccountUpdate: { profile: { business: { legalBusinessName } } },
106
+ });
107
+ expect(result).toBeDefined();
108
+ expect(result.accountID).toEqual(account.accountID);
109
+ expect(result.profile?.business?.legalBusinessName).toEqual(legalBusinessName);
110
+ });
111
+
112
+ test("should be able to get the terms of service token for an account", async () => {
113
+ const { result } = await moov.accounts.getTermsOfServiceToken({
114
+ origin: "https://example.com",
115
+ referer: "https://example.com",
116
+ });
117
+ expect(result).toBeDefined();
118
+ expect(result.token).toEqual(expect.any(String));
119
+ });
120
+
121
+ test("should be able to disconnect an account", async () => {
122
+ const response = await moov.accounts.disconnect({ accountID: account.accountID });
123
+ const headers = response?.headers;
124
+ expect(headers).toBeDefined();
125
+ });
126
+ });
127
+ });
@@ -0,0 +1,171 @@
1
+ import { beforeAll, beforeEach, describe, expect, test } from "bun:test";
2
+ import { ids, moov } from "../setup";
3
+ import { createAccount, createBankAccount } from "../utils/utils";
4
+ import type { BankAccount } from "../../models/components";
5
+ import { sleep } from "bun";
6
+
7
+ let accountID = "a920f147-ed53-4aa1-977c-d11cc192979c"; // default account ID
8
+ let bankAccount: Partial<BankAccount> = {};
9
+ let accountNumber = "1234567890";
10
+
11
+ describe("Bank Accounts", () => {
12
+ beforeAll(async () => {
13
+ const account = await createAccount();
14
+ accountID = account.accountID;
15
+ });
16
+
17
+ test("should be able to link a bank account", async () => {
18
+ const { result } = await moov.bankAccounts.link({
19
+ accountID,
20
+ linkBankAccount: {
21
+ account: {
22
+ holderName: "Marcellus Wallace",
23
+ holderType: "individual",
24
+ accountNumber,
25
+ bankAccountType: "checking",
26
+ routingNumber: "121000248",
27
+ },
28
+ },
29
+ });
30
+ expect(result).toBeDefined();
31
+ expect(result.bankAccountID).toBeDefined();
32
+ expect(result.bankAccountType).toEqual("checking");
33
+ bankAccount = result;
34
+ ids.seen({ accountID, bankAccountID: result.bankAccountID });
35
+ });
36
+ describe("Bank-account dependent tests", () => {
37
+ describe("Getting and listing bank accounts", () => {
38
+ // Create a bank account if it doesn't exist yet
39
+ beforeAll(async () => {
40
+ if (!bankAccount.bankAccountID) {
41
+ const result = await createBankAccount(accountID);
42
+ bankAccount = result.bankAccount;
43
+ accountNumber = result.accountNumber;
44
+ }
45
+ });
46
+ test("should be able to retrieve a bank account", async () => {
47
+ const { result } = await moov.bankAccounts.get({
48
+ accountID,
49
+ bankAccountID: bankAccount.bankAccountID!,
50
+ });
51
+ expect(result).toBeDefined();
52
+ expect(result.bankAccountID).toEqual(bankAccount.bankAccountID!);
53
+ expect(result.bankAccountType).toEqual(bankAccount.bankAccountType!);
54
+ expect(result.holderName).toEqual(bankAccount.holderName!);
55
+ expect(result.holderType).toEqual(bankAccount.holderType!);
56
+ expect(result.routingNumber).toEqual(bankAccount.routingNumber!);
57
+ expect(result.lastFourAccountNumber).toEqual(accountNumber.slice(-4));
58
+ });
59
+
60
+ test("should be able to list bank accounts", async () => {
61
+ const { result } = await moov.bankAccounts.list({
62
+ accountID,
63
+ });
64
+ expect(result).toBeDefined();
65
+ expect(result.length).toBeGreaterThan(0);
66
+ expect(result[0].bankAccountID).toEqual(bankAccount.bankAccountID!);
67
+ expect(result[0].bankAccountType).toEqual(bankAccount.bankAccountType!);
68
+ expect(result[0].holderName).toEqual(bankAccount.holderName!);
69
+ expect(result[0].holderType).toEqual(bankAccount.holderType!);
70
+ expect(result[0].routingNumber).toEqual(bankAccount.routingNumber!);
71
+ expect(result[0].lastFourAccountNumber).toEqual(accountNumber.slice(-4));
72
+ });
73
+ });
74
+
75
+ describe("Bank account verification", () => {
76
+ beforeEach(async () => {
77
+ const result = await createBankAccount(accountID);
78
+ bankAccount = result.bankAccount;
79
+ accountNumber = result.accountNumber;
80
+ });
81
+ describe("RTP verification", () => {
82
+ test("should be able to initiate bank account verification and complete it, and get a 409 error when I try to verify an already-verified bank account", async () => {
83
+ const { result } = await moov.bankAccounts.initiateVerification({
84
+ accountID,
85
+ bankAccountID: bankAccount.bankAccountID!,
86
+ xWaitFor: "rail-response",
87
+ });
88
+ expect(result).toBeDefined();
89
+ expect(result.status).toEqual("sent-credit");
90
+ const { result: result2 } = await moov.bankAccounts.completeVerification({
91
+ accountID,
92
+ bankAccountID: bankAccount.bankAccountID!,
93
+ completeBankAccountVerification: {
94
+ code: "0001",
95
+ },
96
+ });
97
+ expect(result2).toBeDefined();
98
+ expect(result2.status).toEqual("successful");
99
+ expect(
100
+ async () =>
101
+ await moov.bankAccounts.initiateVerification({
102
+ accountID,
103
+ bankAccountID: bankAccount.bankAccountID!,
104
+ }),
105
+ ).toThrowError(
106
+ expect.objectContaining({ error: "unacceptable bank account status verified for verification" }),
107
+ );
108
+ });
109
+ test("should be able to get the bank account verification status", async () => {
110
+ const { result } = await moov.bankAccounts.initiateVerification({
111
+ accountID,
112
+ bankAccountID: bankAccount.bankAccountID!,
113
+ });
114
+ expect(result).toBeDefined();
115
+ expect(result.status).toEqual("new");
116
+ await sleep(2000);
117
+ const { result: result2 } = await moov.bankAccounts.getVerification({
118
+ accountID,
119
+ bankAccountID: bankAccount.bankAccountID!,
120
+ });
121
+ expect(result2).toBeDefined();
122
+ expect(result2.status).toEqual("sent-credit");
123
+ });
124
+ });
125
+
126
+ describe("Micro deposits", () => {
127
+ beforeEach(async () => {
128
+ const result = await createBankAccount(accountID);
129
+ bankAccount = result.bankAccount;
130
+ accountNumber = result.accountNumber;
131
+ });
132
+ test("should be able to initiate micro deposits and complete them and should get a 409 error when we try to complete micro deposits for an already-completed bank account", async () => {
133
+ const result = await moov.bankAccounts.initiateMicroDeposits({
134
+ accountID,
135
+ bankAccountID: bankAccount.bankAccountID!,
136
+ });
137
+ expect(result).toBeDefined();
138
+ await sleep(2000);
139
+ const { result: result2 } = await moov.bankAccounts.completeMicroDeposits({
140
+ accountID,
141
+ bankAccountID: bankAccount.bankAccountID!,
142
+ completeMicroDeposits: {
143
+ amounts: [0, 0],
144
+ },
145
+ });
146
+ expect(result2).toBeDefined();
147
+ expect(result2.status).toEqual("verified");
148
+ expect(
149
+ async () =>
150
+ await moov.bankAccounts.initiateMicroDeposits({
151
+ accountID,
152
+ bankAccountID: bankAccount.bankAccountID!,
153
+ }),
154
+ ).toThrowError(
155
+ expect.objectContaining({
156
+ error: "unexpected account status: expected 'new' or 'verificationFailed', found 'verified'",
157
+ }),
158
+ );
159
+ });
160
+ });
161
+ });
162
+
163
+ test("should be able to disable a bank account", async () => {
164
+ const result = await moov.bankAccounts.disable({
165
+ accountID,
166
+ bankAccountID: bankAccount.bankAccountID!,
167
+ });
168
+ expect(result).toBeDefined();
169
+ });
170
+ });
171
+ });
@@ -0,0 +1,147 @@
1
+ import { beforeAll, beforeEach, describe, expect, test } from "bun:test";
2
+ import { createAccount, createRepresentative } from "../utils/utils";
3
+ import type { Account, CapabilityID } from "../../models/components";
4
+ import { moov } from "../setup";
5
+ import { sleep } from "bun";
6
+
7
+ let account: Account;
8
+
9
+ describe("Capabilities", () => {
10
+ beforeAll(async () => {
11
+ account = await createAccount({ capabilities: ["collect-funds"] });
12
+ });
13
+
14
+ describe("Listing capabilities", () => {
15
+ test("should list capabilities for an account", async () => {
16
+ const { result } = await moov.capabilities.list({
17
+ accountID: account.accountID,
18
+ });
19
+ expect(result).toBeDefined();
20
+ expect(Array.isArray(result)).toBe(true);
21
+ // Capabilities should include some standard capabilities
22
+ expect(result.some((cap) => cap.capability === "transfers")).toBe(true);
23
+ });
24
+
25
+ test("listing capabilities should fail if the account is not found", async () => {
26
+ expect(() =>
27
+ moov.capabilities.list({
28
+ accountID: "not-a-valid-account-id",
29
+ }),
30
+ ).toThrowError("API error occurred: Status 403 Content-Type Body ");
31
+ });
32
+ });
33
+
34
+ describe("Getting specific capabilities", () => {
35
+ test("should get details of a specific capability", async () => {
36
+ const { result } = await moov.capabilities.get({
37
+ accountID: account.accountID,
38
+ capabilityID: "transfers",
39
+ });
40
+ expect(result).toBeDefined();
41
+ expect(result.capability).toBe("transfers");
42
+ expect(result.status).toEqual("enabled");
43
+ });
44
+
45
+ test("should contain currentlyDue for pending capabilities", async () => {
46
+ const { result } = await moov.capabilities.get({
47
+ accountID: account.accountID,
48
+ capabilityID: "collect-funds",
49
+ });
50
+ expect(result).toBeDefined();
51
+ expect(result.requirements?.currentlyDue?.length).toBeGreaterThan(0);
52
+ // somee of the requirements should be business.ein
53
+ expect(result.requirements?.currentlyDue?.some((req) => req === "business.ein")).toBe(true);
54
+ });
55
+
56
+ test.todo("should contain errors for collect-funds capability", async () => {
57
+ await createRepresentative(account.accountID, {
58
+ birthDate: {
59
+ day: 1,
60
+ month: 1,
61
+ year: 1900, // will fail automatic verification
62
+ },
63
+ email: "a@a.com",
64
+ });
65
+ await sleep(1000);
66
+ const { result } = await moov.capabilities.get({
67
+ accountID: account.accountID,
68
+ capabilityID: "collect-funds",
69
+ });
70
+ expect(result).toBeDefined();
71
+ expect(result.requirements?.errors?.length).toBeGreaterThan(0);
72
+ // some of the errors should be business.ein
73
+ expect(result.requirements?.errors?.some((err) => err.errorCode === "failed-automatic-verification")).toBe(true);
74
+ });
75
+
76
+ test("getting a capability should fail if the account is not found", async () => {
77
+ expect(() =>
78
+ moov.capabilities.get({
79
+ accountID: "not-a-valid-account-id",
80
+ capabilityID: "transfers",
81
+ }),
82
+ ).toThrowError("API error occurred: Status 403 Content-Type Body ");
83
+ });
84
+
85
+ test("getting a capability should fail if the capability does not exist", async () => {
86
+ expect(() =>
87
+ moov.capabilities.get({
88
+ accountID: account.accountID,
89
+ capabilityID: "not-a-valid-capability" as CapabilityID,
90
+ }),
91
+ ).toThrowError();
92
+ });
93
+ });
94
+
95
+ describe("Requesting capabilities", () => {
96
+ test("should request new capabilities", async () => {
97
+ const { result } = await moov.capabilities.request({
98
+ accountID: account.accountID,
99
+ addCapabilities: {
100
+ capabilities: ["transfers", "send-funds", "collect-funds"],
101
+ },
102
+ });
103
+ expect(result).toBeDefined();
104
+ expect(result[0].capability).toBe("collect-funds");
105
+ expect(result[0].status).toBeDefined();
106
+ });
107
+
108
+ test("requesting capabilities should fail if the account is not found", async () => {
109
+ expect(() =>
110
+ moov.capabilities.request({
111
+ accountID: "not-a-valid-account-id",
112
+ addCapabilities: {
113
+ capabilities: ["transfers"],
114
+ },
115
+ }),
116
+ ).toThrowError("API error occurred: Status 403 Content-Type Body ");
117
+ });
118
+
119
+ test("requesting capabilities should fail if the capability is invalid", async () => {
120
+ expect(() =>
121
+ moov.capabilities.request({
122
+ accountID: account.accountID,
123
+ addCapabilities: {
124
+ capabilities: ["not-a-valid-capability" as CapabilityID],
125
+ },
126
+ }),
127
+ ).toThrowError();
128
+ });
129
+
130
+ test("requesting capabilities should NOT fail if we request the same capability twice", async () => {
131
+ const { result } = await moov.capabilities.request({
132
+ accountID: account.accountID,
133
+ addCapabilities: { capabilities: ["transfers"] },
134
+ });
135
+ expect(result).toBeDefined();
136
+ // capability array should containe "transfers"
137
+ expect(result.some((cap) => cap.capability === "transfers")).toBe(true);
138
+ expect(result[0].status).toBeDefined();
139
+ expect(() =>
140
+ moov.capabilities.request({
141
+ accountID: account.accountID,
142
+ addCapabilities: { capabilities: ["transfers"] },
143
+ }),
144
+ ).not.toThrowError();
145
+ });
146
+ });
147
+ });
@@ -0,0 +1,168 @@
1
+ import { beforeAll, beforeEach, describe, expect, test } from "bun:test";
2
+ import { ids, moov } from "../setup";
3
+ import { createAccount, createBankAccount, createCard } from "../utils/utils";
4
+ import type { Card } from "../../models/components";
5
+
6
+ let accountID = "a920f147-ed53-4aa1-977c-d11cc192979c"; // default account ID
7
+ let card: Partial<Card> = {};
8
+ let cardNumber: string;
9
+ describe("Cards", () => {
10
+ beforeAll(async () => {
11
+ const account = await createAccount();
12
+ accountID = account.accountID;
13
+ });
14
+
15
+ describe("Card Linking", () => {
16
+ test("should fail when I pass incorrect params", async () => {
17
+ expect(
18
+ async () =>
19
+ await moov.cards.link({
20
+ accountID,
21
+ linkCard: {
22
+ cardNumber: "4111111111111111",
23
+ cardCvv: "123",
24
+ expiration: {
25
+ month: "01",
26
+ year: "2025", // 2025 is not a valid year, should be "25"
27
+ },
28
+ billingAddress: {
29
+ addressLine1: "123 Main St",
30
+ city: "Anytown",
31
+ country: "US",
32
+ postalCode: "12345", // stateOrProvince is missing, but required when passing anything other than just postalCode
33
+ },
34
+ },
35
+ }),
36
+ ).toThrow(
37
+ expect.objectContaining({
38
+ expiration: "year: the length must be exactly 2.",
39
+ billingAddress: "stateOrProvince: cannot be blank.",
40
+ }),
41
+ );
42
+ });
43
+ test("should be able to link a card successfully", async () => {
44
+ const { result } = await moov.cards.link({
45
+ accountID,
46
+ linkCard: {
47
+ cardNumber: "4111111111111111",
48
+ cardCvv: "123",
49
+ expiration: {
50
+ month: "01",
51
+ year: "45",
52
+ },
53
+ billingAddress: {
54
+ addressLine1: "123 Main St",
55
+ city: "Anytown",
56
+ country: "US",
57
+ postalCode: "12345",
58
+ stateOrProvince: "CA",
59
+ },
60
+ },
61
+ });
62
+ expect(result).toBeDefined();
63
+ expect(result.cardID).toBeDefined();
64
+ expect(result.cardType).toEqual("debit");
65
+ expect(result.brand).toEqual("Visa");
66
+ expect(result.lastFourCardNumber).toEqual("1111");
67
+ card = result;
68
+ ids.seen({ accountID, cardID: result.cardID });
69
+ });
70
+ });
71
+ describe("Card dependent tests", () => {
72
+ beforeEach(async () => {
73
+ const result = await createCard(accountID);
74
+ card = result.card;
75
+ cardNumber = result.cardNumber;
76
+ });
77
+ describe("Getting and listing cards", () => {
78
+ test("should be able to retrieve a card", async () => {
79
+ const { result } = await moov.cards.get({
80
+ accountID,
81
+ cardID: card.cardID!,
82
+ });
83
+ expect(result).toBeDefined();
84
+ expect(result.bin).toEqual(card.bin!);
85
+ expect(result.cardID).toEqual(card.cardID!);
86
+ expect(result.cardType).toEqual(card.cardType!);
87
+ expect(result.brand).toEqual(card.brand!);
88
+ expect(result.lastFourCardNumber).toEqual(cardNumber.slice(-4));
89
+ });
90
+
91
+ test("Getting a card should fail when I pass incorrect params", async () => {
92
+ expect(async () => await moov.cards.get({ accountID, cardID: "invalid-card-id" })).toThrowError(
93
+ "API error occurred: Status 404 Content-Type Body",
94
+ );
95
+ });
96
+
97
+ test("should be able to list cards", async () => {
98
+ const { result } = await moov.cards.list({
99
+ accountID,
100
+ });
101
+ expect(result).toBeDefined();
102
+ expect(result.length).toBeGreaterThan(0);
103
+ expect(result[0].bin).toEqual(expect.any(String));
104
+ expect(result[0].cardID).toEqual(expect.any(String));
105
+ expect(result[0].cardType).toEqual(expect.any(String));
106
+ expect(result[0].brand).toEqual(expect.any(String));
107
+ expect(result[0].lastFourCardNumber).toEqual(expect.any(String));
108
+ });
109
+
110
+ test("listing should fail when I pass incorrect params", async () => {
111
+ expect(async () => await moov.cards.list({ accountID: "invalid-account-id" })).toThrowError(
112
+ "API error occurred: Status 403 Content-Type Body ",
113
+ );
114
+ });
115
+ });
116
+
117
+ describe("Updating cards", () => {
118
+ test("should be able to update a card", async () => {
119
+ const { result } = await moov.cards.update({
120
+ accountID,
121
+ cardID: card.cardID!,
122
+ updateCard: {
123
+ expiration: {
124
+ month: "01",
125
+ year: "45",
126
+ },
127
+ },
128
+ });
129
+ expect(result).toBeDefined();
130
+ expect(result.cardID).toEqual(card.cardID!);
131
+ expect(result.expiration.month).toEqual("01");
132
+ expect(result.expiration.year).toEqual("45");
133
+ });
134
+
135
+ test("updating should fail when I pass incorrect params", async () => {
136
+ expect(
137
+ async () =>
138
+ await moov.cards.update({
139
+ accountID,
140
+ cardID: card.cardID!,
141
+ updateCard: {
142
+ expiration: {
143
+ month: "01",
144
+ year: "2045",
145
+ },
146
+ },
147
+ }),
148
+ ).toThrowError('API error occurred: {"expiration":"year: the length must be exactly 2."}');
149
+ });
150
+ });
151
+
152
+ describe("Disabling cards", () => {
153
+ test("should be able to disable a card", async () => {
154
+ const result = await moov.cards.disable({
155
+ accountID,
156
+ cardID: card.cardID!,
157
+ });
158
+ expect(result).toBeDefined();
159
+ });
160
+
161
+ test("disabling should fail when I pass incorrect params", async () => {
162
+ expect(async () => await moov.cards.disable({ accountID, cardID: "invalid-card-id" })).toThrowError(
163
+ "API error occurred: Status 404 Content-Type Body",
164
+ );
165
+ });
166
+ });
167
+ });
168
+ });
@@ -0,0 +1,55 @@
1
+ import { beforeAll, beforeEach, describe, expect, test } from "bun:test";
2
+ import { ids, moov } from "../setup";
3
+ import { createAccount, createBankAccount, createCard } from "../utils/utils";
4
+ import type { BankAccount, Card } from "../../models/components";
5
+
6
+ let accountID = "a920f147-ed53-4aa1-977c-d11cc192979c"; // default account ID
7
+ let card: Partial<Card> = {};
8
+ let bankAccount: Partial<BankAccount> = {};
9
+ let cardNumber: string;
10
+ describe("PaymentMethods", () => {
11
+ beforeAll(async () => {
12
+ const account = await createAccount();
13
+ accountID = account.accountID;
14
+ const result = await createCard(accountID);
15
+ card = result.card;
16
+ cardNumber = result.cardNumber;
17
+ const bankAccountResult = await createBankAccount(accountID);
18
+ bankAccount = bankAccountResult.bankAccount;
19
+ });
20
+
21
+ describe("Listing", () => {
22
+ test("should be able to list payment methods", async () => {
23
+ const { result } = await moov.paymentMethods.list({ accountID });
24
+ expect(result).toBeDefined();
25
+ expect(result.length).toBeGreaterThan(0);
26
+ });
27
+ test("listing should fail if accountID is not provided", async () => {
28
+ expect(() => moov.paymentMethods.list({ accountID: "" })).toThrowError(
29
+ "API error occurred: Status 403 Content-Type Body",
30
+ );
31
+ });
32
+ });
33
+
34
+ describe("Getting PaymentMethods", () => {
35
+ test("should be able to get a payment method", async () => {
36
+ const { result: listResult } = await moov.paymentMethods.list({ accountID });
37
+ const { result } = await moov.paymentMethods.get({
38
+ accountID: accountID,
39
+ paymentMethodID: listResult[0].paymentMethodID,
40
+ });
41
+ expect(result).toBeDefined();
42
+ expect(result.paymentMethodID).toBe(listResult[0].paymentMethodID);
43
+ });
44
+ test("getting should fail if accountID and paymentMethodID are not correct", async () => {
45
+ expect(() => moov.paymentMethods.get({ accountID: "@#$@#$@$", paymentMethodID: "@#$@#$@#$@" })).toThrowError(
46
+ "API error occurred: Status 403 Content-Type Body",
47
+ );
48
+ });
49
+ test("getting should fail if paymentMethodID is not provided", async () => {
50
+ expect(() => moov.paymentMethods.get({ accountID: accountID, paymentMethodID: "" })).toThrowError(
51
+ "API error occurred: Status 403 Content-Type Body",
52
+ );
53
+ });
54
+ });
55
+ });