@financeable/aggregation 0.5.0 → 0.6.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 (293) hide show
  1. package/.devcontainer/README.md +1 -1
  2. package/FUNCTIONS.md +11 -132
  3. package/README.md +262 -1515
  4. package/docs/sdks/applications/README.md +171 -295
  5. package/docs/sdks/oauthtoken/README.md +5 -5
  6. package/docs/sdks/supportingdocuments/README.md +113 -0
  7. package/funcs/applicationsCreate.d.ts +1 -2
  8. package/funcs/applicationsCreate.d.ts.map +1 -1
  9. package/funcs/applicationsCreate.js +2 -3
  10. package/funcs/applicationsCreate.js.map +1 -1
  11. package/funcs/{oauthTokenGet.d.ts → oauthTokenOauthToken.d.ts} +2 -2
  12. package/funcs/oauthTokenOauthToken.d.ts.map +1 -0
  13. package/funcs/{oauthTokenGet.js → oauthTokenOauthToken.js} +3 -3
  14. package/funcs/oauthTokenOauthToken.js.map +1 -0
  15. package/funcs/supportingDocumentsCreate.d.ts +15 -0
  16. package/funcs/supportingDocumentsCreate.d.ts.map +1 -0
  17. package/funcs/{applicationsList.js → supportingDocumentsCreate.js} +15 -12
  18. package/funcs/supportingDocumentsCreate.js.map +1 -0
  19. package/jsr.json +1 -1
  20. package/lib/config.d.ts +4 -4
  21. package/lib/config.d.ts.map +1 -1
  22. package/lib/config.js +4 -7
  23. package/lib/config.js.map +1 -1
  24. package/lib/matchers.d.ts +3 -1
  25. package/lib/matchers.d.ts.map +1 -1
  26. package/lib/matchers.js +12 -0
  27. package/lib/matchers.js.map +1 -1
  28. package/lib/sdks.d.ts +3 -1
  29. package/lib/sdks.d.ts.map +1 -1
  30. package/lib/sdks.js +13 -13
  31. package/lib/sdks.js.map +1 -1
  32. package/models/components/addressattributes.d.ts +8 -8
  33. package/models/components/addressattributes.d.ts.map +1 -1
  34. package/models/components/addressattributes.js +13 -14
  35. package/models/components/addressattributes.js.map +1 -1
  36. package/models/components/applicationresource.d.ts +30 -0
  37. package/models/components/applicationresource.d.ts.map +1 -0
  38. package/models/components/applicationresource.js +73 -0
  39. package/models/components/applicationresource.js.map +1 -0
  40. package/models/components/badrequesterror.d.ts +119 -0
  41. package/models/components/badrequesterror.d.ts.map +1 -0
  42. package/models/components/badrequesterror.js +140 -0
  43. package/models/components/badrequesterror.js.map +1 -0
  44. package/models/components/commercialapplicationjsonapirelationships.d.ts +384 -0
  45. package/models/components/commercialapplicationjsonapirelationships.d.ts.map +1 -0
  46. package/models/components/commercialapplicationjsonapirelationships.js +391 -0
  47. package/models/components/commercialapplicationjsonapirelationships.js.map +1 -0
  48. package/models/components/commercialapplicationresource.d.ts +191 -0
  49. package/models/components/commercialapplicationresource.d.ts.map +1 -0
  50. package/models/components/commercialapplicationresource.js +183 -0
  51. package/models/components/commercialapplicationresource.js.map +1 -0
  52. package/models/components/commercialsecuredloanapplicationsubmissionpayload.d.ts +124 -0
  53. package/models/components/commercialsecuredloanapplicationsubmissionpayload.d.ts.map +1 -0
  54. package/models/components/commercialsecuredloanapplicationsubmissionpayload.js +144 -0
  55. package/models/components/commercialsecuredloanapplicationsubmissionpayload.js.map +1 -0
  56. package/models/components/commercialsecuredloanassetattributes.d.ts +235 -0
  57. package/models/components/commercialsecuredloanassetattributes.d.ts.map +1 -0
  58. package/models/components/commercialsecuredloanassetattributes.js +168 -0
  59. package/models/components/commercialsecuredloanassetattributes.js.map +1 -0
  60. package/models/components/commercialsecuredloanassettype.d.ts +100 -0
  61. package/models/components/commercialsecuredloanassettype.d.ts.map +1 -0
  62. package/models/components/commercialsecuredloanassettype.js +84 -0
  63. package/models/components/commercialsecuredloanassettype.js.map +1 -0
  64. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts +455 -0
  65. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts.map +1 -0
  66. package/models/components/commercialsecuredloancommercialapplicationrelationships.js +504 -0
  67. package/models/components/commercialsecuredloancommercialapplicationrelationships.js.map +1 -0
  68. package/models/components/consumerapplicationjsonapirelationships.d.ts +296 -0
  69. package/models/components/consumerapplicationjsonapirelationships.d.ts.map +1 -0
  70. package/models/components/consumerapplicationjsonapirelationships.js +310 -0
  71. package/models/components/consumerapplicationjsonapirelationships.js.map +1 -0
  72. package/models/components/consumerapplicationresource.d.ts +191 -0
  73. package/models/components/consumerapplicationresource.d.ts.map +1 -0
  74. package/models/components/consumerapplicationresource.js +187 -0
  75. package/models/components/consumerapplicationresource.js.map +1 -0
  76. package/models/components/consumersecuredloanapplicationsubmissionpayload.d.ts +124 -0
  77. package/models/components/consumersecuredloanapplicationsubmissionpayload.d.ts.map +1 -0
  78. package/models/components/consumersecuredloanapplicationsubmissionpayload.js +146 -0
  79. package/models/components/consumersecuredloanapplicationsubmissionpayload.js.map +1 -0
  80. package/models/components/consumersecuredloanassetattributes.d.ts +235 -0
  81. package/models/components/consumersecuredloanassetattributes.d.ts.map +1 -0
  82. package/models/components/consumersecuredloanassetattributes.js +170 -0
  83. package/models/components/consumersecuredloanassetattributes.js.map +1 -0
  84. package/models/components/consumersecuredloanassettype.d.ts +64 -0
  85. package/models/components/consumersecuredloanassettype.d.ts.map +1 -0
  86. package/models/components/{consumerassettype.js → consumersecuredloanassettype.js} +27 -28
  87. package/models/components/consumersecuredloanassettype.js.map +1 -0
  88. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts +376 -0
  89. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts.map +1 -0
  90. package/models/components/consumersecuredloanconsumerapplicationrelationships.js +426 -0
  91. package/models/components/consumersecuredloanconsumerapplicationrelationships.js.map +1 -0
  92. package/models/components/createsupportingdocumentsresponse.d.ts +121 -0
  93. package/models/components/createsupportingdocumentsresponse.d.ts.map +1 -0
  94. package/models/components/createsupportingdocumentsresponse.js +149 -0
  95. package/models/components/createsupportingdocumentsresponse.js.map +1 -0
  96. package/models/components/documenttype.d.ts +70 -0
  97. package/models/components/documenttype.d.ts.map +1 -0
  98. package/models/components/documenttype.js +75 -0
  99. package/models/components/documenttype.js.map +1 -0
  100. package/models/components/entityattributes.d.ts +0 -22
  101. package/models/components/entityattributes.d.ts.map +1 -1
  102. package/models/components/entityattributes.js +0 -19
  103. package/models/components/entityattributes.js.map +1 -1
  104. package/models/components/forbiddenerror.d.ts +17 -39
  105. package/models/components/forbiddenerror.d.ts.map +1 -1
  106. package/models/components/forbiddenerror.js +27 -46
  107. package/models/components/forbiddenerror.js.map +1 -1
  108. package/models/components/index.d.ts +25 -8
  109. package/models/components/index.d.ts.map +1 -1
  110. package/models/components/index.js +25 -8
  111. package/models/components/index.js.map +1 -1
  112. package/models/components/linkobject.d.ts +47 -0
  113. package/models/components/linkobject.d.ts.map +1 -0
  114. package/models/components/linkobject.js +77 -0
  115. package/models/components/linkobject.js.map +1 -0
  116. package/models/components/relationshipresourcenotfound.d.ts +116 -0
  117. package/models/components/relationshipresourcenotfound.d.ts.map +1 -0
  118. package/models/components/relationshipresourcenotfound.js +139 -0
  119. package/models/components/relationshipresourcenotfound.js.map +1 -0
  120. package/models/components/resourcenotfound.d.ts +119 -0
  121. package/models/components/resourcenotfound.d.ts.map +1 -0
  122. package/models/components/resourcenotfound.js +139 -0
  123. package/models/components/resourcenotfound.js.map +1 -0
  124. package/models/components/resourcetypes.d.ts +46 -0
  125. package/models/components/resourcetypes.d.ts.map +1 -0
  126. package/models/components/{links.js → resourcetypes.js} +21 -27
  127. package/models/components/resourcetypes.js.map +1 -0
  128. package/models/components/supportingdocumentattributes.d.ts +40 -0
  129. package/models/components/supportingdocumentattributes.d.ts.map +1 -0
  130. package/models/components/{applicationattributescreate.js → supportingdocumentattributes.js} +24 -24
  131. package/models/components/supportingdocumentattributes.js.map +1 -0
  132. package/models/components/supportingdocumentattributesinput.d.ts +38 -0
  133. package/models/components/supportingdocumentattributesinput.d.ts.map +1 -0
  134. package/models/components/supportingdocumentattributesinput.js +72 -0
  135. package/models/components/supportingdocumentattributesinput.js.map +1 -0
  136. package/models/components/supportingdocumentrelationships.d.ts +448 -0
  137. package/models/components/supportingdocumentrelationships.d.ts.map +1 -0
  138. package/models/components/supportingdocumentrelationships.js +434 -0
  139. package/models/components/supportingdocumentrelationships.js.map +1 -0
  140. package/models/components/supportingdocumentresource.d.ts +91 -0
  141. package/models/components/supportingdocumentresource.d.ts.map +1 -0
  142. package/models/components/supportingdocumentresource.js +121 -0
  143. package/models/components/supportingdocumentresource.js.map +1 -0
  144. package/models/components/uploadmimetype.d.ts +49 -0
  145. package/models/components/uploadmimetype.d.ts.map +1 -0
  146. package/models/components/{applicationtype.js → uploadmimetype.js} +22 -14
  147. package/models/components/uploadmimetype.js.map +1 -0
  148. package/models/errors/createapplication.d.ts +38 -0
  149. package/models/errors/createapplication.d.ts.map +1 -0
  150. package/models/errors/{responsebody.js → createapplication.js} +15 -15
  151. package/models/errors/createapplication.js.map +1 -0
  152. package/models/errors/index.d.ts +2 -1
  153. package/models/errors/index.d.ts.map +1 -1
  154. package/models/errors/index.js +2 -1
  155. package/models/errors/index.js.map +1 -1
  156. package/models/errors/supportingdocumentscreate.d.ts +143 -0
  157. package/models/errors/supportingdocumentscreate.d.ts.map +1 -0
  158. package/models/errors/supportingdocumentscreate.js +225 -0
  159. package/models/errors/supportingdocumentscreate.js.map +1 -0
  160. package/models/operations/createapplication.d.ts +66 -808
  161. package/models/operations/createapplication.d.ts.map +1 -1
  162. package/models/operations/createapplication.js +82 -837
  163. package/models/operations/createapplication.js.map +1 -1
  164. package/models/operations/index.d.ts +1 -2
  165. package/models/operations/index.d.ts.map +1 -1
  166. package/models/operations/index.js +1 -2
  167. package/models/operations/index.js.map +1 -1
  168. package/models/operations/supportingdocumentscreate.d.ts +60 -0
  169. package/models/operations/supportingdocumentscreate.d.ts.map +1 -0
  170. package/models/operations/supportingdocumentscreate.js +108 -0
  171. package/models/operations/supportingdocumentscreate.js.map +1 -0
  172. package/package.json +3 -3
  173. package/sdk/applications.d.ts +1 -10
  174. package/sdk/applications.d.ts.map +1 -1
  175. package/sdk/applications.js +0 -14
  176. package/sdk/applications.js.map +1 -1
  177. package/sdk/oauthtoken.d.ts +1 -1
  178. package/sdk/oauthtoken.d.ts.map +1 -1
  179. package/sdk/oauthtoken.js +3 -3
  180. package/sdk/oauthtoken.js.map +1 -1
  181. package/sdk/sdk.d.ts +3 -0
  182. package/sdk/sdk.d.ts.map +1 -1
  183. package/sdk/sdk.js +4 -0
  184. package/sdk/sdk.js.map +1 -1
  185. package/sdk/supportingdocuments.d.ts +10 -0
  186. package/sdk/supportingdocuments.d.ts.map +1 -0
  187. package/sdk/supportingdocuments.js +19 -0
  188. package/sdk/supportingdocuments.js.map +1 -0
  189. package/src/funcs/applicationsCreate.ts +7 -8
  190. package/src/funcs/{oauthTokenGet.ts → oauthTokenOauthToken.ts} +1 -1
  191. package/src/funcs/{applicationsList.ts → supportingDocumentsCreate.ts} +31 -20
  192. package/src/lib/config.ts +4 -7
  193. package/src/lib/matchers.ts +20 -0
  194. package/src/lib/sdks.ts +19 -13
  195. package/src/models/components/addressattributes.ts +18 -14
  196. package/src/models/components/applicationresource.ts +83 -0
  197. package/src/models/components/badrequesterror.ts +182 -0
  198. package/src/models/components/commercialapplicationjsonapirelationships.ts +894 -0
  199. package/src/models/components/commercialapplicationresource.ts +355 -0
  200. package/src/models/components/commercialsecuredloanapplicationsubmissionpayload.ts +237 -0
  201. package/src/models/components/commercialsecuredloanassetattributes.ts +315 -0
  202. package/src/models/components/commercialsecuredloanassettype.ts +64 -0
  203. package/src/models/components/commercialsecuredloancommercialapplicationrelationships.ts +1148 -0
  204. package/src/models/components/consumerapplicationjsonapirelationships.ts +683 -0
  205. package/src/models/components/consumerapplicationresource.ts +342 -0
  206. package/src/models/components/consumersecuredloanapplicationsubmissionpayload.ts +270 -0
  207. package/src/models/components/consumersecuredloanassetattributes.ts +330 -0
  208. package/src/models/components/consumersecuredloanassettype.ts +47 -0
  209. package/src/models/components/consumersecuredloanconsumerapplicationrelationships.ts +1011 -0
  210. package/src/models/components/createsupportingdocumentsresponse.ts +252 -0
  211. package/src/models/components/documenttype.ts +49 -0
  212. package/src/models/components/entityattributes.ts +0 -44
  213. package/src/models/components/forbiddenerror.ts +35 -58
  214. package/src/models/components/index.ts +25 -8
  215. package/src/models/components/linkobject.ts +84 -0
  216. package/src/models/components/relationshipresourcenotfound.ts +195 -0
  217. package/src/models/components/resourcenotfound.ts +188 -0
  218. package/src/models/components/resourcetypes.ts +39 -0
  219. package/src/models/components/supportingdocumentattributes.ts +87 -0
  220. package/src/models/components/supportingdocumentattributesinput.ts +84 -0
  221. package/src/models/components/supportingdocumentrelationships.ts +828 -0
  222. package/src/models/components/supportingdocumentresource.ts +163 -0
  223. package/src/models/components/uploadmimetype.ts +44 -0
  224. package/src/models/errors/createapplication.ts +76 -0
  225. package/src/models/errors/index.ts +2 -1
  226. package/src/models/errors/supportingdocumentscreate.ts +342 -0
  227. package/src/models/operations/createapplication.ts +143 -1778
  228. package/src/models/operations/index.ts +1 -2
  229. package/src/models/operations/supportingdocumentscreate.ts +150 -0
  230. package/src/sdk/applications.ts +1 -32
  231. package/src/sdk/oauthtoken.ts +3 -3
  232. package/src/sdk/sdk.ts +8 -0
  233. package/src/sdk/supportingdocuments.ts +25 -0
  234. package/funcs/applicationsGet.d.ts +0 -14
  235. package/funcs/applicationsGet.d.ts.map +0 -1
  236. package/funcs/applicationsGet.js +0 -120
  237. package/funcs/applicationsGet.js.map +0 -1
  238. package/funcs/applicationsList.d.ts +0 -14
  239. package/funcs/applicationsList.d.ts.map +0 -1
  240. package/funcs/applicationsList.js.map +0 -1
  241. package/funcs/oauthTokenGet.d.ts.map +0 -1
  242. package/funcs/oauthTokenGet.js.map +0 -1
  243. package/models/components/applicationattributes.d.ts +0 -69
  244. package/models/components/applicationattributes.d.ts.map +0 -1
  245. package/models/components/applicationattributes.js +0 -85
  246. package/models/components/applicationattributes.js.map +0 -1
  247. package/models/components/applicationattributescreate.d.ts +0 -43
  248. package/models/components/applicationattributescreate.d.ts.map +0 -1
  249. package/models/components/applicationattributescreate.js.map +0 -1
  250. package/models/components/applicationresourcebulksubmission.d.ts +0 -533
  251. package/models/components/applicationresourcebulksubmission.d.ts.map +0 -1
  252. package/models/components/applicationresourcebulksubmission.js +0 -565
  253. package/models/components/applicationresourcebulksubmission.js.map +0 -1
  254. package/models/components/applicationtype.d.ts +0 -28
  255. package/models/components/applicationtype.d.ts.map +0 -1
  256. package/models/components/applicationtype.js.map +0 -1
  257. package/models/components/assetattributes.d.ts +0 -311
  258. package/models/components/assetattributes.d.ts.map +0 -1
  259. package/models/components/assetattributes.js +0 -234
  260. package/models/components/assetattributes.js.map +0 -1
  261. package/models/components/commercialassettype.d.ts +0 -44
  262. package/models/components/commercialassettype.d.ts.map +0 -1
  263. package/models/components/commercialassettype.js +0 -85
  264. package/models/components/commercialassettype.js.map +0 -1
  265. package/models/components/consumerassettype.d.ts +0 -32
  266. package/models/components/consumerassettype.d.ts.map +0 -1
  267. package/models/components/consumerassettype.js.map +0 -1
  268. package/models/components/links.d.ts +0 -40
  269. package/models/components/links.d.ts.map +0 -1
  270. package/models/components/links.js.map +0 -1
  271. package/models/errors/responsebody.d.ts +0 -38
  272. package/models/errors/responsebody.d.ts.map +0 -1
  273. package/models/errors/responsebody.js.map +0 -1
  274. package/models/operations/getapplication.d.ts +0 -962
  275. package/models/operations/getapplication.d.ts.map +0 -1
  276. package/models/operations/getapplication.js +0 -1030
  277. package/models/operations/getapplication.js.map +0 -1
  278. package/models/operations/getapplications.d.ts +0 -962
  279. package/models/operations/getapplications.d.ts.map +0 -1
  280. package/models/operations/getapplications.js +0 -1029
  281. package/models/operations/getapplications.js.map +0 -1
  282. package/src/funcs/applicationsGet.ts +0 -168
  283. package/src/models/components/applicationattributes.ts +0 -128
  284. package/src/models/components/applicationattributescreate.ts +0 -90
  285. package/src/models/components/applicationresourcebulksubmission.ts +0 -1178
  286. package/src/models/components/applicationtype.ts +0 -33
  287. package/src/models/components/assetattributes.ts +0 -411
  288. package/src/models/components/commercialassettype.ts +0 -61
  289. package/src/models/components/consumerassettype.ts +0 -43
  290. package/src/models/components/links.ts +0 -72
  291. package/src/models/errors/responsebody.ts +0 -76
  292. package/src/models/operations/getapplication.ts +0 -2246
  293. package/src/models/operations/getapplications.ts +0 -2191
