@financeable/aggregation 0.6.0 → 0.6.12

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 (154) hide show
  1. package/FUNCTIONS.md +4 -0
  2. package/README.md +14 -2
  3. package/docs/sdks/applications/README.md +19 -254
  4. package/docs/sdks/oauthtoken/README.md +5 -5
  5. package/docs/sdks/supportingdocuments/README.md +9 -1
  6. package/funcs/applicationsCreate.d.ts +1 -1
  7. package/funcs/applicationsCreate.d.ts.map +1 -1
  8. package/funcs/applicationsCreate.js +2 -2
  9. package/funcs/applicationsCreate.js.map +1 -1
  10. package/funcs/{oauthTokenOauthToken.d.ts → oauthTokenGet.d.ts} +2 -2
  11. package/funcs/oauthTokenGet.d.ts.map +1 -0
  12. package/funcs/{oauthTokenOauthToken.js → oauthTokenGet.js} +3 -3
  13. package/funcs/oauthTokenGet.js.map +1 -0
  14. package/funcs/supportingDocumentsCreate.d.ts +1 -2
  15. package/funcs/supportingDocumentsCreate.d.ts.map +1 -1
  16. package/funcs/supportingDocumentsCreate.js +1 -2
  17. package/funcs/supportingDocumentsCreate.js.map +1 -1
  18. package/jsr.json +1 -1
  19. package/lib/config.d.ts +2 -2
  20. package/lib/config.js +2 -2
  21. package/lib/config.js.map +1 -1
  22. package/models/components/addressattributes.d.ts +2 -0
  23. package/models/components/addressattributes.d.ts.map +1 -1
  24. package/models/components/addressattributes.js +2 -0
  25. package/models/components/addressattributes.js.map +1 -1
  26. package/models/components/applicationresource.d.ts +4 -4
  27. package/models/components/applicationresource.d.ts.map +1 -1
  28. package/models/components/applicationresource.js +6 -6
  29. package/models/components/applicationresource.js.map +1 -1
  30. package/models/components/{commercialsecuredloanapplicationsubmissionpayload.d.ts → commercialsecuredapplicationpayload.d.ts} +64 -24
  31. package/models/components/commercialsecuredapplicationpayload.d.ts.map +1 -0
  32. package/models/components/{commercialsecuredloanapplicationsubmissionpayload.js → commercialsecuredapplicationpayload.js} +47 -33
  33. package/models/components/commercialsecuredapplicationpayload.js.map +1 -0
  34. package/models/components/commercialsecuredapplicationresource.d.ts +171 -0
  35. package/models/components/commercialsecuredapplicationresource.d.ts.map +1 -0
  36. package/models/components/commercialsecuredapplicationresource.js +161 -0
  37. package/models/components/commercialsecuredapplicationresource.js.map +1 -0
  38. package/models/components/commercialsecuredloanassetattributes.d.ts +2 -0
  39. package/models/components/commercialsecuredloanassetattributes.d.ts.map +1 -1
  40. package/models/components/commercialsecuredloanassetattributes.js +2 -0
  41. package/models/components/commercialsecuredloanassetattributes.js.map +1 -1
  42. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts +99 -17
  43. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts.map +1 -1
  44. package/models/components/commercialsecuredloancommercialapplicationrelationships.js +67 -23
  45. package/models/components/commercialsecuredloancommercialapplicationrelationships.js.map +1 -1
  46. package/models/components/consumersecuredapplicationpayload.d.ts +164 -0
  47. package/models/components/consumersecuredapplicationpayload.d.ts.map +1 -0
  48. package/models/components/consumersecuredapplicationpayload.js +158 -0
  49. package/models/components/consumersecuredapplicationpayload.js.map +1 -0
  50. package/models/components/consumersecuredapplicationresource.d.ts +171 -0
  51. package/models/components/consumersecuredapplicationresource.d.ts.map +1 -0
  52. package/models/components/consumersecuredapplicationresource.js +161 -0
  53. package/models/components/consumersecuredapplicationresource.js.map +1 -0
  54. package/models/components/consumersecuredloanassetattributes.d.ts +2 -0
  55. package/models/components/consumersecuredloanassetattributes.d.ts.map +1 -1
  56. package/models/components/consumersecuredloanassetattributes.js +2 -0
  57. package/models/components/consumersecuredloanassetattributes.js.map +1 -1
  58. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts +51 -2
  59. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts.map +1 -1
  60. package/models/components/consumersecuredloanconsumerapplicationrelationships.js +19 -2
  61. package/models/components/consumersecuredloanconsumerapplicationrelationships.js.map +1 -1
  62. package/models/components/createsupportingdocumentsresponse.d.ts +49 -46
  63. package/models/components/createsupportingdocumentsresponse.d.ts.map +1 -1
  64. package/models/components/createsupportingdocumentsresponse.js +36 -47
  65. package/models/components/createsupportingdocumentsresponse.js.map +1 -1
  66. package/models/components/customerattributes.d.ts +2 -0
  67. package/models/components/customerattributes.d.ts.map +1 -1
  68. package/models/components/customerattributes.js +2 -0
  69. package/models/components/customerattributes.js.map +1 -1
  70. package/models/components/entityattributes.d.ts +2 -0
  71. package/models/components/entityattributes.d.ts.map +1 -1
  72. package/models/components/entityattributes.js +2 -0
  73. package/models/components/entityattributes.js.map +1 -1
  74. package/models/components/index.d.ts +4 -5
  75. package/models/components/index.d.ts.map +1 -1
  76. package/models/components/index.js +4 -5
  77. package/models/components/index.js.map +1 -1
  78. package/models/components/loandetailsattributes.d.ts +2 -0
  79. package/models/components/loandetailsattributes.d.ts.map +1 -1
  80. package/models/components/loandetailsattributes.js +2 -0
  81. package/models/components/loandetailsattributes.js.map +1 -1
  82. package/models/components/supportingdocumentresource.d.ts +5 -25
  83. package/models/components/supportingdocumentresource.d.ts.map +1 -1
  84. package/models/components/supportingdocumentresource.js +6 -29
  85. package/models/components/supportingdocumentresource.js.map +1 -1
  86. package/models/errors/createapplication.d.ts +35 -0
  87. package/models/errors/createapplication.d.ts.map +1 -1
  88. package/models/errors/createapplication.js +40 -1
  89. package/models/errors/createapplication.js.map +1 -1
  90. package/models/operations/createapplication.d.ts +6 -112
  91. package/models/operations/createapplication.d.ts.map +1 -1
  92. package/models/operations/createapplication.js +11 -118
  93. package/models/operations/createapplication.js.map +1 -1
  94. package/models/operations/supportingdocumentscreate.d.ts +34 -0
  95. package/models/operations/supportingdocumentscreate.d.ts.map +1 -1
  96. package/models/operations/supportingdocumentscreate.js +28 -1
  97. package/models/operations/supportingdocumentscreate.js.map +1 -1
  98. package/package.json +1 -1
  99. package/sdk/oauthtoken.d.ts +1 -1
  100. package/sdk/oauthtoken.d.ts.map +1 -1
  101. package/sdk/oauthtoken.js +3 -3
  102. package/sdk/oauthtoken.js.map +1 -1
  103. package/sdk/supportingdocuments.d.ts +1 -2
  104. package/sdk/supportingdocuments.d.ts.map +1 -1
  105. package/sdk/supportingdocuments.js.map +1 -1
  106. package/src/funcs/applicationsCreate.ts +8 -1
  107. package/src/funcs/{oauthTokenOauthToken.ts → oauthTokenGet.ts} +1 -1
  108. package/src/funcs/supportingDocumentsCreate.ts +4 -5
  109. package/src/lib/config.ts +2 -2
  110. package/src/models/components/addressattributes.ts +4 -0
  111. package/src/models/components/applicationresource.ts +18 -18
  112. package/src/models/components/{commercialsecuredloanapplicationsubmissionpayload.ts → commercialsecuredapplicationpayload.ts} +82 -71
  113. package/src/models/components/commercialsecuredapplicationresource.ts +310 -0
  114. package/src/models/components/commercialsecuredloanassetattributes.ts +4 -0
  115. package/src/models/components/commercialsecuredloancommercialapplicationrelationships.ts +159 -69
  116. package/src/models/components/consumersecuredapplicationpayload.ts +273 -0
  117. package/src/models/components/consumersecuredapplicationresource.ts +309 -0
  118. package/src/models/components/consumersecuredloanassetattributes.ts +4 -0
  119. package/src/models/components/consumersecuredloanconsumerapplicationrelationships.ts +44 -8
  120. package/src/models/components/createsupportingdocumentsresponse.ts +57 -103
  121. package/src/models/components/customerattributes.ts +4 -0
  122. package/src/models/components/entityattributes.ts +4 -0
  123. package/src/models/components/index.ts +4 -5
  124. package/src/models/components/loandetailsattributes.ts +4 -0
  125. package/src/models/components/supportingdocumentresource.ts +14 -51
  126. package/src/models/errors/createapplication.ts +73 -0
  127. package/src/models/operations/createapplication.ts +20 -229
  128. package/src/models/operations/supportingdocumentscreate.ts +72 -0
  129. package/src/sdk/oauthtoken.ts +3 -3
  130. package/src/sdk/supportingdocuments.ts +1 -2
  131. package/funcs/oauthTokenOauthToken.d.ts.map +0 -1
  132. package/funcs/oauthTokenOauthToken.js.map +0 -1
  133. package/models/components/commercialapplicationresource.d.ts +0 -191
  134. package/models/components/commercialapplicationresource.d.ts.map +0 -1
  135. package/models/components/commercialapplicationresource.js +0 -183
  136. package/models/components/commercialapplicationresource.js.map +0 -1
  137. package/models/components/commercialsecuredloanapplicationsubmissionpayload.d.ts.map +0 -1
  138. package/models/components/commercialsecuredloanapplicationsubmissionpayload.js.map +0 -1
  139. package/models/components/consumerapplicationresource.d.ts +0 -191
  140. package/models/components/consumerapplicationresource.d.ts.map +0 -1
  141. package/models/components/consumerapplicationresource.js +0 -187
  142. package/models/components/consumerapplicationresource.js.map +0 -1
  143. package/models/components/consumersecuredloanapplicationsubmissionpayload.d.ts +0 -124
  144. package/models/components/consumersecuredloanapplicationsubmissionpayload.d.ts.map +0 -1
  145. package/models/components/consumersecuredloanapplicationsubmissionpayload.js +0 -146
  146. package/models/components/consumersecuredloanapplicationsubmissionpayload.js.map +0 -1
  147. package/models/components/resourcetypes.d.ts +0 -46
  148. package/models/components/resourcetypes.d.ts.map +0 -1
  149. package/models/components/resourcetypes.js +0 -66
  150. package/models/components/resourcetypes.js.map +0 -1
  151. package/src/models/components/commercialapplicationresource.ts +0 -355
  152. package/src/models/components/consumerapplicationresource.ts +0 -342
  153. package/src/models/components/consumersecuredloanapplicationsubmissionpayload.ts +0 -270
  154. package/src/models/components/resourcetypes.ts +0 -39
