@financeable/aggregation 0.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 (394) hide show
  1. package/.devcontainer/README.md +35 -0
  2. package/.devcontainer/devcontainer.json +45 -0
  3. package/FUNCTIONS.md +225 -0
  4. package/README.md +967 -0
  5. package/RUNTIMES.md +48 -0
  6. package/core.d.ts +10 -0
  7. package/core.d.ts.map +1 -0
  8. package/core.js +17 -0
  9. package/core.js.map +1 -0
  10. package/docs/sdks/applications/README.md +467 -0
  11. package/docs/sdks/financeable/README.md +5 -0
  12. package/financeable-typescript/.devcontainer/README.md +30 -0
  13. package/financeable-typescript/FUNCTIONS.md +205 -0
  14. package/financeable-typescript/README.md +895 -0
  15. package/financeable-typescript/RUNTIMES.md +22 -0
  16. package/financeable-typescript/docs/sdks/applications/README.md +427 -0
  17. package/financeable-typescript/docs/sdks/financeable/README.md +5 -0
  18. package/financeable-typescript/src/core.ts +13 -0
  19. package/financeable-typescript/src/funcs/applicationsCreate.ts +124 -0
  20. package/financeable-typescript/src/funcs/applicationsGet.ts +128 -0
  21. package/financeable-typescript/src/funcs/applicationsList.ts +126 -0
  22. package/financeable-typescript/src/hooks/hooks.ts +129 -0
  23. package/financeable-typescript/src/hooks/index.ts +6 -0
  24. package/financeable-typescript/src/hooks/types.ts +109 -0
  25. package/financeable-typescript/src/index.ts +7 -0
  26. package/financeable-typescript/src/lib/base64.ts +37 -0
  27. package/financeable-typescript/src/lib/config.ts +59 -0
  28. package/financeable-typescript/src/lib/dlv.ts +53 -0
  29. package/financeable-typescript/src/lib/encodings.ts +449 -0
  30. package/financeable-typescript/src/lib/env.ts +37 -0
  31. package/financeable-typescript/src/lib/files.ts +40 -0
  32. package/financeable-typescript/src/lib/http.ts +323 -0
  33. package/financeable-typescript/src/lib/is-plain-object.ts +43 -0
  34. package/financeable-typescript/src/lib/logger.ts +9 -0
  35. package/financeable-typescript/src/lib/matchers.ts +322 -0
  36. package/financeable-typescript/src/lib/primitives.ts +122 -0
  37. package/financeable-typescript/src/lib/retries.ts +219 -0
  38. package/financeable-typescript/src/lib/schemas.ts +86 -0
  39. package/financeable-typescript/src/lib/sdks.ts +392 -0
  40. package/financeable-typescript/src/lib/security.ts +227 -0
  41. package/financeable-typescript/src/lib/url.ts +33 -0
  42. package/financeable-typescript/src/models/components/addressattributes.ts +148 -0
  43. package/financeable-typescript/src/models/components/apierrorlinks.ts +65 -0
  44. package/financeable-typescript/src/models/components/applicationattributes.ts +128 -0
  45. package/financeable-typescript/src/models/components/applicationattributescreate.ts +90 -0
  46. package/financeable-typescript/src/models/components/applicationresourcebulksubmission.ts +1000 -0
  47. package/financeable-typescript/src/models/components/applicationstatus.ts +39 -0
  48. package/financeable-typescript/src/models/components/applicationtype.ts +33 -0
  49. package/financeable-typescript/src/models/components/assetattributes.ts +400 -0
  50. package/financeable-typescript/src/models/components/customerattributes.ts +171 -0
  51. package/financeable-typescript/src/models/components/customertitle.ts +35 -0
  52. package/financeable-typescript/src/models/components/errorsource.ts +79 -0
  53. package/financeable-typescript/src/models/components/forbiddenerror.ts +207 -0
  54. package/financeable-typescript/src/models/components/frequencytype.ts +40 -0
  55. package/financeable-typescript/src/models/components/index.ts +20 -0
  56. package/financeable-typescript/src/models/components/links.ts +72 -0
  57. package/financeable-typescript/src/models/components/loandetailsattributes.ts +187 -0
  58. package/financeable-typescript/src/models/components/repaymentstructure.ts +40 -0
  59. package/financeable-typescript/src/models/errors/apierror.ts +27 -0
  60. package/financeable-typescript/src/models/errors/createapplication.ts +76 -0
  61. package/financeable-typescript/src/models/errors/getapplication.ts +76 -0
  62. package/financeable-typescript/src/models/errors/getapplications.ts +76 -0
  63. package/financeable-typescript/src/models/errors/httpclienterrors.ts +62 -0
  64. package/financeable-typescript/src/models/errors/index.ts +10 -0
  65. package/financeable-typescript/src/models/errors/sdkvalidationerror.ts +97 -0
  66. package/financeable-typescript/src/models/operations/createapplication.ts +1649 -0
  67. package/financeable-typescript/src/models/operations/getapplication.ts +1829 -0
  68. package/financeable-typescript/src/models/operations/getapplications.ts +1790 -0
  69. package/financeable-typescript/src/models/operations/index.ts +7 -0
  70. package/financeable-typescript/src/sdk/applications.ts +55 -0
  71. package/financeable-typescript/src/sdk/index.ts +5 -0
  72. package/financeable-typescript/src/sdk/sdk.ts +13 -0
  73. package/financeable-typescript/src/types/blobs.ts +31 -0
  74. package/financeable-typescript/src/types/constdatetime.ts +15 -0
  75. package/financeable-typescript/src/types/enums.ts +16 -0
  76. package/financeable-typescript/src/types/fp.ts +50 -0
  77. package/financeable-typescript/src/types/index.ts +11 -0
  78. package/financeable-typescript/src/types/operations.ts +105 -0
  79. package/financeable-typescript/src/types/rfcdate.ts +54 -0
  80. package/financeable-typescript/src/types/streams.ts +21 -0
  81. package/funcs/applicationsCreate.d.ts +14 -0
  82. package/funcs/applicationsCreate.d.ts.map +1 -0
  83. package/funcs/applicationsCreate.js +105 -0
  84. package/funcs/applicationsCreate.js.map +1 -0
  85. package/funcs/applicationsGet.d.ts +13 -0
  86. package/funcs/applicationsGet.d.ts.map +1 -0
  87. package/funcs/applicationsGet.js +109 -0
  88. package/funcs/applicationsGet.js.map +1 -0
  89. package/funcs/applicationsList.d.ts +13 -0
  90. package/funcs/applicationsList.d.ts.map +1 -0
  91. package/funcs/applicationsList.js +107 -0
  92. package/funcs/applicationsList.js.map +1 -0
  93. package/hooks/hooks.d.ts +24 -0
  94. package/hooks/hooks.d.ts.map +1 -0
  95. package/hooks/hooks.js +84 -0
  96. package/hooks/hooks.js.map +1 -0
  97. package/hooks/index.d.ts +3 -0
  98. package/hooks/index.d.ts.map +1 -0
  99. package/hooks/index.js +22 -0
  100. package/hooks/index.js.map +1 -0
  101. package/hooks/types.d.ts +78 -0
  102. package/hooks/types.d.ts.map +1 -0
  103. package/hooks/types.js +6 -0
  104. package/hooks/types.js.map +1 -0
  105. package/index.d.ts +4 -0
  106. package/index.d.ts.map +1 -0
  107. package/index.js +46 -0
  108. package/index.js.map +1 -0
  109. package/jsr.json +27 -0
  110. package/lib/base64.d.ts +10 -0
  111. package/lib/base64.d.ts.map +1 -0
  112. package/lib/base64.js +71 -0
  113. package/lib/base64.js.map +1 -0
  114. package/lib/config.d.ts +33 -0
  115. package/lib/config.d.ts.map +1 -0
  116. package/lib/config.js +35 -0
  117. package/lib/config.js.map +1 -0
  118. package/lib/dlv.d.ts +14 -0
  119. package/lib/dlv.d.ts.map +1 -0
  120. package/lib/dlv.js +49 -0
  121. package/lib/dlv.js.map +1 -0
  122. package/lib/encodings.d.ts +52 -0
  123. package/lib/encodings.d.ts.map +1 -0
  124. package/lib/encodings.js +368 -0
  125. package/lib/encodings.js.map +1 -0
  126. package/lib/env.d.ts +14 -0
  127. package/lib/env.d.ts.map +1 -0
  128. package/lib/env.js +64 -0
  129. package/lib/env.js.map +1 -0
  130. package/lib/files.d.ts +8 -0
  131. package/lib/files.d.ts.map +1 -0
  132. package/lib/files.js +36 -0
  133. package/lib/files.js.map +1 -0
  134. package/lib/http.d.ts +67 -0
  135. package/lib/http.d.ts.map +1 -0
  136. package/lib/http.js +217 -0
  137. package/lib/http.js.map +1 -0
  138. package/lib/is-plain-object.d.ts +2 -0
  139. package/lib/is-plain-object.d.ts.map +1 -0
  140. package/lib/is-plain-object.js +41 -0
  141. package/lib/is-plain-object.js.map +1 -0
  142. package/lib/logger.d.ts +6 -0
  143. package/lib/logger.d.ts.map +1 -0
  144. package/lib/logger.js +6 -0
  145. package/lib/logger.js.map +1 -0
  146. package/lib/matchers.d.ts +64 -0
  147. package/lib/matchers.d.ts.map +1 -0
  148. package/lib/matchers.js +204 -0
  149. package/lib/matchers.js.map +1 -0
  150. package/lib/primitives.d.ts +23 -0
  151. package/lib/primitives.d.ts.map +1 -0
  152. package/lib/primitives.js +104 -0
  153. package/lib/primitives.js.map +1 -0
  154. package/lib/retries.d.ts +38 -0
  155. package/lib/retries.d.ts.map +1 -0
  156. package/lib/retries.js +153 -0
  157. package/lib/retries.js.map +1 -0
  158. package/lib/schemas.d.ts +19 -0
  159. package/lib/schemas.d.ts.map +1 -0
  160. package/lib/schemas.js +62 -0
  161. package/lib/schemas.js.map +1 -0
  162. package/lib/sdks.d.ts +60 -0
  163. package/lib/sdks.d.ts.map +1 -0
  164. package/lib/sdks.js +280 -0
  165. package/lib/sdks.js.map +1 -0
  166. package/lib/security.d.ts +79 -0
  167. package/lib/security.d.ts.map +1 -0
  168. package/lib/security.js +121 -0
  169. package/lib/security.js.map +1 -0
  170. package/lib/url.d.ts +5 -0
  171. package/lib/url.d.ts.map +1 -0
  172. package/lib/url.js +25 -0
  173. package/lib/url.js.map +1 -0
  174. package/models/components/addressattributes.d.ts +83 -0
  175. package/models/components/addressattributes.d.ts.map +1 -0
  176. package/models/components/addressattributes.js +117 -0
  177. package/models/components/addressattributes.js.map +1 -0
  178. package/models/components/apierrorlinks.d.ts +32 -0
  179. package/models/components/apierrorlinks.d.ts.map +1 -0
  180. package/models/components/apierrorlinks.js +69 -0
  181. package/models/components/apierrorlinks.js.map +1 -0
  182. package/models/components/applicationattributes.d.ts +69 -0
  183. package/models/components/applicationattributes.d.ts.map +1 -0
  184. package/models/components/applicationattributes.js +85 -0
  185. package/models/components/applicationattributes.js.map +1 -0
  186. package/models/components/applicationattributescreate.d.ts +43 -0
  187. package/models/components/applicationattributescreate.d.ts.map +1 -0
  188. package/models/components/applicationattributescreate.js +74 -0
  189. package/models/components/applicationattributescreate.js.map +1 -0
  190. package/models/components/applicationresourcebulksubmission.d.ts +456 -0
  191. package/models/components/applicationresourcebulksubmission.d.ts.map +1 -0
  192. package/models/components/applicationresourcebulksubmission.js +492 -0
  193. package/models/components/applicationresourcebulksubmission.js.map +1 -0
  194. package/models/components/applicationstatus.d.ts +46 -0
  195. package/models/components/applicationstatus.d.ts.map +1 -0
  196. package/models/components/applicationstatus.js +66 -0
  197. package/models/components/applicationstatus.js.map +1 -0
  198. package/models/components/applicationtype.d.ts +28 -0
  199. package/models/components/applicationtype.d.ts.map +1 -0
  200. package/models/components/applicationtype.js +60 -0
  201. package/models/components/applicationtype.js.map +1 -0
  202. package/models/components/assetattributes.d.ts +388 -0
  203. package/models/components/assetattributes.d.ts.map +1 -0
  204. package/models/components/assetattributes.js +244 -0
  205. package/models/components/assetattributes.js.map +1 -0
  206. package/models/components/customerattributes.d.ts +103 -0
  207. package/models/components/customerattributes.d.ts.map +1 -0
  208. package/models/components/customerattributes.js +120 -0
  209. package/models/components/customerattributes.js.map +1 -0
  210. package/models/components/customertitle.d.ts +34 -0
  211. package/models/components/customertitle.d.ts.map +1 -0
  212. package/models/components/customertitle.js +62 -0
  213. package/models/components/customertitle.js.map +1 -0
  214. package/models/components/errorsource.d.ts +42 -0
  215. package/models/components/errorsource.d.ts.map +1 -0
  216. package/models/components/errorsource.js +73 -0
  217. package/models/components/errorsource.js.map +1 -0
  218. package/models/components/forbiddenerror.d.ts +141 -0
  219. package/models/components/forbiddenerror.d.ts.map +1 -0
  220. package/models/components/forbiddenerror.js +158 -0
  221. package/models/components/forbiddenerror.js.map +1 -0
  222. package/models/components/frequencytype.d.ts +37 -0
  223. package/models/components/frequencytype.d.ts.map +1 -0
  224. package/models/components/frequencytype.js +64 -0
  225. package/models/components/frequencytype.js.map +1 -0
  226. package/models/components/index.d.ts +17 -0
  227. package/models/components/index.d.ts.map +1 -0
  228. package/models/components/index.js +36 -0
  229. package/models/components/index.js.map +1 -0
  230. package/models/components/links.d.ts +40 -0
  231. package/models/components/links.d.ts.map +1 -0
  232. package/models/components/links.js +72 -0
  233. package/models/components/links.js.map +1 -0
  234. package/models/components/loandetailsattributes.d.ts +112 -0
  235. package/models/components/loandetailsattributes.d.ts.map +1 -0
  236. package/models/components/loandetailsattributes.js +101 -0
  237. package/models/components/loandetailsattributes.js.map +1 -0
  238. package/models/components/repaymentstructure.d.ts +37 -0
  239. package/models/components/repaymentstructure.d.ts.map +1 -0
  240. package/models/components/repaymentstructure.js +64 -0
  241. package/models/components/repaymentstructure.js.map +1 -0
  242. package/models/errors/apierror.d.ts +8 -0
  243. package/models/errors/apierror.d.ts.map +1 -0
  244. package/models/errors/apierror.js +21 -0
  245. package/models/errors/apierror.js.map +1 -0
  246. package/models/errors/createapplication.d.ts +38 -0
  247. package/models/errors/createapplication.d.ts.map +1 -0
  248. package/models/errors/createapplication.js +81 -0
  249. package/models/errors/createapplication.js.map +1 -0
  250. package/models/errors/getapplication.d.ts +38 -0
  251. package/models/errors/getapplication.d.ts.map +1 -0
  252. package/models/errors/getapplication.js +81 -0
  253. package/models/errors/getapplication.js.map +1 -0
  254. package/models/errors/getapplications.d.ts +38 -0
  255. package/models/errors/getapplications.d.ts.map +1 -0
  256. package/models/errors/getapplications.js +81 -0
  257. package/models/errors/getapplications.js.map +1 -0
  258. package/models/errors/httpclienterrors.d.ts +44 -0
  259. package/models/errors/httpclienterrors.d.ts.map +1 -0
  260. package/models/errors/httpclienterrors.js +78 -0
  261. package/models/errors/httpclienterrors.js.map +1 -0
  262. package/models/errors/index.d.ts +7 -0
  263. package/models/errors/index.d.ts.map +1 -0
  264. package/models/errors/index.js +26 -0
  265. package/models/errors/index.js.map +1 -0
  266. package/models/errors/sdkvalidationerror.d.ts +20 -0
  267. package/models/errors/sdkvalidationerror.d.ts.map +1 -0
  268. package/models/errors/sdkvalidationerror.js +115 -0
  269. package/models/errors/sdkvalidationerror.js.map +1 -0
  270. package/models/operations/createapplication.d.ts +780 -0
  271. package/models/operations/createapplication.d.ts.map +1 -0
  272. package/models/operations/createapplication.js +834 -0
  273. package/models/operations/createapplication.js.map +1 -0
  274. package/models/operations/getapplication.d.ts +805 -0
  275. package/models/operations/getapplication.d.ts.map +1 -0
  276. package/models/operations/getapplication.js +861 -0
  277. package/models/operations/getapplication.js.map +1 -0
  278. package/models/operations/getapplications.d.ts +805 -0
  279. package/models/operations/getapplications.d.ts.map +1 -0
  280. package/models/operations/getapplications.js +864 -0
  281. package/models/operations/getapplications.js.map +1 -0
  282. package/models/operations/index.d.ts +4 -0
  283. package/models/operations/index.d.ts.map +1 -0
  284. package/models/operations/index.js +23 -0
  285. package/models/operations/index.js.map +1 -0
  286. package/package.json +30 -0
  287. package/sdk/applications.d.ts +18 -0
  288. package/sdk/applications.d.ts.map +1 -0
  289. package/sdk/applications.js +33 -0
  290. package/sdk/applications.js.map +1 -0
  291. package/sdk/index.d.ts +2 -0
  292. package/sdk/index.d.ts.map +1 -0
  293. package/sdk/index.js +21 -0
  294. package/sdk/index.js.map +1 -0
  295. package/sdk/sdk.d.ts +7 -0
  296. package/sdk/sdk.d.ts.map +1 -0
  297. package/sdk/sdk.js +15 -0
  298. package/sdk/sdk.js.map +1 -0
  299. package/src/core.ts +13 -0
  300. package/src/funcs/applicationsCreate.ts +128 -0
  301. package/src/funcs/applicationsGet.ts +132 -0
  302. package/src/funcs/applicationsList.ts +130 -0
  303. package/src/hooks/hooks.ts +129 -0
  304. package/src/hooks/index.ts +6 -0
  305. package/src/hooks/types.ts +110 -0
  306. package/src/index.ts +7 -0
  307. package/src/lib/base64.ts +37 -0
  308. package/src/lib/config.ts +59 -0
  309. package/src/lib/dlv.ts +53 -0
  310. package/src/lib/encodings.ts +483 -0
  311. package/src/lib/env.ts +37 -0
  312. package/src/lib/files.ts +40 -0
  313. package/src/lib/http.ts +323 -0
  314. package/src/lib/is-plain-object.ts +43 -0
  315. package/src/lib/logger.ts +9 -0
  316. package/src/lib/matchers.ts +322 -0
  317. package/src/lib/primitives.ts +136 -0
  318. package/src/lib/retries.ts +218 -0
  319. package/src/lib/schemas.ts +91 -0
  320. package/src/lib/sdks.ts +400 -0
  321. package/src/lib/security.ts +227 -0
  322. package/src/lib/url.ts +33 -0
  323. package/src/models/components/addressattributes.ts +148 -0
  324. package/src/models/components/apierrorlinks.ts +65 -0
  325. package/src/models/components/applicationattributes.ts +128 -0
  326. package/src/models/components/applicationattributescreate.ts +90 -0
  327. package/src/models/components/applicationresourcebulksubmission.ts +1000 -0
  328. package/src/models/components/applicationstatus.ts +39 -0
  329. package/src/models/components/applicationtype.ts +33 -0
  330. package/src/models/components/assetattributes.ts +400 -0
  331. package/src/models/components/customerattributes.ts +171 -0
  332. package/src/models/components/customertitle.ts +35 -0
  333. package/src/models/components/errorsource.ts +79 -0
  334. package/src/models/components/forbiddenerror.ts +207 -0
  335. package/src/models/components/frequencytype.ts +40 -0
  336. package/src/models/components/index.ts +20 -0
  337. package/src/models/components/links.ts +72 -0
  338. package/src/models/components/loandetailsattributes.ts +187 -0
  339. package/src/models/components/repaymentstructure.ts +40 -0
  340. package/src/models/errors/apierror.ts +27 -0
  341. package/src/models/errors/createapplication.ts +76 -0
  342. package/src/models/errors/getapplication.ts +76 -0
  343. package/src/models/errors/getapplications.ts +76 -0
  344. package/src/models/errors/httpclienterrors.ts +62 -0
  345. package/src/models/errors/index.ts +10 -0
  346. package/src/models/errors/sdkvalidationerror.ts +97 -0
  347. package/src/models/operations/createapplication.ts +1649 -0
  348. package/src/models/operations/getapplication.ts +1829 -0
  349. package/src/models/operations/getapplications.ts +1790 -0
  350. package/src/models/operations/index.ts +7 -0
  351. package/src/sdk/applications.ts +55 -0
  352. package/src/sdk/index.ts +5 -0
  353. package/src/sdk/sdk.ts +13 -0
  354. package/src/types/blobs.ts +31 -0
  355. package/src/types/constdatetime.ts +15 -0
  356. package/src/types/enums.ts +16 -0
  357. package/src/types/fp.ts +50 -0
  358. package/src/types/index.ts +11 -0
  359. package/src/types/operations.ts +105 -0
  360. package/src/types/rfcdate.ts +54 -0
  361. package/src/types/streams.ts +21 -0
  362. package/tsconfig.json +41 -0
  363. package/types/blobs.d.ts +4 -0
  364. package/types/blobs.d.ts.map +1 -0
  365. package/types/blobs.js +62 -0
  366. package/types/blobs.js.map +1 -0
  367. package/types/constdatetime.d.ts +3 -0
  368. package/types/constdatetime.d.ts.map +1 -0
  369. package/types/constdatetime.js +46 -0
  370. package/types/constdatetime.js.map +1 -0
  371. package/types/enums.d.ts +12 -0
  372. package/types/enums.d.ts.map +1 -0
  373. package/types/enums.js +10 -0
  374. package/types/enums.js.map +1 -0
  375. package/types/fp.d.ts +31 -0
  376. package/types/fp.d.ts.map +1 -0
  377. package/types/fp.js +37 -0
  378. package/types/fp.js.map +1 -0
  379. package/types/index.d.ts +8 -0
  380. package/types/index.d.ts.map +1 -0
  381. package/types/index.js +16 -0
  382. package/types/index.js.map +1 -0
  383. package/types/operations.d.ts +27 -0
  384. package/types/operations.d.ts.map +1 -0
  385. package/types/operations.js +83 -0
  386. package/types/operations.js.map +1 -0
  387. package/types/rfcdate.d.ts +21 -0
  388. package/types/rfcdate.d.ts.map +1 -0
  389. package/types/rfcdate.js +46 -0
  390. package/types/rfcdate.js.map +1 -0
  391. package/types/streams.d.ts +2 -0
  392. package/types/streams.d.ts.map +1 -0
  393. package/types/streams.js +18 -0
  394. package/types/streams.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,967 @@