@@ -0,0 +1,355 @@
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
+
22
+ export const CommercialApplicationResourceType = {
23
+ CommercialSecuredApplications: "commercial-secured-applications",
24
+ } as const;
25
+ export type CommercialApplicationResourceType = ClosedEnum<
26
+ typeof CommercialApplicationResourceType
27
+ >;
28
+
29
+ /**
30
+ * Type of the loan application
31
+ */
32
+ export const CommercialApplicationResourceApplicationType = {
33
+ CommercialSecured: "commercialSecured",
34
+ } as const;
35
+ /**
36
+ * Type of the loan application
37
+ */
38
+ export type CommercialApplicationResourceApplicationType = ClosedEnum<
39
+ typeof CommercialApplicationResourceApplicationType
40
+ >;
41
+
42
+ /**
43
+ * Application resource attributes
44
+ */
45
+ export type CommercialApplicationResourceAttributes = {
46
+ /**
47
+ * Full identifier of the application. Not visible within the web application.
48
+ */
49
+ id: string;
50
+ /**
51
+ * Human readable & easily communicated identifier of the application. Visible within the web application.
52
+ */
53
+ humanId: string;
54
+ /**
55
+ * Type of the loan application
56
+ */
57
+ applicationType: CommercialApplicationResourceApplicationType;
58
+ /**
59
+ * Current status, must be 'workshop' for new applications
60
+ */
61
+ status: ApplicationStatus;
62
+ /**
63
+ * Email address of the broker to be associated with this application.
64
+ */
65
+ associatedBrokerEmail?: string | undefined;
66
+ /**
67
+ * Creation timestamp
68
+ */
69
+ createdAt?: string | undefined;
70
+ /**
71
+ * Last update timestamp
72
+ */
73
+ updatedAt?: string | undefined;
74
+ };
75
+
76
+ export type CommercialApplicationResourceLinks = {};
77
+
78
+ /**
79
+ * A Commercial Application resource following JSON:API structure
80
+ */
81
+ export type CommercialApplicationResource = {
82
+ type: CommercialApplicationResourceType;
83
+ id: string;
84
+ /**
85
+ * Application resource attributes
86
+ */
87
+ attributes?: CommercialApplicationResourceAttributes | undefined;
88
+ /**
89
+ * Relationships for a Commercial Application Resource
90
+ */
91
+ relationships: CommercialApplicationJsonApiRelationships;
92
+ links?: { [k: string]: CommercialApplicationResourceLinks } | undefined;
93
+ meta?: { [k: string]: any } | undefined;
94
+ };
95
+
96
+ /** @internal */
97
+ export const CommercialApplicationResourceType$inboundSchema: z.ZodNativeEnum<
98
+ typeof CommercialApplicationResourceType
99
+ > = z.nativeEnum(CommercialApplicationResourceType);
100
+
101
+ /** @internal */
102
+ export const CommercialApplicationResourceType$outboundSchema: z.ZodNativeEnum<
103
+ typeof CommercialApplicationResourceType
104
+ > = CommercialApplicationResourceType$inboundSchema;
105
+
106
+ /**
107
+ * @internal
108
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
109
+ */
110
+ export namespace CommercialApplicationResourceType$ {
111
+ /** @deprecated use `CommercialApplicationResourceType$inboundSchema` instead. */
112
+ export const inboundSchema = CommercialApplicationResourceType$inboundSchema;
113
+ /** @deprecated use `CommercialApplicationResourceType$outboundSchema` instead. */
114
+ export const outboundSchema =
115
+ CommercialApplicationResourceType$outboundSchema;
116
+ }
117
+
118
+ /** @internal */
119
+ export const CommercialApplicationResourceApplicationType$inboundSchema:
120
+ z.ZodNativeEnum<typeof CommercialApplicationResourceApplicationType> = z
121
+ .nativeEnum(CommercialApplicationResourceApplicationType);
122
+
123
+ /** @internal */
124
+ export const CommercialApplicationResourceApplicationType$outboundSchema:
125
+ z.ZodNativeEnum<typeof CommercialApplicationResourceApplicationType> =
126
+ CommercialApplicationResourceApplicationType$inboundSchema;
127
+
128
+ /**
129
+ * @internal
130
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
131
+ */
132
+ export namespace CommercialApplicationResourceApplicationType$ {
133
+ /** @deprecated use `CommercialApplicationResourceApplicationType$inboundSchema` instead. */
134
+ export const inboundSchema =
135
+ CommercialApplicationResourceApplicationType$inboundSchema;
136
+ /** @deprecated use `CommercialApplicationResourceApplicationType$outboundSchema` instead. */
137
+ export const outboundSchema =
138
+ CommercialApplicationResourceApplicationType$outboundSchema;
139
+ }
140
+
141
+ /** @internal */
142
+ export const CommercialApplicationResourceAttributes$inboundSchema: z.ZodType<
143
+ CommercialApplicationResourceAttributes,
144
+ z.ZodTypeDef,
145
+ unknown
146
+ > = z.object({
147
+ id: z.string(),
148
+ humanId: z.string(),
149
+ applicationType: CommercialApplicationResourceApplicationType$inboundSchema,
150
+ status: ApplicationStatus$inboundSchema,
151
+ associatedBrokerEmail: z.string().optional(),
152
+ createdAt: z.string().optional(),
153
+ updatedAt: z.string().optional(),
154
+ });
155
+
156
+ /** @internal */
157
+ export type CommercialApplicationResourceAttributes$Outbound = {
158
+ id: string;
159
+ humanId: string;
160
+ applicationType: string;
161
+ status: string;
162
+ associatedBrokerEmail?: string | undefined;
163
+ createdAt?: string | undefined;
164
+ updatedAt?: string | undefined;
165
+ };
166
+
167
+ /** @internal */
168
+ export const CommercialApplicationResourceAttributes$outboundSchema: z.ZodType<
169
+ CommercialApplicationResourceAttributes$Outbound,
170
+ z.ZodTypeDef,
171
+ CommercialApplicationResourceAttributes
172
+ > = z.object({
173
+ id: z.string(),
174
+ humanId: z.string(),
175
+ applicationType: CommercialApplicationResourceApplicationType$outboundSchema,
176
+ status: ApplicationStatus$outboundSchema,
177
+ associatedBrokerEmail: z.string().optional(),
178
+ createdAt: z.string().optional(),
179
+ updatedAt: z.string().optional(),
180
+ });
181
+
182
+ /**
183
+ * @internal
184
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
185
+ */
186
+ export namespace CommercialApplicationResourceAttributes$ {
187
+ /** @deprecated use `CommercialApplicationResourceAttributes$inboundSchema` instead. */
188
+ export const inboundSchema =
189
+ CommercialApplicationResourceAttributes$inboundSchema;
190
+ /** @deprecated use `CommercialApplicationResourceAttributes$outboundSchema` instead. */
191
+ export const outboundSchema =
192
+ CommercialApplicationResourceAttributes$outboundSchema;
193
+ /** @deprecated use `CommercialApplicationResourceAttributes$Outbound` instead. */
194
+ export type Outbound = CommercialApplicationResourceAttributes$Outbound;
195
+ }
196
+
197
+ export function commercialApplicationResourceAttributesToJSON(
198
+ commercialApplicationResourceAttributes:
199
+ CommercialApplicationResourceAttributes,
200
+ ): string {
201
+ return JSON.stringify(
202
+ CommercialApplicationResourceAttributes$outboundSchema.parse(
203
+ commercialApplicationResourceAttributes,
204
+ ),
205
+ );
206
+ }
207
+
208
+ export function commercialApplicationResourceAttributesFromJSON(
209
+ jsonString: string,
210
+ ): SafeParseResult<
211
+ CommercialApplicationResourceAttributes,
212
+ SDKValidationError
213
+ > {
214
+ return safeParse(
215
+ jsonString,
216
+ (x) =>
217
+ CommercialApplicationResourceAttributes$inboundSchema.parse(
218
+ JSON.parse(x),
219
+ ),
220
+ `Failed to parse 'CommercialApplicationResourceAttributes' from JSON`,
221
+ );
222
+ }
223
+
224
+ /** @internal */
225
+ export const CommercialApplicationResourceLinks$inboundSchema: z.ZodType<
226
+ CommercialApplicationResourceLinks,
227
+ z.ZodTypeDef,
228
+ unknown
229
+ > = z.object({});
230
+
231
+ /** @internal */
232
+ export type CommercialApplicationResourceLinks$Outbound = {};
233
+
234
+ /** @internal */
235
+ export const CommercialApplicationResourceLinks$outboundSchema: z.ZodType<
236
+ CommercialApplicationResourceLinks$Outbound,
237
+ z.ZodTypeDef,
238
+ CommercialApplicationResourceLinks
239
+ > = z.object({});
240
+
241
+ /**
242
+ * @internal
243
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
244
+ */
245
+ export namespace CommercialApplicationResourceLinks$ {
246
+ /** @deprecated use `CommercialApplicationResourceLinks$inboundSchema` instead. */
247
+ export const inboundSchema = CommercialApplicationResourceLinks$inboundSchema;
248
+ /** @deprecated use `CommercialApplicationResourceLinks$outboundSchema` instead. */
249
+ export const outboundSchema =
250
+ CommercialApplicationResourceLinks$outboundSchema;
251
+ /** @deprecated use `CommercialApplicationResourceLinks$Outbound` instead. */
252
+ export type Outbound = CommercialApplicationResourceLinks$Outbound;
253
+ }
254
+
255
+ export function commercialApplicationResourceLinksToJSON(
256
+ commercialApplicationResourceLinks: CommercialApplicationResourceLinks,
257
+ ): string {
258
+ return JSON.stringify(
259
+ CommercialApplicationResourceLinks$outboundSchema.parse(
260
+ commercialApplicationResourceLinks,
261
+ ),
262
+ );
263
+ }
264
+
265
+ export function commercialApplicationResourceLinksFromJSON(
266
+ jsonString: string,
267
+ ): SafeParseResult<CommercialApplicationResourceLinks, SDKValidationError> {
268
+ return safeParse(
269
+ jsonString,
270
+ (x) =>
271
+ CommercialApplicationResourceLinks$inboundSchema.parse(JSON.parse(x)),
272
+ `Failed to parse 'CommercialApplicationResourceLinks' from JSON`,
273
+ );
274
+ }
275
+
276
+ /** @internal */
277
+ export const CommercialApplicationResource$inboundSchema: z.ZodType<
278
+ CommercialApplicationResource,
279
+ z.ZodTypeDef,
280
+ unknown
281
+ > = z.object({
282
+ type: CommercialApplicationResourceType$inboundSchema,
283
+ id: z.string(),
284
+ attributes: z.lazy(() =>
285
+ CommercialApplicationResourceAttributes$inboundSchema
286
+ ).optional(),
287
+ relationships: CommercialApplicationJsonApiRelationships$inboundSchema,
288
+ links: z.record(
289
+ z.lazy(() => CommercialApplicationResourceLinks$inboundSchema),
290
+ ).optional(),
291
+ meta: z.record(z.any()).optional(),
292
+ });
293
+
294
+ /** @internal */
295
+ export type CommercialApplicationResource$Outbound = {
296
+ type: string;
297
+ id: string;
298
+ attributes?: CommercialApplicationResourceAttributes$Outbound | undefined;
299
+ relationships: CommercialApplicationJsonApiRelationships$Outbound;
300
+ links?:
301
+ | { [k: string]: CommercialApplicationResourceLinks$Outbound }
302
+ | undefined;
303
+ meta?: { [k: string]: any } | undefined;
304
+ };
305
+
306
+ /** @internal */
307
+ export const CommercialApplicationResource$outboundSchema: z.ZodType<
308
+ CommercialApplicationResource$Outbound,
309
+ z.ZodTypeDef,
310
+ CommercialApplicationResource
311
+ > = z.object({
312
+ type: CommercialApplicationResourceType$outboundSchema,
313
+ id: z.string(),
314
+ attributes: z.lazy(() =>
315
+ CommercialApplicationResourceAttributes$outboundSchema
316
+ ).optional(),
317
+ relationships: CommercialApplicationJsonApiRelationships$outboundSchema,
318
+ links: z.record(
319
+ z.lazy(() => CommercialApplicationResourceLinks$outboundSchema),
320
+ ).optional(),
321
+ meta: z.record(z.any()).optional(),
322
+ });
323
+
324
+ /**
325
+ * @internal
326
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
327
+ */
328
+ export namespace CommercialApplicationResource$ {
329
+ /** @deprecated use `CommercialApplicationResource$inboundSchema` instead. */
330
+ export const inboundSchema = CommercialApplicationResource$inboundSchema;
331
+ /** @deprecated use `CommercialApplicationResource$outboundSchema` instead. */
332
+ export const outboundSchema = CommercialApplicationResource$outboundSchema;
333
+ /** @deprecated use `CommercialApplicationResource$Outbound` instead. */
334
+ export type Outbound = CommercialApplicationResource$Outbound;
335
+ }
336
+
337
+ export function commercialApplicationResourceToJSON(
338
+ commercialApplicationResource: CommercialApplicationResource,
339
+ ): string {
340
+ return JSON.stringify(
341
+ CommercialApplicationResource$outboundSchema.parse(
342
+ commercialApplicationResource,
343
+ ),
344
+ );
345
+ }
346
+
347
+ export function commercialApplicationResourceFromJSON(
348
+ jsonString: string,
349
+ ): SafeParseResult<CommercialApplicationResource, SDKValidationError> {
350
+ return safeParse(
351
+ jsonString,
352
+ (x) => CommercialApplicationResource$inboundSchema.parse(JSON.parse(x)),
353
+ `Failed to parse 'CommercialApplicationResource' from JSON`,
354
+ );
355
+ }
@@ -0,0 +1,237 @@
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
+
17
+ export const CommercialSecuredLoanApplicationSubmissionPayloadType = {
18
+ CommercialSecuredApplications: "commercial-secured-applications",
19
+ } as const;
20
+ export type CommercialSecuredLoanApplicationSubmissionPayloadType = ClosedEnum<
21
+ typeof CommercialSecuredLoanApplicationSubmissionPayloadType
22
+ >;
23
+
24
+ /**
25
+ * Type of the loan application
26
+ */
27
+ export const ApplicationType = {
28
+ CommercialSecured: "commercialSecured",
29
+ } as const;
30
+ /**
31
+ * Type of the loan application
32
+ */
33
+ export type ApplicationType = ClosedEnum<typeof ApplicationType>;
34
+
35
+ /**
36
+ * Application resource attributes
37
+ */
38
+ export type Attributes = {
39
+ /**
40
+ * Type of the loan application
41
+ */
42
+ applicationType: ApplicationType;
43
+ /**
44
+ * Email address of the broker to be associated with this application.
45
+ */
46
+ associatedBrokerEmail?: string | undefined;
47
+ };
48
+
49
+ export type CommercialSecuredLoanApplicationSubmissionPayload = {
50
+ type: CommercialSecuredLoanApplicationSubmissionPayloadType;
51
+ /**
52
+ * Application resource attributes
53
+ */
54
+ attributes: Attributes;
55
+ relationships?:
56
+ | CommercialSecuredLoanCommercialApplicationRelationships
57
+ | undefined;
58
+ };
59
+
60
+ /** @internal */
61
+ export const CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema:
62
+ z.ZodNativeEnum<
63
+ typeof CommercialSecuredLoanApplicationSubmissionPayloadType
64
+ > = z.nativeEnum(CommercialSecuredLoanApplicationSubmissionPayloadType);
65
+
66
+ /** @internal */
67
+ export const CommercialSecuredLoanApplicationSubmissionPayloadType$outboundSchema:
68
+ z.ZodNativeEnum<
69
+ typeof CommercialSecuredLoanApplicationSubmissionPayloadType
70
+ > = CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema;
71
+
72
+ /**
73
+ * @internal
74
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
75
+ */
76
+ export namespace CommercialSecuredLoanApplicationSubmissionPayloadType$ {
77
+ /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema` instead. */
78
+ export const inboundSchema =
79
+ CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema;
80
+ /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayloadType$outboundSchema` instead. */
81
+ export const outboundSchema =
82
+ CommercialSecuredLoanApplicationSubmissionPayloadType$outboundSchema;
83
+ }
84
+
85
+ /** @internal */
86
+ export const ApplicationType$inboundSchema: z.ZodNativeEnum<
87
+ typeof ApplicationType
88
+ > = z.nativeEnum(ApplicationType);
89
+
90
+ /** @internal */
91
+ export const ApplicationType$outboundSchema: z.ZodNativeEnum<
92
+ typeof ApplicationType
93
+ > = ApplicationType$inboundSchema;
94
+
95
+ /**
96
+ * @internal
97
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
98
+ */
99
+ export namespace ApplicationType$ {
100
+ /** @deprecated use `ApplicationType$inboundSchema` instead. */
101
+ export const inboundSchema = ApplicationType$inboundSchema;
102
+ /** @deprecated use `ApplicationType$outboundSchema` instead. */
103
+ export const outboundSchema = ApplicationType$outboundSchema;
104
+ }
105
+
106
+ /** @internal */
107
+ export const Attributes$inboundSchema: z.ZodType<
108
+ Attributes,
109
+ z.ZodTypeDef,
110
+ unknown
111
+ > = z.object({
112
+ applicationType: ApplicationType$inboundSchema,
113
+ associatedBrokerEmail: z.string().optional(),
114
+ });
115
+
116
+ /** @internal */
117
+ export type Attributes$Outbound = {
118
+ applicationType: string;
119
+ associatedBrokerEmail?: string | undefined;
120
+ };
121
+
122
+ /** @internal */
123
+ export const Attributes$outboundSchema: z.ZodType<
124
+ Attributes$Outbound,
125
+ z.ZodTypeDef,
126
+ Attributes
127
+ > = z.object({
128
+ applicationType: ApplicationType$outboundSchema,
129
+ associatedBrokerEmail: z.string().optional(),
130
+ });
131
+
132
+ /**
133
+ * @internal
134
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
135
+ */
136
+ export namespace Attributes$ {
137
+ /** @deprecated use `Attributes$inboundSchema` instead. */
138
+ export const inboundSchema = Attributes$inboundSchema;
139
+ /** @deprecated use `Attributes$outboundSchema` instead. */
140
+ export const outboundSchema = Attributes$outboundSchema;
141
+ /** @deprecated use `Attributes$Outbound` instead. */
142
+ export type Outbound = Attributes$Outbound;
143
+ }
144
+
145
+ export function attributesToJSON(attributes: Attributes): string {
146
+ return JSON.stringify(Attributes$outboundSchema.parse(attributes));
147
+ }
148
+
149
+ export function attributesFromJSON(
150
+ jsonString: string,
151
+ ): SafeParseResult<Attributes, SDKValidationError> {
152
+ return safeParse(
153
+ jsonString,
154
+ (x) => Attributes$inboundSchema.parse(JSON.parse(x)),
155
+ `Failed to parse 'Attributes' from JSON`,
156
+ );
157
+ }
158
+
159
+ /** @internal */
160
+ export const CommercialSecuredLoanApplicationSubmissionPayload$inboundSchema:
161
+ z.ZodType<
162
+ CommercialSecuredLoanApplicationSubmissionPayload,
163
+ z.ZodTypeDef,
164
+ unknown
165
+ > = z.object({
166
+ type: CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema,
167
+ attributes: z.lazy(() => Attributes$inboundSchema),
168
+ relationships:
169
+ CommercialSecuredLoanCommercialApplicationRelationships$inboundSchema
170
+ .optional(),
171
+ });
172
+
173
+ /** @internal */
174
+ export type CommercialSecuredLoanApplicationSubmissionPayload$Outbound = {
175
+ type: string;
176
+ attributes: Attributes$Outbound;
177
+ relationships?:
178
+ | CommercialSecuredLoanCommercialApplicationRelationships$Outbound
179
+ | undefined;
180
+ };
181
+
182
+ /** @internal */
183
+ export const CommercialSecuredLoanApplicationSubmissionPayload$outboundSchema:
184
+ z.ZodType<
185
+ CommercialSecuredLoanApplicationSubmissionPayload$Outbound,
186
+ z.ZodTypeDef,
187
+ CommercialSecuredLoanApplicationSubmissionPayload
188
+ > = z.object({
189
+ type: CommercialSecuredLoanApplicationSubmissionPayloadType$outboundSchema,
190
+ attributes: z.lazy(() => Attributes$outboundSchema),
191
+ relationships:
192
+ CommercialSecuredLoanCommercialApplicationRelationships$outboundSchema
193
+ .optional(),
194
+ });
195
+
196
+ /**
197
+ * @internal
198
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
199
+ */
200
+ export namespace CommercialSecuredLoanApplicationSubmissionPayload$ {
201
+ /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayload$inboundSchema` instead. */
202
+ export const inboundSchema =
203
+ CommercialSecuredLoanApplicationSubmissionPayload$inboundSchema;
204
+ /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayload$outboundSchema` instead. */
205
+ export const outboundSchema =
206
+ CommercialSecuredLoanApplicationSubmissionPayload$outboundSchema;
207
+ /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayload$Outbound` instead. */
208
+ export type Outbound =
209
+ CommercialSecuredLoanApplicationSubmissionPayload$Outbound;
210
+ }
211
+
212
+ export function commercialSecuredLoanApplicationSubmissionPayloadToJSON(
213
+ commercialSecuredLoanApplicationSubmissionPayload:
214
+ CommercialSecuredLoanApplicationSubmissionPayload,
215
+ ): string {
216
+ return JSON.stringify(
217
+ CommercialSecuredLoanApplicationSubmissionPayload$outboundSchema.parse(
218
+ commercialSecuredLoanApplicationSubmissionPayload,
219
+ ),
220
+ );
221
+ }
222
+
223
+ export function commercialSecuredLoanApplicationSubmissionPayloadFromJSON(
224
+ jsonString: string,
225
+ ): SafeParseResult<
226
+ CommercialSecuredLoanApplicationSubmissionPayload,
227
+ SDKValidationError
228
+ > {
229
+ return safeParse(
230
+ jsonString,
231
+ (x) =>
232
+ CommercialSecuredLoanApplicationSubmissionPayload$inboundSchema.parse(
233
+ JSON.parse(x),
234
+ ),
235
+ `Failed to parse 'CommercialSecuredLoanApplicationSubmissionPayload' from JSON`,
236
+ );
237
+ }