@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.
Files changed (389) hide show
  1. package/README.md +312 -1
  2. package/dist/internal/utils/requestbody.d.ts +1 -1
  3. package/dist/internal/utils/retries.d.ts +2 -2
  4. package/dist/internal/utils/security.d.ts +5 -2
  5. package/dist/internal/utils/security.js +28 -28
  6. package/dist/sdk/accountingbankdata.d.ts +2 -26
  7. package/dist/sdk/accountingbankdata.js +24 -146
  8. package/dist/sdk/accountingbankdataaccounts.d.ts +34 -0
  9. package/dist/sdk/accountingbankdataaccounts.js +262 -0
  10. package/dist/sdk/accountspayable.d.ts +8 -170
  11. package/dist/sdk/accountspayable.js +53 -983
  12. package/dist/sdk/accountspayablebillcreditnotes.d.ts +34 -0
  13. package/dist/sdk/accountspayablebillcreditnotes.js +262 -0
  14. package/dist/sdk/accountspayablebillpayments.d.ts +34 -0
  15. package/dist/sdk/accountspayablebillpayments.js +262 -0
  16. package/dist/sdk/accountspayablebills.d.ts +46 -0
  17. package/dist/sdk/accountspayablebills.js +348 -0
  18. package/dist/sdk/accountspayablesuppliers.d.ts +74 -0
  19. package/dist/sdk/accountspayablesuppliers.js +530 -0
  20. package/dist/sdk/accountsreceivable.d.ts +12 -284
  21. package/dist/sdk/accountsreceivable.js +13 -1677
  22. package/dist/sdk/accountsreceivablecreditnotes.d.ts +34 -0
  23. package/dist/sdk/accountsreceivablecreditnotes.js +262 -0
  24. package/dist/sdk/accountsreceivablecustomers.d.ts +74 -0
  25. package/dist/sdk/accountsreceivablecustomers.js +530 -0
  26. package/dist/sdk/accountsreceivabledirectincomes.d.ts +74 -0
  27. package/dist/sdk/{financials.js → accountsreceivabledirectincomes.js} +183 -211
  28. package/dist/sdk/accountsreceivableinvoices.d.ts +93 -0
  29. package/dist/sdk/{cashflow.js → accountsreceivableinvoices.js} +250 -189
  30. package/dist/sdk/accountsreceivablepayments.d.ts +34 -0
  31. package/dist/sdk/accountsreceivablepayments.js +262 -0
  32. package/dist/sdk/accountsreceivablereports.d.ts +36 -0
  33. package/dist/sdk/accountsreceivablereports.js +399 -0
  34. package/dist/sdk/banking.d.ts +15 -0
  35. package/dist/sdk/banking.js +23 -0
  36. package/dist/sdk/bankingaccountbalances.d.ts +20 -0
  37. package/dist/sdk/bankingaccountbalances.js +174 -0
  38. package/dist/sdk/bankingaccounts.d.ts +34 -0
  39. package/dist/sdk/bankingaccounts.js +254 -0
  40. package/dist/sdk/bankingcategorizedstatement.d.ts +19 -0
  41. package/dist/sdk/bankingcategorizedstatement.js +173 -0
  42. package/dist/sdk/bankingtransactioncategories.d.ts +34 -0
  43. package/dist/sdk/bankingtransactioncategories.js +254 -0
  44. package/dist/sdk/bankingtransactions.d.ts +34 -0
  45. package/dist/sdk/bankingtransactions.js +254 -0
  46. package/dist/sdk/companies.js +110 -25
  47. package/dist/sdk/companyinfo.d.ts +4 -4
  48. package/dist/sdk/companyinfo.js +52 -18
  49. package/dist/sdk/connections.js +110 -25
  50. package/dist/sdk/dataintegrity.js +66 -15
  51. package/dist/sdk/excelreports.d.ts +10 -2
  52. package/dist/sdk/excelreports.js +76 -17
  53. package/dist/sdk/fileupload.js +66 -15
  54. package/dist/sdk/financialstatements.d.ts +13 -0
  55. package/dist/sdk/financialstatements.js +21 -0
  56. package/dist/sdk/financialstatementsaccounts.d.ts +33 -0
  57. package/dist/sdk/financialstatementsaccounts.js +261 -0
  58. package/dist/sdk/financialstatementsbalancesheet.d.ts +24 -0
  59. package/dist/sdk/financialstatementsbalancesheet.js +253 -0
  60. package/dist/sdk/financialstatementscashflow.d.ts +15 -0
  61. package/dist/sdk/financialstatementscashflow.js +169 -0
  62. package/dist/sdk/financialstatementsprofitandloss.d.ts +24 -0
  63. package/dist/sdk/financialstatementsprofitandloss.js +253 -0
  64. package/dist/sdk/liabilities.d.ts +4 -4
  65. package/dist/sdk/liabilities.js +48 -14
  66. package/dist/sdk/managedata.d.ts +5 -38
  67. package/dist/sdk/managedata.js +27 -267
  68. package/dist/sdk/managedatapulloperations.d.ts +22 -0
  69. package/dist/sdk/managedatapulloperations.js +250 -0
  70. package/dist/sdk/managedatarefresh.d.ts +28 -0
  71. package/dist/sdk/managedatarefresh.js +250 -0
  72. package/dist/sdk/models/operations/{getaccountingcompanyinfo.d.ts → getaccountingprofile.d.ts} +2 -2
  73. package/dist/sdk/models/operations/{getaccountingcompanyinfo.js → getaccountingprofile.js} +17 -17
  74. package/dist/sdk/models/operations/{getenhancedprofitandlossaccounts.d.ts → getcategorizedbalancesheetstatement.d.ts} +2 -2
  75. package/dist/sdk/models/operations/{getenhancedbalancesheetaccounts.js → getcategorizedbalancesheetstatement.js} +19 -19
  76. package/dist/sdk/models/operations/{getenhancedcashflowtransactions.d.ts → getcategorizedbankstatement.d.ts} +2 -2
  77. package/dist/sdk/models/operations/{getenhancedcashflowtransactions.js → getcategorizedbankstatement.js} +20 -20
  78. package/dist/sdk/models/operations/{getenhancedbalancesheetaccounts.d.ts → getcategorizedprofitandlossstatement.d.ts} +2 -2
  79. package/dist/sdk/models/operations/{getenhancedprofitandlossaccounts.js → getcategorizedprofitandlossstatement.js} +19 -19
  80. package/dist/sdk/models/operations/{getcommercecompanyinfo.d.ts → getcommerceprofile.d.ts} +2 -2
  81. package/dist/sdk/models/operations/{getcommercecompanyinfo.js → getcommerceprofile.js} +18 -18
  82. package/dist/sdk/models/operations/{getcommercerefundsmetrics.d.ts → getcommercerefundsreport.d.ts} +2 -2
  83. package/dist/sdk/models/operations/{getcommercerefundsmetrics.js → getcommercerefundsreport.js} +23 -23
  84. package/dist/sdk/models/operations/index.d.ts +8 -8
  85. package/dist/sdk/models/operations/index.js +8 -8
  86. package/dist/sdk/models/operations/{isageddebtorreportavailable.d.ts → isageddebtorsreportavailable.d.ts} +3 -3
  87. package/dist/sdk/models/operations/{isageddebtorreportavailable.js → isageddebtorsreportavailable.js} +16 -16
  88. package/dist/sdk/models/operations/{getenhancedinvoicesreport.d.ts → listreconciledinvoices.d.ts} +2 -2
  89. package/dist/sdk/models/operations/{getenhancedinvoicesreport.js → listreconciledinvoices.js} +20 -20
  90. package/dist/sdk/models/operations/unlinkconnection.d.ts +6 -3
  91. package/dist/sdk/models/operations/unlinkconnection.js +8 -8
  92. package/dist/sdk/models/shared/accountbalance.d.ts +1 -1
  93. package/dist/sdk/models/shared/accountbalance.js +1 -1
  94. package/dist/sdk/models/shared/accountingaccounts.d.ts +0 -3
  95. package/dist/sdk/models/shared/accountingaccounts.js +0 -3
  96. package/dist/sdk/models/shared/accountingaccounttransactions.d.ts +0 -3
  97. package/dist/sdk/models/shared/accountingaccounttransactions.js +0 -3
  98. package/dist/sdk/models/shared/accountingbankaccounts.d.ts +0 -3
  99. package/dist/sdk/models/shared/accountingbankaccounts.js +0 -3
  100. package/dist/sdk/models/shared/accountingbanktransactions.d.ts +0 -3
  101. package/dist/sdk/models/shared/accountingbanktransactions.js +0 -3
  102. package/dist/sdk/models/shared/accountingbill.d.ts +1 -1
  103. package/dist/sdk/models/shared/accountingbillcreditnote.d.ts +1 -1
  104. package/dist/sdk/models/shared/accountingbillcreditnotes.d.ts +0 -3
  105. package/dist/sdk/models/shared/accountingbillcreditnotes.js +0 -3
  106. package/dist/sdk/models/shared/accountingbillpayment.d.ts +1 -1
  107. package/dist/sdk/models/shared/accountingbillpayments.d.ts +0 -3
  108. package/dist/sdk/models/shared/accountingbillpayments.js +0 -3
  109. package/dist/sdk/models/shared/accountingbills.d.ts +0 -3
  110. package/dist/sdk/models/shared/accountingbills.js +0 -3
  111. package/dist/sdk/models/shared/accountingcompanyinfo.d.ts +32 -2
  112. package/dist/sdk/models/shared/accountingcompanyinfo.js +47 -4
  113. package/dist/sdk/models/shared/accountingcreditnote.d.ts +1 -1
  114. package/dist/sdk/models/shared/accountingcreditnotes.d.ts +0 -3
  115. package/dist/sdk/models/shared/accountingcreditnotes.js +0 -3
  116. package/dist/sdk/models/shared/accountingcustomer.d.ts +3 -3
  117. package/dist/sdk/models/shared/accountingcustomer.js +3 -3
  118. package/dist/sdk/models/shared/accountingcustomers.d.ts +0 -3
  119. package/dist/sdk/models/shared/accountingcustomers.js +0 -3
  120. package/dist/sdk/models/shared/accountingdirectcost.d.ts +1 -1
  121. package/dist/sdk/models/shared/accountingdirectcosts.d.ts +0 -3
  122. package/dist/sdk/models/shared/accountingdirectcosts.js +0 -3
  123. package/dist/sdk/models/shared/accountingdirectincome.d.ts +1 -1
  124. package/dist/sdk/models/shared/accountingdirectincomes.d.ts +0 -3
  125. package/dist/sdk/models/shared/accountingdirectincomes.js +0 -3
  126. package/dist/sdk/models/shared/accountinginvoice.d.ts +1 -1
  127. package/dist/sdk/models/shared/accountinginvoices.d.ts +0 -3
  128. package/dist/sdk/models/shared/accountinginvoices.js +0 -3
  129. package/dist/sdk/models/shared/accountingjournalentries.d.ts +0 -3
  130. package/dist/sdk/models/shared/accountingjournalentries.js +0 -3
  131. package/dist/sdk/models/shared/accountingjournalentry.d.ts +1 -1
  132. package/dist/sdk/models/shared/accountingjournals.d.ts +0 -3
  133. package/dist/sdk/models/shared/accountingjournals.js +0 -3
  134. package/dist/sdk/models/shared/accountingpayment.d.ts +1 -1
  135. package/dist/sdk/models/shared/accountingpayments.d.ts +0 -3
  136. package/dist/sdk/models/shared/accountingpayments.js +0 -3
  137. package/dist/sdk/models/shared/accountingsupplier.d.ts +3 -3
  138. package/dist/sdk/models/shared/accountingsupplier.js +3 -3
  139. package/dist/sdk/models/shared/accountingsuppliers.d.ts +0 -3
  140. package/dist/sdk/models/shared/accountingsuppliers.js +0 -3
  141. package/dist/sdk/models/shared/accountingtransfer.d.ts +1 -1
  142. package/dist/sdk/models/shared/accountingtransfers.d.ts +0 -3
  143. package/dist/sdk/models/shared/accountingtransfers.js +0 -3
  144. package/dist/sdk/models/shared/{accountingaddress.d.ts → addressesitems.d.ts} +1 -1
  145. package/dist/sdk/models/shared/{accountingaddress.js → addressesitems.js} +13 -13
  146. package/dist/sdk/models/shared/attachments.d.ts +0 -3
  147. package/dist/sdk/models/shared/attachments.js +0 -3
  148. package/dist/sdk/models/shared/bankingaccountbalances.d.ts +0 -3
  149. package/dist/sdk/models/shared/bankingaccountbalances.js +0 -3
  150. package/dist/sdk/models/shared/bankingaccounts.d.ts +0 -3
  151. package/dist/sdk/models/shared/bankingaccounts.js +0 -3
  152. package/dist/sdk/models/shared/bankingtransactioncategories.d.ts +0 -3
  153. package/dist/sdk/models/shared/bankingtransactioncategories.js +0 -3
  154. package/dist/sdk/models/shared/bankingtransactions.d.ts +0 -3
  155. package/dist/sdk/models/shared/bankingtransactions.js +0 -3
  156. package/dist/sdk/models/shared/commercecustomers.d.ts +0 -3
  157. package/dist/sdk/models/shared/commercecustomers.js +0 -3
  158. package/dist/sdk/models/shared/commercedispute.d.ts +1 -1
  159. package/dist/sdk/models/shared/commercedispute.js +1 -1
  160. package/dist/sdk/models/shared/commercedisputes.d.ts +0 -3
  161. package/dist/sdk/models/shared/commercedisputes.js +0 -3
  162. package/dist/sdk/models/shared/commercelocations.d.ts +0 -3
  163. package/dist/sdk/models/shared/commercelocations.js +0 -3
  164. package/dist/sdk/models/shared/commerceorder.d.ts +2 -2
  165. package/dist/sdk/models/shared/commerceorder.js +1 -1
  166. package/dist/sdk/models/shared/commerceorders.d.ts +0 -3
  167. package/dist/sdk/models/shared/commerceorders.js +0 -3
  168. package/dist/sdk/models/shared/commercepaymentmethods.d.ts +0 -3
  169. package/dist/sdk/models/shared/commercepaymentmethods.js +0 -3
  170. package/dist/sdk/models/shared/commercepayments.d.ts +0 -3
  171. package/dist/sdk/models/shared/commercepayments.js +0 -3
  172. package/dist/sdk/models/shared/commerceproductcategories.d.ts +0 -3
  173. package/dist/sdk/models/shared/commerceproductcategories.js +0 -3
  174. package/dist/sdk/models/shared/commerceproducts.d.ts +0 -3
  175. package/dist/sdk/models/shared/commerceproducts.js +0 -3
  176. package/dist/sdk/models/shared/commercetransactions.d.ts +0 -3
  177. package/dist/sdk/models/shared/commercetransactions.js +0 -3
  178. package/dist/sdk/models/shared/companies.d.ts +0 -3
  179. package/dist/sdk/models/shared/companies.js +0 -3
  180. package/dist/sdk/models/shared/connections.d.ts +0 -3
  181. package/dist/sdk/models/shared/connections.js +0 -3
  182. package/dist/sdk/models/shared/contact.d.ts +2 -2
  183. package/dist/sdk/models/shared/contact.js +3 -3
  184. package/dist/sdk/models/shared/dataintegritydatatype.d.ts +0 -3
  185. package/dist/sdk/models/shared/dataintegritydatatype.js +0 -3
  186. package/dist/sdk/models/shared/dataintegritydetails.d.ts +0 -3
  187. package/dist/sdk/models/shared/dataintegritydetails.js +0 -3
  188. package/dist/sdk/models/shared/dataintegritystatuses.d.ts +0 -3
  189. package/dist/sdk/models/shared/dataintegritystatuses.js +0 -3
  190. package/dist/sdk/models/shared/dataintegritysummaries.d.ts +0 -3
  191. package/dist/sdk/models/shared/dataintegritysummaries.js +0 -3
  192. package/dist/sdk/models/shared/enhancedfinancialreport.d.ts +0 -3
  193. package/dist/sdk/models/shared/enhancedfinancialreport.js +0 -3
  194. package/dist/sdk/models/shared/errormessage.d.ts +0 -3
  195. package/dist/sdk/models/shared/errormessage.js +0 -3
  196. package/dist/sdk/models/shared/excelstatus.d.ts +0 -3
  197. package/dist/sdk/models/shared/excelstatus.js +0 -3
  198. package/dist/sdk/models/shared/index.d.ts +1 -1
  199. package/dist/sdk/models/shared/index.js +1 -1
  200. package/dist/sdk/models/shared/loansummary.d.ts +0 -3
  201. package/dist/sdk/models/shared/loansummary.js +0 -3
  202. package/dist/sdk/models/shared/loantransactions.d.ts +0 -3
  203. package/dist/sdk/models/shared/loantransactions.js +0 -3
  204. package/dist/sdk/models/shared/periodunit.d.ts +0 -3
  205. package/dist/sdk/models/shared/periodunit.js +0 -3
  206. package/dist/sdk/models/shared/pulloperations.d.ts +0 -3
  207. package/dist/sdk/models/shared/pulloperations.js +0 -3
  208. package/dist/sdk/models/shared/supplementaldata.d.ts +1 -1
  209. package/dist/sdk/models/shared/supplementaldata.js +1 -1
  210. package/dist/sdk/sales.d.ts +22 -372
  211. package/dist/sdk/sales.js +22 -1767
  212. package/dist/sdk/salescustomers.d.ts +34 -0
  213. package/dist/sdk/salescustomers.js +262 -0
  214. package/dist/sdk/salesdisputes.d.ts +34 -0
  215. package/dist/sdk/salesdisputes.js +262 -0
  216. package/dist/sdk/saleslocations.d.ts +34 -0
  217. package/dist/sdk/saleslocations.js +261 -0
  218. package/dist/sdk/salesmetrics.d.ts +102 -0
  219. package/dist/sdk/salesmetrics.js +406 -0
  220. package/dist/sdk/salesorders.d.ts +34 -0
  221. package/dist/sdk/salesorders.js +262 -0
  222. package/dist/sdk/salespaymentmethods.d.ts +34 -0
  223. package/dist/sdk/salespaymentmethods.js +262 -0
  224. package/dist/sdk/salespayments.d.ts +34 -0
  225. package/dist/sdk/salespayments.js +262 -0
  226. package/dist/sdk/salesproductcategories.d.ts +34 -0
  227. package/dist/sdk/salesproductcategories.js +262 -0
  228. package/dist/sdk/salesproducts.d.ts +34 -0
  229. package/dist/sdk/salesproducts.js +262 -0
  230. package/dist/sdk/salesreports.d.ts +69 -0
  231. package/dist/sdk/salesreports.js +298 -0
  232. package/dist/sdk/salestransactions.d.ts +34 -0
  233. package/dist/sdk/salestransactions.js +262 -0
  234. package/dist/sdk/sdk.d.ts +38 -30
  235. package/dist/sdk/sdk.js +33 -45
  236. package/dist/sdk/transactions.d.ts +10 -176
  237. package/dist/sdk/transactions.js +11 -1000
  238. package/dist/sdk/transactionsaccounttransactions.d.ts +34 -0
  239. package/dist/sdk/transactionsaccounttransactions.js +262 -0
  240. package/dist/sdk/transactionsdirectcosts.d.ts +74 -0
  241. package/dist/sdk/transactionsdirectcosts.js +530 -0
  242. package/dist/sdk/transactionsjournalentries.d.ts +34 -0
  243. package/dist/sdk/transactionsjournalentries.js +262 -0
  244. package/dist/sdk/transactionsjournals.d.ts +34 -0
  245. package/dist/sdk/transactionsjournals.js +262 -0
  246. package/dist/sdk/transactionstransfers.d.ts +34 -0
  247. package/dist/sdk/transactionstransfers.js +262 -0
  248. package/docs/models/operations/{getaccountingcompanyinforequest.md → getaccountingprofilerequest.md} +1 -1
  249. package/docs/models/operations/{getaccountingcompanyinforesponse.md → getaccountingprofileresponse.md} +1 -1
  250. package/docs/models/operations/{getenhancedbalancesheetaccountsrequest.md → getcategorizedbalancesheetstatementrequest.md} +1 -1
  251. package/docs/models/operations/{getenhancedprofitandlossaccountsresponse.md → getcategorizedbalancesheetstatementresponse.md} +1 -1
  252. package/docs/models/operations/{getenhancedcashflowtransactionsrequest.md → getcategorizedbankstatementrequest.md} +1 -1
  253. package/docs/models/operations/{getenhancedcashflowtransactionsresponse.md → getcategorizedbankstatementresponse.md} +1 -1
  254. package/docs/models/operations/{getenhancedprofitandlossaccountsrequest.md → getcategorizedprofitandlossstatementrequest.md} +1 -1
  255. package/docs/models/operations/{getenhancedbalancesheetaccountsresponse.md → getcategorizedprofitandlossstatementresponse.md} +1 -1
  256. package/docs/models/operations/{getcommercecompanyinforequest.md → getcommerceprofilerequest.md} +1 -1
  257. package/docs/models/operations/{getcommercecompanyinforesponse.md → getcommerceprofileresponse.md} +1 -1
  258. package/docs/models/operations/{getcommercerefundsmetricsrequest.md → getcommercerefundsreportrequest.md} +1 -1
  259. package/docs/models/operations/{getcommercerefundsmetricsresponse.md → getcommercerefundsreportresponse.md} +1 -1
  260. package/docs/models/operations/{isageddebtorreportavailablerequest.md → isageddebtorsreportavailablerequest.md} +1 -1
  261. package/docs/models/operations/{isageddebtorreportavailableresponse.md → isageddebtorsreportavailableresponse.md} +2 -2
  262. package/docs/models/operations/{getenhancedinvoicesreportrequest.md → listreconciledinvoicesrequest.md} +1 -1
  263. package/docs/models/operations/{getenhancedinvoicesreportresponse.md → listreconciledinvoicesresponse.md} +1 -1
  264. package/docs/models/operations/unlinkconnectionrequest.md +5 -5
  265. package/docs/models/operations/unlinkconnectionupdateconnection.md +8 -0
  266. package/docs/models/shared/accountbalance.md +1 -1
  267. package/docs/models/shared/accountingaccounts.md +0 -2
  268. package/docs/models/shared/accountingaccounttransactions.md +0 -2
  269. package/docs/models/shared/accountingbankaccounts.md +0 -2
  270. package/docs/models/shared/accountingbanktransactions.md +0 -2
  271. package/docs/models/shared/accountingbill.md +1 -1
  272. package/docs/models/shared/accountingbillcreditnote.md +1 -1
  273. package/docs/models/shared/accountingbillcreditnotes.md +0 -2
  274. package/docs/models/shared/accountingbillpayment.md +1 -1
  275. package/docs/models/shared/accountingbillpayments.md +0 -2
  276. package/docs/models/shared/accountingbills.md +0 -2
  277. package/docs/models/shared/accountingcompanyinfo.md +1 -1
  278. package/docs/models/shared/accountingcompanyinfoaccountingaddress.md +14 -0
  279. package/docs/models/shared/accountingcreditnote.md +1 -1
  280. package/docs/models/shared/accountingcreditnotes.md +0 -2
  281. package/docs/models/shared/accountingcustomer.md +2 -2
  282. package/docs/models/shared/accountingcustomers.md +0 -2
  283. package/docs/models/shared/accountingdirectcost.md +1 -1
  284. package/docs/models/shared/accountingdirectcosts.md +0 -2
  285. package/docs/models/shared/accountingdirectincome.md +1 -1
  286. package/docs/models/shared/accountingdirectincomes.md +0 -2
  287. package/docs/models/shared/accountinginvoice.md +1 -1
  288. package/docs/models/shared/accountinginvoices.md +0 -2
  289. package/docs/models/shared/accountingjournalentries.md +0 -2
  290. package/docs/models/shared/accountingjournalentry.md +1 -1
  291. package/docs/models/shared/accountingjournals.md +0 -2
  292. package/docs/models/shared/accountingpayment.md +1 -1
  293. package/docs/models/shared/accountingpayments.md +0 -2
  294. package/docs/models/shared/accountingsupplier.md +16 -16
  295. package/docs/models/shared/accountingsuppliers.md +0 -2
  296. package/docs/models/shared/accountingtransfer.md +1 -1
  297. package/docs/models/shared/accountingtransfers.md +0 -2
  298. package/docs/models/shared/{accountingaddress.md → addressesitems.md} +1 -1
  299. package/docs/models/shared/attachments.md +0 -2
  300. package/docs/models/shared/bankingaccountbalances.md +0 -2
  301. package/docs/models/shared/bankingaccounts.md +0 -2
  302. package/docs/models/shared/bankingtransactioncategories.md +0 -2
  303. package/docs/models/shared/bankingtransactions.md +0 -2
  304. package/docs/models/shared/commercecustomers.md +0 -2
  305. package/docs/models/shared/commercedispute.md +1 -1
  306. package/docs/models/shared/commercedisputes.md +0 -2
  307. package/docs/models/shared/commercelocations.md +0 -2
  308. package/docs/models/shared/commerceorder.md +1 -1
  309. package/docs/models/shared/commerceorders.md +0 -2
  310. package/docs/models/shared/commerceordersupplementaldata.md +1 -1
  311. package/docs/models/shared/commercepaymentmethods.md +0 -2
  312. package/docs/models/shared/commercepayments.md +0 -2
  313. package/docs/models/shared/commerceproductcategories.md +0 -2
  314. package/docs/models/shared/commerceproducts.md +0 -2
  315. package/docs/models/shared/commercetransactions.md +0 -2
  316. package/docs/models/shared/companies.md +0 -2
  317. package/docs/models/shared/connections.md +0 -2
  318. package/docs/models/shared/contact.md +1 -1
  319. package/docs/models/shared/dataintegritydatatype.md +0 -2
  320. package/docs/models/shared/dataintegritydetails.md +0 -2
  321. package/docs/models/shared/dataintegritystatuses.md +0 -2
  322. package/docs/models/shared/dataintegritysummaries.md +0 -2
  323. package/docs/models/shared/enhancedfinancialreport.md +0 -2
  324. package/docs/models/shared/errormessage.md +0 -2
  325. package/docs/models/shared/excelstatus.md +0 -2
  326. package/docs/models/shared/loansummary.md +0 -2
  327. package/docs/models/shared/loantransactions.md +0 -2
  328. package/docs/models/shared/periodunit.md +0 -2
  329. package/docs/models/shared/pulloperations.md +0 -2
  330. package/docs/models/shared/supplementaldata.md +1 -1
  331. package/docs/sdks/accountingbankdata/README.md +2 -101
  332. package/docs/sdks/accountingbankdataaccounts/README.md +103 -0
  333. package/docs/sdks/accountspayable/README.md +2 -664
  334. package/docs/sdks/accountspayablebillcreditnotes/README.md +101 -0
  335. package/docs/sdks/accountspayablebillpayments/README.md +101 -0
  336. package/docs/sdks/accountspayablebills/README.md +148 -0
  337. package/docs/sdks/accountspayablesuppliers/README.md +244 -0
  338. package/docs/sdks/accountsreceivable/README.md +0 -1089
  339. package/docs/sdks/accountsreceivablecreditnotes/README.md +101 -0
  340. package/docs/sdks/accountsreceivablecustomers/README.md +244 -0
  341. package/docs/sdks/accountsreceivabledirectincomes/README.md +247 -0
  342. package/docs/sdks/{financials → accountsreceivableinvoices}/README.md +123 -111
  343. package/docs/sdks/accountsreceivablepayments/README.md +101 -0
  344. package/docs/sdks/accountsreceivablereports/README.md +172 -0
  345. package/docs/sdks/banking/README.md +4 -0
  346. package/docs/sdks/bankingaccountbalances/README.md +54 -0
  347. package/docs/sdks/bankingaccounts/README.md +103 -0
  348. package/docs/sdks/bankingcategorizedstatement/README.md +51 -0
  349. package/docs/sdks/bankingtransactioncategories/README.md +103 -0
  350. package/docs/sdks/bankingtransactions/README.md +103 -0
  351. package/docs/sdks/codatlending/README.md +24 -4
  352. package/docs/sdks/companies/README.md +1 -1
  353. package/docs/sdks/companyinfo/README.md +22 -22
  354. package/docs/sdks/connections/README.md +4 -3
  355. package/docs/sdks/dataintegrity/README.md +5 -5
  356. package/docs/sdks/excelreports/README.md +12 -4
  357. package/docs/sdks/fileupload/README.md +2 -2
  358. package/docs/sdks/financialstatements/README.md +4 -0
  359. package/docs/sdks/financialstatementsaccounts/README.md +100 -0
  360. package/docs/sdks/financialstatementsbalancesheet/README.md +91 -0
  361. package/docs/sdks/financialstatementscashflow/README.md +47 -0
  362. package/docs/sdks/financialstatementsprofitandloss/README.md +91 -0
  363. package/docs/sdks/liabilities/README.md +4 -4
  364. package/docs/sdks/managedata/README.md +3 -181
  365. package/docs/sdks/managedatapulloperations/README.md +89 -0
  366. package/docs/sdks/managedatarefresh/README.md +93 -0
  367. package/docs/sdks/sales/README.md +0 -1223
  368. package/docs/sdks/salescustomers/README.md +103 -0
  369. package/docs/sdks/salesdisputes/README.md +103 -0
  370. package/docs/sdks/saleslocations/README.md +99 -0
  371. package/docs/sdks/salesmetrics/README.md +218 -0
  372. package/docs/sdks/salesorders/README.md +103 -0
  373. package/docs/sdks/salespaymentmethods/README.md +103 -0
  374. package/docs/sdks/salespayments/README.md +103 -0
  375. package/docs/sdks/salesproductcategories/README.md +103 -0
  376. package/docs/sdks/salesproducts/README.md +103 -0
  377. package/docs/sdks/salesreports/README.md +145 -0
  378. package/docs/sdks/salestransactions/README.md +103 -0
  379. package/docs/sdks/transactions/README.md +0 -638
  380. package/docs/sdks/transactionsaccounttransactions/README.md +103 -0
  381. package/docs/sdks/transactionsdirectcosts/README.md +246 -0
  382. package/docs/sdks/transactionsjournalentries/README.md +101 -0
  383. package/docs/sdks/transactionsjournals/README.md +101 -0
  384. package/docs/sdks/transactionstransfers/README.md +103 -0
  385. package/package.json +1 -1
  386. package/dist/sdk/cashflow.d.ts +0 -112
  387. package/dist/sdk/financials.d.ts +0 -75
  388. package/docs/models/operations/unlinkconnectionrequestbody.md +0 -8
  389. package/docs/sdks/cashflow/README.md +0 -402