@@ -13,12 +13,31 @@ import {
13
13
  CommercialSecuredLoanCommercialApplicationRelationships$Outbound,
14
14
  CommercialSecuredLoanCommercialApplicationRelationships$outboundSchema,
15
15
  } from "./commercialsecuredloancommercialapplicationrelationships.js";
16
+ import {
17
+ LinkObject,
18
+ LinkObject$inboundSchema,
19
+ LinkObject$Outbound,
20
+ LinkObject$outboundSchema,
21
+ } from "./linkobject.js";
16
22
 
17
- export const CommercialSecuredLoanApplicationSubmissionPayloadType = {
23
+ /**
24
+ * Resource types used in the API
25
+ */
26
+ export const CommercialSecuredApplicationPayloadType = {
27
+ ConsumerSecuredApplications: "consumer-secured-applications",
18
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",
19
35
  } as const;
20
- export type CommercialSecuredLoanApplicationSubmissionPayloadType = ClosedEnum<
21
- typeof CommercialSecuredLoanApplicationSubmissionPayloadType
36
+ /**
37
+ * Resource types used in the API
38
+ */
39
+ export type CommercialSecuredApplicationPayloadType = ClosedEnum<
40
+ typeof CommercialSecuredApplicationPayloadType
22
41
  >;
23
42
 
24
43
  /**
@@ -46,40 +65,38 @@ export type Attributes = {
46
65
  associatedBrokerEmail?: string | undefined;
47
66
  };
48
67
 
49
- export type CommercialSecuredLoanApplicationSubmissionPayload = {
50
- type: CommercialSecuredLoanApplicationSubmissionPayloadType;
68
+ export type CommercialSecuredApplicationPayload = {
69
+ type: CommercialSecuredApplicationPayloadType;
51
70
  /**
52
71
  * Application resource attributes
53
72
  */
54
73
  attributes: Attributes;
55
- relationships?:
56
- | CommercialSecuredLoanCommercialApplicationRelationships
57
- | undefined;
74
+ relationships: CommercialSecuredLoanCommercialApplicationRelationships;
75
+ links?: { [k: string]: LinkObject } | undefined;
76
+ meta?: { [k: string]: any } | undefined;
58
77
  };
