@moovio/sdk 0.11.4 → 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.
- package/FUNCTIONS.md +1 -82
- package/README.md +13 -505
- package/bin/mcp-server.js +1921 -1584
- package/bin/mcp-server.js.map +161 -151
- package/docs/sdks/accounts/README.md +16 -180
- package/docs/sdks/adjustments/README.md +6 -6
- package/docs/sdks/applepay/README.md +12 -12
- package/docs/sdks/bankaccounts/README.md +36 -36
- package/docs/sdks/branding/README.md +8 -8
- package/docs/sdks/capabilities/README.md +10 -10
- package/docs/sdks/cardissuing/README.md +22 -38
- package/docs/sdks/cards/README.md +11 -41
- package/docs/sdks/disputes/README.md +54 -54
- package/docs/sdks/enrichedprofile/README.md +2 -2
- package/docs/sdks/feeplans/README.md +16 -16
- package/docs/sdks/files/README.md +8 -8
- package/docs/sdks/industries/README.md +4 -4
- package/docs/sdks/issuingtransactions/README.md +16 -16
- package/docs/sdks/onboarding/README.md +2 -170
- package/docs/sdks/paymentlinks/README.md +16 -74
- package/docs/sdks/paymentmethods/README.md +6 -6
- package/docs/sdks/receipts/README.md +4 -14
- package/docs/sdks/representatives/README.md +18 -26
- package/docs/sdks/scheduling/README.md +34 -34
- package/docs/sdks/sweeps/README.md +22 -22
- package/docs/sdks/transfers/README.md +50 -96
- package/docs/sdks/underwriting/README.md +30 -30
- package/docs/sdks/wallets/README.md +6 -6
- package/docs/sdks/wallettransactions/README.md +10 -10
- package/funcs/accountTerminalApplicationsGet.js +2 -0
- package/funcs/accountTerminalApplicationsGet.js.map +1 -1
- package/funcs/accountTerminalApplicationsGetConfiguration.js +2 -0
- package/funcs/accountTerminalApplicationsGetConfiguration.js.map +1 -1
- package/funcs/accountTerminalApplicationsLink.js +2 -0
- package/funcs/accountTerminalApplicationsLink.js.map +1 -1
- package/funcs/accountTerminalApplicationsList.js +2 -0
- package/funcs/accountTerminalApplicationsList.js.map +1 -1
- package/funcs/accountsAssignCountries.js +2 -0
- package/funcs/accountsAssignCountries.js.map +1 -1
- package/funcs/accountsCreate.js +2 -0
- package/funcs/accountsCreate.js.map +1 -1
- package/funcs/accountsDisconnect.js +2 -0
- package/funcs/accountsDisconnect.js.map +1 -1
- package/funcs/accountsGet.js +2 -0
- package/funcs/accountsGet.js.map +1 -1
- package/funcs/accountsGetCountries.js +2 -0
- package/funcs/accountsGetCountries.js.map +1 -1
- package/funcs/accountsGetMerchantProcessingAgreement.js +2 -0
- package/funcs/accountsGetMerchantProcessingAgreement.js.map +1 -1
- package/funcs/accountsGetTermsOfServiceToken.js +2 -0
- package/funcs/accountsGetTermsOfServiceToken.js.map +1 -1
- package/funcs/accountsList.js +2 -0
- package/funcs/accountsList.js.map +1 -1
- package/funcs/accountsUpdate.js +2 -0
- package/funcs/accountsUpdate.js.map +1 -1
- package/funcs/adjustmentsGet.js +2 -0
- package/funcs/adjustmentsGet.js.map +1 -1
- package/funcs/adjustmentsList.js +2 -0
- package/funcs/adjustmentsList.js.map +1 -1
- package/funcs/applePayCreateSession.js +2 -0
- package/funcs/applePayCreateSession.js.map +1 -1
- package/funcs/applePayGetMerchantDomains.js +2 -0
- package/funcs/applePayGetMerchantDomains.js.map +1 -1
- package/funcs/applePayLinkToken.js +2 -0
- package/funcs/applePayLinkToken.js.map +1 -1
- package/funcs/applePayRegisterMerchantDomains.js +2 -0
- package/funcs/applePayRegisterMerchantDomains.js.map +1 -1
- package/funcs/applePayUpdateMerchantDomains.js +2 -0
- package/funcs/applePayUpdateMerchantDomains.js.map +1 -1
- package/funcs/authenticationCreateAccessToken.js +2 -0
- package/funcs/authenticationCreateAccessToken.js.map +1 -1
- package/funcs/authenticationRevokeAccessToken.js +2 -0
- package/funcs/authenticationRevokeAccessToken.js.map +1 -1
- package/funcs/avatarsGet.js +2 -0
- package/funcs/avatarsGet.js.map +1 -1
- package/funcs/bankAccountsCompleteMicroDeposits.js +2 -0
- package/funcs/bankAccountsCompleteMicroDeposits.js.map +1 -1
- package/funcs/bankAccountsCompleteVerification.js +2 -0
- package/funcs/bankAccountsCompleteVerification.js.map +1 -1
- package/funcs/bankAccountsDisable.js +2 -0
- package/funcs/bankAccountsDisable.js.map +1 -1
- package/funcs/bankAccountsGet.js +2 -0
- package/funcs/bankAccountsGet.js.map +1 -1
- package/funcs/bankAccountsGetVerification.js +2 -0
- package/funcs/bankAccountsGetVerification.js.map +1 -1
- package/funcs/bankAccountsInitiateMicroDeposits.js +2 -0
- package/funcs/bankAccountsInitiateMicroDeposits.js.map +1 -1
- package/funcs/bankAccountsInitiateVerification.js +2 -0
- package/funcs/bankAccountsInitiateVerification.js.map +1 -1
- package/funcs/bankAccountsLink.js +2 -0
- package/funcs/bankAccountsLink.js.map +1 -1
- package/funcs/bankAccountsList.js +2 -0
- package/funcs/bankAccountsList.js.map +1 -1
- package/funcs/brandingCreate.js +2 -0
- package/funcs/brandingCreate.js.map +1 -1
- package/funcs/brandingGet.js +2 -0
- package/funcs/brandingGet.js.map +1 -1
- package/funcs/brandingUpdate.js +2 -0
- package/funcs/brandingUpdate.js.map +1 -1
- package/funcs/brandingUpsert.js +2 -0
- package/funcs/brandingUpsert.js.map +1 -1
- package/funcs/capabilitiesDisable.js +2 -0
- package/funcs/capabilitiesDisable.js.map +1 -1
- package/funcs/capabilitiesGet.js +2 -0
- package/funcs/capabilitiesGet.js.map +1 -1
- package/funcs/capabilitiesList.js +2 -0
- package/funcs/capabilitiesList.js.map +1 -1
- package/funcs/capabilitiesRequest.js +2 -0
- package/funcs/capabilitiesRequest.js.map +1 -1
- package/funcs/cardIssuingGet.js +2 -0
- package/funcs/cardIssuingGet.js.map +1 -1
- package/funcs/cardIssuingGetFull.js +2 -0
- package/funcs/cardIssuingGetFull.js.map +1 -1
- package/funcs/cardIssuingList.js +2 -0
- package/funcs/cardIssuingList.js.map +1 -1
- package/funcs/cardIssuingRequest.js +2 -0
- package/funcs/cardIssuingRequest.js.map +1 -1
- package/funcs/cardIssuingUpdate.js +2 -0
- package/funcs/cardIssuingUpdate.js.map +1 -1
- package/funcs/cardsDisable.js +2 -0
- package/funcs/cardsDisable.js.map +1 -1
- package/funcs/cardsGet.js +2 -0
- package/funcs/cardsGet.js.map +1 -1
- package/funcs/cardsLink.js +3 -1
- package/funcs/cardsLink.js.map +1 -1
- package/funcs/cardsList.js +2 -0
- package/funcs/cardsList.js.map +1 -1
- package/funcs/cardsUpdate.js +2 -0
- package/funcs/cardsUpdate.js.map +1 -1
- package/funcs/disputesAccept.js +2 -0
- package/funcs/disputesAccept.js.map +1 -1
- package/funcs/disputesDeleteEvidence.js +2 -0
- package/funcs/disputesDeleteEvidence.js.map +1 -1
- package/funcs/disputesGet.js +2 -0
- package/funcs/disputesGet.js.map +1 -1
- package/funcs/disputesGetEvidence.js +2 -0
- package/funcs/disputesGetEvidence.js.map +1 -1
- package/funcs/disputesGetEvidenceData.js +2 -0
- package/funcs/disputesGetEvidenceData.js.map +1 -1
- package/funcs/disputesList.js +2 -0
- package/funcs/disputesList.js.map +1 -1
- package/funcs/disputesListEvidence.js +2 -0
- package/funcs/disputesListEvidence.js.map +1 -1
- package/funcs/disputesSubmitEvidence.js +2 -0
- package/funcs/disputesSubmitEvidence.js.map +1 -1
- package/funcs/disputesUpdateEvidence.js +2 -0
- package/funcs/disputesUpdateEvidence.js.map +1 -1
- package/funcs/disputesUploadEvidenceFile.js +2 -0
- package/funcs/disputesUploadEvidenceFile.js.map +1 -1
- package/funcs/disputesUploadEvidenceText.js +2 -0
- package/funcs/disputesUploadEvidenceText.js.map +1 -1
- package/funcs/endToEndEncryptionGenerateKey.js +2 -0
- package/funcs/endToEndEncryptionGenerateKey.js.map +1 -1
- package/funcs/endToEndEncryptionTestEncryptedToken.js +2 -0
- package/funcs/endToEndEncryptionTestEncryptedToken.js.map +1 -1
- package/funcs/enrichedAddressGet.js +2 -0
- package/funcs/enrichedAddressGet.js.map +1 -1
- package/funcs/enrichedProfileGet.js +2 -0
- package/funcs/enrichedProfileGet.js.map +1 -1
- package/funcs/feePlansCreateFeePlanAgreements.js +2 -0
- package/funcs/feePlansCreateFeePlanAgreements.js.map +1 -1
- package/funcs/feePlansListFeePlanAgreements.js +2 -0
- package/funcs/feePlansListFeePlanAgreements.js.map +1 -1
- package/funcs/feePlansListFeePlans.js +2 -0
- package/funcs/feePlansListFeePlans.js.map +1 -1
- package/funcs/feePlansListFeesFetch.js +2 -0
- package/funcs/feePlansListFeesFetch.js.map +1 -1
- package/funcs/feePlansListPartnerPricing.js +2 -0
- package/funcs/feePlansListPartnerPricing.js.map +1 -1
- package/funcs/feePlansListPartnerPricingAgreements.js +2 -0
- package/funcs/feePlansListPartnerPricingAgreements.js.map +1 -1
- package/funcs/feePlansRetrieveFees.js +2 -0
- package/funcs/feePlansRetrieveFees.js.map +1 -1
- package/funcs/filesGet.js +2 -0
- package/funcs/filesGet.js.map +1 -1
- package/funcs/filesList.js +2 -0
- package/funcs/filesList.js.map +1 -1
- package/funcs/filesUpload.js +2 -0
- package/funcs/filesUpload.js.map +1 -1
- package/funcs/industriesList.d.ts +2 -2
- package/funcs/industriesList.js +4 -2
- package/funcs/industriesList.js.map +1 -1
- package/funcs/institutionsSearch.js +2 -0
- package/funcs/institutionsSearch.js.map +1 -1
- package/funcs/issuingTransactionsGet.js +2 -0
- package/funcs/issuingTransactionsGet.js.map +1 -1
- package/funcs/issuingTransactionsGetAuthorization.js +2 -0
- package/funcs/issuingTransactionsGetAuthorization.js.map +1 -1
- package/funcs/issuingTransactionsList.js +2 -0
- package/funcs/issuingTransactionsList.js.map +1 -1
- package/funcs/issuingTransactionsListAuthorizationEvents.js +2 -0
- package/funcs/issuingTransactionsListAuthorizationEvents.js.map +1 -1
- package/funcs/issuingTransactionsListAuthorizations.js +2 -0
- package/funcs/issuingTransactionsListAuthorizations.js.map +1 -1
- package/funcs/onboardingCreateInvite.js +2 -0
- package/funcs/onboardingCreateInvite.js.map +1 -1
- package/funcs/onboardingGetInvite.js +2 -0
- package/funcs/onboardingGetInvite.js.map +1 -1
- package/funcs/onboardingListInvites.js +2 -0
- package/funcs/onboardingListInvites.js.map +1 -1
- package/funcs/onboardingRevokeInvite.js +2 -0
- package/funcs/onboardingRevokeInvite.js.map +1 -1
- package/funcs/paymentLinksCreate.js +2 -0
- package/funcs/paymentLinksCreate.js.map +1 -1
- package/funcs/paymentLinksDisable.js +2 -0
- package/funcs/paymentLinksDisable.js.map +1 -1
- package/funcs/paymentLinksGet.js +2 -0
- package/funcs/paymentLinksGet.js.map +1 -1
- package/funcs/paymentLinksGetQRCode.js +2 -0
- package/funcs/paymentLinksGetQRCode.js.map +1 -1
- package/funcs/paymentLinksList.js +2 -0
- package/funcs/paymentLinksList.js.map +1 -1
- package/funcs/paymentLinksUpdate.js +2 -0
- package/funcs/paymentLinksUpdate.js.map +1 -1
- package/funcs/paymentMethodsGet.js +2 -0
- package/funcs/paymentMethodsGet.js.map +1 -1
- package/funcs/paymentMethodsList.js +2 -0
- package/funcs/paymentMethodsList.js.map +1 -1
- package/funcs/pingPing.js +2 -0
- package/funcs/pingPing.js.map +1 -1
- package/funcs/receiptsCreate.js +2 -0
- package/funcs/receiptsCreate.js.map +1 -1
- package/funcs/receiptsList.js +2 -0
- package/funcs/receiptsList.js.map +1 -1
- package/funcs/representativesCreate.js +2 -0
- package/funcs/representativesCreate.js.map +1 -1
- package/funcs/representativesDelete.js +2 -0
- package/funcs/representativesDelete.js.map +1 -1
- package/funcs/representativesGet.js +2 -0
- package/funcs/representativesGet.js.map +1 -1
- package/funcs/representativesList.js +2 -0
- package/funcs/representativesList.js.map +1 -1
- package/funcs/representativesUpdate.js +2 -0
- package/funcs/representativesUpdate.js.map +1 -1
- package/funcs/schedulingCancel.js +2 -0
- package/funcs/schedulingCancel.js.map +1 -1
- package/funcs/schedulingCreate.js +2 -0
- package/funcs/schedulingCreate.js.map +1 -1
- package/funcs/schedulingGet.js +2 -0
- package/funcs/schedulingGet.js.map +1 -1
- package/funcs/schedulingGetOccurrance.js +2 -0
- package/funcs/schedulingGetOccurrance.js.map +1 -1
- package/funcs/schedulingList.js +2 -0
- package/funcs/schedulingList.js.map +1 -1
- package/funcs/schedulingUpdate.js +2 -0
- package/funcs/schedulingUpdate.js.map +1 -1
- package/funcs/sweepsCreateConfig.js +2 -0
- package/funcs/sweepsCreateConfig.js.map +1 -1
- package/funcs/sweepsGet.js +2 -0
- package/funcs/sweepsGet.js.map +1 -1
- package/funcs/sweepsGetConfig.js +2 -0
- package/funcs/sweepsGetConfig.js.map +1 -1
- package/funcs/sweepsList.js +2 -0
- package/funcs/sweepsList.js.map +1 -1
- package/funcs/sweepsListConfigs.js +2 -0
- package/funcs/sweepsListConfigs.js.map +1 -1
- package/funcs/sweepsUpdateConfig.js +2 -0
- package/funcs/sweepsUpdateConfig.js.map +1 -1
- package/funcs/terminalApplicationsCreate.js +2 -0
- package/funcs/terminalApplicationsCreate.js.map +1 -1
- package/funcs/terminalApplicationsDelete.js +2 -0
- package/funcs/terminalApplicationsDelete.js.map +1 -1
- package/funcs/terminalApplicationsGet.js +2 -0
- package/funcs/terminalApplicationsGet.js.map +1 -1
- package/funcs/terminalApplicationsList.js +2 -0
- package/funcs/terminalApplicationsList.js.map +1 -1
- package/funcs/transfersCreate.js +2 -0
- package/funcs/transfersCreate.js.map +1 -1
- package/funcs/transfersCreateCancellation.js +2 -0
- package/funcs/transfersCreateCancellation.js.map +1 -1
- package/funcs/transfersCreateReversal.js +2 -0
- package/funcs/transfersCreateReversal.js.map +1 -1
- package/funcs/transfersGenerateOptions.js +2 -0
- package/funcs/transfersGenerateOptions.js.map +1 -1
- package/funcs/transfersGet.js +2 -0
- package/funcs/transfersGet.js.map +1 -1
- package/funcs/transfersGetCancellation.js +2 -0
- package/funcs/transfersGetCancellation.js.map +1 -1
- package/funcs/transfersGetRefund.js +2 -0
- package/funcs/transfersGetRefund.js.map +1 -1
- package/funcs/transfersInitiateRefund.js +2 -0
- package/funcs/transfersInitiateRefund.js.map +1 -1
- package/funcs/transfersList.js +2 -0
- package/funcs/transfersList.js.map +1 -1
- package/funcs/transfersListRefunds.js +2 -0
- package/funcs/transfersListRefunds.js.map +1 -1
- package/funcs/transfersUpdate.js +2 -0
- package/funcs/transfersUpdate.js.map +1 -1
- package/funcs/underwritingGet.js +2 -0
- package/funcs/underwritingGet.js.map +1 -1
- package/funcs/underwritingUpsert.js +2 -0
- package/funcs/underwritingUpsert.js.map +1 -1
- package/funcs/walletTransactionsGet.js +2 -0
- package/funcs/walletTransactionsGet.js.map +1 -1
- package/funcs/walletTransactionsList.js +2 -0
- package/funcs/walletTransactionsList.js.map +1 -1
- package/funcs/walletsGet.js +2 -0
- package/funcs/walletsGet.js.map +1 -1
- package/funcs/walletsList.js +2 -0
- package/funcs/walletsList.js.map +1 -1
- package/hooks/types.d.ts +2 -0
- package/hooks/types.d.ts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +7 -3
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts +1 -0
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +3 -3
- package/lib/sdks.js.map +1 -1
- package/mcp-server/cli/start/impl.js +4 -4
- package/mcp-server/cli/start/impl.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/mcp-server/tools/industriesList.js +2 -2
- package/models/components/enrichedindustries.d.ts +3 -3
- package/models/components/enrichedindustries.js +3 -3
- package/models/components/index.d.ts +2 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -1
- package/models/components/index.js.map +1 -1
- package/models/components/industrytaxonomy.d.ts +55 -0
- package/models/components/industrytaxonomy.d.ts.map +1 -0
- package/models/components/{enrichedindustry.js → industrytaxonomy.js} +27 -25
- package/models/components/industrytaxonomy.js.map +1 -0
- package/models/components/sweep.d.ts +6 -0
- package/models/components/sweep.d.ts.map +1 -1
- package/models/components/sweep.js +3 -0
- package/models/components/sweep.js.map +1 -1
- package/models/components/sweepsubtotal.d.ts +44 -0
- package/models/components/sweepsubtotal.d.ts.map +1 -0
- package/models/components/sweepsubtotal.js +75 -0
- package/models/components/sweepsubtotal.js.map +1 -0
- package/models/operations/createtransfer.d.ts +1 -1
- package/package.json +2 -2
- package/sdk/industries.d.ts +2 -2
- package/sdk/industries.js +2 -2
- package/src/funcs/accountTerminalApplicationsGet.ts +2 -0
- package/src/funcs/accountTerminalApplicationsGetConfiguration.ts +2 -0
- package/src/funcs/accountTerminalApplicationsLink.ts +2 -0
- package/src/funcs/accountTerminalApplicationsList.ts +2 -0
- package/src/funcs/accountsAssignCountries.ts +2 -0
- package/src/funcs/accountsCreate.ts +2 -0
- package/src/funcs/accountsDisconnect.ts +2 -0
- package/src/funcs/accountsGet.ts +2 -0
- package/src/funcs/accountsGetCountries.ts +2 -0
- package/src/funcs/accountsGetMerchantProcessingAgreement.ts +2 -0
- package/src/funcs/accountsGetTermsOfServiceToken.ts +2 -0
- package/src/funcs/accountsList.ts +2 -0
- package/src/funcs/accountsUpdate.ts +2 -0
- package/src/funcs/adjustmentsGet.ts +2 -0
- package/src/funcs/adjustmentsList.ts +2 -0
- package/src/funcs/applePayCreateSession.ts +2 -0
- package/src/funcs/applePayGetMerchantDomains.ts +2 -0
- package/src/funcs/applePayLinkToken.ts +2 -0
- package/src/funcs/applePayRegisterMerchantDomains.ts +2 -0
- package/src/funcs/applePayUpdateMerchantDomains.ts +2 -0
- package/src/funcs/authenticationCreateAccessToken.ts +2 -0
- package/src/funcs/authenticationRevokeAccessToken.ts +2 -0
- package/src/funcs/avatarsGet.ts +2 -0
- package/src/funcs/bankAccountsCompleteMicroDeposits.ts +2 -0
- package/src/funcs/bankAccountsCompleteVerification.ts +2 -0
- package/src/funcs/bankAccountsDisable.ts +2 -0
- package/src/funcs/bankAccountsGet.ts +2 -0
- package/src/funcs/bankAccountsGetVerification.ts +2 -0
- package/src/funcs/bankAccountsInitiateMicroDeposits.ts +2 -0
- package/src/funcs/bankAccountsInitiateVerification.ts +2 -0
- package/src/funcs/bankAccountsLink.ts +2 -0
- package/src/funcs/bankAccountsList.ts +2 -0
- package/src/funcs/brandingCreate.ts +2 -0
- package/src/funcs/brandingGet.ts +2 -0
- package/src/funcs/brandingUpdate.ts +2 -0
- package/src/funcs/brandingUpsert.ts +2 -0
- package/src/funcs/capabilitiesDisable.ts +2 -0
- package/src/funcs/capabilitiesGet.ts +2 -0
- package/src/funcs/capabilitiesList.ts +2 -0
- package/src/funcs/capabilitiesRequest.ts +2 -0
- package/src/funcs/cardIssuingGet.ts +2 -0
- package/src/funcs/cardIssuingGetFull.ts +2 -0
- package/src/funcs/cardIssuingList.ts +2 -0
- package/src/funcs/cardIssuingRequest.ts +2 -0
- package/src/funcs/cardIssuingUpdate.ts +2 -0
- package/src/funcs/cardsDisable.ts +2 -0
- package/src/funcs/cardsGet.ts +2 -0
- package/src/funcs/cardsLink.ts +4 -2
- package/src/funcs/cardsList.ts +2 -0
- package/src/funcs/cardsUpdate.ts +2 -0
- package/src/funcs/disputesAccept.ts +2 -0
- package/src/funcs/disputesDeleteEvidence.ts +2 -0
- package/src/funcs/disputesGet.ts +2 -0
- package/src/funcs/disputesGetEvidence.ts +2 -0
- package/src/funcs/disputesGetEvidenceData.ts +2 -0
- package/src/funcs/disputesList.ts +2 -0
- package/src/funcs/disputesListEvidence.ts +2 -0
- package/src/funcs/disputesSubmitEvidence.ts +2 -0
- package/src/funcs/disputesUpdateEvidence.ts +2 -0
- package/src/funcs/disputesUploadEvidenceFile.ts +2 -0
- package/src/funcs/disputesUploadEvidenceText.ts +2 -0
- package/src/funcs/endToEndEncryptionGenerateKey.ts +2 -0
- package/src/funcs/endToEndEncryptionTestEncryptedToken.ts +2 -0
- package/src/funcs/enrichedAddressGet.ts +2 -0
- package/src/funcs/enrichedProfileGet.ts +2 -0
- package/src/funcs/feePlansCreateFeePlanAgreements.ts +2 -0
- package/src/funcs/feePlansListFeePlanAgreements.ts +2 -0
- package/src/funcs/feePlansListFeePlans.ts +2 -0
- package/src/funcs/feePlansListFeesFetch.ts +2 -0
- package/src/funcs/feePlansListPartnerPricing.ts +2 -0
- package/src/funcs/feePlansListPartnerPricingAgreements.ts +2 -0
- package/src/funcs/feePlansRetrieveFees.ts +2 -0
- package/src/funcs/filesGet.ts +2 -0
- package/src/funcs/filesList.ts +2 -0
- package/src/funcs/filesUpload.ts +2 -0
- package/src/funcs/industriesList.ts +4 -2
- package/src/funcs/institutionsSearch.ts +2 -0
- package/src/funcs/issuingTransactionsGet.ts +2 -0
- package/src/funcs/issuingTransactionsGetAuthorization.ts +2 -0
- package/src/funcs/issuingTransactionsList.ts +2 -0
- package/src/funcs/issuingTransactionsListAuthorizationEvents.ts +2 -0
- package/src/funcs/issuingTransactionsListAuthorizations.ts +2 -0
- package/src/funcs/onboardingCreateInvite.ts +2 -0
- package/src/funcs/onboardingGetInvite.ts +2 -0
- package/src/funcs/onboardingListInvites.ts +2 -0
- package/src/funcs/onboardingRevokeInvite.ts +2 -0
- package/src/funcs/paymentLinksCreate.ts +2 -0
- package/src/funcs/paymentLinksDisable.ts +2 -0
- package/src/funcs/paymentLinksGet.ts +2 -0
- package/src/funcs/paymentLinksGetQRCode.ts +2 -0
- package/src/funcs/paymentLinksList.ts +2 -0
- package/src/funcs/paymentLinksUpdate.ts +2 -0
- package/src/funcs/paymentMethodsGet.ts +2 -0
- package/src/funcs/paymentMethodsList.ts +2 -0
- package/src/funcs/pingPing.ts +2 -0
- package/src/funcs/receiptsCreate.ts +2 -0
- package/src/funcs/receiptsList.ts +2 -0
- package/src/funcs/representativesCreate.ts +2 -0
- package/src/funcs/representativesDelete.ts +2 -0
- package/src/funcs/representativesGet.ts +2 -0
- package/src/funcs/representativesList.ts +2 -0
- package/src/funcs/representativesUpdate.ts +2 -0
- package/src/funcs/schedulingCancel.ts +2 -0
- package/src/funcs/schedulingCreate.ts +2 -0
- package/src/funcs/schedulingGet.ts +2 -0
- package/src/funcs/schedulingGetOccurrance.ts +2 -0
- package/src/funcs/schedulingList.ts +2 -0
- package/src/funcs/schedulingUpdate.ts +2 -0
- package/src/funcs/sweepsCreateConfig.ts +2 -0
- package/src/funcs/sweepsGet.ts +2 -0
- package/src/funcs/sweepsGetConfig.ts +2 -0
- package/src/funcs/sweepsList.ts +2 -0
- package/src/funcs/sweepsListConfigs.ts +2 -0
- package/src/funcs/sweepsUpdateConfig.ts +2 -0
- package/src/funcs/terminalApplicationsCreate.ts +2 -0
- package/src/funcs/terminalApplicationsDelete.ts +2 -0
- package/src/funcs/terminalApplicationsGet.ts +2 -0
- package/src/funcs/terminalApplicationsList.ts +2 -0
- package/src/funcs/transfersCreate.ts +2 -0
- package/src/funcs/transfersCreateCancellation.ts +2 -0
- package/src/funcs/transfersCreateReversal.ts +2 -0
- package/src/funcs/transfersGenerateOptions.ts +2 -0
- package/src/funcs/transfersGet.ts +2 -0
- package/src/funcs/transfersGetCancellation.ts +2 -0
- package/src/funcs/transfersGetRefund.ts +2 -0
- package/src/funcs/transfersInitiateRefund.ts +2 -0
- package/src/funcs/transfersList.ts +2 -0
- package/src/funcs/transfersListRefunds.ts +2 -0
- package/src/funcs/transfersUpdate.ts +2 -0
- package/src/funcs/underwritingGet.ts +2 -0
- package/src/funcs/underwritingUpsert.ts +2 -0
- package/src/funcs/walletTransactionsGet.ts +2 -0
- package/src/funcs/walletTransactionsList.ts +2 -0
- package/src/funcs/walletsGet.ts +2 -0
- package/src/funcs/walletsList.ts +2 -0
- package/src/hooks/types.ts +2 -0
- package/src/index.ts +2 -0
- package/src/lib/config.ts +7 -3
- package/src/lib/sdks.ts +10 -4
- package/src/mcp-server/cli/start/impl.ts +4 -4
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/industriesList.ts +2 -2
- package/src/models/components/enrichedindustries.ts +9 -9
- package/src/models/components/index.ts +2 -1
- package/src/models/components/industrytaxonomy.ts +100 -0
- package/src/models/components/sweep.ts +13 -0
- package/src/models/components/sweepsubtotal.ts +90 -0
- package/src/models/operations/createtransfer.ts +1 -1
- package/src/sdk/industries.ts +2 -2
- package/test/README.md +2 -0
- package/test/index.ts +1 -0
- package/test/package.json +25 -0
- package/test/setup.ts +119 -0
- package/test/tests/accounts.test.ts +127 -0
- package/test/tests/bankAccounts.test.ts +171 -0
- package/test/tests/capabilities.test.ts +147 -0
- package/test/tests/cards.test.ts +168 -0
- package/test/tests/paymentMethods.test.ts +55 -0
- package/test/tests/representatives.test.ts +83 -0
- package/test/tests/transfers.test.ts +122 -0
- package/test/tests/wallets.test.ts +31 -0
- package/test/tsconfig.json +30 -0
- package/test/utils/utils.ts +276 -0
- package/models/components/enrichedindustry.d.ts +0 -47
- package/models/components/enrichedindustry.d.ts.map +0 -1
- package/models/components/enrichedindustry.js.map +0 -1
- package/src/models/components/enrichedindustry.ts +0 -90
package/test/setup.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { beforeAll, afterAll } from "bun:test";
|
|
2
|
+
import { Moov } from "@moovio/sdk";
|
|
3
|
+
import secrets from "./.secrets.json";
|
|
4
|
+
|
|
5
|
+
export let moov: Moov;
|
|
6
|
+
|
|
7
|
+
const verbose = process.env.VERBOSE === "1";
|
|
8
|
+
|
|
9
|
+
type Seen = {
|
|
10
|
+
accountID: string;
|
|
11
|
+
bankAccountID?: string;
|
|
12
|
+
cardID?: string;
|
|
13
|
+
representativeID?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const idsSeen: Set<Seen> = new Set();
|
|
17
|
+
|
|
18
|
+
export const ids = {
|
|
19
|
+
seen: (seen: Seen) => {
|
|
20
|
+
idsSeen.add(seen);
|
|
21
|
+
},
|
|
22
|
+
cleanup: async () => {
|
|
23
|
+
for (const seen of idsSeen) {
|
|
24
|
+
if (seen.representativeID) {
|
|
25
|
+
try {
|
|
26
|
+
console.log("🔄 Removing Representative", seen.representativeID);
|
|
27
|
+
await moov.representatives.delete({ accountID: seen.accountID, representativeID: seen.representativeID! });
|
|
28
|
+
} catch (e) {
|
|
29
|
+
// empty
|
|
30
|
+
}
|
|
31
|
+
} else if (seen.bankAccountID) {
|
|
32
|
+
try {
|
|
33
|
+
console.log("🔄 Removing Bank Account", seen.bankAccountID);
|
|
34
|
+
await moov.bankAccounts.disable({ accountID: seen.accountID, bankAccountID: seen.bankAccountID! });
|
|
35
|
+
} catch (e) {
|
|
36
|
+
// eslint-disable
|
|
37
|
+
}
|
|
38
|
+
} else if (seen.cardID) {
|
|
39
|
+
try {
|
|
40
|
+
console.log("🔄 Removing Card", seen.cardID);
|
|
41
|
+
await moov.cards.disable({ accountID: seen.accountID, cardID: seen.cardID! });
|
|
42
|
+
} catch (e) {
|
|
43
|
+
// empty
|
|
44
|
+
}
|
|
45
|
+
} else if (seen.accountID) {
|
|
46
|
+
try {
|
|
47
|
+
console.log("🔄 Removing Account", seen.accountID);
|
|
48
|
+
await moov.accounts.disconnect({ accountID: seen.accountID });
|
|
49
|
+
} catch (e) {
|
|
50
|
+
// eslint-disable
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
beforeAll(() => {
|
|
58
|
+
if (verbose) {
|
|
59
|
+
// Override global fetch to attach a logger
|
|
60
|
+
const originalFetch = global.fetch;
|
|
61
|
+
global.fetch = async (input: RequestInfo | URL, init?: RequestInit) => {
|
|
62
|
+
const url = input instanceof Request ? input.url : input.toString();
|
|
63
|
+
const headers = input instanceof Request ? input.headers : "";
|
|
64
|
+
const body = input instanceof Request ? input.body : "";
|
|
65
|
+
const method = init?.method || (input instanceof Request ? input.method : "");
|
|
66
|
+
|
|
67
|
+
// Log requests
|
|
68
|
+
console.log(`↗️ API Request | ${method} | URL: ${url}`);
|
|
69
|
+
console.log(`Headers:`);
|
|
70
|
+
console.log(headers);
|
|
71
|
+
console.log(`Body:`);
|
|
72
|
+
console.log(body);
|
|
73
|
+
console.log("\n");
|
|
74
|
+
|
|
75
|
+
// Make the actual request
|
|
76
|
+
const response = await originalFetch(input, init);
|
|
77
|
+
|
|
78
|
+
// Clone the response since it can only be read once
|
|
79
|
+
const responseClone = response.clone();
|
|
80
|
+
|
|
81
|
+
// Log responses
|
|
82
|
+
console.log(`↙️ API Response | ${method} | URL: ${url}`);
|
|
83
|
+
console.log(`Status: ${response.status} ${response.statusText}`);
|
|
84
|
+
console.log(`Headers:`);
|
|
85
|
+
console.log(response.headers);
|
|
86
|
+
console.log(`Body:`);
|
|
87
|
+
try {
|
|
88
|
+
const responseBody = await responseClone.json();
|
|
89
|
+
console.log(JSON.stringify(responseBody, null, 2));
|
|
90
|
+
} catch (e) {
|
|
91
|
+
console.log("<non-JSON response>");
|
|
92
|
+
}
|
|
93
|
+
console.log("\n");
|
|
94
|
+
|
|
95
|
+
return response;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
afterAll(() => {
|
|
99
|
+
global.fetch = originalFetch;
|
|
100
|
+
});
|
|
101
|
+
console.log("ℹ️ Logger setup complete\n\n");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
moov = new Moov({
|
|
105
|
+
security: {
|
|
106
|
+
username: secrets.username,
|
|
107
|
+
password: secrets.password,
|
|
108
|
+
},
|
|
109
|
+
serverURL: secrets.serverURL,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
console.log("ℹ️ Moov SDK setup complete\n\n");
|
|
113
|
+
|
|
114
|
+
afterAll(async () => {
|
|
115
|
+
console.log("\n\n🔄 Cleaning up after tests\n\n");
|
|
116
|
+
// Cleanup if we have the IDs available
|
|
117
|
+
await ids.cleanup();
|
|
118
|
+
});
|
|
119
|
+
});
|
|
@@ -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
|
+
});
|