@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
@@ -0,0 +1,128 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { FinanceableCore } from "../core.js";
6
+ import { encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { pathToFunc } from "../lib/url.js";
11
+ import { APIError } from "../models/errors/apierror.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../models/errors/httpclienterrors.js";
19
+ import * as errors from "../models/errors/index.js";
20
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
+ import * as operations from "../models/operations/index.js";
22
+ import { Result } from "../types/fp.js";
23
+
24
+ /**
25
+ * Retrieve an application by its ID
26
+ */
27
+ export async function applicationsGet(
28
+ client: FinanceableCore,
29
+ request: operations.GetApplicationRequest,
30
+ options?: RequestOptions,
31
+ ): Promise<
32
+ Result<
33
+ operations.GetApplicationResponseBody,
34
+ | errors.GetApplicationResponseBody
35
+ | APIError
36
+ | SDKValidationError
37
+ | UnexpectedClientError
38
+ | InvalidRequestError
39
+ | RequestAbortedError
40
+ | RequestTimeoutError
41
+ | ConnectionError
42
+ >
43
+ > {
44
+ const parsed = safeParse(
45
+ request,
46
+ (value) => operations.GetApplicationRequest$outboundSchema.parse(value),
47
+ "Input validation failed",
48
+ );
49
+ if (!parsed.ok) {
50
+ return parsed;
51
+ }
52
+ const payload = parsed.value;
53
+ const body = null;
54
+
55
+ const pathParams = {
56
+ id: encodeSimple("id", payload.id, {
57
+ explode: false,
58
+ charEncoding: "percent",
59
+ }),
60
+ };
61
+
62
+ const path = pathToFunc("/applications/{id}")(pathParams);
63
+
64
+ const headers = new Headers({
65
+ Accept: "application/json",
66
+ });
67
+
68
+ const context = {
69
+ operationID: "getApplication",
70
+ oAuth2Scopes: [],
71
+
72
+ resolvedSecurity: null,
73
+
74
+ securitySource: null,
75
+ retryConfig: options?.retries
76
+ || client._options.retryConfig
77
+ || { strategy: "none" },
78
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
79
+ };
80
+
81
+ const requestRes = client._createRequest(context, {
82
+ method: "GET",
83
+ path: path,
84
+ headers: headers,
85
+ body: body,
86
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
87
+ }, options);
88
+ if (!requestRes.ok) {
89
+ return requestRes;
90
+ }
91
+ const req = requestRes.value;
92
+
93
+ const doResult = await client._do(req, {
94
+ context,
95
+ errorCodes: ["403", "4XX", "5XX"],
96
+ retryConfig: context.retryConfig,
97
+ retryCodes: context.retryCodes,
98
+ });
99
+ if (!doResult.ok) {
100
+ return doResult;
101
+ }
102
+ const response = doResult.value;
103
+
104
+ const responseFields = {
105
+ HttpMeta: { Response: response, Request: req },
106
+ };
107
+
108
+ const [result] = await M.match<
109
+ operations.GetApplicationResponseBody,
110
+ | errors.GetApplicationResponseBody
111
+ | APIError
112
+ | SDKValidationError
113
+ | UnexpectedClientError
114
+ | InvalidRequestError
115
+ | RequestAbortedError
116
+ | RequestTimeoutError
117
+ | ConnectionError
118
+ >(
119
+ M.json(200, operations.GetApplicationResponseBody$inboundSchema),
120
+ M.jsonErr(403, errors.GetApplicationResponseBody$inboundSchema),
121
+ M.fail(["4XX", "5XX"]),
122
+ )(response, { extraFields: responseFields });
123
+ if (!result.ok) {
124
+ return result;
125
+ }
126
+
127
+ return result;
128
+ }
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { FinanceableCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { pathToFunc } from "../lib/url.js";
11
+ import { APIError } from "../models/errors/apierror.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../models/errors/httpclienterrors.js";
19
+ import * as errors from "../models/errors/index.js";
20
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
+ import * as operations from "../models/operations/index.js";
22
+ import { Result } from "../types/fp.js";
23
+
24
+ /**
25
+ * Retrieve a list of applications
26
+ */
27
+ export async function applicationsList(
28
+ client: FinanceableCore,
29
+ request: operations.GetApplicationsRequest,
30
+ options?: RequestOptions,
31
+ ): Promise<
32
+ Result<
33
+ operations.GetApplicationsResponseBody,
34
+ | errors.GetApplicationsResponseBody
35
+ | APIError
36
+ | SDKValidationError
37
+ | UnexpectedClientError
38
+ | InvalidRequestError
39
+ | RequestAbortedError
40
+ | RequestTimeoutError
41
+ | ConnectionError
42
+ >
43
+ > {
44
+ const parsed = safeParse(
45
+ request,
46
+ (value) => operations.GetApplicationsRequest$outboundSchema.parse(value),
47
+ "Input validation failed",
48
+ );
49
+ if (!parsed.ok) {
50
+ return parsed;
51
+ }
52
+ const payload = parsed.value;
53
+ const body = null;
54
+
55
+ const path = pathToFunc("/applications")();
56
+
57
+ const query = encodeFormQuery({
58
+ "humanId": payload.humanId,
59
+ }, { explode: false });
60
+
61
+ const headers = new Headers({
62
+ Accept: "application/json",
63
+ });
64
+
65
+ const context = {
66
+ operationID: "getApplications",
67
+ oAuth2Scopes: [],
68
+
69
+ resolvedSecurity: null,
70
+
71
+ securitySource: null,
72
+ retryConfig: options?.retries
73
+ || client._options.retryConfig
74
+ || { strategy: "none" },
75
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
76
+ };
77
+
78
+ const requestRes = client._createRequest(context, {
79
+ method: "GET",
80
+ path: path,
81
+ headers: headers,
82
+ query: query,
83
+ body: body,
84
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
85
+ }, options);
86
+ if (!requestRes.ok) {
87
+ return requestRes;
88
+ }
89
+ const req = requestRes.value;
90
+
91
+ const doResult = await client._do(req, {
92
+ context,
93
+ errorCodes: ["403", "4XX", "5XX"],
94
+ retryConfig: context.retryConfig,
95
+ retryCodes: context.retryCodes,
96
+ });
97
+ if (!doResult.ok) {
98
+ return doResult;
99
+ }
100
+ const response = doResult.value;
101
+
102
+ const responseFields = {
103
+ HttpMeta: { Response: response, Request: req },
104
+ };
105
+
106
+ const [result] = await M.match<
107
+ operations.GetApplicationsResponseBody,
108
+ | errors.GetApplicationsResponseBody
109
+ | APIError
110
+ | SDKValidationError
111
+ | UnexpectedClientError
112
+ | InvalidRequestError
113
+ | RequestAbortedError
114
+ | RequestTimeoutError
115
+ | ConnectionError
116
+ >(
117
+ M.json(200, operations.GetApplicationsResponseBody$inboundSchema),
118
+ M.jsonErr(403, errors.GetApplicationsResponseBody$inboundSchema),
119
+ M.fail(["4XX", "5XX"]),
120
+ )(response, { extraFields: responseFields });
121
+ if (!result.ok) {
122
+ return result;
123
+ }
124
+
125
+ return result;
126
+ }
@@ -0,0 +1,129 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { RequestInput } from "../lib/http.js";
6
+ import {
7
+ AfterErrorContext,
8
+ AfterErrorHook,
9
+ AfterSuccessContext,
10
+ AfterSuccessHook,
11
+ BeforeCreateRequestContext,
12
+ BeforeCreateRequestHook,
13
+ BeforeRequestContext,
14
+ BeforeRequestHook,
15
+ Hook,
16
+ Hooks,
17
+ SDKInitHook,
18
+ SDKInitOptions,
19
+ } from "./types.js";
20
+
21
+ export class SDKHooks implements Hooks {
22
+ sdkInitHooks: SDKInitHook[] = [];
23
+ beforeCreateRequestHooks: BeforeCreateRequestHook[] = [];
24
+ beforeRequestHooks: BeforeRequestHook[] = [];
25
+ afterSuccessHooks: AfterSuccessHook[] = [];
26
+ afterErrorHooks: AfterErrorHook[] = [];
27
+
28
+ constructor() {
29
+ const presetHooks: Array<Hook> = [];
30
+
31
+ for (const hook of presetHooks) {
32
+ if ("sdkInit" in hook) {
33
+ this.registerSDKInitHook(hook);
34
+ }
35
+ if ("beforeCreateRequest" in hook) {
36
+ this.registerBeforeCreateRequestHook(hook);
37
+ }
38
+ if ("beforeRequest" in hook) {
39
+ this.registerBeforeRequestHook(hook);
40
+ }
41
+ if ("afterSuccess" in hook) {
42
+ this.registerAfterSuccessHook(hook);
43
+ }
44
+ if ("afterError" in hook) {
45
+ this.registerAfterErrorHook(hook);
46
+ }
47
+ }
48
+ }
49
+
50
+ registerSDKInitHook(hook: SDKInitHook) {
51
+ this.sdkInitHooks.push(hook);
52
+ }
53
+
54
+ registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) {
55
+ this.beforeCreateRequestHooks.push(hook);
56
+ }
57
+
58
+ registerBeforeRequestHook(hook: BeforeRequestHook) {
59
+ this.beforeRequestHooks.push(hook);
60
+ }
61
+
62
+ registerAfterSuccessHook(hook: AfterSuccessHook) {
63
+ this.afterSuccessHooks.push(hook);
64
+ }
65
+
66
+ registerAfterErrorHook(hook: AfterErrorHook) {
67
+ this.afterErrorHooks.push(hook);
68
+ }
69
+
70
+ sdkInit(opts: SDKInitOptions): SDKInitOptions {
71
+ return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts);
72
+ }
73
+
74
+ beforeCreateRequest(
75
+ hookCtx: BeforeCreateRequestContext,
76
+ input: RequestInput,
77
+ ): RequestInput {
78
+ let inp = input;
79
+
80
+ for (const hook of this.beforeCreateRequestHooks) {
81
+ inp = hook.beforeCreateRequest(hookCtx, inp);
82
+ }
83
+
84
+ return inp;
85
+ }
86
+
87
+ async beforeRequest(
88
+ hookCtx: BeforeRequestContext,
89
+ request: Request,
90
+ ): Promise<Request> {
91
+ let req = request;
92
+
93
+ for (const hook of this.beforeRequestHooks) {
94
+ req = await hook.beforeRequest(hookCtx, req);
95
+ }
96
+
97
+ return req;
98
+ }
99
+
100
+ async afterSuccess(
101
+ hookCtx: AfterSuccessContext,
102
+ response: Response,
103
+ ): Promise<Response> {
104
+ let res = response;
105
+
106
+ for (const hook of this.afterSuccessHooks) {
107
+ res = await hook.afterSuccess(hookCtx, res);
108
+ }
109
+
110
+ return res;
111
+ }
112
+
113
+ async afterError(
114
+ hookCtx: AfterErrorContext,
115
+ response: Response | null,
116
+ error: unknown,
117
+ ): Promise<{ response: Response | null; error: unknown }> {
118
+ let res = response;
119
+ let err = error;
120
+
121
+ for (const hook of this.afterErrorHooks) {
122
+ const result = await hook.afterError(hookCtx, res, err);
123
+ res = result.response;
124
+ err = result.error;
125
+ }
126
+
127
+ return { response: res, error: err };
128
+ }
129
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ export * from "./hooks.js";
6
+ export * from "./types.js";
@@ -0,0 +1,109 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { HTTPClient, RequestInput } from "../lib/http.js";
6
+ import { RetryConfig } from "../lib/retries.js";
7
+ import { SecurityState } from "../lib/security.js";
8
+
9
+ export type HookContext = {
10
+ operationID: string;
11
+ oAuth2Scopes?: string[];
12
+ securitySource?: any | (() => Promise<any>);
13
+ retryConfig: RetryConfig;
14
+ resolvedSecurity: SecurityState | null;
15
+ };
16
+
17
+ export type Awaitable<T> = T | Promise<T>;
18
+
19
+ export type SDKInitOptions = {
20
+ baseURL: URL | null;
21
+ client: HTTPClient;
22
+ };
23
+
24
+ export type BeforeCreateRequestContext = HookContext & {};
25
+ export type BeforeRequestContext = HookContext & {};
26
+ export type AfterSuccessContext = HookContext & {};
27
+ export type AfterErrorContext = HookContext & {};
28
+
29
+ /**
30
+ * SDKInitHook is called when the SDK is initializing. The
31
+ * hook can return a new baseURL and HTTP client to be used by the SDK.
32
+ */
33
+ export interface SDKInitHook {
34
+ sdkInit: (opts: SDKInitOptions) => SDKInitOptions;
35
+ }
36
+
37
+ export interface BeforeCreateRequestHook {
38
+ /**
39
+ * A hook that is called before the SDK creates a `Request` object. The hook
40
+ * can modify how a request is constructed since certain modifications, like
41
+ * changing the request URL, cannot be done on a request object directly.
42
+ */
43
+ beforeCreateRequest: (
44
+ hookCtx: BeforeCreateRequestContext,
45
+ input: RequestInput,
46
+ ) => RequestInput;
47
+ }
48
+
49
+ export interface BeforeRequestHook {
50
+ /**
51
+ * A hook that is called before the SDK sends a request. The hook can
52
+ * introduce instrumentation code such as logging, tracing and metrics or
53
+ * replace the request before it is sent or throw an error to stop the
54
+ * request from being sent.
55
+ */
56
+ beforeRequest: (
57
+ hookCtx: BeforeRequestContext,
58
+ request: Request,
59
+ ) => Awaitable<Request>;
60
+ }
61
+
62
+ export interface AfterSuccessHook {
63
+ /**
64
+ * A hook that is called after the SDK receives a response. The hook can
65
+ * introduce instrumentation code such as logging, tracing and metrics or
66
+ * modify the response before it is handled or throw an error to stop the
67
+ * response from being handled.
68
+ */
69
+ afterSuccess: (
70
+ hookCtx: AfterSuccessContext,
71
+ response: Response,
72
+ ) => Awaitable<Response>;
73
+ }
74
+
75
+ export interface AfterErrorHook {
76
+ /**
77
+ * A hook that is called after the SDK encounters an error, or a
78
+ * non-successful response. The hook can introduce instrumentation code such
79
+ * as logging, tracing and metrics or modify the response or error values.
80
+ */
81
+ afterError: (
82
+ hookCtx: AfterErrorContext,
83
+ response: Response | null,
84
+ error: unknown,
85
+ ) => Awaitable<{
86
+ response: Response | null;
87
+ error: unknown;
88
+ }>;
89
+ }
90
+
91
+ export interface Hooks {
92
+ /** Registers a hook to be used by the SDK for initialization event. */
93
+ registerSDKInitHook(hook: SDKInitHook): void;
94
+ /** Registers a hook to be used by the SDK for to modify `Request` construction. */
95
+ registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void;
96
+ /** Registers a hook to be used by the SDK for the before request event. */
97
+ registerBeforeRequestHook(hook: BeforeRequestHook): void;
98
+ /** Registers a hook to be used by the SDK for the after success event. */
99
+ registerAfterSuccessHook(hook: AfterSuccessHook): void;
100
+ /** Registers a hook to be used by the SDK for the after error event. */
101
+ registerAfterErrorHook(hook: AfterErrorHook): void;
102
+ }
103
+
104
+ export type Hook =
105
+ | SDKInitHook
106
+ | BeforeCreateRequestHook
107
+ | BeforeRequestHook
108
+ | AfterSuccessHook
109
+ | AfterErrorHook;
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ export * from "./lib/config.js";
6
+ export * as files from "./lib/files.js";
7
+ export * from "./sdk/sdk.js";
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export function bytesToBase64(u8arr: Uint8Array): string {
8
+ return btoa(String.fromCodePoint(...u8arr));
9
+ }
10
+
11
+ export function bytesFromBase64(encoded: string): Uint8Array {
12
+ return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0));
13
+ }
14
+
15
+ export function stringToBytes(str: string): Uint8Array {
16
+ return new TextEncoder().encode(str);
17
+ }
18
+
19
+ export function stringFromBytes(u8arr: Uint8Array): string {
20
+ return new TextDecoder().decode(u8arr);
21
+ }
22
+
23
+ export function stringToBase64(str: string): string {
24
+ return bytesToBase64(stringToBytes(str));
25
+ }
26
+
27
+ export function stringFromBase64(b64str: string): string {
28
+ return stringFromBytes(bytesFromBase64(b64str));
29
+ }
30
+
31
+ export const zodOutbound = z
32
+ .instanceof(Uint8Array)
33
+ .or(z.string().transform(stringToBytes));
34
+
35
+ export const zodInbound = z
36
+ .instanceof(Uint8Array)
37
+ .or(z.string().transform(bytesFromBase64));
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { HTTPClient } from "./http.js";
6
+ import { Logger } from "./logger.js";
7
+ import { RetryConfig } from "./retries.js";
8
+ import { Params, pathToFunc } from "./url.js";
9
+
10
+ /**
11
+ * Contains the list of servers available to the SDK
12
+ */
13
+ export const ServerList = [
14
+ "https://api.financeable.com.au",
15
+ ] as const;
16
+
17
+ export type SDKOptions = {
18
+ httpClient?: HTTPClient;
19
+ /**
20
+ * Allows overriding the default server used by the SDK
21
+ */
22
+ serverIdx?: number;
23
+ /**
24
+ * Allows overriding the default server URL used by the SDK
25
+ */
26
+ serverURL?: string;
27
+ /**
28
+ * Allows overriding the default retry config used by the SDK
29
+ */
30
+ retryConfig?: RetryConfig;
31
+ timeoutMs?: number;
32
+ debugLogger?: Logger;
33
+ };
34
+
35
+ export function serverURLFromOptions(options: SDKOptions): URL | null {
36
+ let serverURL = options.serverURL;
37
+
38
+ const params: Params = {};
39
+
40
+ if (!serverURL) {
41
+ const serverIdx = options.serverIdx ?? 0;
42
+ if (serverIdx < 0 || serverIdx >= ServerList.length) {
43
+ throw new Error(`Invalid server index ${serverIdx}`);
44
+ }
45
+ serverURL = ServerList[serverIdx] || "";
46
+ }
47
+
48
+ const u = pathToFunc(serverURL)(params);
49
+ return new URL(u);
50
+ }
51
+
52
+ export const SDK_METADATA = {
53
+ language: "typescript",
54
+ openapiDocVersion: "1.0.0",
55
+ sdkVersion: "0.1.1",
56
+ genVersion: "2.479.3",
57
+ userAgent:
58
+ "speakeasy-sdk/typescript 0.1.1 2.479.3 1.0.0 @financeable/aggregation",
59
+ } as const;
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ /*
6
+ MIT License
7
+
8
+ Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
11
+ this software and associated documentation files (the "Software"), to deal in
12
+ the Software without restriction, including without limitation the rights to
13
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14
+ the Software, and to permit persons to whom the Software is furnished to do so,
15
+ subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
23
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+ */
27
+
28
+ /**
29
+ * @param obj The object to walk
30
+ * @param key The key path to walk the object with
31
+ * @param def A default value to return if the result is undefined
32
+ *
33
+ * @example
34
+ * dlv(obj, "a.b.c.d")
35
+ * @example
36
+ * dlv(object, ["a", "b", "c", "d"])
37
+ * @example
38
+ * dlv(object, "foo.bar.baz", "Hello, default value!")
39
+ */
40
+ export function dlv<T = any>(
41
+ obj: any,
42
+ key: string | string[],
43
+ def?: T,
44
+ p?: number,
45
+ undef?: never,
46
+ ): T | undefined {
47
+ key = Array.isArray(key) ? key : key.split(".");
48
+ for (p = 0; p < key.length; p++) {
49
+ const k = key[p];
50
+ obj = k != null && obj ? obj[k] : undef;
51
+ }
52
+ return obj === undef ? def : obj;
53
+ }