@@ -2,1011 +2,22 @@
2
2
  /*
3
3
  * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
4
  */
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- var desc = Object.getOwnPropertyDescriptor(m, k);
19
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
- desc = { enumerable: true, get: function() { return m[k]; } };
21
- }
22
- Object.defineProperty(o, k2, desc);
23
- }) : (function(o, m, k, k2) {
24
- if (k2 === undefined) k2 = k;
25
- o[k2] = m[k];
26
- }));
27
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
- Object.defineProperty(o, "default", { enumerable: true, value: v });
29
- }) : function(o, v) {
30
- o["default"] = v;
31
- });
32
- var __importStar = (this && this.__importStar) || function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
40
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
41
- return new (P || (P = Promise))(function (resolve, reject) {
42
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
43
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
44
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
45
- step((generator = generator.apply(thisArg, _arguments || [])).next());
46
- });
47
- };
48
- var __generator = (this && this.__generator) || function (thisArg, body) {
49
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
50
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
- function verb(n) { return function (v) { return step([n, v]); }; }
52
- function step(op) {
53
- if (f) throw new TypeError("Generator is already executing.");
54
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
55
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
56
- if (y = 0, t) op = [op[0] & 2, t.value];
57
- switch (op[0]) {
58
- case 0: case 1: t = op; break;
59
- case 4: _.label++; return { value: op[1], done: false };
60
- case 5: _.label++; y = op[1]; op = [0]; continue;
61
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
62
- default:
63
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
64
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
65
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
66
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
67
- if (t[2]) _.ops.pop();
68
- _.trys.pop(); continue;
69
- }
70
- op = body.call(thisArg, _);
71
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
72
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
- }
74
- };
75
5
  Object.defineProperty(exports, "__esModule", { value: true });