59
78
 
60
79
  /** @internal */
61
- export const CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema:
62
- z.ZodNativeEnum<
63
- typeof CommercialSecuredLoanApplicationSubmissionPayloadType
64
- > = z.nativeEnum(CommercialSecuredLoanApplicationSubmissionPayloadType);
80
+ export const CommercialSecuredApplicationPayloadType$inboundSchema:
81
+ z.ZodNativeEnum<typeof CommercialSecuredApplicationPayloadType> = z
82
+ .nativeEnum(CommercialSecuredApplicationPayloadType);
65
83
 
66
84
  /** @internal */
67
- export const CommercialSecuredLoanApplicationSubmissionPayloadType$outboundSchema:
68
- z.ZodNativeEnum<
69
- typeof CommercialSecuredLoanApplicationSubmissionPayloadType
70
- > = CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema;
85
+ export const CommercialSecuredApplicationPayloadType$outboundSchema:
86
+ z.ZodNativeEnum<typeof CommercialSecuredApplicationPayloadType> =
87
+ CommercialSecuredApplicationPayloadType$inboundSchema;
71
88
 
72
89
  /**
73
90
  * @internal
74
91
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
75
92
  */
76
- export namespace CommercialSecuredLoanApplicationSubmissionPayloadType$ {
77
- /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema` instead. */
93
+ export namespace CommercialSecuredApplicationPayloadType$ {
94
+ /** @deprecated use `CommercialSecuredApplicationPayloadType$inboundSchema` instead. */
78
95
  export const inboundSchema =
79
- CommercialSecuredLoanApplicationSubmissionPayloadType$inboundSchema;
80
- /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayloadType$outboundSchema` instead. */
96
+ CommercialSecuredApplicationPayloadType$inboundSchema;
97
+ /** @deprecated use `CommercialSecuredApplicationPayloadType$outboundSchema` instead. */
81
98
  export const outboundSchema =
82
- CommercialSecuredLoanApplicationSubmissionPayloadType$outboundSchema;
99
+ CommercialSecuredApplicationPayloadType$outboundSchema;
83
100
  }