1
+ # financeable-aggregation-api
2
+
3
+ <!-- Start Summary [summary] -->
4
+ ## Summary
5
+
6
+
7
+ <!-- End Summary [summary] -->
8
+
9
+ <!-- Start Table of Contents [toc] -->
10
+ ## Table of Contents
11
+ <!-- $toc-max-depth=2 -->
12
+ * [financeable-aggregation-api](#financeable-aggregation-api)
13
+ * [SDK Installation](#sdk-installation)
14
+ * [Requirements](#requirements)
15
+ * [SDK Example Usage](#sdk-example-usage)
16
+ * [Available Resources and Operations](#available-resources-and-operations)
17
+ * [Standalone functions](#standalone-functions)
18
+ * [Retries](#retries)
19
+ * [Error Handling](#error-handling)
20
+ * [Server Selection](#server-selection)
21
+ * [Custom HTTP Client](#custom-http-client)
22
+ * [Debugging](#debugging)
23
+
24
+ <!-- End Table of Contents [toc] -->
25
+
26
+ <!-- Start SDK Installation [installation] -->
27
+ ## SDK Installation
28
+
29
+ > [!TIP]
30
+ > To finish publishing your SDK to npm and others you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
31
+
32
+
33
+ The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
34
+
35
+ ### NPM
36
+
37
+ ```bash
38
+ npm add https://github.com/financeable-com-au/financeable-aggregation-api
39
+ ```
40
+
41
+ ### PNPM
42
+
43
+ ```bash
44
+ pnpm add https://github.com/financeable-com-au/financeable-aggregation-api
45
+ ```
46
+
47
+ ### Bun
48
+
49
+ ```bash
50
+ bun add https://github.com/financeable-com-au/financeable-aggregation-api
51
+ ```
52
+
53
+ ### Yarn
54
+
55
+ ```bash
56
+ yarn add https://github.com/financeable-com-au/financeable-aggregation-api zod
57
+
58
+ # Note that Yarn does not install peer dependencies automatically. You will need
59
+ # to install zod as shown above.
60
+ ```
61
+ <!-- End SDK Installation [installation] -->
62
+
63
+ <!-- Start Requirements [requirements] -->
64
+ ## Requirements
65
+
66
+ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
67
+ <!-- End Requirements [requirements] -->
68
+
69
+ <!-- Start SDK Example Usage [usage] -->
70
+ ## SDK Example Usage
71
+
72
+ ### Example
73
+
74
+ ```typescript
75
+ import { Financeable } from "@financeable/aggregation";
76
+
77
+ const financeable = new Financeable();
78
+
79
+ async function run() {
80
+ const result = await financeable.applications.create({
81
+ data: {
82
+ type: "applications",
83
+ attributes: {
84
+ purpose: "Purchase of a motor vehicle",
85
+ applicationType: "consumer",
86
+ },
87
+ relationships: {
88
+ loanDetails: {
89
+ data: {
90
+ type: "loan-details",
91
+ attributes: {
92
+ repayments: 12,
93
+ repaymentFrequency: "monthly",
94
+ repaymentStructure: "group-payments",
95
+ loanAmount: "10280.95",
96
+ purpose: "Purchase of a motor vehicle",
97
+ term: 48,
98
+ balloon: 5,
99
+ deposit: "2500",
100
+ originationFee: 200,
101
+ rate: "0.15",
102
+ rateAdjustment: "-0.01",
103
+ },
104
+ },
105
+ },
106
+ customers: {
107
+ data: [
108
+ {
109
+ id: "<id>",
110
+ type: "customers",
111
+ attributes: {
112
+ title: "Mr",
113
+ firstName: "John",
114
+ lastName: "Smith",
115
+ dateOfBirth: "01-01-1990",
116
+ idExpiryDate: "01-01-2025",
117
+ idType: "licence",
118
+ idNumber: "12345678",
119
+ },
120
+ relationships: {
121
+ addresses: {
122
+ data: [
123
+ {
124
+ id: "<id>",
125
+ type: "addresses",
126
+ attributes: {
127
+ addressType: "residential",
128
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
129
+ city: "Sydney",
130
+ postCode: "2000",
131
+ streetAddress: "42 Wallaby Way",
132
+ addressLine2: "",
133
+ streetNumber: "42",
134
+ streetType: "Way",
135
+ street: "Wallaby",
136
+ state: "NSW",
137
+ country: "Australia",
138
+ status: "current",
139
+ monthsAt: 24,
140
+ yearsAt: 2,
141
+ },
142
+ },
143
+ {
144
+ id: "<id>",
145
+ type: "addresses",
146
+ attributes: {
147
+ addressType: "residential",
148
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
149
+ city: "Sydney",
150
+ postCode: "2000",
151
+ streetAddress: "42 Wallaby Way",
152
+ addressLine2: "",
153
+ streetNumber: "42",
154
+ streetType: "Way",
155
+ street: "Wallaby",
156
+ state: "NSW",
157
+ country: "Australia",
158
+ status: "current",
159
+ monthsAt: 24,
160
+ yearsAt: 2,
161
+ },
162
+ },
163
+ ],
164
+ },
165
+ },
166
+ },
167
+ ],
168
+ },
169
+ asset: {
170
+ data: {
171
+ id: "<id>",
172
+ type: "asset",
173
+ attributes: {
174
+ ageOfAsset: 3,
175
+ ageOfAssetAtEnd: 8,
176
+ condition: "USED",
177
+ assetType: "MOTOR_VEHICLE_(<4.5_TONNES)",
178
+ purpose: "VEHICLE",
179
+ assetValue: "35000.00",
180
+ make: "Toyota",
181
+ assetModel: "Camry",
182
+ registrationNumber: "ABC123",
183
+ registrationState: "VIC",
184
+ vin: "1HGCM82633A123456",
185
+ supplierName: "Mr and Mrs Smith",
186
+ supplierABN: "12345678901",
187
+ supplierAddress: "123 Car Street, Melbourne VIC 3000",
188
+ supplierPhone: "0412345678",
189
+ supplierContactName: "John Smith",
190
+ supplierEmail: "john.smith@mrandmrssmith.com.au",
191
+ privateSale: false,
192
+ typeOfSale: "DEALER",
193
+ description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
194
+ netAssetValue: "32000.00",
195
+ isLuxury: false,
196
+ additionalFees: "995.00",
197
+ additionalTaxes: "0.00",
198
+ },
199
+ },
200
+ },
201
+ },
202
+ },
203
+ });
204
+
205
+ // Handle the result
206
+ console.log(result);
207
+ }
208
+
209
+ run();
210
+
211
+ ```
212
+ <!-- End SDK Example Usage [usage] -->
213
+
214
+ <!-- Start Available Resources and Operations [operations] -->
215
+ ## Available Resources and Operations
216
+
217
+ <details open>
218
+ <summary>Available methods</summary>
219
+
220
+ ### [applications](docs/sdks/applications/README.md)
221
+
222
+ * [create](docs/sdks/applications/README.md#create) - Create an application in the Financeable platform.
223
+ * [list](docs/sdks/applications/README.md#list) - Retrieve a list of applications
224
+ * [get](docs/sdks/applications/README.md#get) - Retrieve an application by its ID
225
+
226
+
227
+ </details>
228
+ <!-- End Available Resources and Operations [operations] -->
229
+
230
+ <!-- Start Standalone functions [standalone-funcs] -->
231
+ ## Standalone functions
232
+
233
+ All the methods listed above are available as standalone functions. These
234
+ functions are ideal for use in applications running in the browser, serverless
235
+ runtimes or other environments where application bundle size is a primary
236
+ concern. When using a bundler to build your application, all unused
237
+ functionality will be either excluded from the final bundle or tree-shaken away.
238
+
239
+ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
240
+
241
+ <details>
242
+
243
+ <summary>Available standalone functions</summary>
244
+
245
+ - [`applicationsCreate`](docs/sdks/applications/README.md#create) - Create an application in the Financeable platform.
246
+ - [`applicationsGet`](docs/sdks/applications/README.md#get) - Retrieve an application by its ID
247
+ - [`applicationsList`](docs/sdks/applications/README.md#list) - Retrieve a list of applications
248
+
249
+ </details>
250
+ <!-- End Standalone functions [standalone-funcs] -->
251
+
252
+ <!-- Start Retries [retries] -->
253
+ ## Retries
254
+
255
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
256
+
257
+ To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
258
+ ```typescript
259
+ import { Financeable } from "@financeable/aggregation";
260
+
261
+ const financeable = new Financeable();
262
+
263
+ async function run() {
264
+ const result = await financeable.applications.create({
265
+ data: {
266
+ type: "applications",
267
+ attributes: {
268
+ purpose: "Purchase of a motor vehicle",
269
+ applicationType: "consumer",
270
+ },
271
+ relationships: {
272
+ loanDetails: {
273
+ data: {
274
+ type: "loan-details",
275
+ attributes: {
276
+ repayments: 12,
277
+ repaymentFrequency: "monthly",
278
+ repaymentStructure: "group-payments",
279
+ loanAmount: "10280.95",
280
+ purpose: "Purchase of a motor vehicle",
281
+ term: 48,
282
+ balloon: 5,
283
+ deposit: "2500",
284
+ originationFee: 200,
285
+ rate: "0.15",
286
+ rateAdjustment: "-0.01",
287
+ },
288
+ },
289
+ },
290
+ customers: {
291
+ data: [
292
+ {
293
+ id: "<id>",
294
+ type: "customers",
295
+ attributes: {
296
+ title: "Mr",
297
+ firstName: "John",
298
+ lastName: "Smith",
299
+ dateOfBirth: "01-01-1990",
300
+ idExpiryDate: "01-01-2025",
301
+ idType: "licence",
302
+ idNumber: "12345678",
303
+ },
304
+ relationships: {
305
+ addresses: {
306
+ data: [
307
+ {
308
+ id: "<id>",
309
+ type: "addresses",
310
+ attributes: {
311
+ addressType: "residential",
312
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
313
+ city: "Sydney",
314
+ postCode: "2000",
315
+ streetAddress: "42 Wallaby Way",
316
+ addressLine2: "",
317
+ streetNumber: "42",
318
+ streetType: "Way",
319
+ street: "Wallaby",
320
+ state: "NSW",
321
+ country: "Australia",
322
+ status: "current",
323
+ monthsAt: 24,
324
+ yearsAt: 2,
325
+ },
326
+ },
327
+ {
328
+ id: "<id>",
329
+ type: "addresses",
330
+ attributes: {
331
+ addressType: "residential",
332
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
333
+ city: "Sydney",
334
+ postCode: "2000",
335
+ streetAddress: "42 Wallaby Way",
336
+ addressLine2: "",
337
+ streetNumber: "42",
338
+ streetType: "Way",
339
+ street: "Wallaby",
340
+ state: "NSW",
341
+ country: "Australia",
342
+ status: "current",
343
+ monthsAt: 24,
344
+ yearsAt: 2,
345
+ },
346
+ },
347
+ ],
348
+ },
349
+ },
350
+ },
351
+ ],
352
+ },
353
+ asset: {
354
+ data: {
355
+ id: "<id>",
356
+ type: "asset",
357
+ attributes: {
358
+ ageOfAsset: 3,
359
+ ageOfAssetAtEnd: 8,
360
+ condition: "USED",
361
+ assetType: "MOTOR_VEHICLE_(<4.5_TONNES)",
362
+ purpose: "VEHICLE",
363
+ assetValue: "35000.00",
364
+ make: "Toyota",
365
+ assetModel: "Camry",
366
+ registrationNumber: "ABC123",
367
+ registrationState: "VIC",
368
+ vin: "1HGCM82633A123456",
369
+ supplierName: "Mr and Mrs Smith",
370
+ supplierABN: "12345678901",
371
+ supplierAddress: "123 Car Street, Melbourne VIC 3000",
372
+ supplierPhone: "0412345678",
373
+ supplierContactName: "John Smith",
374
+ supplierEmail: "john.smith@mrandmrssmith.com.au",
375
+ privateSale: false,
376
+ typeOfSale: "DEALER",
377
+ description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
378
+ netAssetValue: "32000.00",
379
+ isLuxury: false,
380
+ additionalFees: "995.00",
381
+ additionalTaxes: "0.00",
382
+ },
383
+ },
384
+ },
385
+ },
386
+ },
387
+ }, {
388
+ retries: {
389
+ strategy: "backoff",
390
+ backoff: {
391
+ initialInterval: 1,
392
+ maxInterval: 50,
393
+ exponent: 1.1,
394
+ maxElapsedTime: 100,
395
+ },
396
+ retryConnectionErrors: false,
397
+ },
398
+ });
399
+
400
+ // Handle the result
401
+ console.log(result);
402
+ }
403
+
404
+ run();
405
+
406
+ ```
407
+
408
+ If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
409
+ ```typescript
410
+ import { Financeable } from "@financeable/aggregation";
411
+
412
+ const financeable = new Financeable({
413
+ retryConfig: {
414
+ strategy: "backoff",
415
+ backoff: {
416
+ initialInterval: 1,
417
+ maxInterval: 50,
418
+ exponent: 1.1,
419
+ maxElapsedTime: 100,
420
+ },
421
+ retryConnectionErrors: false,
422
+ },
423
+ });
424
+
425
+ async function run() {
426
+ const result = await financeable.applications.create({
427
+ data: {
428
+ type: "applications",
429
+ attributes: {
430
+ purpose: "Purchase of a motor vehicle",
431
+ applicationType: "consumer",
432
+ },
433
+ relationships: {
434
+ loanDetails: {
435
+ data: {
436
+ type: "loan-details",
437
+ attributes: {
438
+ repayments: 12,
439
+ repaymentFrequency: "monthly",
440
+ repaymentStructure: "group-payments",
441
+ loanAmount: "10280.95",
442
+ purpose: "Purchase of a motor vehicle",
443
+ term: 48,
444
+ balloon: 5,
445
+ deposit: "2500",
446
+ originationFee: 200,
447
+ rate: "0.15",
448
+ rateAdjustment: "-0.01",
449
+ },
450
+ },
451
+ },
452
+ customers: {
453
+ data: [
454
+ {
455
+ id: "<id>",
456
+ type: "customers",
457
+ attributes: {
458
+ title: "Mr",
459
+ firstName: "John",
460
+ lastName: "Smith",
461
+ dateOfBirth: "01-01-1990",
462
+ idExpiryDate: "01-01-2025",
463
+ idType: "licence",
464
+ idNumber: "12345678",
465
+ },
466
+ relationships: {
467
+ addresses: {
468
+ data: [
469
+ {
470
+ id: "<id>",
471
+ type: "addresses",
472
+ attributes: {
473
+ addressType: "residential",
474
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
475
+ city: "Sydney",
476
+ postCode: "2000",
477
+ streetAddress: "42 Wallaby Way",
478
+ addressLine2: "",
479
+ streetNumber: "42",
480
+ streetType: "Way",
481
+ street: "Wallaby",
482
+ state: "NSW",
483
+ country: "Australia",
484
+ status: "current",
485
+ monthsAt: 24,
486
+ yearsAt: 2,
487
+ },
488
+ },
489
+ {
490
+ id: "<id>",
491
+ type: "addresses",
492
+ attributes: {
493
+ addressType: "residential",
494
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
495
+ city: "Sydney",
496
+ postCode: "2000",
497
+ streetAddress: "42 Wallaby Way",
498
+ addressLine2: "",
499
+ streetNumber: "42",
500
+ streetType: "Way",
501
+ street: "Wallaby",
502
+ state: "NSW",
503
+ country: "Australia",
504
+ status: "current",
505
+ monthsAt: 24,
506
+ yearsAt: 2,
507
+ },
508
+ },
509
+ ],
510
+ },
511
+ },
512
+ },
513
+ ],
514
+ },
515
+ asset: {
516
+ data: {
517
+ id: "<id>",
518
+ type: "asset",
519
+ attributes: {
520
+ ageOfAsset: 3,
521
+ ageOfAssetAtEnd: 8,
522
+ condition: "USED",
523
+ assetType: "MOTOR_VEHICLE_(<4.5_TONNES)",
524
+ purpose: "VEHICLE",
525
+ assetValue: "35000.00",
526
+ make: "Toyota",
527
+ assetModel: "Camry",
528
+ registrationNumber: "ABC123",
529
+ registrationState: "VIC",
530
+ vin: "1HGCM82633A123456",
531
+ supplierName: "Mr and Mrs Smith",
532
+ supplierABN: "12345678901",
533
+ supplierAddress: "123 Car Street, Melbourne VIC 3000",
534
+ supplierPhone: "0412345678",
535
+ supplierContactName: "John Smith",
536
+ supplierEmail: "john.smith@mrandmrssmith.com.au",
537
+ privateSale: false,
538
+ typeOfSale: "DEALER",
539
+ description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
540
+ netAssetValue: "32000.00",
541
+ isLuxury: false,
542
+ additionalFees: "995.00",
543
+ additionalTaxes: "0.00",
544
+ },
545
+ },
546
+ },
547
+ },
548
+ },
549
+ });
550
+
551
+ // Handle the result
552
+ console.log(result);
553
+ }
554
+
555
+ run();
556
+
557
+ ```
558
+ <!-- End Retries [retries] -->
559
+
560
+ <!-- Start Error Handling [errors] -->
561
+ ## Error Handling
562
+
563
+ Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `create` method may throw the following errors:
564
+
565
+ | Error Type | Status Code | Content Type |
566
+ | ------------------------------------ | ----------- | ---------------- |
567
+ | errors.CreateApplicationResponseBody | 403 | application/json |
568
+ | errors.APIError | 4XX, 5XX | \*/\* |
569
+
570
+ If the method throws an error and it is not captured by the known errors, it will default to throwing a `APIError`.
571
+
572
+ ```typescript
573
+ import { Financeable } from "@financeable/aggregation";
574
+ import {
575
+ CreateApplicationResponseBody,
576
+ SDKValidationError,
577
+ } from "@financeable/aggregation/models/errors";
578
+
579
+ const financeable = new Financeable();
580
+
581
+ async function run() {
582
+ let result;
583
+ try {
584
+ result = await financeable.applications.create({
585
+ data: {
586
+ type: "applications",
587
+ attributes: {
588
+ purpose: "Purchase of a motor vehicle",
589
+ applicationType: "consumer",
590
+ },
591
+ relationships: {
592
+ loanDetails: {
593
+ data: {
594
+ type: "loan-details",
595
+ attributes: {
596
+ repayments: 12,
597
+ repaymentFrequency: "monthly",
598
+ repaymentStructure: "group-payments",
599
+ loanAmount: "10280.95",
600
+ purpose: "Purchase of a motor vehicle",
601
+ term: 48,
602
+ balloon: 5,
603
+ deposit: "2500",
604
+ originationFee: 200,
605
+ rate: "0.15",
606
+ rateAdjustment: "-0.01",
607
+ },
608
+ },
609
+ },
610
+ customers: {
611
+ data: [
612
+ {
613
+ id: "<id>",
614
+ type: "customers",
615
+ attributes: {
616
+ title: "Mr",
617
+ firstName: "John",
618
+ lastName: "Smith",
619
+ dateOfBirth: "01-01-1990",
620
+ idExpiryDate: "01-01-2025",
621
+ idType: "licence",
622
+ idNumber: "12345678",
623
+ },
624
+ relationships: {
625
+ addresses: {
626
+ data: [
627
+ {
628
+ id: "<id>",
629
+ type: "addresses",
630
+ attributes: {
631
+ addressType: "residential",
632
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
633
+ city: "Sydney",
634
+ postCode: "2000",
635
+ streetAddress: "42 Wallaby Way",
636
+ addressLine2: "",
637
+ streetNumber: "42",
638
+ streetType: "Way",
639
+ street: "Wallaby",
640
+ state: "NSW",
641
+ country: "Australia",
642
+ status: "current",
643
+ monthsAt: 24,
644
+ yearsAt: 2,
645
+ },
646
+ },
647
+ {
648
+ id: "<id>",
649
+ type: "addresses",
650
+ attributes: {
651
+ addressType: "residential",
652
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
653
+ city: "Sydney",
654
+ postCode: "2000",
655
+ streetAddress: "42 Wallaby Way",
656
+ addressLine2: "",
657
+ streetNumber: "42",
658
+ streetType: "Way",
659
+ street: "Wallaby",
660
+ state: "NSW",
661
+ country: "Australia",
662
+ status: "current",
663
+ monthsAt: 24,
664
+ yearsAt: 2,
665
+ },
666
+ },
667
+ ],
668
+ },
669
+ },
670
+ },
671
+ ],
672
+ },
673
+ asset: {
674
+ data: {
675
+ id: "<id>",
676
+ type: "asset",
677
+ attributes: {
678
+ ageOfAsset: 3,
679
+ ageOfAssetAtEnd: 8,
680
+ condition: "USED",
681
+ assetType: "MOTOR_VEHICLE_(<4.5_TONNES)",
682
+ purpose: "VEHICLE",
683
+ assetValue: "35000.00",
684
+ make: "Toyota",
685
+ assetModel: "Camry",
686
+ registrationNumber: "ABC123",
687
+ registrationState: "VIC",
688
+ vin: "1HGCM82633A123456",
689
+ supplierName: "Mr and Mrs Smith",
690
+ supplierABN: "12345678901",
691
+ supplierAddress: "123 Car Street, Melbourne VIC 3000",
692
+ supplierPhone: "0412345678",
693
+ supplierContactName: "John Smith",
694
+ supplierEmail: "john.smith@mrandmrssmith.com.au",
695
+ privateSale: false,
696
+ typeOfSale: "DEALER",
697
+ description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
698
+ netAssetValue: "32000.00",
699
+ isLuxury: false,
700
+ additionalFees: "995.00",
701
+ additionalTaxes: "0.00",
702
+ },
703
+ },
704
+ },
705
+ },
706
+ },
707
+ });
708
+
709
+ // Handle the result
710
+ console.log(result);
711
+ } catch (err) {
712
+ switch (true) {
713
+ // The server response does not match the expected SDK schema
714
+ case (err instanceof SDKValidationError): {
715
+ // Pretty-print will provide a human-readable multi-line error message
716
+ console.error(err.pretty());
717
+ // Raw value may also be inspected
718
+ console.error(err.rawValue);
719
+ return;
720
+ }
721
+ case (err instanceof CreateApplicationResponseBody): {
722
+ // Handle err.data$: CreateApplicationResponseBodyData
723
+ console.error(err);
724
+ return;
725
+ }
726
+ default: {
727
+ // Other errors such as network errors, see HTTPClientErrors for more details
728
+ throw err;
729
+ }
730
+ }
731
+ }
732
+ }
733
+
734
+ run();
735
+
736
+ ```
737
+
738
+ Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging.
739
+
740
+ In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `models/errors/httpclienterrors.ts` module:
741
+
742
+ | HTTP Client Error | Description |
743
+ | ---------------------------------------------------- | ---------------------------------------------------- |
744
+ | RequestAbortedError | HTTP request was aborted by the client |
745
+ | RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
746
+ | ConnectionError | HTTP client was unable to make a request to a server |
747
+ | InvalidRequestError | Any input used to create a request is invalid |
748
+ | UnexpectedClientError | Unrecognised or unexpected error |
749
+ <!-- End Error Handling [errors] -->
750
+
751
+ <!-- Start Server Selection [server] -->
752
+ ## Server Selection
753
+
754
+ ### Override Server URL Per-Client
755
+
756
+ The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
757
+ ```typescript
758
+ import { Financeable } from "@financeable/aggregation";
759
+
760
+ const financeable = new Financeable({
761
+ serverURL: "https://api.financeable.com.au",
762
+ });
763
+
764
+ async function run() {
765
+ const result = await financeable.applications.create({
766
+ data: {
767
+ type: "applications",
768
+ attributes: {
769
+ purpose: "Purchase of a motor vehicle",
770
+ applicationType: "consumer",
771
+ },
772
+ relationships: {
773
+ loanDetails: {
774
+ data: {
775
+ type: "loan-details",
776
+ attributes: {
777
+ repayments: 12,
778
+ repaymentFrequency: "monthly",
779
+ repaymentStructure: "group-payments",
780
+ loanAmount: "10280.95",
781
+ purpose: "Purchase of a motor vehicle",
782
+ term: 48,
783
+ balloon: 5,
784
+ deposit: "2500",
785
+ originationFee: 200,
786
+ rate: "0.15",
787
+ rateAdjustment: "-0.01",
788
+ },
789
+ },
790
+ },
791
+ customers: {
792
+ data: [
793
+ {
794
+ id: "<id>",
795
+ type: "customers",
796
+ attributes: {
797
+ title: "Mr",
798
+ firstName: "John",
799
+ lastName: "Smith",
800
+ dateOfBirth: "01-01-1990",
801
+ idExpiryDate: "01-01-2025",
802
+ idType: "licence",
803
+ idNumber: "12345678",
804
+ },
805
+ relationships: {
806
+ addresses: {
807
+ data: [
808
+ {
809
+ id: "<id>",
810
+ type: "addresses",
811
+ attributes: {
812
+ addressType: "residential",
813
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
814
+ city: "Sydney",
815
+ postCode: "2000",
816
+ streetAddress: "42 Wallaby Way",
817
+ addressLine2: "",
818
+ streetNumber: "42",
819
+ streetType: "Way",
820
+ street: "Wallaby",
821
+ state: "NSW",
822
+ country: "Australia",
823
+ status: "current",
824
+ monthsAt: 24,
825
+ yearsAt: 2,
826
+ },
827
+ },
828
+ {
829
+ id: "<id>",
830
+ type: "addresses",
831
+ attributes: {
832
+ addressType: "residential",
833
+ fullAddress: "42 Wallaby Way, Sydney NSW 2000",
834
+ city: "Sydney",
835
+ postCode: "2000",
836
+ streetAddress: "42 Wallaby Way",
837
+ addressLine2: "",
838
+ streetNumber: "42",
839
+ streetType: "Way",
840
+ street: "Wallaby",
841
+ state: "NSW",
842
+ country: "Australia",
843
+ status: "current",
844
+ monthsAt: 24,
845
+ yearsAt: 2,
846
+ },
847
+ },
848
+ ],
849
+ },
850
+ },
851
+ },
852
+ ],
853
+ },
854
+ asset: {
855
+ data: {
856
+ id: "<id>",
857
+ type: "asset",
858
+ attributes: {
859
+ ageOfAsset: 3,
860
+ ageOfAssetAtEnd: 8,
861
+ condition: "USED",
862
+ assetType: "MOTOR_VEHICLE_(<4.5_TONNES)",
863
+ purpose: "VEHICLE",
864
+ assetValue: "35000.00",
865
+ make: "Toyota",
866
+ assetModel: "Camry",
867
+ registrationNumber: "ABC123",
868
+ registrationState: "VIC",
869
+ vin: "1HGCM82633A123456",
870
+ supplierName: "Mr and Mrs Smith",
871
+ supplierABN: "12345678901",
872
+ supplierAddress: "123 Car Street, Melbourne VIC 3000",
873
+ supplierPhone: "0412345678",
874
+ supplierContactName: "John Smith",
875
+ supplierEmail: "john.smith@mrandmrssmith.com.au",
876
+ privateSale: false,
877
+ typeOfSale: "DEALER",
878
+ description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
879
+ netAssetValue: "32000.00",
880
+ isLuxury: false,
881
+ additionalFees: "995.00",
882
+ additionalTaxes: "0.00",
883
+ },
884
+ },
885
+ },
886
+ },
887
+ },
888
+ });
889
+
890
+ // Handle the result
891
+ console.log(result);
892
+ }
893
+
894
+ run();
895
+
896
+ ```
897
+ <!-- End Server Selection [server] -->
898
+
899
+ <!-- Start Custom HTTP Client [http-client] -->
900
+ ## Custom HTTP Client
901
+
902
+ The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
903
+ [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
904
+ client is a thin wrapper around `fetch` and provides the ability to attach hooks
905
+ around the request lifecycle that can be used to modify the request or handle
906
+ errors and response.
907
+
908
+ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
909
+ used to integrate a third-party HTTP client or when writing tests to mock out
910
+ the HTTP client and feed in fixtures.
911
+
912
+ The following example shows how to use the `"beforeRequest"` hook to to add a
913
+ custom header and a timeout to requests and how to use the `"requestError"` hook
914
+ to log errors:
915
+
916
+ ```typescript
917
+ import { Financeable } from "@financeable/aggregation";
918
+ import { HTTPClient } from "@financeable/aggregation/lib/http";
919
+
920
+ const httpClient = new HTTPClient({
921
+ // fetcher takes a function that has the same signature as native `fetch`.
922
+ fetcher: (request) => {
923
+ return fetch(request);
924
+ }
925
+ });
926
+
927
+ httpClient.addHook("beforeRequest", (request) => {
928
+ const nextRequest = new Request(request, {
929
+ signal: request.signal || AbortSignal.timeout(5000)
930
+ });
931
+
932
+ nextRequest.headers.set("x-custom-header", "custom value");
933
+
934
+ return nextRequest;
935
+ });
936
+
937
+ httpClient.addHook("requestError", (error, request) => {
938
+ console.group("Request Error");
939
+ console.log("Reason:", `${error}`);
940
+ console.log("Endpoint:", `${request.method} ${request.url}`);
941
+ console.groupEnd();
942
+ });
943
+
944
+ const sdk = new Financeable({ httpClient });
945
+ ```
946
+ <!-- End Custom HTTP Client [http-client] -->
947
+
948
+ <!-- Start Debugging [debug] -->
949
+ ## Debugging
950
+
951
+ You can setup your SDK to emit debug logs for SDK requests and responses.
952
+
953
+ You can pass a logger that matches `console`'s interface as an SDK option.
954
+
955
+ > [!WARNING]
956
+ > Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
957
+
958
+ ```typescript
959
+ import { Financeable } from "@financeable/aggregation";
960
+
961
+ const sdk = new Financeable({ debugLogger: console });
962
+ ```
963
+
964
+ You can also enable a default debug logger by setting an environment variable `FINANCEABLE_DEBUG` to true.
965
+ <!-- End Debugging [debug] -->
966
+
967
+ <!-- Placeholder for Future Speakeasy SDK Sections -->