76
- exports.Transactions = exports.DownloadDirectCostAttachmentAcceptEnum = void 0;
77
- var utils = __importStar(require("../internal/utils"));
78
- var errors = __importStar(require("./models/errors"));
79
- var operations = __importStar(require("./models/operations"));
80
- var shared = __importStar(require("./models/shared"));
81
- /**
82
- * Data from a linked accounting platform representing transactions.
83
- */
84
- var DownloadDirectCostAttachmentAcceptEnum;
85
- (function (DownloadDirectCostAttachmentAcceptEnum) {
86
- DownloadDirectCostAttachmentAcceptEnum["applicationJson"] = "application/json";
87
- DownloadDirectCostAttachmentAcceptEnum["applicationOctetStream"] = "application/octet-stream";
88
- })(DownloadDirectCostAttachmentAcceptEnum = exports.DownloadDirectCostAttachmentAcceptEnum || (exports.DownloadDirectCostAttachmentAcceptEnum = {}));
6
+ exports.Transactions = void 0;
7
+ var transactionsaccounttransactions_1 = require("./transactionsaccounttransactions");
8
+ var transactionsdirectcosts_1 = require("./transactionsdirectcosts");
9
+ var transactionsjournalentries_1 = require("./transactionsjournalentries");
10
+ var transactionsjournals_1 = require("./transactionsjournals");
11
+ var transactionstransfers_1 = require("./transactionstransfers");
89
12
  var Transactions = /** @class */ (function () {
90
13
  function Transactions(sdkConfig) {
91
14
  this.sdkConfiguration = sdkConfig;
15
+ this.accountTransactions = new transactionsaccounttransactions_1.TransactionsAccountTransactions(this.sdkConfiguration);
16
+ this.directCosts = new transactionsdirectcosts_1.TransactionsDirectCosts(this.sdkConfiguration);
17
+ this.journalEntries = new transactionsjournalentries_1.TransactionsJournalEntries(this.sdkConfiguration);
18
+ this.journals = new transactionsjournals_1.TransactionsJournals(this.sdkConfiguration);
19
+ this.transfers = new transactionstransfers_1.TransactionsTransfers(this.sdkConfiguration);
92
20
  }
93
- /**
94
- * Download direct cost attachment
95
- *
96
- * @remarks
97
- * The *Download direct cost attachment* endpoint downloads a specific attachment for a given `directCostId` and `attachmentId`.
98
- *
99
- * [Direct costs](https://docs.codat.io/accounting-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase.
100
- *
101
- * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support downloading a direct cost attachment.
102
- *
103
- */
104
- Transactions.prototype.downloadDirectCostAttachment = function (req, retries, config, acceptHeaderOverride) {
105
- var _a, _b;
106
- return __awaiter(this, void 0, void 0, function () {
107
- var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
108
- return __generator(this, function (_c) {
109
- switch (_c.label) {
110
- case 0:
111
- if (!(req instanceof utils.SpeakeasyBase)) {
112
- req = new operations.DownloadAccountingDirectCostAttachmentRequest(req);
113
- }
114
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
115
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}/download", req);
116
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
117
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
118
- if (acceptHeaderOverride !== undefined) {
119
- headers["Accept"] = acceptHeaderOverride.toString();
120
- }
121
- else {
122
- headers["Accept"] = "application/json;q=1, application/octet-stream;q=0";
123
- }
124
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
125
- retryConfig = retries;
126
- if (!retryConfig) {
127
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
128
- }
129
- return [4 /*yield*/, utils.Retry(function () {
130
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
131
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
132
- case 1:
133
- httpRes = _c.sent();
134
- 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 : "";
135
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
136
- throw new Error("status code not found in response: ".concat(httpRes));
137
- }
138
- res = new operations.DownloadAccountingDirectCostAttachmentResponse({
139
- statusCode: httpRes.status,
140
- contentType: contentType,
141
- rawResponse: httpRes,
142
- });
143
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
144
- switch (true) {
145
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
146
- if (utils.matchContentType(contentType, "application/octet-stream")) {
147
- res.data = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
148
- }
149
- else {
150
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
151
- }
152
- break;
153
- case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
154
- if (utils.matchContentType(contentType, "application/json")) {
155
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
156
- }
157
- else {
158
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
159
- }
160
- break;
161
- }
162
- return [2 /*return*/, res];
163
- }
164
- });
165
- });
166
- };
167
- /**
168
- * Get account transaction
169
- *
170
- * @remarks
171
- * The *Get account transaction* endpoint returns a single account transaction for a given accountTransactionId.
172
- *
173
- * [Account transactions](https://docs.codat.io/accounting-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions.
174
- *
175
- * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=accountTransactions) for integrations that support getting a specific account transaction.
176
- *
177
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
178
- *
179
- */
180
- Transactions.prototype.getAccountTransaction = function (req, retries, config) {
181
- var _a, _b;
182
- return __awaiter(this, void 0, void 0, function () {
183
- var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
184
- return __generator(this, function (_c) {
185
- switch (_c.label) {
186
- case 0:
187
- if (!(req instanceof utils.SpeakeasyBase)) {
188
- req = new operations.GetAccountingAccountTransactionRequest(req);
189
- }
190
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
191
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/accountTransactions/{accountTransactionId}", req);
192
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
193
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
194
- headers["Accept"] = "application/json";
195
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
196
- retryConfig = retries;
197
- if (!retryConfig) {
198
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
199
- }
200
- return [4 /*yield*/, utils.Retry(function () {
201
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
202
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
203
- case 1:
204
- httpRes = _c.sent();
205
- 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 : "";
206
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
207
- throw new Error("status code not found in response: ".concat(httpRes));
208
- }
209
- res = new operations.GetAccountingAccountTransactionResponse({
210
- statusCode: httpRes.status,
211
- contentType: contentType,
212
- rawResponse: httpRes,
213
- });
214
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
215
- switch (true) {
216
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
217
- if (utils.matchContentType(contentType, "application/json")) {
218
- res.accountingAccountTransaction = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingAccountTransaction);
219
- }
220
- else {
221
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
222
- }
223
- break;
224
- case [401, 404, 409, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
225
- if (utils.matchContentType(contentType, "application/json")) {
226
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
227
- }
228
- else {
229
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
230
- }
231
- break;
232
- }
233
- return [2 /*return*/, res];
234
- }
235
- });
236
- });
237
- };
238
- /**
239
- * Get direct cost
240
- *
241
- * @remarks
242
- * The *Get direct cost* endpoint returns a single direct cost for a given directCostId.
243
- *
244
- * [Direct costs](https://docs.codat.io/accounting-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase.
245
- *
246
- * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support getting a specific direct cost.
247
- *
248
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
249
- *
250
- */
251
- Transactions.prototype.getDirectCost = function (req, retries, config) {
252
- var _a, _b;
253
- return __awaiter(this, void 0, void 0, function () {
254
- var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
255
- return __generator(this, function (_c) {
256
- switch (_c.label) {
257
- case 0:
258
- if (!(req instanceof utils.SpeakeasyBase)) {
259
- req = new operations.GetAccountingDirectCostRequest(req);
260
- }
261
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
262
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}", req);
263
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
264
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
265
- headers["Accept"] = "application/json";
266
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
267
- retryConfig = retries;
268
- if (!retryConfig) {
269
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
270
- }
271
- return [4 /*yield*/, utils.Retry(function () {
272
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
273
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
274
- case 1:
275
- httpRes = _c.sent();
276
- 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 : "";
277
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
278
- throw new Error("status code not found in response: ".concat(httpRes));
279
- }
280
- res = new operations.GetAccountingDirectCostResponse({
281
- statusCode: httpRes.status,
282
- contentType: contentType,
283
- rawResponse: httpRes,
284
- });
285
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
286
- switch (true) {
287
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
288
- if (utils.matchContentType(contentType, "application/json")) {
289
- res.accountingDirectCost = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingDirectCost);
290
- }
291
- else {
292
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
293
- }
294
- break;
295
- case [401, 404, 409, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
296
- if (utils.matchContentType(contentType, "application/json")) {
297
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
298
- }
299
- else {
300
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
301
- }
302
- break;
303
- }
304
- return [2 /*return*/, res];
305
- }
306
- });
307
- });
308
- };
309
- /**
310
- * Get direct cost attachment
311
- *
312
- * @remarks
313
- * The *Get direct cost attachment* endpoint returns a specific attachment for a given `directCostId` and `attachmentId`.
314
- *
315
- * [Direct costs](https://docs.codat.io/accounting-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase.
316
- *
317
- * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support getting a direct cost attachment.
318
- *
319
- */
320
- Transactions.prototype.getDirectCostAttachment = function (req, retries, config) {
321
- var _a, _b;
322
- return __awaiter(this, void 0, void 0, function () {
323
- var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
324
- return __generator(this, function (_c) {
325
- switch (_c.label) {
326
- case 0:
327
- if (!(req instanceof utils.SpeakeasyBase)) {
328
- req = new operations.GetAccountingDirectCostAttachmentRequest(req);
329
- }
330
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
331
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}", req);
332
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
333
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
334
- headers["Accept"] = "application/json";
335
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
336
- retryConfig = retries;
337
- if (!retryConfig) {
338
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
339
- }
340
- return [4 /*yield*/, utils.Retry(function () {
341
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
342
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
343
- case 1:
344
- httpRes = _c.sent();
345
- 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 : "";
346
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
347
- throw new Error("status code not found in response: ".concat(httpRes));
348
- }
349
- res = new operations.GetAccountingDirectCostAttachmentResponse({
350
- statusCode: httpRes.status,
351
- contentType: contentType,
352
- rawResponse: httpRes,
353
- });
354
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
355
- switch (true) {
356
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
357
- if (utils.matchContentType(contentType, "application/json")) {
358
- res.accountingAttachment = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingAttachment);
359
- }
360
- else {
361
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
362
- }
363
- break;
364
- case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
365
- if (utils.matchContentType(contentType, "application/json")) {
366
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
367
- }
368
- else {
369
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
370
- }
371
- break;
372
- }
373
- return [2 /*return*/, res];
374
- }
375
- });
376
- });
377
- };
378
- /**
379
- * Get journal
380
- *
381
- * @remarks
382
- * The *Get journal* endpoint returns a single journal for a given journalId.
383
- *
384
- * [Journals](https://docs.codat.io/accounting-api#/schemas/Journal) are used to record all the financial transactions of a company.
385
- *
386
- * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support getting a specific journal.
387
- *
388
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
389
- *
390
- */
391
- Transactions.prototype.getJournal = function (req, retries, config) {
392
- var _a, _b;
393
- return __awaiter(this, void 0, void 0, function () {
394
- var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
395
- return __generator(this, function (_c) {
396
- switch (_c.label) {
397
- case 0:
398
- if (!(req instanceof utils.SpeakeasyBase)) {
399
- req = new operations.GetAccountingJournalRequest(req);
400
- }
401
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
402
- url = utils.generateURL(baseURL, "/companies/{companyId}/data/journals/{journalId}", req);
403
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
404
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
405
- headers["Accept"] = "application/json";
406
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
407
- retryConfig = retries;
408
- if (!retryConfig) {
409
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
410
- }
411
- return [4 /*yield*/, utils.Retry(function () {
412
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
413
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
414
- case 1:
415
- httpRes = _c.sent();
416
- 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 : "";
417
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
418
- throw new Error("status code not found in response: ".concat(httpRes));
419
- }
420
- res = new operations.GetAccountingJournalResponse({
421
- statusCode: httpRes.status,
422
- contentType: contentType,
423
- rawResponse: httpRes,
424
- });
425
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
426
- switch (true) {
427
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
428
- if (utils.matchContentType(contentType, "application/json")) {
429
- res.accountingJournal = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingJournal);
430
- }
431
- else {
432
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
433
- }
434
- break;
435
- case [401, 404, 409, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
436
- if (utils.matchContentType(contentType, "application/json")) {
437
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
438
- }
439
- else {
440
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
441
- }
442
- break;
443
- }
444
- return [2 /*return*/, res];
445
- }
446
- });
447
- });
448
- };
449
- /**
450
- * Get journal entry
451
- *
452
- * @remarks
453
- * The *Get journal entry* endpoint returns a single journal entry for a given journalEntryId.
454
- *
455
- * [Journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved.
456
- *
457
- * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support getting a specific journal entry.
458
- *
459
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
460
- *
461
- */
462
- Transactions.prototype.getJournalEntry = function (req, retries, config) {
463
- var _a, _b;
464
- return __awaiter(this, void 0, void 0, function () {
465
- var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
466
- return __generator(this, function (_c) {
467
- switch (_c.label) {
468
- case 0:
469
- if (!(req instanceof utils.SpeakeasyBase)) {
470
- req = new operations.GetAccountingJournalEntryRequest(req);
471
- }
472
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
473
- url = utils.generateURL(baseURL, "/companies/{companyId}/data/journalEntries/{journalEntryId}", req);
474
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
475
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
476
- headers["Accept"] = "application/json";
477
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
478
- retryConfig = retries;
479
- if (!retryConfig) {
480
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
481
- }
482
- return [4 /*yield*/, utils.Retry(function () {
483
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
484
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
485
- case 1:
486
- httpRes = _c.sent();
487
- 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 : "";
488
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
489
- throw new Error("status code not found in response: ".concat(httpRes));
490
- }
491
- res = new operations.GetAccountingJournalEntryResponse({
492
- statusCode: httpRes.status,
493
- contentType: contentType,
494
- rawResponse: httpRes,
495
- });
496
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
497
- switch (true) {
498
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
499
- if (utils.matchContentType(contentType, "application/json")) {
500
- res.accountingJournalEntry = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingJournalEntry);
501
- }
502
- else {
503
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
504
- }
505
- break;
506
- case [401, 404, 409, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
507
- if (utils.matchContentType(contentType, "application/json")) {
508
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
509
- }
510
- else {
511
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
512
- }
513
- break;
514
- }
515
- return [2 /*return*/, res];
516
- }
517
- });
518
- });
519
- };
520
- /**
521
- * Get transfer
522
- *
523
- * @remarks
524
- * The *Get transfer* endpoint returns a single transfer for a given transferId.
525
- *
526
- * [Transfers](https://docs.codat.io/accounting-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account.
527
- *
528
- * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support getting a specific transfer.
529
- *
530
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
531
- *
532
- */
533
- Transactions.prototype.getTransfer = function (req, retries, config) {
534
- var _a, _b;
535
- return __awaiter(this, void 0, void 0, function () {
536
- var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
537
- return __generator(this, function (_c) {
538
- switch (_c.label) {
539
- case 0:
540
- if (!(req instanceof utils.SpeakeasyBase)) {
541
- req = new operations.GetAccountingTransferRequest(req);
542
- }
543
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
544
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/transfers/{transferId}", req);
545
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
546
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
547
- headers["Accept"] = "application/json";
548
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
549
- retryConfig = retries;
550
- if (!retryConfig) {
551
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
552
- }
553
- return [4 /*yield*/, utils.Retry(function () {
554
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
555
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
556
- case 1:
557
- httpRes = _c.sent();
558
- 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 : "";
559
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
560
- throw new Error("status code not found in response: ".concat(httpRes));
561
- }
562
- res = new operations.GetAccountingTransferResponse({
563
- statusCode: httpRes.status,
564
- contentType: contentType,
565
- rawResponse: httpRes,
566
- });
567
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
568
- switch (true) {
569
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
570
- if (utils.matchContentType(contentType, "application/json")) {
571
- res.accountingTransfer = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingTransfer);
572
- }
573
- else {
574
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
575
- }
576
- break;
577
- case [401, 404, 409, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
578
- if (utils.matchContentType(contentType, "application/json")) {
579
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
580
- }
581
- else {
582
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
583
- }
584
- break;
585
- }
586
- return [2 /*return*/, res];
587
- }
588
- });
589
- });
590
- };
591
- /**
592
- * List account transactions
593
- *
594
- * @remarks
595
- * The *List account transactions* endpoint returns a list of [account transactions](https://docs.codat.io/accounting-api#/schemas/AccountTransaction) for a given company's connection.
596
- *
597
- * [Account transactions](https://docs.codat.io/accounting-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions.
598
- *
599
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
600
- *
601
- */
602
- Transactions.prototype.listAccountTransactions = function (req, retries, config) {
603
- var _a, _b;
604
- return __awaiter(this, void 0, void 0, function () {
605
- var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes;
606
- return __generator(this, function (_c) {
607
- switch (_c.label) {
608
- case 0:
609
- if (!(req instanceof utils.SpeakeasyBase)) {
610
- req = new operations.ListAccountingAccountTransactionsRequest(req);
611
- }
612
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
613
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/accountTransactions", req);
614
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
615
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
616
- queryParams = utils.serializeQueryParams(req);
617
- headers["Accept"] = "application/json";
618
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
619
- retryConfig = retries;
620
- if (!retryConfig) {
621
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
622
- }
623
- return [4 /*yield*/, utils.Retry(function () {
624
- return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config));
625
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
626
- case 1:
627
- httpRes = _c.sent();
628
- 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 : "";
629
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
630
- throw new Error("status code not found in response: ".concat(httpRes));
631
- }
632
- res = new operations.ListAccountingAccountTransactionsResponse({
633
- statusCode: httpRes.status,
634
- contentType: contentType,
635
- rawResponse: httpRes,
636
- });
637
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
638
- switch (true) {
639
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
640
- if (utils.matchContentType(contentType, "application/json")) {
641
- res.accountingAccountTransactions = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingAccountTransactions);
642
- }
643
- else {
644
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
645
- }
646
- break;
647
- case [400, 401, 404, 409].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
648
- if (utils.matchContentType(contentType, "application/json")) {
649
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
650
- }
651
- else {
652
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
653
- }
654
- break;
655
- }
656
- return [2 /*return*/, res];
657
- }
658
- });
659
- });
660
- };
661
- /**
662
- * List direct cost attachments
663
- *
664
- * @remarks
665
- * The *List direct cost attachments* endpoint returns a list of attachments available to download for given `directCostId`.
666
- *
667
- * [Direct costs](https://docs.codat.io/accounting-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase.
668
- *
669
- * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support listing direct cost attachments.
670
- *
671
- */
672
- Transactions.prototype.listDirectCostAttachments = function (req, retries, config) {
673
- var _a, _b;
674
- return __awaiter(this, void 0, void 0, function () {
675
- var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes;
676
- return __generator(this, function (_c) {
677
- switch (_c.label) {
678
- case 0:
679
- if (!(req instanceof utils.SpeakeasyBase)) {
680
- req = new operations.ListAccountingDirectCostAttachmentsRequest(req);
681
- }
682
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
683
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments", req);
684
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
685
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
686
- headers["Accept"] = "application/json";
687
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
688
- retryConfig = retries;
689
- if (!retryConfig) {
690
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
691
- }
692
- return [4 /*yield*/, utils.Retry(function () {
693
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
694
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
695
- case 1:
696
- httpRes = _c.sent();
697
- 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 : "";
698
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
699
- throw new Error("status code not found in response: ".concat(httpRes));
700
- }
701
- res = new operations.ListAccountingDirectCostAttachmentsResponse({
702
- statusCode: httpRes.status,
703
- contentType: contentType,
704
- rawResponse: httpRes,
705
- });
706
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
707
- switch (true) {
708
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
709
- if (utils.matchContentType(contentType, "application/json")) {
710
- res.attachments = utils.objectToClass(JSON.parse(decodedRes), shared.Attachments);
711
- }
712
- else {
713
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
714
- }
715
- break;
716
- case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
717
- if (utils.matchContentType(contentType, "application/json")) {
718
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
719
- }
720
- else {
721
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
722
- }
723
- break;
724
- }
725
- return [2 /*return*/, res];
726
- }
727
- });
728
- });
729
- };
730
- /**
731
- * List direct costs
732
- *
733
- * @remarks
734
- * The *List direct costs* endpoint returns a list of [direct costs](https://docs.codat.io/accounting-api#/schemas/DirectCost) for a given company's connection.
735
- *
736
- * [Direct costs](https://docs.codat.io/accounting-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase.
737
- *
738
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
739
- *
740
- */
741
- Transactions.prototype.listDirectCosts = function (req, retries, config) {
742
- var _a, _b;
743
- return __awaiter(this, void 0, void 0, function () {
744
- var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes;
745
- return __generator(this, function (_c) {
746
- switch (_c.label) {
747
- case 0:
748
- if (!(req instanceof utils.SpeakeasyBase)) {
749
- req = new operations.ListAccountingDirectCostsRequest(req);
750
- }
751
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
752
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/directCosts", req);
753
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
754
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
755
- queryParams = utils.serializeQueryParams(req);
756
- headers["Accept"] = "application/json";
757
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
758
- retryConfig = retries;
759
- if (!retryConfig) {
760
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
761
- }
762
- return [4 /*yield*/, utils.Retry(function () {
763
- return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config));
764
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
765
- case 1:
766
- httpRes = _c.sent();
767
- 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 : "";
768
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
769
- throw new Error("status code not found in response: ".concat(httpRes));
770
- }
771
- res = new operations.ListAccountingDirectCostsResponse({
772
- statusCode: httpRes.status,
773
- contentType: contentType,
774
- rawResponse: httpRes,
775
- });
776
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
777
- switch (true) {
778
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
779
- if (utils.matchContentType(contentType, "application/json")) {
780
- res.accountingDirectCosts = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingDirectCosts);
781
- }
782
- else {
783
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
784
- }
785
- break;
786
- case [400, 401, 404, 409].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
787
- if (utils.matchContentType(contentType, "application/json")) {
788
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
789
- }
790
- else {
791
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
792
- }
793
- break;
794
- }
795
- return [2 /*return*/, res];
796
- }
797
- });
798
- });
799
- };
800
- /**
801
- * List journal entries
802
- *
803
- * @remarks
804
- * The *List journal entries* endpoint returns a list of [journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) for a given company's connection.
805
- *
806
- * [Journal entries](https://docs.codat.io/accounting-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved.
807
- *
808
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
809
- *
810
- */
811
- Transactions.prototype.listJournalEntries = function (req, retries, config) {
812
- var _a, _b;
813
- return __awaiter(this, void 0, void 0, function () {
814
- var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes;
815
- return __generator(this, function (_c) {
816
- switch (_c.label) {
817
- case 0:
818
- if (!(req instanceof utils.SpeakeasyBase)) {
819
- req = new operations.ListAccountingJournalEntriesRequest(req);
820
- }
821
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
822
- url = utils.generateURL(baseURL, "/companies/{companyId}/data/journalEntries", req);
823
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
824
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
825
- queryParams = utils.serializeQueryParams(req);
826
- headers["Accept"] = "application/json";
827
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
828
- retryConfig = retries;
829
- if (!retryConfig) {
830
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
831
- }
832
- return [4 /*yield*/, utils.Retry(function () {
833
- return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config));
834
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
835
- case 1:
836
- httpRes = _c.sent();
837
- 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 : "";
838
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
839
- throw new Error("status code not found in response: ".concat(httpRes));
840
- }
841
- res = new operations.ListAccountingJournalEntriesResponse({
842
- statusCode: httpRes.status,
843
- contentType: contentType,
844
- rawResponse: httpRes,
845
- });
846
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
847
- switch (true) {
848
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
849
- if (utils.matchContentType(contentType, "application/json")) {
850
- res.accountingJournalEntries = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingJournalEntries);
851
- }
852
- else {
853
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
854
- }
855
- break;
856
- case [400, 401, 404, 409].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
857
- if (utils.matchContentType(contentType, "application/json")) {
858
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
859
- }
860
- else {
861
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
862
- }
863
- break;
864
- }
865
- return [2 /*return*/, res];
866
- }
867
- });
868
- });
869
- };
870
- /**
871
- * List journals
872
- *
873
- * @remarks
874
- * The *List journals* endpoint returns a list of [journals](https://docs.codat.io/accounting-api#/schemas/Journal) for a given company's connection.
875
- *
876
- * [Journals](https://docs.codat.io/accounting-api#/schemas/Journal) are used to record all the financial transactions of a company.
877
- *
878
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
879
- *
880
- */
881
- Transactions.prototype.listJournals = function (req, retries, config) {
882
- var _a, _b;
883
- return __awaiter(this, void 0, void 0, function () {
884
- var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes;
885
- return __generator(this, function (_c) {
886
- switch (_c.label) {
887
- case 0:
888
- if (!(req instanceof utils.SpeakeasyBase)) {
889
- req = new operations.ListAccountingJournalsRequest(req);
890
- }
891
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
892
- url = utils.generateURL(baseURL, "/companies/{companyId}/data/journals", req);
893
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
894
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
895
- queryParams = utils.serializeQueryParams(req);
896
- headers["Accept"] = "application/json";
897
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
898
- retryConfig = retries;
899
- if (!retryConfig) {
900
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
901
- }
902
- return [4 /*yield*/, utils.Retry(function () {
903
- return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config));
904
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
905
- case 1:
906
- httpRes = _c.sent();
907
- 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 : "";
908
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
909
- throw new Error("status code not found in response: ".concat(httpRes));
910
- }
911
- res = new operations.ListAccountingJournalsResponse({
912
- statusCode: httpRes.status,
913
- contentType: contentType,
914
- rawResponse: httpRes,
915
- });
916
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
917
- switch (true) {
918
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
919
- if (utils.matchContentType(contentType, "application/json")) {
920
- res.accountingJournals = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingJournals);
921
- }
922
- else {
923
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
924
- }
925
- break;
926
- case [400, 401, 404, 409].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
927
- if (utils.matchContentType(contentType, "application/json")) {
928
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
929
- }
930
- else {
931
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
932
- }
933
- break;
934
- }
935
- return [2 /*return*/, res];
936
- }
937
- });
938
- });
939
- };
940
- /**
941
- * List transfers
942
- *
943
- * @remarks
944
- * The *List transfers* endpoint returns a list of [transfers](https://docs.codat.io/accounting-api#/schemas/Transfer) for a given company's connection.
945
- *
946
- * [Transfers](https://docs.codat.io/accounting-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account.
947
- *
948
- * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
949
- *
950
- */
951
- Transactions.prototype.listTransfers = function (req, retries, config) {
952
- var _a, _b;
953
- return __awaiter(this, void 0, void 0, function () {
954
- var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes;
955
- return __generator(this, function (_c) {
956
- switch (_c.label) {
957
- case 0:
958
- if (!(req instanceof utils.SpeakeasyBase)) {
959
- req = new operations.ListAccountingTransfersRequest(req);
960
- }
961
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
962
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/transfers", req);
963
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
964
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
965
- queryParams = utils.serializeQueryParams(req);
966
- headers["Accept"] = "application/json";
967
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
968
- retryConfig = retries;
969
- if (!retryConfig) {
970
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
971
- }
972
- return [4 /*yield*/, utils.Retry(function () {
973
- return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config));
974
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
975
- case 1:
976
- httpRes = _c.sent();
977
- 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 : "";
978
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
979
- throw new Error("status code not found in response: ".concat(httpRes));
980
- }
981
- res = new operations.ListAccountingTransfersResponse({
982
- statusCode: httpRes.status,
983
- contentType: contentType,
984
- rawResponse: httpRes,
985
- });
986
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
987
- switch (true) {
988
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
989
- if (utils.matchContentType(contentType, "application/json")) {
990
- res.accountingTransfers = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingTransfers);
991
- }
992
- else {
993
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
994
- }
995
- break;
996
- case [400, 401, 404, 409].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
997
- if (utils.matchContentType(contentType, "application/json")) {
998
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
999
- }
1000
- else {
1001
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1002
- }
1003
- break;
1004
- }
1005
- return [2 /*return*/, res];
1006
- }
1007
- });
1008
- });
1009
- };
1010
21
  return Transactions;
1011
22
  }());
1012
23
  exports.Transactions = Transactions;