84
101
 
85
102
  /** @internal */
@@ -157,81 +174,75 @@ export function attributesFromJSON(
157
174
  }
158
175
 
159
176
  /** @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
- });
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
+ });
172
189
 
173
190
  /** @internal */
174
- export type CommercialSecuredLoanApplicationSubmissionPayload$Outbound = {
191
+ export type CommercialSecuredApplicationPayload$Outbound = {
175
192
  type: string;
176
193
  attributes: Attributes$Outbound;
177
- relationships?:
178
- | CommercialSecuredLoanCommercialApplicationRelationships$Outbound
179
- | undefined;
194
+ relationships:
195
+ CommercialSecuredLoanCommercialApplicationRelationships$Outbound;
196
+ links?: { [k: string]: LinkObject$Outbound } | undefined;
197
+ meta?: { [k: string]: any } | undefined;
180
198
  };
181
199
 
182
200
  /** @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
- });
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
+ });
195
213
 
196
214
  /**
197
215
  * @internal
198
216
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
199
217
  */
200
- export namespace CommercialSecuredLoanApplicationSubmissionPayload$ {
201
- /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayload$inboundSchema` instead. */
218
+ export namespace CommercialSecuredApplicationPayload$ {
219
+ /** @deprecated use `CommercialSecuredApplicationPayload$inboundSchema` instead. */
202
220
  export const inboundSchema =
203
- CommercialSecuredLoanApplicationSubmissionPayload$inboundSchema;
204
- /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayload$outboundSchema` instead. */
221
+ CommercialSecuredApplicationPayload$inboundSchema;
222
+ /** @deprecated use `CommercialSecuredApplicationPayload$outboundSchema` instead. */
205
223
  export const outboundSchema =
206
- CommercialSecuredLoanApplicationSubmissionPayload$outboundSchema;
207
- /** @deprecated use `CommercialSecuredLoanApplicationSubmissionPayload$Outbound` instead. */
208
- export type Outbound =
209
- CommercialSecuredLoanApplicationSubmissionPayload$Outbound;
224
+ CommercialSecuredApplicationPayload$outboundSchema;
225
+ /** @deprecated use `CommercialSecuredApplicationPayload$Outbound` instead. */
226
+ export type Outbound = CommercialSecuredApplicationPayload$Outbound;
210
227
  }
211
228
 
212
- export function commercialSecuredLoanApplicationSubmissionPayloadToJSON(
213
- commercialSecuredLoanApplicationSubmissionPayload:
214
- CommercialSecuredLoanApplicationSubmissionPayload,
229
+ export function commercialSecuredApplicationPayloadToJSON(
230
+ commercialSecuredApplicationPayload: CommercialSecuredApplicationPayload,
215
231
  ): string {
216
232
  return JSON.stringify(
217
- CommercialSecuredLoanApplicationSubmissionPayload$outboundSchema.parse(
218
- commercialSecuredLoanApplicationSubmissionPayload,
233
+ CommercialSecuredApplicationPayload$outboundSchema.parse(
234
+ commercialSecuredApplicationPayload,
219
235
  ),
220
236
  );
221
237
  }
222
238
 
223
- export function commercialSecuredLoanApplicationSubmissionPayloadFromJSON(
239
+ export function commercialSecuredApplicationPayloadFromJSON(
224
240
  jsonString: string,
225
- ): SafeParseResult<
226
- CommercialSecuredLoanApplicationSubmissionPayload,
227
- SDKValidationError
228
- > {
241
+ ): SafeParseResult<CommercialSecuredApplicationPayload, SDKValidationError> {
229
242
  return safeParse(
230
243
  jsonString,
231
244
  (x) =>
232
- CommercialSecuredLoanApplicationSubmissionPayload$inboundSchema.parse(
233
- JSON.parse(x),
234
- ),
235
- `Failed to parse 'CommercialSecuredLoanApplicationSubmissionPayload' from JSON`,
245
+ CommercialSecuredApplicationPayload$inboundSchema.parse(JSON.parse(x)),
246
+ `Failed to parse 'CommercialSecuredApplicationPayload' from JSON`,
236
247
  );
237
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
+ }
@@ -48,6 +48,7 @@ export type RegistrationState = ClosedEnum<typeof RegistrationState>;
48
48
  * Type of asset for secured commercial loans
49
49
  */
50
50
  export type CommercialSecuredLoanAssetAttributes = {
51
+ id: string;
51
52
  /**
52
53
  * Current age of asset as number (integer) of years
53
54
  */
@@ -192,6 +193,7 @@ export const CommercialSecuredLoanAssetAttributes$inboundSchema: z.ZodType<
192
193
  z.ZodTypeDef,
193
194
  unknown
194
195
  > = z.object({
196
+ id: z.string(),
195
197
  ageOfAsset: z.number().int().optional(),
196
198
  ageOfAssetAtEnd: z.number().int().optional(),
197
199
  condition: Condition$inboundSchema.optional(),
@@ -220,6 +222,7 @@ export const CommercialSecuredLoanAssetAttributes$inboundSchema: z.ZodType<
220
222
 
221
223
  /** @internal */
222
224
  export type CommercialSecuredLoanAssetAttributes$Outbound = {
225
+ id: string;
223
226
  ageOfAsset?: number | undefined;
224
227
  ageOfAssetAtEnd?: number | undefined;
225
228
  condition?: string | undefined;
@@ -252,6 +255,7 @@ export const CommercialSecuredLoanAssetAttributes$outboundSchema: z.ZodType<
252
255
  z.ZodTypeDef,
253
256
  CommercialSecuredLoanAssetAttributes
254
257
  > = z.object({
258
+ id: z.string(),
255
259
  ageOfAsset: z.number().int().optional(),
256
260
  ageOfAssetAtEnd: z.number().int().optional(),
257
261
  condition: Condition$outboundSchema.optional(),