@codat/lending 0.1.0 → 1.2.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/README.md +312 -1
- package/dist/internal/utils/requestbody.d.ts +1 -1
- package/dist/internal/utils/retries.d.ts +2 -2
- package/dist/internal/utils/security.d.ts +5 -2
- package/dist/internal/utils/security.js +28 -28
- package/dist/sdk/accountingbankdata.d.ts +2 -26
- package/dist/sdk/accountingbankdata.js +24 -146
- package/dist/sdk/accountingbankdataaccounts.d.ts +34 -0
- package/dist/sdk/accountingbankdataaccounts.js +262 -0
- package/dist/sdk/accountspayable.d.ts +8 -170
- package/dist/sdk/accountspayable.js +53 -983
- package/dist/sdk/accountspayablebillcreditnotes.d.ts +34 -0
- package/dist/sdk/accountspayablebillcreditnotes.js +262 -0
- package/dist/sdk/accountspayablebillpayments.d.ts +34 -0
- package/dist/sdk/accountspayablebillpayments.js +262 -0
- package/dist/sdk/accountspayablebills.d.ts +46 -0
- package/dist/sdk/accountspayablebills.js +348 -0
- package/dist/sdk/accountspayablesuppliers.d.ts +74 -0
- package/dist/sdk/accountspayablesuppliers.js +530 -0
- package/dist/sdk/accountsreceivable.d.ts +12 -284
- package/dist/sdk/accountsreceivable.js +13 -1677
- package/dist/sdk/accountsreceivablecreditnotes.d.ts +34 -0
- package/dist/sdk/accountsreceivablecreditnotes.js +262 -0
- package/dist/sdk/accountsreceivablecustomers.d.ts +74 -0
- package/dist/sdk/accountsreceivablecustomers.js +530 -0
- package/dist/sdk/accountsreceivabledirectincomes.d.ts +74 -0
- package/dist/sdk/{financials.js → accountsreceivabledirectincomes.js} +183 -211
- package/dist/sdk/accountsreceivableinvoices.d.ts +93 -0
- package/dist/sdk/{cashflow.js → accountsreceivableinvoices.js} +250 -189
- package/dist/sdk/accountsreceivablepayments.d.ts +34 -0
- package/dist/sdk/accountsreceivablepayments.js +262 -0
- package/dist/sdk/accountsreceivablereports.d.ts +36 -0
- package/dist/sdk/accountsreceivablereports.js +399 -0
- package/dist/sdk/banking.d.ts +15 -0
- package/dist/sdk/banking.js +23 -0
- package/dist/sdk/bankingaccountbalances.d.ts +20 -0
- package/dist/sdk/bankingaccountbalances.js +174 -0
- package/dist/sdk/bankingaccounts.d.ts +34 -0
- package/dist/sdk/bankingaccounts.js +254 -0
- package/dist/sdk/bankingcategorizedstatement.d.ts +19 -0
- package/dist/sdk/bankingcategorizedstatement.js +173 -0
- package/dist/sdk/bankingtransactioncategories.d.ts +34 -0
- package/dist/sdk/bankingtransactioncategories.js +254 -0
- package/dist/sdk/bankingtransactions.d.ts +34 -0
- package/dist/sdk/bankingtransactions.js +254 -0
- package/dist/sdk/companies.js +110 -25
- package/dist/sdk/companyinfo.d.ts +4 -4
- package/dist/sdk/companyinfo.js +52 -18
- package/dist/sdk/connections.js +110 -25
- package/dist/sdk/dataintegrity.js +66 -15
- package/dist/sdk/excelreports.d.ts +10 -2
- package/dist/sdk/excelreports.js +76 -17
- package/dist/sdk/fileupload.js +66 -15
- package/dist/sdk/financialstatements.d.ts +13 -0
- package/dist/sdk/financialstatements.js +21 -0
- package/dist/sdk/financialstatementsaccounts.d.ts +33 -0
- package/dist/sdk/financialstatementsaccounts.js +261 -0
- package/dist/sdk/financialstatementsbalancesheet.d.ts +24 -0
- package/dist/sdk/financialstatementsbalancesheet.js +253 -0
- package/dist/sdk/financialstatementscashflow.d.ts +15 -0
- package/dist/sdk/financialstatementscashflow.js +169 -0
- package/dist/sdk/financialstatementsprofitandloss.d.ts +24 -0
- package/dist/sdk/financialstatementsprofitandloss.js +253 -0
- package/dist/sdk/liabilities.d.ts +4 -4
- package/dist/sdk/liabilities.js +48 -14
- package/dist/sdk/managedata.d.ts +5 -38
- package/dist/sdk/managedata.js +27 -267
- package/dist/sdk/managedatapulloperations.d.ts +22 -0
- package/dist/sdk/managedatapulloperations.js +250 -0
- package/dist/sdk/managedatarefresh.d.ts +28 -0
- package/dist/sdk/managedatarefresh.js +250 -0
- package/dist/sdk/models/operations/{getaccountingcompanyinfo.d.ts → getaccountingprofile.d.ts} +2 -2
- package/dist/sdk/models/operations/{getaccountingcompanyinfo.js → getaccountingprofile.js} +17 -17
- package/dist/sdk/models/operations/{getenhancedprofitandlossaccounts.d.ts → getcategorizedbalancesheetstatement.d.ts} +2 -2
- package/dist/sdk/models/operations/{getenhancedbalancesheetaccounts.js → getcategorizedbalancesheetstatement.js} +19 -19
- package/dist/sdk/models/operations/{getenhancedcashflowtransactions.d.ts → getcategorizedbankstatement.d.ts} +2 -2
- package/dist/sdk/models/operations/{getenhancedcashflowtransactions.js → getcategorizedbankstatement.js} +20 -20
- package/dist/sdk/models/operations/{getenhancedbalancesheetaccounts.d.ts → getcategorizedprofitandlossstatement.d.ts} +2 -2
- package/dist/sdk/models/operations/{getenhancedprofitandlossaccounts.js → getcategorizedprofitandlossstatement.js} +19 -19
- package/dist/sdk/models/operations/{getcommercecompanyinfo.d.ts → getcommerceprofile.d.ts} +2 -2
- package/dist/sdk/models/operations/{getcommercecompanyinfo.js → getcommerceprofile.js} +18 -18
- package/dist/sdk/models/operations/{getcommercerefundsmetrics.d.ts → getcommercerefundsreport.d.ts} +2 -2
- package/dist/sdk/models/operations/{getcommercerefundsmetrics.js → getcommercerefundsreport.js} +23 -23
- package/dist/sdk/models/operations/index.d.ts +8 -8
- package/dist/sdk/models/operations/index.js +8 -8
- package/dist/sdk/models/operations/{isageddebtorreportavailable.d.ts → isageddebtorsreportavailable.d.ts} +3 -3
- package/dist/sdk/models/operations/{isageddebtorreportavailable.js → isageddebtorsreportavailable.js} +16 -16
- package/dist/sdk/models/operations/{getenhancedinvoicesreport.d.ts → listreconciledinvoices.d.ts} +2 -2
- package/dist/sdk/models/operations/{getenhancedinvoicesreport.js → listreconciledinvoices.js} +20 -20
- package/dist/sdk/models/operations/unlinkconnection.d.ts +6 -3
- package/dist/sdk/models/operations/unlinkconnection.js +8 -8
- package/dist/sdk/models/shared/accountbalance.d.ts +1 -1
- package/dist/sdk/models/shared/accountbalance.js +1 -1
- package/dist/sdk/models/shared/accountingaccounts.d.ts +0 -3
- package/dist/sdk/models/shared/accountingaccounts.js +0 -3
- package/dist/sdk/models/shared/accountingaccounttransactions.d.ts +0 -3
- package/dist/sdk/models/shared/accountingaccounttransactions.js +0 -3
- package/dist/sdk/models/shared/accountingbankaccounts.d.ts +0 -3
- package/dist/sdk/models/shared/accountingbankaccounts.js +0 -3
- package/dist/sdk/models/shared/accountingbanktransactions.d.ts +0 -3
- package/dist/sdk/models/shared/accountingbanktransactions.js +0 -3
- package/dist/sdk/models/shared/accountingbill.d.ts +1 -1
- package/dist/sdk/models/shared/accountingbillcreditnote.d.ts +1 -1
- package/dist/sdk/models/shared/accountingbillcreditnotes.d.ts +0 -3
- package/dist/sdk/models/shared/accountingbillcreditnotes.js +0 -3
- package/dist/sdk/models/shared/accountingbillpayment.d.ts +1 -1
- package/dist/sdk/models/shared/accountingbillpayments.d.ts +0 -3
- package/dist/sdk/models/shared/accountingbillpayments.js +0 -3
- package/dist/sdk/models/shared/accountingbills.d.ts +0 -3
- package/dist/sdk/models/shared/accountingbills.js +0 -3
- package/dist/sdk/models/shared/accountingcompanyinfo.d.ts +32 -2
- package/dist/sdk/models/shared/accountingcompanyinfo.js +47 -4
- package/dist/sdk/models/shared/accountingcreditnote.d.ts +1 -1
- package/dist/sdk/models/shared/accountingcreditnotes.d.ts +0 -3
- package/dist/sdk/models/shared/accountingcreditnotes.js +0 -3
- package/dist/sdk/models/shared/accountingcustomer.d.ts +3 -3
- package/dist/sdk/models/shared/accountingcustomer.js +3 -3
- package/dist/sdk/models/shared/accountingcustomers.d.ts +0 -3
- package/dist/sdk/models/shared/accountingcustomers.js +0 -3
- package/dist/sdk/models/shared/accountingdirectcost.d.ts +1 -1
- package/dist/sdk/models/shared/accountingdirectcosts.d.ts +0 -3
- package/dist/sdk/models/shared/accountingdirectcosts.js +0 -3
- package/dist/sdk/models/shared/accountingdirectincome.d.ts +1 -1
- package/dist/sdk/models/shared/accountingdirectincomes.d.ts +0 -3
- package/dist/sdk/models/shared/accountingdirectincomes.js +0 -3
- package/dist/sdk/models/shared/accountinginvoice.d.ts +1 -1
- package/dist/sdk/models/shared/accountinginvoices.d.ts +0 -3
- package/dist/sdk/models/shared/accountinginvoices.js +0 -3
- package/dist/sdk/models/shared/accountingjournalentries.d.ts +0 -3
- package/dist/sdk/models/shared/accountingjournalentries.js +0 -3
- package/dist/sdk/models/shared/accountingjournalentry.d.ts +1 -1
- package/dist/sdk/models/shared/accountingjournals.d.ts +0 -3
- package/dist/sdk/models/shared/accountingjournals.js +0 -3
- package/dist/sdk/models/shared/accountingpayment.d.ts +1 -1
- package/dist/sdk/models/shared/accountingpayments.d.ts +0 -3
- package/dist/sdk/models/shared/accountingpayments.js +0 -3
- package/dist/sdk/models/shared/accountingsupplier.d.ts +3 -3
- package/dist/sdk/models/shared/accountingsupplier.js +3 -3
- package/dist/sdk/models/shared/accountingsuppliers.d.ts +0 -3
- package/dist/sdk/models/shared/accountingsuppliers.js +0 -3
- package/dist/sdk/models/shared/accountingtransfer.d.ts +1 -1
- package/dist/sdk/models/shared/accountingtransfers.d.ts +0 -3
- package/dist/sdk/models/shared/accountingtransfers.js +0 -3
- package/dist/sdk/models/shared/{accountingaddress.d.ts → addressesitems.d.ts} +1 -1
- package/dist/sdk/models/shared/{accountingaddress.js → addressesitems.js} +13 -13
- package/dist/sdk/models/shared/attachments.d.ts +0 -3
- package/dist/sdk/models/shared/attachments.js +0 -3
- package/dist/sdk/models/shared/bankingaccountbalances.d.ts +0 -3
- package/dist/sdk/models/shared/bankingaccountbalances.js +0 -3
- package/dist/sdk/models/shared/bankingaccounts.d.ts +0 -3
- package/dist/sdk/models/shared/bankingaccounts.js +0 -3
- package/dist/sdk/models/shared/bankingtransactioncategories.d.ts +0 -3
- package/dist/sdk/models/shared/bankingtransactioncategories.js +0 -3
- package/dist/sdk/models/shared/bankingtransactions.d.ts +0 -3
- package/dist/sdk/models/shared/bankingtransactions.js +0 -3
- package/dist/sdk/models/shared/commercecustomers.d.ts +0 -3
- package/dist/sdk/models/shared/commercecustomers.js +0 -3
- package/dist/sdk/models/shared/commercedispute.d.ts +1 -1
- package/dist/sdk/models/shared/commercedispute.js +1 -1
- package/dist/sdk/models/shared/commercedisputes.d.ts +0 -3
- package/dist/sdk/models/shared/commercedisputes.js +0 -3
- package/dist/sdk/models/shared/commercelocations.d.ts +0 -3
- package/dist/sdk/models/shared/commercelocations.js +0 -3
- package/dist/sdk/models/shared/commerceorder.d.ts +2 -2
- package/dist/sdk/models/shared/commerceorder.js +1 -1
- package/dist/sdk/models/shared/commerceorders.d.ts +0 -3
- package/dist/sdk/models/shared/commerceorders.js +0 -3
- package/dist/sdk/models/shared/commercepaymentmethods.d.ts +0 -3
- package/dist/sdk/models/shared/commercepaymentmethods.js +0 -3
- package/dist/sdk/models/shared/commercepayments.d.ts +0 -3
- package/dist/sdk/models/shared/commercepayments.js +0 -3
- package/dist/sdk/models/shared/commerceproductcategories.d.ts +0 -3
- package/dist/sdk/models/shared/commerceproductcategories.js +0 -3
- package/dist/sdk/models/shared/commerceproducts.d.ts +0 -3
- package/dist/sdk/models/shared/commerceproducts.js +0 -3
- package/dist/sdk/models/shared/commercetransactions.d.ts +0 -3
- package/dist/sdk/models/shared/commercetransactions.js +0 -3
- package/dist/sdk/models/shared/companies.d.ts +0 -3
- package/dist/sdk/models/shared/companies.js +0 -3
- package/dist/sdk/models/shared/connections.d.ts +0 -3
- package/dist/sdk/models/shared/connections.js +0 -3
- package/dist/sdk/models/shared/contact.d.ts +2 -2
- package/dist/sdk/models/shared/contact.js +3 -3
- package/dist/sdk/models/shared/dataintegritydatatype.d.ts +0 -3
- package/dist/sdk/models/shared/dataintegritydatatype.js +0 -3
- package/dist/sdk/models/shared/dataintegritydetails.d.ts +0 -3
- package/dist/sdk/models/shared/dataintegritydetails.js +0 -3
- package/dist/sdk/models/shared/dataintegritystatuses.d.ts +0 -3
- package/dist/sdk/models/shared/dataintegritystatuses.js +0 -3
- package/dist/sdk/models/shared/dataintegritysummaries.d.ts +0 -3
- package/dist/sdk/models/shared/dataintegritysummaries.js +0 -3
- package/dist/sdk/models/shared/enhancedfinancialreport.d.ts +0 -3
- package/dist/sdk/models/shared/enhancedfinancialreport.js +0 -3
- package/dist/sdk/models/shared/errormessage.d.ts +0 -3
- package/dist/sdk/models/shared/errormessage.js +0 -3
- package/dist/sdk/models/shared/excelstatus.d.ts +0 -3
- package/dist/sdk/models/shared/excelstatus.js +0 -3
- package/dist/sdk/models/shared/index.d.ts +1 -1
- package/dist/sdk/models/shared/index.js +1 -1
- package/dist/sdk/models/shared/loansummary.d.ts +0 -3
- package/dist/sdk/models/shared/loansummary.js +0 -3
- package/dist/sdk/models/shared/loantransactions.d.ts +0 -3
- package/dist/sdk/models/shared/loantransactions.js +0 -3
- package/dist/sdk/models/shared/periodunit.d.ts +0 -3
- package/dist/sdk/models/shared/periodunit.js +0 -3
- package/dist/sdk/models/shared/pulloperations.d.ts +0 -3
- package/dist/sdk/models/shared/pulloperations.js +0 -3
- package/dist/sdk/models/shared/supplementaldata.d.ts +1 -1
- package/dist/sdk/models/shared/supplementaldata.js +1 -1
- package/dist/sdk/sales.d.ts +22 -372
- package/dist/sdk/sales.js +22 -1767
- package/dist/sdk/salescustomers.d.ts +34 -0
- package/dist/sdk/salescustomers.js +262 -0
- package/dist/sdk/salesdisputes.d.ts +34 -0
- package/dist/sdk/salesdisputes.js +262 -0
- package/dist/sdk/saleslocations.d.ts +34 -0
- package/dist/sdk/saleslocations.js +261 -0
- package/dist/sdk/salesmetrics.d.ts +102 -0
- package/dist/sdk/salesmetrics.js +406 -0
- package/dist/sdk/salesorders.d.ts +34 -0
- package/dist/sdk/salesorders.js +262 -0
- package/dist/sdk/salespaymentmethods.d.ts +34 -0
- package/dist/sdk/salespaymentmethods.js +262 -0
- package/dist/sdk/salespayments.d.ts +34 -0
- package/dist/sdk/salespayments.js +262 -0
- package/dist/sdk/salesproductcategories.d.ts +34 -0
- package/dist/sdk/salesproductcategories.js +262 -0
- package/dist/sdk/salesproducts.d.ts +34 -0
- package/dist/sdk/salesproducts.js +262 -0
- package/dist/sdk/salesreports.d.ts +69 -0
- package/dist/sdk/salesreports.js +298 -0
- package/dist/sdk/salestransactions.d.ts +34 -0
- package/dist/sdk/salestransactions.js +262 -0
- package/dist/sdk/sdk.d.ts +38 -30
- package/dist/sdk/sdk.js +33 -45
- package/dist/sdk/transactions.d.ts +10 -176
- package/dist/sdk/transactions.js +11 -1000
- package/dist/sdk/transactionsaccounttransactions.d.ts +34 -0
- package/dist/sdk/transactionsaccounttransactions.js +262 -0
- package/dist/sdk/transactionsdirectcosts.d.ts +74 -0
- package/dist/sdk/transactionsdirectcosts.js +530 -0
- package/dist/sdk/transactionsjournalentries.d.ts +34 -0
- package/dist/sdk/transactionsjournalentries.js +262 -0
- package/dist/sdk/transactionsjournals.d.ts +34 -0
- package/dist/sdk/transactionsjournals.js +262 -0
- package/dist/sdk/transactionstransfers.d.ts +34 -0
- package/dist/sdk/transactionstransfers.js +262 -0
- package/docs/models/operations/{getaccountingcompanyinforequest.md → getaccountingprofilerequest.md} +1 -1
- package/docs/models/operations/{getaccountingcompanyinforesponse.md → getaccountingprofileresponse.md} +1 -1
- package/docs/models/operations/{getenhancedbalancesheetaccountsrequest.md → getcategorizedbalancesheetstatementrequest.md} +1 -1
- package/docs/models/operations/{getenhancedprofitandlossaccountsresponse.md → getcategorizedbalancesheetstatementresponse.md} +1 -1
- package/docs/models/operations/{getenhancedcashflowtransactionsrequest.md → getcategorizedbankstatementrequest.md} +1 -1
- package/docs/models/operations/{getenhancedcashflowtransactionsresponse.md → getcategorizedbankstatementresponse.md} +1 -1
- package/docs/models/operations/{getenhancedprofitandlossaccountsrequest.md → getcategorizedprofitandlossstatementrequest.md} +1 -1
- package/docs/models/operations/{getenhancedbalancesheetaccountsresponse.md → getcategorizedprofitandlossstatementresponse.md} +1 -1
- package/docs/models/operations/{getcommercecompanyinforequest.md → getcommerceprofilerequest.md} +1 -1
- package/docs/models/operations/{getcommercecompanyinforesponse.md → getcommerceprofileresponse.md} +1 -1
- package/docs/models/operations/{getcommercerefundsmetricsrequest.md → getcommercerefundsreportrequest.md} +1 -1
- package/docs/models/operations/{getcommercerefundsmetricsresponse.md → getcommercerefundsreportresponse.md} +1 -1
- package/docs/models/operations/{isageddebtorreportavailablerequest.md → isageddebtorsreportavailablerequest.md} +1 -1
- package/docs/models/operations/{isageddebtorreportavailableresponse.md → isageddebtorsreportavailableresponse.md} +2 -2
- package/docs/models/operations/{getenhancedinvoicesreportrequest.md → listreconciledinvoicesrequest.md} +1 -1
- package/docs/models/operations/{getenhancedinvoicesreportresponse.md → listreconciledinvoicesresponse.md} +1 -1
- package/docs/models/operations/unlinkconnectionrequest.md +5 -5
- package/docs/models/operations/unlinkconnectionupdateconnection.md +8 -0
- package/docs/models/shared/accountbalance.md +1 -1
- package/docs/models/shared/accountingaccounts.md +0 -2
- package/docs/models/shared/accountingaccounttransactions.md +0 -2
- package/docs/models/shared/accountingbankaccounts.md +0 -2
- package/docs/models/shared/accountingbanktransactions.md +0 -2
- package/docs/models/shared/accountingbill.md +1 -1
- package/docs/models/shared/accountingbillcreditnote.md +1 -1
- package/docs/models/shared/accountingbillcreditnotes.md +0 -2
- package/docs/models/shared/accountingbillpayment.md +1 -1
- package/docs/models/shared/accountingbillpayments.md +0 -2
- package/docs/models/shared/accountingbills.md +0 -2
- package/docs/models/shared/accountingcompanyinfo.md +1 -1
- package/docs/models/shared/accountingcompanyinfoaccountingaddress.md +14 -0
- package/docs/models/shared/accountingcreditnote.md +1 -1
- package/docs/models/shared/accountingcreditnotes.md +0 -2
- package/docs/models/shared/accountingcustomer.md +2 -2
- package/docs/models/shared/accountingcustomers.md +0 -2
- package/docs/models/shared/accountingdirectcost.md +1 -1
- package/docs/models/shared/accountingdirectcosts.md +0 -2
- package/docs/models/shared/accountingdirectincome.md +1 -1
- package/docs/models/shared/accountingdirectincomes.md +0 -2
- package/docs/models/shared/accountinginvoice.md +1 -1
- package/docs/models/shared/accountinginvoices.md +0 -2
- package/docs/models/shared/accountingjournalentries.md +0 -2
- package/docs/models/shared/accountingjournalentry.md +1 -1
- package/docs/models/shared/accountingjournals.md +0 -2
- package/docs/models/shared/accountingpayment.md +1 -1
- package/docs/models/shared/accountingpayments.md +0 -2
- package/docs/models/shared/accountingsupplier.md +16 -16
- package/docs/models/shared/accountingsuppliers.md +0 -2
- package/docs/models/shared/accountingtransfer.md +1 -1
- package/docs/models/shared/accountingtransfers.md +0 -2
- package/docs/models/shared/{accountingaddress.md → addressesitems.md} +1 -1
- package/docs/models/shared/attachments.md +0 -2
- package/docs/models/shared/bankingaccountbalances.md +0 -2
- package/docs/models/shared/bankingaccounts.md +0 -2
- package/docs/models/shared/bankingtransactioncategories.md +0 -2
- package/docs/models/shared/bankingtransactions.md +0 -2
- package/docs/models/shared/commercecustomers.md +0 -2
- package/docs/models/shared/commercedispute.md +1 -1
- package/docs/models/shared/commercedisputes.md +0 -2
- package/docs/models/shared/commercelocations.md +0 -2
- package/docs/models/shared/commerceorder.md +1 -1
- package/docs/models/shared/commerceorders.md +0 -2
- package/docs/models/shared/commerceordersupplementaldata.md +1 -1
- package/docs/models/shared/commercepaymentmethods.md +0 -2
- package/docs/models/shared/commercepayments.md +0 -2
- package/docs/models/shared/commerceproductcategories.md +0 -2
- package/docs/models/shared/commerceproducts.md +0 -2
- package/docs/models/shared/commercetransactions.md +0 -2
- package/docs/models/shared/companies.md +0 -2
- package/docs/models/shared/connections.md +0 -2
- package/docs/models/shared/contact.md +1 -1
- package/docs/models/shared/dataintegritydatatype.md +0 -2
- package/docs/models/shared/dataintegritydetails.md +0 -2
- package/docs/models/shared/dataintegritystatuses.md +0 -2
- package/docs/models/shared/dataintegritysummaries.md +0 -2
- package/docs/models/shared/enhancedfinancialreport.md +0 -2
- package/docs/models/shared/errormessage.md +0 -2
- package/docs/models/shared/excelstatus.md +0 -2
- package/docs/models/shared/loansummary.md +0 -2
- package/docs/models/shared/loantransactions.md +0 -2
- package/docs/models/shared/periodunit.md +0 -2
- package/docs/models/shared/pulloperations.md +0 -2
- package/docs/models/shared/supplementaldata.md +1 -1
- package/docs/sdks/accountingbankdata/README.md +2 -101
- package/docs/sdks/accountingbankdataaccounts/README.md +103 -0
- package/docs/sdks/accountspayable/README.md +2 -664
- package/docs/sdks/accountspayablebillcreditnotes/README.md +101 -0
- package/docs/sdks/accountspayablebillpayments/README.md +101 -0
- package/docs/sdks/accountspayablebills/README.md +148 -0
- package/docs/sdks/accountspayablesuppliers/README.md +244 -0
- package/docs/sdks/accountsreceivable/README.md +0 -1089
- package/docs/sdks/accountsreceivablecreditnotes/README.md +101 -0
- package/docs/sdks/accountsreceivablecustomers/README.md +244 -0
- package/docs/sdks/accountsreceivabledirectincomes/README.md +247 -0
- package/docs/sdks/{financials → accountsreceivableinvoices}/README.md +123 -111
- package/docs/sdks/accountsreceivablepayments/README.md +101 -0
- package/docs/sdks/accountsreceivablereports/README.md +172 -0
- package/docs/sdks/banking/README.md +4 -0
- package/docs/sdks/bankingaccountbalances/README.md +54 -0
- package/docs/sdks/bankingaccounts/README.md +103 -0
- package/docs/sdks/bankingcategorizedstatement/README.md +51 -0
- package/docs/sdks/bankingtransactioncategories/README.md +103 -0
- package/docs/sdks/bankingtransactions/README.md +103 -0
- package/docs/sdks/codatlending/README.md +24 -4
- package/docs/sdks/companies/README.md +1 -1
- package/docs/sdks/companyinfo/README.md +22 -22
- package/docs/sdks/connections/README.md +4 -3
- package/docs/sdks/dataintegrity/README.md +5 -5
- package/docs/sdks/excelreports/README.md +12 -4
- package/docs/sdks/fileupload/README.md +2 -2
- package/docs/sdks/financialstatements/README.md +4 -0
- package/docs/sdks/financialstatementsaccounts/README.md +100 -0
- package/docs/sdks/financialstatementsbalancesheet/README.md +91 -0
- package/docs/sdks/financialstatementscashflow/README.md +47 -0
- package/docs/sdks/financialstatementsprofitandloss/README.md +91 -0
- package/docs/sdks/liabilities/README.md +4 -4
- package/docs/sdks/managedata/README.md +3 -181
- package/docs/sdks/managedatapulloperations/README.md +89 -0
- package/docs/sdks/managedatarefresh/README.md +93 -0
- package/docs/sdks/sales/README.md +0 -1223
- package/docs/sdks/salescustomers/README.md +103 -0
- package/docs/sdks/salesdisputes/README.md +103 -0
- package/docs/sdks/saleslocations/README.md +99 -0
- package/docs/sdks/salesmetrics/README.md +218 -0
- package/docs/sdks/salesorders/README.md +103 -0
- package/docs/sdks/salespaymentmethods/README.md +103 -0
- package/docs/sdks/salespayments/README.md +103 -0
- package/docs/sdks/salesproductcategories/README.md +103 -0
- package/docs/sdks/salesproducts/README.md +103 -0
- package/docs/sdks/salesreports/README.md +145 -0
- package/docs/sdks/salestransactions/README.md +103 -0
- package/docs/sdks/transactions/README.md +0 -638
- package/docs/sdks/transactionsaccounttransactions/README.md +103 -0
- package/docs/sdks/transactionsdirectcosts/README.md +246 -0
- package/docs/sdks/transactionsjournalentries/README.md +101 -0
- package/docs/sdks/transactionsjournals/README.md +101 -0
- package/docs/sdks/transactionstransfers/README.md +103 -0
- package/package.json +1 -1
- package/dist/sdk/cashflow.d.ts +0 -112
- package/dist/sdk/financials.d.ts +0 -75
- package/docs/models/operations/unlinkconnectionrequestbody.md +0 -8
- package/docs/sdks/cashflow/README.md +0 -402
|
@@ -73,61 +73,83 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
-
exports.
|
|
76
|
+
exports.AccountsReceivableInvoices = exports.DownloadAttachmentAcceptEnum = void 0;
|
|
77
77
|
var utils = __importStar(require("../internal/utils"));
|
|
78
78
|
var errors = __importStar(require("./models/errors"));
|
|
79
79
|
var operations = __importStar(require("./models/operations"));
|
|
80
80
|
var shared = __importStar(require("./models/shared"));
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
var DownloadAttachmentAcceptEnum;
|
|
82
|
+
(function (DownloadAttachmentAcceptEnum) {
|
|
83
|
+
DownloadAttachmentAcceptEnum["applicationJson"] = "application/json";
|
|
84
|
+
DownloadAttachmentAcceptEnum["applicationOctetStream"] = "application/octet-stream";
|
|
85
|
+
})(DownloadAttachmentAcceptEnum = exports.DownloadAttachmentAcceptEnum || (exports.DownloadAttachmentAcceptEnum = {}));
|
|
86
|
+
var AccountsReceivableInvoices = /** @class */ (function () {
|
|
87
|
+
function AccountsReceivableInvoices(sdkConfig) {
|
|
86
88
|
this.sdkConfiguration = sdkConfig;
|
|
87
89
|
}
|
|
88
90
|
/**
|
|
89
|
-
*
|
|
91
|
+
* Download invoice attachment
|
|
90
92
|
*
|
|
91
93
|
* @remarks
|
|
92
|
-
* The *
|
|
93
|
-
*
|
|
94
|
-
* [Accounts](https://docs.codat.io/banking-api#/schemas/Account) are financial accounts maintained by a bank or other financial institution.
|
|
94
|
+
* The *Download invoice attachment* endpoint downloads a specific attachment for a given `invoiceId` and `attachmentId`.
|
|
95
95
|
*
|
|
96
|
-
*
|
|
96
|
+
* [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer.
|
|
97
97
|
*
|
|
98
|
-
*
|
|
98
|
+
* Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support downloading an invoice attachment.
|
|
99
99
|
*
|
|
100
100
|
*/
|
|
101
|
-
|
|
101
|
+
AccountsReceivableInvoices.prototype.downloadAttachment = function (req, retries, config, acceptHeaderOverride) {
|
|
102
102
|
var _a, _b;
|
|
103
103
|
return __awaiter(this, void 0, void 0, function () {
|
|
104
|
-
var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
|
|
104
|
+
var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
|
|
105
105
|
return __generator(this, function (_c) {
|
|
106
106
|
switch (_c.label) {
|
|
107
107
|
case 0:
|
|
108
108
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
109
|
-
req = new operations.
|
|
109
|
+
req = new operations.DownloadAccountingInvoiceAttachmentRequest(req);
|
|
110
110
|
}
|
|
111
111
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
112
|
-
url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/
|
|
113
|
-
client = this.sdkConfiguration.
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments/{attachmentId}/download", req);
|
|
113
|
+
client = this.sdkConfiguration.defaultClient;
|
|
114
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
115
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
116
|
+
return [4 /*yield*/, globalSecurity()];
|
|
117
|
+
case 1:
|
|
118
|
+
globalSecurity = _c.sent();
|
|
119
|
+
_c.label = 2;
|
|
120
|
+
case 2:
|
|
121
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
122
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
123
|
+
}
|
|
124
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
125
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
126
|
+
if (acceptHeaderOverride !== undefined) {
|
|
127
|
+
headers["Accept"] = acceptHeaderOverride.toString();
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
headers["Accept"] = "application/json;q=1, application/octet-stream;q=0";
|
|
131
|
+
}
|
|
116
132
|
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
133
|
+
globalRetryConfig = this.sdkConfiguration.retryConfig;
|
|
117
134
|
retryConfig = retries;
|
|
118
135
|
if (!retryConfig) {
|
|
119
|
-
|
|
136
|
+
if (globalRetryConfig) {
|
|
137
|
+
retryConfig = globalRetryConfig;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
|
|
141
|
+
}
|
|
120
142
|
}
|
|
121
143
|
return [4 /*yield*/, utils.Retry(function () {
|
|
122
144
|
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
|
|
123
145
|
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
|
|
124
|
-
case
|
|
146
|
+
case 3:
|
|
125
147
|
httpRes = _c.sent();
|
|
126
148
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
127
149
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
128
150
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
129
151
|
}
|
|
130
|
-
res = new operations.
|
|
152
|
+
res = new operations.DownloadAccountingInvoiceAttachmentResponse({
|
|
131
153
|
statusCode: httpRes.status,
|
|
132
154
|
contentType: contentType,
|
|
133
155
|
rawResponse: httpRes,
|
|
@@ -135,71 +157,16 @@ var CashFlow = /** @class */ (function () {
|
|
|
135
157
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
136
158
|
switch (true) {
|
|
137
159
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
138
|
-
if (utils.matchContentType(contentType, "application/
|
|
139
|
-
res.
|
|
160
|
+
if (utils.matchContentType(contentType, "application/octet-stream")) {
|
|
161
|
+
res.data = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
140
162
|
}
|
|
141
163
|
else {
|
|
142
164
|
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
143
165
|
}
|
|
144
166
|
break;
|
|
145
|
-
|
|
146
|
-
return [2 /*return*/, res];
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Get bank transaction
|
|
153
|
-
*
|
|
154
|
-
* @remarks
|
|
155
|
-
* The *Get transaction* endpoint returns a single transaction for a given transactionId.
|
|
156
|
-
*
|
|
157
|
-
* [Transactions](https://docs.codat.io/banking-api#/schemas/Transaction) provide an immutable source of up-to-date information on income and expenditure.
|
|
158
|
-
*
|
|
159
|
-
* Check out our [coverage explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-transactions) for integrations that support getting a specific transaction.
|
|
160
|
-
*
|
|
161
|
-
* Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
|
|
162
|
-
*
|
|
163
|
-
*/
|
|
164
|
-
CashFlow.prototype.getBankTransaction = function (req, retries, config) {
|
|
165
|
-
var _a, _b;
|
|
166
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
167
|
-
var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
|
|
168
|
-
return __generator(this, function (_c) {
|
|
169
|
-
switch (_c.label) {
|
|
170
|
-
case 0:
|
|
171
|
-
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
172
|
-
req = new operations.GetBankingTransactionRequest(req);
|
|
173
|
-
}
|
|
174
|
-
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
175
|
-
url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/banking-transactions/{transactionId}", req);
|
|
176
|
-
client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
|
|
177
|
-
headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
|
|
178
|
-
headers["Accept"] = "application/json";
|
|
179
|
-
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
180
|
-
retryConfig = retries;
|
|
181
|
-
if (!retryConfig) {
|
|
182
|
-
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
|
|
183
|
-
}
|
|
184
|
-
return [4 /*yield*/, utils.Retry(function () {
|
|
185
|
-
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
|
|
186
|
-
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
|
|
187
|
-
case 1:
|
|
188
|
-
httpRes = _c.sent();
|
|
189
|
-
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
190
|
-
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
191
|
-
throw new Error("status code not found in response: ".concat(httpRes));
|
|
192
|
-
}
|
|
193
|
-
res = new operations.GetBankingTransactionResponse({
|
|
194
|
-
statusCode: httpRes.status,
|
|
195
|
-
contentType: contentType,
|
|
196
|
-
rawResponse: httpRes,
|
|
197
|
-
});
|
|
198
|
-
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
199
|
-
switch (true) {
|
|
200
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
167
|
+
case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
|
|
201
168
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
202
|
-
res.
|
|
169
|
+
res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
|
|
203
170
|
}
|
|
204
171
|
else {
|
|
205
172
|
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
@@ -212,60 +179,69 @@ var CashFlow = /** @class */ (function () {
|
|
|
212
179
|
});
|
|
213
180
|
};
|
|
214
181
|
/**
|
|
215
|
-
* Get
|
|
182
|
+
* Get invoice as PDF
|
|
216
183
|
*
|
|
217
184
|
* @remarks
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* [Transaction categories](https://docs.codat.io/banking-api#/schemas/TransactionCategory) are associated with a transaction to provide greater contextual meaning to transaction activity.
|
|
221
|
-
*
|
|
222
|
-
* Check out our [coverage explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-transactionCategories) for integrations that support getting a specific transaction category.
|
|
223
|
-
*
|
|
224
|
-
* Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
|
|
225
|
-
*
|
|
185
|
+
* Download invoice as a pdf.
|
|
226
186
|
*/
|
|
227
|
-
|
|
187
|
+
AccountsReceivableInvoices.prototype.downloadPdf = function (req, retries, config) {
|
|
228
188
|
var _a, _b;
|
|
229
189
|
return __awaiter(this, void 0, void 0, function () {
|
|
230
|
-
var baseURL, url, client, headers, retryConfig, httpRes, contentType, res
|
|
190
|
+
var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res;
|
|
231
191
|
return __generator(this, function (_c) {
|
|
232
192
|
switch (_c.label) {
|
|
233
193
|
case 0:
|
|
234
194
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
235
|
-
req = new operations.
|
|
195
|
+
req = new operations.DownloadAccountingInvoicePdfRequest(req);
|
|
236
196
|
}
|
|
237
197
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
238
|
-
url = utils.generateURL(baseURL, "/companies/{companyId}/
|
|
239
|
-
client = this.sdkConfiguration.
|
|
240
|
-
|
|
241
|
-
|
|
198
|
+
url = utils.generateURL(baseURL, "/companies/{companyId}/data/invoices/{invoiceId}/pdf", req);
|
|
199
|
+
client = this.sdkConfiguration.defaultClient;
|
|
200
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
201
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
202
|
+
return [4 /*yield*/, globalSecurity()];
|
|
203
|
+
case 1:
|
|
204
|
+
globalSecurity = _c.sent();
|
|
205
|
+
_c.label = 2;
|
|
206
|
+
case 2:
|
|
207
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
208
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
209
|
+
}
|
|
210
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
211
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
212
|
+
headers["Accept"] = "application/octet-stream";
|
|
242
213
|
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
214
|
+
globalRetryConfig = this.sdkConfiguration.retryConfig;
|
|
243
215
|
retryConfig = retries;
|
|
244
216
|
if (!retryConfig) {
|
|
245
|
-
|
|
217
|
+
if (globalRetryConfig) {
|
|
218
|
+
retryConfig = globalRetryConfig;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
|
|
222
|
+
}
|
|
246
223
|
}
|
|
247
224
|
return [4 /*yield*/, utils.Retry(function () {
|
|
248
225
|
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
|
|
249
226
|
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
|
|
250
|
-
case
|
|
227
|
+
case 3:
|
|
251
228
|
httpRes = _c.sent();
|
|
252
229
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
253
230
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
254
231
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
255
232
|
}
|
|
256
|
-
res = new operations.
|
|
233
|
+
res = new operations.DownloadAccountingInvoicePdfResponse({
|
|
257
234
|
statusCode: httpRes.status,
|
|
258
235
|
contentType: contentType,
|
|
259
236
|
rawResponse: httpRes,
|
|
260
237
|
});
|
|
261
|
-
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
262
238
|
switch (true) {
|
|
263
239
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
264
|
-
if (utils.matchContentType(contentType, "application/
|
|
265
|
-
res.
|
|
240
|
+
if (utils.matchContentType(contentType, "application/octet-stream")) {
|
|
241
|
+
res.data = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
266
242
|
}
|
|
267
243
|
else {
|
|
268
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status,
|
|
244
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, httpRes);
|
|
269
245
|
}
|
|
270
246
|
break;
|
|
271
247
|
}
|
|
@@ -275,46 +251,64 @@ var CashFlow = /** @class */ (function () {
|
|
|
275
251
|
});
|
|
276
252
|
};
|
|
277
253
|
/**
|
|
278
|
-
* Get
|
|
254
|
+
* Get invoice
|
|
279
255
|
*
|
|
280
256
|
* @remarks
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
257
|
+
* The *Get invoice* endpoint returns a single invoice for a given invoiceId.
|
|
258
|
+
*
|
|
259
|
+
* [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer.
|
|
284
260
|
*
|
|
285
|
-
*
|
|
261
|
+
* Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting a specific invoice.
|
|
262
|
+
*
|
|
263
|
+
* Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
|
|
286
264
|
*/
|
|
287
|
-
|
|
265
|
+
AccountsReceivableInvoices.prototype.get = function (req, retries, config) {
|
|
288
266
|
var _a, _b;
|
|
289
267
|
return __awaiter(this, void 0, void 0, function () {
|
|
290
|
-
var baseURL, url, client, headers,
|
|
268
|
+
var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
|
|
291
269
|
return __generator(this, function (_c) {
|
|
292
270
|
switch (_c.label) {
|
|
293
271
|
case 0:
|
|
294
272
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
295
|
-
req = new operations.
|
|
273
|
+
req = new operations.GetAccountingInvoiceRequest(req);
|
|
296
274
|
}
|
|
297
275
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
298
|
-
url = utils.generateURL(baseURL, "/companies/{companyId}/
|
|
299
|
-
client = this.sdkConfiguration.
|
|
300
|
-
|
|
301
|
-
|
|
276
|
+
url = utils.generateURL(baseURL, "/companies/{companyId}/data/invoices/{invoiceId}", req);
|
|
277
|
+
client = this.sdkConfiguration.defaultClient;
|
|
278
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
279
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
280
|
+
return [4 /*yield*/, globalSecurity()];
|
|
281
|
+
case 1:
|
|
282
|
+
globalSecurity = _c.sent();
|
|
283
|
+
_c.label = 2;
|
|
284
|
+
case 2:
|
|
285
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
286
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
287
|
+
}
|
|
288
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
289
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
302
290
|
headers["Accept"] = "application/json";
|
|
303
291
|
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
292
|
+
globalRetryConfig = this.sdkConfiguration.retryConfig;
|
|
304
293
|
retryConfig = retries;
|
|
305
294
|
if (!retryConfig) {
|
|
306
|
-
|
|
295
|
+
if (globalRetryConfig) {
|
|
296
|
+
retryConfig = globalRetryConfig;
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
|
|
300
|
+
}
|
|
307
301
|
}
|
|
308
302
|
return [4 /*yield*/, utils.Retry(function () {
|
|
309
|
-
return client.request(__assign({ validateStatus: function () { return true; }, url: url
|
|
303
|
+
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
|
|
310
304
|
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
|
|
311
|
-
case
|
|
305
|
+
case 3:
|
|
312
306
|
httpRes = _c.sent();
|
|
313
307
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
314
308
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
315
309
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
316
310
|
}
|
|
317
|
-
res = new operations.
|
|
311
|
+
res = new operations.GetAccountingInvoiceResponse({
|
|
318
312
|
statusCode: httpRes.status,
|
|
319
313
|
contentType: contentType,
|
|
320
314
|
rawResponse: httpRes,
|
|
@@ -323,13 +317,13 @@ var CashFlow = /** @class */ (function () {
|
|
|
323
317
|
switch (true) {
|
|
324
318
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
325
319
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
326
|
-
res.
|
|
320
|
+
res.accountingInvoice = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingInvoice);
|
|
327
321
|
}
|
|
328
322
|
else {
|
|
329
323
|
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
330
324
|
}
|
|
331
325
|
break;
|
|
332
|
-
case [401, 404].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
|
|
326
|
+
case [401, 404, 409, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
|
|
333
327
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
334
328
|
res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
|
|
335
329
|
}
|
|
@@ -344,47 +338,63 @@ var CashFlow = /** @class */ (function () {
|
|
|
344
338
|
});
|
|
345
339
|
};
|
|
346
340
|
/**
|
|
347
|
-
*
|
|
341
|
+
* Get invoice attachment
|
|
348
342
|
*
|
|
349
343
|
* @remarks
|
|
350
|
-
* The *
|
|
344
|
+
* The *Get invoice attachment* endpoint returns a specific attachment for a given `invoiceId` and `attachmentId`.
|
|
351
345
|
*
|
|
352
|
-
* [
|
|
346
|
+
* [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer.
|
|
353
347
|
*
|
|
354
|
-
*
|
|
348
|
+
* Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting an invoice attachment.
|
|
355
349
|
*
|
|
356
350
|
*/
|
|
357
|
-
|
|
351
|
+
AccountsReceivableInvoices.prototype.getAttachment = function (req, retries, config) {
|
|
358
352
|
var _a, _b;
|
|
359
353
|
return __awaiter(this, void 0, void 0, function () {
|
|
360
|
-
var baseURL, url, client, headers,
|
|
354
|
+
var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
|
|
361
355
|
return __generator(this, function (_c) {
|
|
362
356
|
switch (_c.label) {
|
|
363
357
|
case 0:
|
|
364
358
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
365
|
-
req = new operations.
|
|
359
|
+
req = new operations.GetAccountingInvoiceAttachmentRequest(req);
|
|
366
360
|
}
|
|
367
361
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
368
|
-
url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/
|
|
369
|
-
client = this.sdkConfiguration.
|
|
370
|
-
|
|
371
|
-
|
|
362
|
+
url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments/{attachmentId}", req);
|
|
363
|
+
client = this.sdkConfiguration.defaultClient;
|
|
364
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
365
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
366
|
+
return [4 /*yield*/, globalSecurity()];
|
|
367
|
+
case 1:
|
|
368
|
+
globalSecurity = _c.sent();
|
|
369
|
+
_c.label = 2;
|
|
370
|
+
case 2:
|
|
371
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
372
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
373
|
+
}
|
|
374
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
375
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
372
376
|
headers["Accept"] = "application/json";
|
|
373
377
|
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
378
|
+
globalRetryConfig = this.sdkConfiguration.retryConfig;
|
|
374
379
|
retryConfig = retries;
|
|
375
380
|
if (!retryConfig) {
|
|
376
|
-
|
|
381
|
+
if (globalRetryConfig) {
|
|
382
|
+
retryConfig = globalRetryConfig;
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
|
|
386
|
+
}
|
|
377
387
|
}
|
|
378
388
|
return [4 /*yield*/, utils.Retry(function () {
|
|
379
|
-
return client.request(__assign({ validateStatus: function () { return true; }, url: url
|
|
389
|
+
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
|
|
380
390
|
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
|
|
381
|
-
case
|
|
391
|
+
case 3:
|
|
382
392
|
httpRes = _c.sent();
|
|
383
393
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
384
394
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
385
395
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
386
396
|
}
|
|
387
|
-
res = new operations.
|
|
397
|
+
res = new operations.GetAccountingInvoiceAttachmentResponse({
|
|
388
398
|
statusCode: httpRes.status,
|
|
389
399
|
contentType: contentType,
|
|
390
400
|
rawResponse: httpRes,
|
|
@@ -393,13 +403,13 @@ var CashFlow = /** @class */ (function () {
|
|
|
393
403
|
switch (true) {
|
|
394
404
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
395
405
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
396
|
-
res.
|
|
406
|
+
res.accountingAttachment = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingAttachment);
|
|
397
407
|
}
|
|
398
408
|
else {
|
|
399
409
|
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
400
410
|
}
|
|
401
411
|
break;
|
|
402
|
-
case [
|
|
412
|
+
case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
|
|
403
413
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
404
414
|
res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
|
|
405
415
|
}
|
|
@@ -414,47 +424,70 @@ var CashFlow = /** @class */ (function () {
|
|
|
414
424
|
});
|
|
415
425
|
};
|
|
416
426
|
/**
|
|
417
|
-
* List
|
|
427
|
+
* List invoices
|
|
418
428
|
*
|
|
419
429
|
* @remarks
|
|
420
|
-
* The *List
|
|
430
|
+
* The *List invoices* endpoint returns a list of [invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) for a given company's connection.
|
|
421
431
|
*
|
|
422
|
-
* [
|
|
432
|
+
* [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer.
|
|
423
433
|
*
|
|
424
434
|
* Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
|
|
425
435
|
*
|
|
436
|
+
* ### Useful queries
|
|
437
|
+
*
|
|
438
|
+
* - Outstanding invoices - `query = amountDue > 0`
|
|
439
|
+
* - Invoices due after a certain date: `query = dueDate > 2021-01-28`
|
|
440
|
+
*
|
|
441
|
+
* [Read more about querying](https://docs.codat.io/using-the-api/querying).
|
|
426
442
|
*/
|
|
427
|
-
|
|
443
|
+
AccountsReceivableInvoices.prototype.list = function (req, retries, config) {
|
|
428
444
|
var _a, _b;
|
|
429
445
|
return __awaiter(this, void 0, void 0, function () {
|
|
430
|
-
var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes;
|
|
446
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
|
|
431
447
|
return __generator(this, function (_c) {
|
|
432
448
|
switch (_c.label) {
|
|
433
449
|
case 0:
|
|
434
450
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
435
|
-
req = new operations.
|
|
451
|
+
req = new operations.ListAccountingInvoicesRequest(req);
|
|
436
452
|
}
|
|
437
453
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
438
|
-
url = utils.generateURL(baseURL, "/companies/{companyId}/
|
|
439
|
-
client = this.sdkConfiguration.
|
|
440
|
-
|
|
454
|
+
url = utils.generateURL(baseURL, "/companies/{companyId}/data/invoices", req);
|
|
455
|
+
client = this.sdkConfiguration.defaultClient;
|
|
456
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
457
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
458
|
+
return [4 /*yield*/, globalSecurity()];
|
|
459
|
+
case 1:
|
|
460
|
+
globalSecurity = _c.sent();
|
|
461
|
+
_c.label = 2;
|
|
462
|
+
case 2:
|
|
463
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
464
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
465
|
+
}
|
|
466
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
467
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
441
468
|
queryParams = utils.serializeQueryParams(req);
|
|
442
469
|
headers["Accept"] = "application/json";
|
|
443
470
|
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
471
|
+
globalRetryConfig = this.sdkConfiguration.retryConfig;
|
|
444
472
|
retryConfig = retries;
|
|
445
473
|
if (!retryConfig) {
|
|
446
|
-
|
|
474
|
+
if (globalRetryConfig) {
|
|
475
|
+
retryConfig = globalRetryConfig;
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
|
|
479
|
+
}
|
|
447
480
|
}
|
|
448
481
|
return [4 /*yield*/, utils.Retry(function () {
|
|
449
482
|
return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config));
|
|
450
483
|
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
|
|
451
|
-
case
|
|
484
|
+
case 3:
|
|
452
485
|
httpRes = _c.sent();
|
|
453
486
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
454
487
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
455
488
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
456
489
|
}
|
|
457
|
-
res = new operations.
|
|
490
|
+
res = new operations.ListAccountingInvoicesResponse({
|
|
458
491
|
statusCode: httpRes.status,
|
|
459
492
|
contentType: contentType,
|
|
460
493
|
rawResponse: httpRes,
|
|
@@ -463,7 +496,7 @@ var CashFlow = /** @class */ (function () {
|
|
|
463
496
|
switch (true) {
|
|
464
497
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
465
498
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
466
|
-
res.
|
|
499
|
+
res.accountingInvoices = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingInvoices);
|
|
467
500
|
}
|
|
468
501
|
else {
|
|
469
502
|
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
@@ -484,47 +517,63 @@ var CashFlow = /** @class */ (function () {
|
|
|
484
517
|
});
|
|
485
518
|
};
|
|
486
519
|
/**
|
|
487
|
-
* List
|
|
520
|
+
* List invoice attachments
|
|
488
521
|
*
|
|
489
522
|
* @remarks
|
|
490
|
-
* The *List
|
|
523
|
+
* The *List invoice attachments* endpoint returns a list of attachments available to download for given `invoiceId`.
|
|
491
524
|
*
|
|
492
|
-
* [
|
|
525
|
+
* [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer.
|
|
493
526
|
*
|
|
494
|
-
*
|
|
527
|
+
* Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support listing invoice attachments.
|
|
495
528
|
*
|
|
496
529
|
*/
|
|
497
|
-
|
|
530
|
+
AccountsReceivableInvoices.prototype.listAttachments = function (req, retries, config) {
|
|
498
531
|
var _a, _b;
|
|
499
532
|
return __awaiter(this, void 0, void 0, function () {
|
|
500
|
-
var baseURL, url, client, headers,
|
|
533
|
+
var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
|
|
501
534
|
return __generator(this, function (_c) {
|
|
502
535
|
switch (_c.label) {
|
|
503
536
|
case 0:
|
|
504
537
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
505
|
-
req = new operations.
|
|
538
|
+
req = new operations.ListAccountingInvoiceAttachmentsRequest(req);
|
|
506
539
|
}
|
|
507
540
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
508
|
-
url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/
|
|
509
|
-
client = this.sdkConfiguration.
|
|
510
|
-
|
|
511
|
-
|
|
541
|
+
url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments", req);
|
|
542
|
+
client = this.sdkConfiguration.defaultClient;
|
|
543
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
544
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
545
|
+
return [4 /*yield*/, globalSecurity()];
|
|
546
|
+
case 1:
|
|
547
|
+
globalSecurity = _c.sent();
|
|
548
|
+
_c.label = 2;
|
|
549
|
+
case 2:
|
|
550
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
551
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
552
|
+
}
|
|
553
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
554
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
512
555
|
headers["Accept"] = "application/json";
|
|
513
556
|
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
557
|
+
globalRetryConfig = this.sdkConfiguration.retryConfig;
|
|
514
558
|
retryConfig = retries;
|
|
515
559
|
if (!retryConfig) {
|
|
516
|
-
|
|
560
|
+
if (globalRetryConfig) {
|
|
561
|
+
retryConfig = globalRetryConfig;
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
|
|
565
|
+
}
|
|
517
566
|
}
|
|
518
567
|
return [4 /*yield*/, utils.Retry(function () {
|
|
519
|
-
return client.request(__assign({ validateStatus: function () { return true; }, url: url
|
|
568
|
+
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
|
|
520
569
|
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
|
|
521
|
-
case
|
|
570
|
+
case 3:
|
|
522
571
|
httpRes = _c.sent();
|
|
523
572
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
524
573
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
525
574
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
526
575
|
}
|
|
527
|
-
res = new operations.
|
|
576
|
+
res = new operations.ListAccountingInvoiceAttachmentsResponse({
|
|
528
577
|
statusCode: httpRes.status,
|
|
529
578
|
contentType: contentType,
|
|
530
579
|
rawResponse: httpRes,
|
|
@@ -533,13 +582,13 @@ var CashFlow = /** @class */ (function () {
|
|
|
533
582
|
switch (true) {
|
|
534
583
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
535
584
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
536
|
-
res.
|
|
585
|
+
res.attachments = utils.objectToClass(JSON.parse(decodedRes), shared.Attachments);
|
|
537
586
|
}
|
|
538
587
|
else {
|
|
539
588
|
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
540
589
|
}
|
|
541
590
|
break;
|
|
542
|
-
case [
|
|
591
|
+
case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
|
|
543
592
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
544
593
|
res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
|
|
545
594
|
}
|
|
@@ -554,47 +603,59 @@ var CashFlow = /** @class */ (function () {
|
|
|
554
603
|
});
|
|
555
604
|
};
|
|
556
605
|
/**
|
|
557
|
-
* List
|
|
606
|
+
* List reconciled invoices
|
|
558
607
|
*
|
|
559
608
|
* @remarks
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
* [Transactions](https://docs.codat.io/banking-api#/schemas/Transaction) provide an immutable source of up-to-date information on income and expenditure.
|
|
563
|
-
*
|
|
564
|
-
* Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
|
|
565
|
-
*
|
|
609
|
+
* Gets a list of invoices linked to the corresponding banking transaction
|
|
566
610
|
*/
|
|
567
|
-
|
|
611
|
+
AccountsReceivableInvoices.prototype.listReconciled = function (req, retries, config) {
|
|
568
612
|
var _a, _b;
|
|
569
613
|
return __awaiter(this, void 0, void 0, function () {
|
|
570
|
-
var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes;
|
|
614
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
|
|
571
615
|
return __generator(this, function (_c) {
|
|
572
616
|
switch (_c.label) {
|
|
573
617
|
case 0:
|
|
574
618
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
575
|
-
req = new operations.
|
|
619
|
+
req = new operations.ListReconciledInvoicesRequest(req);
|
|
576
620
|
}
|
|
577
621
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
578
|
-
url = utils.generateURL(baseURL, "/companies/{companyId}/
|
|
579
|
-
client = this.sdkConfiguration.
|
|
580
|
-
|
|
622
|
+
url = utils.generateURL(baseURL, "/companies/{companyId}/reports/enhancedInvoices", req);
|
|
623
|
+
client = this.sdkConfiguration.defaultClient;
|
|
624
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
625
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
626
|
+
return [4 /*yield*/, globalSecurity()];
|
|
627
|
+
case 1:
|
|
628
|
+
globalSecurity = _c.sent();
|
|
629
|
+
_c.label = 2;
|
|
630
|
+
case 2:
|
|
631
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
632
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
633
|
+
}
|
|
634
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
635
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
581
636
|
queryParams = utils.serializeQueryParams(req);
|
|
582
637
|
headers["Accept"] = "application/json";
|
|
583
638
|
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
639
|
+
globalRetryConfig = this.sdkConfiguration.retryConfig;
|
|
584
640
|
retryConfig = retries;
|
|
585
641
|
if (!retryConfig) {
|
|
586
|
-
|
|
642
|
+
if (globalRetryConfig) {
|
|
643
|
+
retryConfig = globalRetryConfig;
|
|
644
|
+
}
|
|
645
|
+
else {
|
|
646
|
+
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
|
|
647
|
+
}
|
|
587
648
|
}
|
|
588
649
|
return [4 /*yield*/, utils.Retry(function () {
|
|
589
650
|
return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config));
|
|
590
651
|
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
|
|
591
|
-
case
|
|
652
|
+
case 3:
|
|
592
653
|
httpRes = _c.sent();
|
|
593
654
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
594
655
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
595
656
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
596
657
|
}
|
|
597
|
-
res = new operations.
|
|
658
|
+
res = new operations.ListReconciledInvoicesResponse({
|
|
598
659
|
statusCode: httpRes.status,
|
|
599
660
|
contentType: contentType,
|
|
600
661
|
rawResponse: httpRes,
|
|
@@ -603,13 +664,13 @@ var CashFlow = /** @class */ (function () {
|
|
|
603
664
|
switch (true) {
|
|
604
665
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
605
666
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
606
|
-
res.
|
|
667
|
+
res.enhancedInvoicesReport = utils.objectToClass(JSON.parse(decodedRes), shared.EnhancedInvoicesReport);
|
|
607
668
|
}
|
|
608
669
|
else {
|
|
609
670
|
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
610
671
|
}
|
|
611
672
|
break;
|
|
612
|
-
case [
|
|
673
|
+
case [401, 404].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
|
|
613
674
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
614
675
|
res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
|
|
615
676
|
}
|
|
@@ -623,6 +684,6 @@ var CashFlow = /** @class */ (function () {
|
|
|
623
684
|
});
|
|
624
685
|
});
|
|
625
686
|
};
|
|
626
|
-
return
|
|
687
|
+
return AccountsReceivableInvoices;
|
|
627
688
|
}());
|
|
628
|
-
exports.
|
|
689
|
+
exports.AccountsReceivableInvoices = AccountsReceivableInvoices;
|