@financeable/aggregation 0.5.1 → 0.6.1

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 (297) hide show
  1. package/FUNCTIONS.md +14 -131
  2. package/README.md +271 -1512
  3. package/docs/sdks/applications/README.md +24 -383
  4. package/docs/sdks/oauthtoken/README.md +5 -5
  5. package/docs/sdks/supportingdocuments/README.md +121 -0
  6. package/funcs/applicationsCreate.d.ts +1 -2
  7. package/funcs/applicationsCreate.d.ts.map +1 -1
  8. package/funcs/applicationsCreate.js +3 -4
  9. package/funcs/applicationsCreate.js.map +1 -1
  10. package/funcs/{oauthTokenGet.d.ts → oauthTokenOauthToken.d.ts} +2 -2
  11. package/funcs/oauthTokenOauthToken.d.ts.map +1 -0
  12. package/funcs/{oauthTokenGet.js → oauthTokenOauthToken.js} +3 -3
  13. package/funcs/oauthTokenOauthToken.js.map +1 -0
  14. package/funcs/supportingDocumentsCreate.d.ts +14 -0
  15. package/funcs/supportingDocumentsCreate.d.ts.map +1 -0
  16. package/funcs/{applicationsList.js → supportingDocumentsCreate.js} +14 -12
  17. package/funcs/supportingDocumentsCreate.js.map +1 -0
  18. package/jsr.json +1 -1
  19. package/lib/config.d.ts +4 -4
  20. package/lib/config.d.ts.map +1 -1
  21. package/lib/config.js +4 -7
  22. package/lib/config.js.map +1 -1
  23. package/lib/matchers.d.ts +3 -1
  24. package/lib/matchers.d.ts.map +1 -1
  25. package/lib/matchers.js +12 -0
  26. package/lib/matchers.js.map +1 -1
  27. package/lib/sdks.d.ts +3 -1
  28. package/lib/sdks.d.ts.map +1 -1
  29. package/lib/sdks.js +13 -13
  30. package/lib/sdks.js.map +1 -1
  31. package/models/components/addressattributes.d.ts +10 -8
  32. package/models/components/addressattributes.d.ts.map +1 -1
  33. package/models/components/addressattributes.js +15 -14
  34. package/models/components/addressattributes.js.map +1 -1
  35. package/models/components/applicationresource.d.ts +30 -0
  36. package/models/components/applicationresource.d.ts.map +1 -0
  37. package/models/components/applicationresource.js +73 -0
  38. package/models/components/applicationresource.js.map +1 -0
  39. package/models/components/badrequesterror.d.ts +119 -0
  40. package/models/components/badrequesterror.d.ts.map +1 -0
  41. package/models/components/badrequesterror.js +140 -0
  42. package/models/components/badrequesterror.js.map +1 -0
  43. package/models/components/commercialapplicationjsonapirelationships.d.ts +384 -0
  44. package/models/components/commercialapplicationjsonapirelationships.d.ts.map +1 -0
  45. package/models/components/commercialapplicationjsonapirelationships.js +391 -0
  46. package/models/components/commercialapplicationjsonapirelationships.js.map +1 -0
  47. package/models/components/commercialsecuredapplicationpayload.d.ts +164 -0
  48. package/models/components/commercialsecuredapplicationpayload.d.ts.map +1 -0
  49. package/models/components/commercialsecuredapplicationpayload.js +158 -0
  50. package/models/components/commercialsecuredapplicationpayload.js.map +1 -0
  51. package/models/components/commercialsecuredapplicationresource.d.ts +171 -0
  52. package/models/components/commercialsecuredapplicationresource.d.ts.map +1 -0
  53. package/models/components/commercialsecuredapplicationresource.js +161 -0
  54. package/models/components/commercialsecuredapplicationresource.js.map +1 -0
  55. package/models/components/commercialsecuredloanassetattributes.d.ts +237 -0
  56. package/models/components/commercialsecuredloanassetattributes.d.ts.map +1 -0
  57. package/models/components/commercialsecuredloanassetattributes.js +170 -0
  58. package/models/components/commercialsecuredloanassetattributes.js.map +1 -0
  59. package/models/components/commercialsecuredloanassettype.d.ts +100 -0
  60. package/models/components/commercialsecuredloanassettype.d.ts.map +1 -0
  61. package/models/components/commercialsecuredloanassettype.js +84 -0
  62. package/models/components/commercialsecuredloanassettype.js.map +1 -0
  63. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts +537 -0
  64. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts.map +1 -0
  65. package/models/components/commercialsecuredloancommercialapplicationrelationships.js +548 -0
  66. package/models/components/commercialsecuredloancommercialapplicationrelationships.js.map +1 -0
  67. package/models/components/consumerapplicationjsonapirelationships.d.ts +296 -0
  68. package/models/components/consumerapplicationjsonapirelationships.d.ts.map +1 -0
  69. package/models/components/consumerapplicationjsonapirelationships.js +310 -0
  70. package/models/components/consumerapplicationjsonapirelationships.js.map +1 -0
  71. package/models/components/consumersecuredapplicationpayload.d.ts +164 -0
  72. package/models/components/consumersecuredapplicationpayload.d.ts.map +1 -0
  73. package/models/components/consumersecuredapplicationpayload.js +158 -0
  74. package/models/components/consumersecuredapplicationpayload.js.map +1 -0
  75. package/models/components/consumersecuredapplicationresource.d.ts +171 -0
  76. package/models/components/consumersecuredapplicationresource.d.ts.map +1 -0
  77. package/models/components/consumersecuredapplicationresource.js +161 -0
  78. package/models/components/consumersecuredapplicationresource.js.map +1 -0
  79. package/models/components/consumersecuredloanassetattributes.d.ts +237 -0
  80. package/models/components/consumersecuredloanassetattributes.d.ts.map +1 -0
  81. package/models/components/consumersecuredloanassetattributes.js +172 -0
  82. package/models/components/consumersecuredloanassetattributes.js.map +1 -0
  83. package/models/components/consumersecuredloanassettype.d.ts +64 -0
  84. package/models/components/consumersecuredloanassettype.d.ts.map +1 -0
  85. package/models/components/{consumerassettype.js → consumersecuredloanassettype.js} +27 -28
  86. package/models/components/consumersecuredloanassettype.js.map +1 -0
  87. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts +425 -0
  88. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts.map +1 -0
  89. package/models/components/consumersecuredloanconsumerapplicationrelationships.js +443 -0
  90. package/models/components/consumersecuredloanconsumerapplicationrelationships.js.map +1 -0
  91. package/models/components/createsupportingdocumentsresponse.d.ts +124 -0
  92. package/models/components/createsupportingdocumentsresponse.d.ts.map +1 -0
  93. package/models/components/createsupportingdocumentsresponse.js +138 -0
  94. package/models/components/createsupportingdocumentsresponse.js.map +1 -0
  95. package/models/components/customerattributes.d.ts +2 -0
  96. package/models/components/customerattributes.d.ts.map +1 -1
  97. package/models/components/customerattributes.js +2 -0
  98. package/models/components/customerattributes.js.map +1 -1
  99. package/models/components/documenttype.d.ts +70 -0
  100. package/models/components/documenttype.d.ts.map +1 -0
  101. package/models/{errors/responsebody.js → components/documenttype.js} +28 -34
  102. package/models/components/documenttype.js.map +1 -0
  103. package/models/components/entityattributes.d.ts +2 -22
  104. package/models/components/entityattributes.d.ts.map +1 -1
  105. package/models/components/entityattributes.js +2 -19
  106. package/models/components/entityattributes.js.map +1 -1
  107. package/models/components/forbiddenerror.d.ts +17 -39
  108. package/models/components/forbiddenerror.d.ts.map +1 -1
  109. package/models/components/forbiddenerror.js +27 -46
  110. package/models/components/forbiddenerror.js.map +1 -1
  111. package/models/components/index.d.ts +24 -8
  112. package/models/components/index.d.ts.map +1 -1
  113. package/models/components/index.js +24 -8
  114. package/models/components/index.js.map +1 -1
  115. package/models/components/linkobject.d.ts +47 -0
  116. package/models/components/linkobject.d.ts.map +1 -0
  117. package/models/components/{links.js → linkobject.js} +27 -22
  118. package/models/components/linkobject.js.map +1 -0
  119. package/models/components/loandetailsattributes.d.ts +2 -0
  120. package/models/components/loandetailsattributes.d.ts.map +1 -1
  121. package/models/components/loandetailsattributes.js +2 -0
  122. package/models/components/loandetailsattributes.js.map +1 -1
  123. package/models/components/relationshipresourcenotfound.d.ts +116 -0
  124. package/models/components/relationshipresourcenotfound.d.ts.map +1 -0
  125. package/models/components/relationshipresourcenotfound.js +139 -0
  126. package/models/components/relationshipresourcenotfound.js.map +1 -0
  127. package/models/components/resourcenotfound.d.ts +119 -0
  128. package/models/components/resourcenotfound.d.ts.map +1 -0
  129. package/models/components/resourcenotfound.js +139 -0
  130. package/models/components/resourcenotfound.js.map +1 -0
  131. package/models/components/supportingdocumentattributes.d.ts +40 -0
  132. package/models/components/supportingdocumentattributes.d.ts.map +1 -0
  133. package/models/components/{applicationattributescreate.js → supportingdocumentattributes.js} +24 -24
  134. package/models/components/supportingdocumentattributes.js.map +1 -0
  135. package/models/components/supportingdocumentattributesinput.d.ts +38 -0
  136. package/models/components/supportingdocumentattributesinput.d.ts.map +1 -0
  137. package/models/components/supportingdocumentattributesinput.js +72 -0
  138. package/models/components/supportingdocumentattributesinput.js.map +1 -0
  139. package/models/components/supportingdocumentrelationships.d.ts +448 -0
  140. package/models/components/supportingdocumentrelationships.d.ts.map +1 -0
  141. package/models/components/supportingdocumentrelationships.js +434 -0
  142. package/models/components/supportingdocumentrelationships.js.map +1 -0
  143. package/models/components/supportingdocumentresource.d.ts +71 -0
  144. package/models/components/supportingdocumentresource.d.ts.map +1 -0
  145. package/models/components/supportingdocumentresource.js +98 -0
  146. package/models/components/supportingdocumentresource.js.map +1 -0
  147. package/models/components/uploadmimetype.d.ts +49 -0
  148. package/models/components/uploadmimetype.d.ts.map +1 -0
  149. package/models/components/{applicationtype.js → uploadmimetype.js} +22 -14
  150. package/models/components/uploadmimetype.js.map +1 -0
  151. package/models/errors/createapplication.d.ts +73 -0
  152. package/models/errors/createapplication.d.ts.map +1 -0
  153. package/models/errors/createapplication.js +120 -0
  154. package/models/errors/createapplication.js.map +1 -0
  155. package/models/errors/index.d.ts +2 -1
  156. package/models/errors/index.d.ts.map +1 -1
  157. package/models/errors/index.js +2 -1
  158. package/models/errors/index.js.map +1 -1
  159. package/models/errors/supportingdocumentscreate.d.ts +143 -0
  160. package/models/errors/supportingdocumentscreate.d.ts.map +1 -0
  161. package/models/errors/supportingdocumentscreate.js +225 -0
  162. package/models/errors/supportingdocumentscreate.js.map +1 -0
  163. package/models/operations/createapplication.d.ts +26 -874
  164. package/models/operations/createapplication.d.ts.map +1 -1
  165. package/models/operations/createapplication.js +37 -899
  166. package/models/operations/createapplication.js.map +1 -1
  167. package/models/operations/index.d.ts +1 -2
  168. package/models/operations/index.d.ts.map +1 -1
  169. package/models/operations/index.js +1 -2
  170. package/models/operations/index.js.map +1 -1
  171. package/models/operations/supportingdocumentscreate.d.ts +94 -0
  172. package/models/operations/supportingdocumentscreate.d.ts.map +1 -0
  173. package/models/operations/supportingdocumentscreate.js +135 -0
  174. package/models/operations/supportingdocumentscreate.js.map +1 -0
  175. package/package.json +2 -2
  176. package/sdk/applications.d.ts +1 -10
  177. package/sdk/applications.d.ts.map +1 -1
  178. package/sdk/applications.js +0 -14
  179. package/sdk/applications.js.map +1 -1
  180. package/sdk/oauthtoken.d.ts +1 -1
  181. package/sdk/oauthtoken.d.ts.map +1 -1
  182. package/sdk/oauthtoken.js +3 -3
  183. package/sdk/oauthtoken.js.map +1 -1
  184. package/sdk/sdk.d.ts +3 -0
  185. package/sdk/sdk.d.ts.map +1 -1
  186. package/sdk/sdk.js +4 -0
  187. package/sdk/sdk.js.map +1 -1
  188. package/sdk/supportingdocuments.d.ts +9 -0
  189. package/sdk/supportingdocuments.d.ts.map +1 -0
  190. package/sdk/supportingdocuments.js +19 -0
  191. package/sdk/supportingdocuments.js.map +1 -0
  192. package/src/funcs/applicationsCreate.ts +15 -9
  193. package/src/funcs/{oauthTokenGet.ts → oauthTokenOauthToken.ts} +1 -1
  194. package/src/funcs/{applicationsList.ts → supportingDocumentsCreate.ts} +30 -20
  195. package/src/lib/config.ts +4 -7
  196. package/src/lib/matchers.ts +20 -0
  197. package/src/lib/sdks.ts +19 -13
  198. package/src/models/components/addressattributes.ts +22 -14
  199. package/src/models/components/applicationresource.ts +83 -0
  200. package/src/models/components/badrequesterror.ts +182 -0
  201. package/src/models/components/commercialapplicationjsonapirelationships.ts +894 -0
  202. package/src/models/components/commercialsecuredapplicationpayload.ts +248 -0
  203. package/src/models/components/commercialsecuredapplicationresource.ts +310 -0
  204. package/src/models/components/commercialsecuredloanassetattributes.ts +319 -0
  205. package/src/models/components/commercialsecuredloanassettype.ts +64 -0
  206. package/src/models/components/commercialsecuredloancommercialapplicationrelationships.ts +1238 -0
  207. package/src/models/components/consumerapplicationjsonapirelationships.ts +683 -0
  208. package/src/models/components/consumersecuredapplicationpayload.ts +273 -0
  209. package/src/models/components/consumersecuredapplicationresource.ts +309 -0
  210. package/src/models/components/consumersecuredloanassetattributes.ts +334 -0
  211. package/src/models/components/consumersecuredloanassettype.ts +47 -0
  212. package/src/models/components/consumersecuredloanconsumerapplicationrelationships.ts +1047 -0
  213. package/src/models/components/createsupportingdocumentsresponse.ts +206 -0
  214. package/src/models/components/customerattributes.ts +4 -0
  215. package/src/models/components/documenttype.ts +49 -0
  216. package/src/models/components/entityattributes.ts +4 -44
  217. package/src/models/components/forbiddenerror.ts +35 -58
  218. package/src/models/components/index.ts +24 -8
  219. package/src/models/components/linkobject.ts +84 -0
  220. package/src/models/components/loandetailsattributes.ts +4 -0
  221. package/src/models/components/relationshipresourcenotfound.ts +195 -0
  222. package/src/models/components/resourcenotfound.ts +188 -0
  223. package/src/models/components/supportingdocumentattributes.ts +87 -0
  224. package/src/models/components/supportingdocumentattributesinput.ts +84 -0
  225. package/src/models/components/supportingdocumentrelationships.ts +828 -0
  226. package/src/models/components/supportingdocumentresource.ts +126 -0
  227. package/src/models/components/uploadmimetype.ts +44 -0
  228. package/src/models/errors/createapplication.ts +149 -0
  229. package/src/models/errors/index.ts +2 -1
  230. package/src/models/errors/supportingdocumentscreate.ts +342 -0
  231. package/src/models/operations/createapplication.ts +69 -1913
  232. package/src/models/operations/index.ts +1 -2
  233. package/src/models/operations/supportingdocumentscreate.ts +222 -0
  234. package/src/sdk/applications.ts +1 -32
  235. package/src/sdk/oauthtoken.ts +3 -3
  236. package/src/sdk/sdk.ts +8 -0
  237. package/src/sdk/supportingdocuments.ts +24 -0
  238. package/funcs/applicationsGet.d.ts +0 -14
  239. package/funcs/applicationsGet.d.ts.map +0 -1
  240. package/funcs/applicationsGet.js +0 -120
  241. package/funcs/applicationsGet.js.map +0 -1
  242. package/funcs/applicationsList.d.ts +0 -14
  243. package/funcs/applicationsList.d.ts.map +0 -1
  244. package/funcs/applicationsList.js.map +0 -1
  245. package/funcs/oauthTokenGet.d.ts.map +0 -1
  246. package/funcs/oauthTokenGet.js.map +0 -1
  247. package/models/components/applicationattributes.d.ts +0 -69
  248. package/models/components/applicationattributes.d.ts.map +0 -1
  249. package/models/components/applicationattributes.js +0 -85
  250. package/models/components/applicationattributes.js.map +0 -1
  251. package/models/components/applicationattributescreate.d.ts +0 -43
  252. package/models/components/applicationattributescreate.d.ts.map +0 -1
  253. package/models/components/applicationattributescreate.js.map +0 -1
  254. package/models/components/applicationresourcebulksubmission.d.ts +0 -527
  255. package/models/components/applicationresourcebulksubmission.d.ts.map +0 -1
  256. package/models/components/applicationresourcebulksubmission.js +0 -565
  257. package/models/components/applicationresourcebulksubmission.js.map +0 -1
  258. package/models/components/applicationtype.d.ts +0 -28
  259. package/models/components/applicationtype.d.ts.map +0 -1
  260. package/models/components/applicationtype.js.map +0 -1
  261. package/models/components/assetattributes.d.ts +0 -311
  262. package/models/components/assetattributes.d.ts.map +0 -1
  263. package/models/components/assetattributes.js +0 -234
  264. package/models/components/assetattributes.js.map +0 -1
  265. package/models/components/commercialassettype.d.ts +0 -44
  266. package/models/components/commercialassettype.d.ts.map +0 -1
  267. package/models/components/commercialassettype.js +0 -85
  268. package/models/components/commercialassettype.js.map +0 -1
  269. package/models/components/consumerassettype.d.ts +0 -32
  270. package/models/components/consumerassettype.d.ts.map +0 -1
  271. package/models/components/consumerassettype.js.map +0 -1
  272. package/models/components/links.d.ts +0 -40
  273. package/models/components/links.d.ts.map +0 -1
  274. package/models/components/links.js.map +0 -1
  275. package/models/errors/responsebody.d.ts +0 -38
  276. package/models/errors/responsebody.d.ts.map +0 -1
  277. package/models/errors/responsebody.js.map +0 -1
  278. package/models/operations/getapplication.d.ts +0 -962
  279. package/models/operations/getapplication.d.ts.map +0 -1
  280. package/models/operations/getapplication.js +0 -1030
  281. package/models/operations/getapplication.js.map +0 -1
  282. package/models/operations/getapplications.d.ts +0 -962
  283. package/models/operations/getapplications.d.ts.map +0 -1
  284. package/models/operations/getapplications.js +0 -1029
  285. package/models/operations/getapplications.js.map +0 -1
  286. package/src/funcs/applicationsGet.ts +0 -168
  287. package/src/models/components/applicationattributes.ts +0 -128
  288. package/src/models/components/applicationattributescreate.ts +0 -90
  289. package/src/models/components/applicationresourcebulksubmission.ts +0 -1172
  290. package/src/models/components/applicationtype.ts +0 -33
  291. package/src/models/components/assetattributes.ts +0 -411
  292. package/src/models/components/commercialassettype.ts +0 -61
  293. package/src/models/components/consumerassettype.ts +0 -43
  294. package/src/models/components/links.ts +0 -72
  295. package/src/models/errors/responsebody.ts +0 -76
  296. package/src/models/operations/getapplication.ts +0 -2246
  297. package/src/models/operations/getapplications.ts +0 -2191
@@ -0,0 +1,248 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ CommercialSecuredLoanCommercialApplicationRelationships,
12
+ CommercialSecuredLoanCommercialApplicationRelationships$inboundSchema,
13
+ CommercialSecuredLoanCommercialApplicationRelationships$Outbound,
14
+ CommercialSecuredLoanCommercialApplicationRelationships$outboundSchema,
15
+ } from "./commercialsecuredloancommercialapplicationrelationships.js";
16
+ import {
17
+ LinkObject,
18
+ LinkObject$inboundSchema,
19
+ LinkObject$Outbound,
20
+ LinkObject$outboundSchema,
21
+ } from "./linkobject.js";
22
+
23
+ /**
24
+ * Resource types used in the API
25
+ */
26
+ export const CommercialSecuredApplicationPayloadType = {
27
+ ConsumerSecuredApplications: "consumer-secured-applications",
28
+ CommercialSecuredApplications: "commercial-secured-applications",
29
+ SupportingDocuments: "supporting-documents",
30
+ Customers: "customers",
31
+ Assets: "assets",
32
+ Entities: "entities",
33
+ LoanDetails: "loan-details",
34
+ Addresses: "addresses",
35
+ } as const;
36
+ /**
37
+ * Resource types used in the API
38
+ */
39
+ export type CommercialSecuredApplicationPayloadType = ClosedEnum<
40
+ typeof CommercialSecuredApplicationPayloadType
41
+ >;
42
+
43
+ /**
44
+ * Type of the loan application
45
+ */
46
+ export const ApplicationType = {
47
+ CommercialSecured: "commercialSecured",
48
+ } as const;
49
+ /**
50
+ * Type of the loan application
51
+ */
52
+ export type ApplicationType = ClosedEnum<typeof ApplicationType>;
53
+
54
+ /**
55
+ * Application resource attributes
56
+ */
57
+ export type Attributes = {
58
+ /**
59
+ * Type of the loan application
60
+ */
61
+ applicationType: ApplicationType;
62
+ /**
63
+ * Email address of the broker to be associated with this application.
64
+ */
65
+ associatedBrokerEmail?: string | undefined;
66
+ };
67
+
68
+ export type CommercialSecuredApplicationPayload = {
69
+ type: CommercialSecuredApplicationPayloadType;
70
+ /**
71
+ * Application resource attributes
72
+ */
73
+ attributes: Attributes;
74
+ relationships: CommercialSecuredLoanCommercialApplicationRelationships;
75
+ links?: { [k: string]: LinkObject } | undefined;
76
+ meta?: { [k: string]: any } | undefined;
77
+ };
78
+
79
+ /** @internal */
80
+ export const CommercialSecuredApplicationPayloadType$inboundSchema:
81
+ z.ZodNativeEnum<typeof CommercialSecuredApplicationPayloadType> = z
82
+ .nativeEnum(CommercialSecuredApplicationPayloadType);
83
+
84
+ /** @internal */
85
+ export const CommercialSecuredApplicationPayloadType$outboundSchema:
86
+ z.ZodNativeEnum<typeof CommercialSecuredApplicationPayloadType> =
87
+ CommercialSecuredApplicationPayloadType$inboundSchema;
88
+
89
+ /**
90
+ * @internal
91
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
92
+ */
93
+ export namespace CommercialSecuredApplicationPayloadType$ {
94
+ /** @deprecated use `CommercialSecuredApplicationPayloadType$inboundSchema` instead. */
95
+ export const inboundSchema =
96
+ CommercialSecuredApplicationPayloadType$inboundSchema;
97
+ /** @deprecated use `CommercialSecuredApplicationPayloadType$outboundSchema` instead. */
98
+ export const outboundSchema =
99
+ CommercialSecuredApplicationPayloadType$outboundSchema;
100
+ }
101
+
102
+ /** @internal */
103
+ export const ApplicationType$inboundSchema: z.ZodNativeEnum<
104
+ typeof ApplicationType
105
+ > = z.nativeEnum(ApplicationType);
106
+
107
+ /** @internal */
108
+ export const ApplicationType$outboundSchema: z.ZodNativeEnum<
109
+ typeof ApplicationType
110
+ > = ApplicationType$inboundSchema;
111
+
112
+ /**
113
+ * @internal
114
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
115
+ */
116
+ export namespace ApplicationType$ {
117
+ /** @deprecated use `ApplicationType$inboundSchema` instead. */
118
+ export const inboundSchema = ApplicationType$inboundSchema;
119
+ /** @deprecated use `ApplicationType$outboundSchema` instead. */
120
+ export const outboundSchema = ApplicationType$outboundSchema;
121
+ }
122
+
123
+ /** @internal */
124
+ export const Attributes$inboundSchema: z.ZodType<
125
+ Attributes,
126
+ z.ZodTypeDef,
127
+ unknown
128
+ > = z.object({
129
+ applicationType: ApplicationType$inboundSchema,
130
+ associatedBrokerEmail: z.string().optional(),
131
+ });
132
+
133
+ /** @internal */
134
+ export type Attributes$Outbound = {
135
+ applicationType: string;
136
+ associatedBrokerEmail?: string | undefined;
137
+ };
138
+
139
+ /** @internal */
140
+ export const Attributes$outboundSchema: z.ZodType<
141
+ Attributes$Outbound,
142
+ z.ZodTypeDef,
143
+ Attributes
144
+ > = z.object({
145
+ applicationType: ApplicationType$outboundSchema,
146
+ associatedBrokerEmail: z.string().optional(),
147
+ });
148
+
149
+ /**
150
+ * @internal
151
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
152
+ */
153
+ export namespace Attributes$ {
154
+ /** @deprecated use `Attributes$inboundSchema` instead. */
155
+ export const inboundSchema = Attributes$inboundSchema;
156
+ /** @deprecated use `Attributes$outboundSchema` instead. */
157
+ export const outboundSchema = Attributes$outboundSchema;
158
+ /** @deprecated use `Attributes$Outbound` instead. */
159
+ export type Outbound = Attributes$Outbound;
160
+ }
161
+
162
+ export function attributesToJSON(attributes: Attributes): string {
163
+ return JSON.stringify(Attributes$outboundSchema.parse(attributes));
164
+ }
165
+
166
+ export function attributesFromJSON(
167
+ jsonString: string,
168
+ ): SafeParseResult<Attributes, SDKValidationError> {
169
+ return safeParse(
170
+ jsonString,
171
+ (x) => Attributes$inboundSchema.parse(JSON.parse(x)),
172
+ `Failed to parse 'Attributes' from JSON`,
173
+ );
174
+ }
175
+
176
+ /** @internal */
177
+ export const CommercialSecuredApplicationPayload$inboundSchema: z.ZodType<
178
+ CommercialSecuredApplicationPayload,
179
+ z.ZodTypeDef,
180
+ unknown
181
+ > = z.object({
182
+ type: CommercialSecuredApplicationPayloadType$inboundSchema,
183
+ attributes: z.lazy(() => Attributes$inboundSchema),
184
+ relationships:
185
+ CommercialSecuredLoanCommercialApplicationRelationships$inboundSchema,
186
+ links: z.record(LinkObject$inboundSchema).optional(),
187
+ meta: z.record(z.any()).optional(),
188
+ });
189
+
190
+ /** @internal */
191
+ export type CommercialSecuredApplicationPayload$Outbound = {
192
+ type: string;
193
+ attributes: Attributes$Outbound;
194
+ relationships:
195
+ CommercialSecuredLoanCommercialApplicationRelationships$Outbound;
196
+ links?: { [k: string]: LinkObject$Outbound } | undefined;
197
+ meta?: { [k: string]: any } | undefined;
198
+ };
199
+
200
+ /** @internal */
201
+ export const CommercialSecuredApplicationPayload$outboundSchema: z.ZodType<
202
+ CommercialSecuredApplicationPayload$Outbound,
203
+ z.ZodTypeDef,
204
+ CommercialSecuredApplicationPayload
205
+ > = z.object({
206
+ type: CommercialSecuredApplicationPayloadType$outboundSchema,
207
+ attributes: z.lazy(() => Attributes$outboundSchema),
208
+ relationships:
209
+ CommercialSecuredLoanCommercialApplicationRelationships$outboundSchema,
210
+ links: z.record(LinkObject$outboundSchema).optional(),
211
+ meta: z.record(z.any()).optional(),
212
+ });
213
+
214
+ /**
215
+ * @internal
216
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
217
+ */
218
+ export namespace CommercialSecuredApplicationPayload$ {
219
+ /** @deprecated use `CommercialSecuredApplicationPayload$inboundSchema` instead. */
220
+ export const inboundSchema =
221
+ CommercialSecuredApplicationPayload$inboundSchema;
222
+ /** @deprecated use `CommercialSecuredApplicationPayload$outboundSchema` instead. */
223
+ export const outboundSchema =
224
+ CommercialSecuredApplicationPayload$outboundSchema;
225
+ /** @deprecated use `CommercialSecuredApplicationPayload$Outbound` instead. */
226
+ export type Outbound = CommercialSecuredApplicationPayload$Outbound;
227
+ }
228
+
229
+ export function commercialSecuredApplicationPayloadToJSON(
230
+ commercialSecuredApplicationPayload: CommercialSecuredApplicationPayload,
231
+ ): string {
232
+ return JSON.stringify(
233
+ CommercialSecuredApplicationPayload$outboundSchema.parse(
234
+ commercialSecuredApplicationPayload,
235
+ ),
236
+ );
237
+ }
238
+
239
+ export function commercialSecuredApplicationPayloadFromJSON(
240
+ jsonString: string,
241
+ ): SafeParseResult<CommercialSecuredApplicationPayload, SDKValidationError> {
242
+ return safeParse(
243
+ jsonString,
244
+ (x) =>
245
+ CommercialSecuredApplicationPayload$inboundSchema.parse(JSON.parse(x)),
246
+ `Failed to parse 'CommercialSecuredApplicationPayload' from JSON`,
247
+ );
248
+ }
@@ -0,0 +1,310 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ ApplicationStatus,
12
+ ApplicationStatus$inboundSchema,
13
+ ApplicationStatus$outboundSchema,
14
+ } from "./applicationstatus.js";
15
+ import {
16
+ CommercialApplicationJsonApiRelationships,
17
+ CommercialApplicationJsonApiRelationships$inboundSchema,
18
+ CommercialApplicationJsonApiRelationships$Outbound,
19
+ CommercialApplicationJsonApiRelationships$outboundSchema,
20
+ } from "./commercialapplicationjsonapirelationships.js";
21
+ import {
22
+ LinkObject,
23
+ LinkObject$inboundSchema,
24
+ LinkObject$Outbound,
25
+ LinkObject$outboundSchema,
26
+ } from "./linkobject.js";
27
+
28
+ export const CommercialSecuredApplicationResourceType = {
29
+ CommercialSecuredApplications: "commercial-secured-applications",
30
+ } as const;
31
+ export type CommercialSecuredApplicationResourceType = ClosedEnum<
32
+ typeof CommercialSecuredApplicationResourceType
33
+ >;
34
+
35
+ /**
36
+ * Type of the loan application
37
+ */
38
+ export const CommercialSecuredApplicationResourceApplicationType = {
39
+ CommercialSecured: "commercialSecured",
40
+ } as const;
41
+ /**
42
+ * Type of the loan application
43
+ */
44
+ export type CommercialSecuredApplicationResourceApplicationType = ClosedEnum<
45
+ typeof CommercialSecuredApplicationResourceApplicationType
46
+ >;
47
+
48
+ /**
49
+ * Application resource attributes
50
+ */
51
+ export type CommercialSecuredApplicationResourceAttributes = {
52
+ /**
53
+ * Full identifier of the application. Not visible within the web application.
54
+ */
55
+ id: string;
56
+ /**
57
+ * Human readable & easily communicated identifier of the application. Visible within the web application.
58
+ */
59
+ humanId: string;
60
+ /**
61
+ * Type of the loan application
62
+ */
63
+ applicationType: CommercialSecuredApplicationResourceApplicationType;
64
+ /**
65
+ * Current status, must be 'workshop' for new applications
66
+ */
67
+ status: ApplicationStatus;
68
+ /**
69
+ * Email address of the broker to be associated with this application.
70
+ */
71
+ associatedBrokerEmail?: string | undefined;
72
+ /**
73
+ * Creation timestamp
74
+ */
75
+ createdAt?: string | undefined;
76
+ /**
77
+ * Last update timestamp
78
+ */
79
+ updatedAt?: string | undefined;
80
+ };
81
+
82
+ /**
83
+ * A Commercial Application resource following JSON:API structure
84
+ */
85
+ export type CommercialSecuredApplicationResource = {
86
+ type: CommercialSecuredApplicationResourceType;
87
+ id?: string | undefined;
88
+ /**
89
+ * Application resource attributes
90
+ */
91
+ attributes: CommercialSecuredApplicationResourceAttributes;
92
+ /**
93
+ * Relationships for a Commercial Application Resource
94
+ */
95
+ relationships: CommercialApplicationJsonApiRelationships;
96
+ links?: { [k: string]: LinkObject } | undefined;
97
+ meta?: { [k: string]: any } | undefined;
98
+ };
99
+
100
+ /** @internal */
101
+ export const CommercialSecuredApplicationResourceType$inboundSchema:
102
+ z.ZodNativeEnum<typeof CommercialSecuredApplicationResourceType> = z
103
+ .nativeEnum(CommercialSecuredApplicationResourceType);
104
+
105
+ /** @internal */
106
+ export const CommercialSecuredApplicationResourceType$outboundSchema:
107
+ z.ZodNativeEnum<typeof CommercialSecuredApplicationResourceType> =
108
+ CommercialSecuredApplicationResourceType$inboundSchema;
109
+
110
+ /**
111
+ * @internal
112
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
113
+ */
114
+ export namespace CommercialSecuredApplicationResourceType$ {
115
+ /** @deprecated use `CommercialSecuredApplicationResourceType$inboundSchema` instead. */
116
+ export const inboundSchema =
117
+ CommercialSecuredApplicationResourceType$inboundSchema;
118
+ /** @deprecated use `CommercialSecuredApplicationResourceType$outboundSchema` instead. */
119
+ export const outboundSchema =
120
+ CommercialSecuredApplicationResourceType$outboundSchema;
121
+ }
122
+
123
+ /** @internal */
124
+ export const CommercialSecuredApplicationResourceApplicationType$inboundSchema:
125
+ z.ZodNativeEnum<typeof CommercialSecuredApplicationResourceApplicationType> =
126
+ z.nativeEnum(CommercialSecuredApplicationResourceApplicationType);
127
+
128
+ /** @internal */
129
+ export const CommercialSecuredApplicationResourceApplicationType$outboundSchema:
130
+ z.ZodNativeEnum<typeof CommercialSecuredApplicationResourceApplicationType> =
131
+ CommercialSecuredApplicationResourceApplicationType$inboundSchema;
132
+
133
+ /**
134
+ * @internal
135
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
136
+ */
137
+ export namespace CommercialSecuredApplicationResourceApplicationType$ {
138
+ /** @deprecated use `CommercialSecuredApplicationResourceApplicationType$inboundSchema` instead. */
139
+ export const inboundSchema =
140
+ CommercialSecuredApplicationResourceApplicationType$inboundSchema;
141
+ /** @deprecated use `CommercialSecuredApplicationResourceApplicationType$outboundSchema` instead. */
142
+ export const outboundSchema =
143
+ CommercialSecuredApplicationResourceApplicationType$outboundSchema;
144
+ }
145
+
146
+ /** @internal */
147
+ export const CommercialSecuredApplicationResourceAttributes$inboundSchema:
148
+ z.ZodType<
149
+ CommercialSecuredApplicationResourceAttributes,
150
+ z.ZodTypeDef,
151
+ unknown
152
+ > = z.object({
153
+ id: z.string(),
154
+ humanId: z.string(),
155
+ applicationType:
156
+ CommercialSecuredApplicationResourceApplicationType$inboundSchema,
157
+ status: ApplicationStatus$inboundSchema,
158
+ associatedBrokerEmail: z.string().optional(),
159
+ createdAt: z.string().optional(),
160
+ updatedAt: z.string().optional(),
161
+ });
162
+
163
+ /** @internal */
164
+ export type CommercialSecuredApplicationResourceAttributes$Outbound = {
165
+ id: string;
166
+ humanId: string;
167
+ applicationType: string;
168
+ status: string;
169
+ associatedBrokerEmail?: string | undefined;
170
+ createdAt?: string | undefined;
171
+ updatedAt?: string | undefined;
172
+ };
173
+
174
+ /** @internal */
175
+ export const CommercialSecuredApplicationResourceAttributes$outboundSchema:
176
+ z.ZodType<
177
+ CommercialSecuredApplicationResourceAttributes$Outbound,
178
+ z.ZodTypeDef,
179
+ CommercialSecuredApplicationResourceAttributes
180
+ > = z.object({
181
+ id: z.string(),
182
+ humanId: z.string(),
183
+ applicationType:
184
+ CommercialSecuredApplicationResourceApplicationType$outboundSchema,
185
+ status: ApplicationStatus$outboundSchema,
186
+ associatedBrokerEmail: z.string().optional(),
187
+ createdAt: z.string().optional(),
188
+ updatedAt: z.string().optional(),
189
+ });
190
+
191
+ /**
192
+ * @internal
193
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
194
+ */
195
+ export namespace CommercialSecuredApplicationResourceAttributes$ {
196
+ /** @deprecated use `CommercialSecuredApplicationResourceAttributes$inboundSchema` instead. */
197
+ export const inboundSchema =
198
+ CommercialSecuredApplicationResourceAttributes$inboundSchema;
199
+ /** @deprecated use `CommercialSecuredApplicationResourceAttributes$outboundSchema` instead. */
200
+ export const outboundSchema =
201
+ CommercialSecuredApplicationResourceAttributes$outboundSchema;
202
+ /** @deprecated use `CommercialSecuredApplicationResourceAttributes$Outbound` instead. */
203
+ export type Outbound =
204
+ CommercialSecuredApplicationResourceAttributes$Outbound;
205
+ }
206
+
207
+ export function commercialSecuredApplicationResourceAttributesToJSON(
208
+ commercialSecuredApplicationResourceAttributes:
209
+ CommercialSecuredApplicationResourceAttributes,
210
+ ): string {
211
+ return JSON.stringify(
212
+ CommercialSecuredApplicationResourceAttributes$outboundSchema.parse(
213
+ commercialSecuredApplicationResourceAttributes,
214
+ ),
215
+ );
216
+ }
217
+
218
+ export function commercialSecuredApplicationResourceAttributesFromJSON(
219
+ jsonString: string,
220
+ ): SafeParseResult<
221
+ CommercialSecuredApplicationResourceAttributes,
222
+ SDKValidationError
223
+ > {
224
+ return safeParse(
225
+ jsonString,
226
+ (x) =>
227
+ CommercialSecuredApplicationResourceAttributes$inboundSchema.parse(
228
+ JSON.parse(x),
229
+ ),
230
+ `Failed to parse 'CommercialSecuredApplicationResourceAttributes' from JSON`,
231
+ );
232
+ }
233
+
234
+ /** @internal */
235
+ export const CommercialSecuredApplicationResource$inboundSchema: z.ZodType<
236
+ CommercialSecuredApplicationResource,
237
+ z.ZodTypeDef,
238
+ unknown
239
+ > = z.object({
240
+ type: CommercialSecuredApplicationResourceType$inboundSchema,
241
+ id: z.string().optional(),
242
+ attributes: z.lazy(() =>
243
+ CommercialSecuredApplicationResourceAttributes$inboundSchema
244
+ ),
245
+ relationships: CommercialApplicationJsonApiRelationships$inboundSchema,
246
+ links: z.record(LinkObject$inboundSchema).optional(),
247
+ meta: z.record(z.any()).optional(),
248
+ });
249
+
250
+ /** @internal */
251
+ export type CommercialSecuredApplicationResource$Outbound = {
252
+ type: string;
253
+ id?: string | undefined;
254
+ attributes: CommercialSecuredApplicationResourceAttributes$Outbound;
255
+ relationships: CommercialApplicationJsonApiRelationships$Outbound;
256
+ links?: { [k: string]: LinkObject$Outbound } | undefined;
257
+ meta?: { [k: string]: any } | undefined;
258
+ };
259
+
260
+ /** @internal */
261
+ export const CommercialSecuredApplicationResource$outboundSchema: z.ZodType<
262
+ CommercialSecuredApplicationResource$Outbound,
263
+ z.ZodTypeDef,
264
+ CommercialSecuredApplicationResource
265
+ > = z.object({
266
+ type: CommercialSecuredApplicationResourceType$outboundSchema,
267
+ id: z.string().optional(),
268
+ attributes: z.lazy(() =>
269
+ CommercialSecuredApplicationResourceAttributes$outboundSchema
270
+ ),
271
+ relationships: CommercialApplicationJsonApiRelationships$outboundSchema,
272
+ links: z.record(LinkObject$outboundSchema).optional(),
273
+ meta: z.record(z.any()).optional(),
274
+ });
275
+
276
+ /**
277
+ * @internal
278
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
279
+ */
280
+ export namespace CommercialSecuredApplicationResource$ {
281
+ /** @deprecated use `CommercialSecuredApplicationResource$inboundSchema` instead. */
282
+ export const inboundSchema =
283
+ CommercialSecuredApplicationResource$inboundSchema;
284
+ /** @deprecated use `CommercialSecuredApplicationResource$outboundSchema` instead. */
285
+ export const outboundSchema =
286
+ CommercialSecuredApplicationResource$outboundSchema;
287
+ /** @deprecated use `CommercialSecuredApplicationResource$Outbound` instead. */
288
+ export type Outbound = CommercialSecuredApplicationResource$Outbound;
289
+ }
290
+
291
+ export function commercialSecuredApplicationResourceToJSON(
292
+ commercialSecuredApplicationResource: CommercialSecuredApplicationResource,
293
+ ): string {
294
+ return JSON.stringify(
295
+ CommercialSecuredApplicationResource$outboundSchema.parse(
296
+ commercialSecuredApplicationResource,
297
+ ),
298
+ );
299
+ }
300
+
301
+ export function commercialSecuredApplicationResourceFromJSON(
302
+ jsonString: string,
303
+ ): SafeParseResult<CommercialSecuredApplicationResource, SDKValidationError> {
304
+ return safeParse(
305
+ jsonString,
306
+ (x) =>
307
+ CommercialSecuredApplicationResource$inboundSchema.parse(JSON.parse(x)),
308
+ `Failed to parse 'CommercialSecuredApplicationResource' from JSON`,
309
+ );
310
+ }