@financeable/aggregation 0.11.0 → 0.12.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 (102) hide show
  1. package/README.md +4 -0
  2. package/docs/sdks/applications/README.md +144 -0
  3. package/examples/package-lock.json +1 -1
  4. package/funcs/applicationsGet.d.ts +14 -0
  5. package/funcs/applicationsGet.d.ts.map +1 -0
  6. package/funcs/applicationsGet.js +122 -0
  7. package/funcs/applicationsGet.js.map +1 -0
  8. package/funcs/applicationsList.d.ts +14 -0
  9. package/funcs/applicationsList.d.ts.map +1 -0
  10. package/funcs/applicationsList.js +117 -0
  11. package/funcs/applicationsList.js.map +1 -0
  12. package/lib/config.d.ts +3 -3
  13. package/lib/config.js +3 -3
  14. package/models/components/businessloanbusinessapplicationrelationships.d.ts +21 -21
  15. package/models/components/businessloanbusinessapplicationrelationships.d.ts.map +1 -1
  16. package/models/components/businessloanbusinessapplicationrelationships.js +24 -26
  17. package/models/components/businessloanbusinessapplicationrelationships.js.map +1 -1
  18. package/models/components/commercialapplicationjsonapirelationships.d.ts +15 -15
  19. package/models/components/commercialapplicationjsonapirelationships.d.ts.map +1 -1
  20. package/models/components/commercialapplicationjsonapirelationships.js +18 -18
  21. package/models/components/commercialapplicationjsonapirelationships.js.map +1 -1
  22. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts +36 -36
  23. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts.map +1 -1
  24. package/models/components/commercialsecuredloancommercialapplicationrelationships.js +46 -44
  25. package/models/components/commercialsecuredloancommercialapplicationrelationships.js.map +1 -1
  26. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts +3 -3
  27. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts.map +1 -1
  28. package/models/components/consumersecuredloanconsumerapplicationrelationships.js +3 -3
  29. package/models/components/consumersecuredloanconsumerapplicationrelationships.js.map +1 -1
  30. package/models/components/customerattributes.d.ts +0 -22
  31. package/models/components/customerattributes.d.ts.map +1 -1
  32. package/models/components/customerattributes.js +0 -10
  33. package/models/components/customerattributes.js.map +1 -1
  34. package/models/components/customerattributescreateitem.d.ts +112 -0
  35. package/models/components/customerattributescreateitem.d.ts.map +1 -0
  36. package/models/components/customerattributescreateitem.js +110 -0
  37. package/models/components/customerattributescreateitem.js.map +1 -0
  38. package/models/components/entityattributes.d.ts +129 -0
  39. package/models/components/entityattributes.d.ts.map +1 -1
  40. package/models/components/entityattributes.js +71 -1
  41. package/models/components/entityattributes.js.map +1 -1
  42. package/models/components/entityattributesinput.d.ts +41 -0
  43. package/models/components/entityattributesinput.d.ts.map +1 -0
  44. package/models/components/entityattributesinput.js +81 -0
  45. package/models/components/entityattributesinput.js.map +1 -0
  46. package/models/components/index.d.ts +4 -0
  47. package/models/components/index.d.ts.map +1 -1
  48. package/models/components/index.js +4 -0
  49. package/models/components/index.js.map +1 -1
  50. package/models/components/paginationlinks.d.ts +47 -0
  51. package/models/components/paginationlinks.d.ts.map +1 -0
  52. package/models/components/paginationlinks.js +75 -0
  53. package/models/components/paginationlinks.js.map +1 -0
  54. package/models/components/paginationmeta.d.ts +47 -0
  55. package/models/components/paginationmeta.d.ts.map +1 -0
  56. package/models/components/paginationmeta.js +88 -0
  57. package/models/components/paginationmeta.js.map +1 -0
  58. package/models/components/personalloanpersonalapplicationrelationships.d.ts +3 -3
  59. package/models/components/personalloanpersonalapplicationrelationships.d.ts.map +1 -1
  60. package/models/components/personalloanpersonalapplicationrelationships.js +3 -3
  61. package/models/components/personalloanpersonalapplicationrelationships.js.map +1 -1
  62. package/models/operations/createapplication.d.ts +218 -45
  63. package/models/operations/createapplication.d.ts.map +1 -1
  64. package/models/operations/createapplication.js +145 -45
  65. package/models/operations/createapplication.js.map +1 -1
  66. package/models/operations/getapplication.d.ts +703 -0
  67. package/models/operations/getapplication.d.ts.map +1 -0
  68. package/models/operations/getapplication.js +697 -0
  69. package/models/operations/getapplication.js.map +1 -0
  70. package/models/operations/index.d.ts +2 -0
  71. package/models/operations/index.d.ts.map +1 -1
  72. package/models/operations/index.js +2 -0
  73. package/models/operations/index.js.map +1 -1
  74. package/models/operations/listapplications.d.ts +141 -0
  75. package/models/operations/listapplications.d.ts.map +1 -0
  76. package/models/operations/listapplications.js +199 -0
  77. package/models/operations/listapplications.js.map +1 -0
  78. package/package.json +1 -1
  79. package/sdk/applications.d.ts +8 -0
  80. package/sdk/applications.d.ts.map +1 -1
  81. package/sdk/applications.js +14 -0
  82. package/sdk/applications.js.map +1 -1
  83. package/src/funcs/applicationsGet.ts +170 -0
  84. package/src/funcs/applicationsList.ts +164 -0
  85. package/src/lib/config.ts +3 -3
  86. package/src/models/components/businessloanbusinessapplicationrelationships.ts +52 -53
  87. package/src/models/components/commercialapplicationjsonapirelationships.ts +43 -67
  88. package/src/models/components/commercialsecuredloancommercialapplicationrelationships.ts +114 -94
  89. package/src/models/components/consumersecuredloanconsumerapplicationrelationships.ts +9 -9
  90. package/src/models/components/customerattributes.ts +0 -38
  91. package/src/models/components/customerattributescreateitem.ts +214 -0
  92. package/src/models/components/entityattributes.ts +134 -0
  93. package/src/models/components/entityattributesinput.ts +90 -0
  94. package/src/models/components/index.ts +4 -0
  95. package/src/models/components/paginationlinks.ts +88 -0
  96. package/src/models/components/paginationmeta.ts +99 -0
  97. package/src/models/components/personalloanpersonalapplicationrelationships.ts +9 -9
  98. package/src/models/operations/createapplication.ts +289 -62
  99. package/src/models/operations/getapplication.ts +1378 -0
  100. package/src/models/operations/index.ts +2 -0
  101. package/src/models/operations/listapplications.ts +364 -0
  102. package/src/sdk/applications.ts +30 -0
@@ -3,4 +3,6 @@
3
3
  */
4
4
 
5
5
  export * from "./createapplication.js";
6
+ export * from "./getapplication.js";
7
+ export * from "./listapplications.js";
6
8
  export * from "./supportingdocumentscreate.js";
@@ -0,0 +1,364 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type ListApplicationsRequest = {
13
+ pageNumber?: number | undefined;
14
+ pageSize?: number | undefined;
15
+ };
16
+
17
+ /**
18
+ * The server cannot find the requested resource.
19
+ */
20
+ export type ListApplicationsApplicationsResponseResponseBody = {
21
+ errors: Array<components.ResourceNotFound>;
22
+ };
23
+
24
+ /**
25
+ * Access is forbidden.
26
+ */
27
+ export type ListApplicationsApplicationsResponseBody = {
28
+ errors: Array<components.ForbiddenError>;
29
+ };
30
+
31
+ /**
32
+ * The request has succeeded.
33
+ */
34
+ export type ListApplicationsResponseBody = {
35
+ data: Array<components.ApplicationResource>;
36
+ links?: components.PaginationLinks | undefined;
37
+ meta?: components.PaginationMeta | undefined;
38
+ };
39
+
40
+ export type ListApplicationsResponse =
41
+ | ListApplicationsResponseBody
42
+ | ListApplicationsApplicationsResponseBody
43
+ | ListApplicationsApplicationsResponseResponseBody;
44
+
45
+ /** @internal */
46
+ export const ListApplicationsRequest$inboundSchema: z.ZodType<
47
+ ListApplicationsRequest,
48
+ z.ZodTypeDef,
49
+ unknown
50
+ > = z.object({
51
+ "page[number]": z.number().int().optional(),
52
+ "page[size]": z.number().int().optional(),
53
+ }).transform((v) => {
54
+ return remap$(v, {
55
+ "page[number]": "pageNumber",
56
+ "page[size]": "pageSize",
57
+ });
58
+ });
59
+
60
+ /** @internal */
61
+ export type ListApplicationsRequest$Outbound = {
62
+ "page[number]"?: number | undefined;
63
+ "page[size]"?: number | undefined;
64
+ };
65
+
66
+ /** @internal */
67
+ export const ListApplicationsRequest$outboundSchema: z.ZodType<
68
+ ListApplicationsRequest$Outbound,
69
+ z.ZodTypeDef,
70
+ ListApplicationsRequest
71
+ > = z.object({
72
+ pageNumber: z.number().int().optional(),
73
+ pageSize: z.number().int().optional(),
74
+ }).transform((v) => {
75
+ return remap$(v, {
76
+ pageNumber: "page[number]",
77
+ pageSize: "page[size]",
78
+ });
79
+ });
80
+
81
+ /**
82
+ * @internal
83
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
84
+ */
85
+ export namespace ListApplicationsRequest$ {
86
+ /** @deprecated use `ListApplicationsRequest$inboundSchema` instead. */
87
+ export const inboundSchema = ListApplicationsRequest$inboundSchema;
88
+ /** @deprecated use `ListApplicationsRequest$outboundSchema` instead. */
89
+ export const outboundSchema = ListApplicationsRequest$outboundSchema;
90
+ /** @deprecated use `ListApplicationsRequest$Outbound` instead. */
91
+ export type Outbound = ListApplicationsRequest$Outbound;
92
+ }
93
+
94
+ export function listApplicationsRequestToJSON(
95
+ listApplicationsRequest: ListApplicationsRequest,
96
+ ): string {
97
+ return JSON.stringify(
98
+ ListApplicationsRequest$outboundSchema.parse(listApplicationsRequest),
99
+ );
100
+ }
101
+
102
+ export function listApplicationsRequestFromJSON(
103
+ jsonString: string,
104
+ ): SafeParseResult<ListApplicationsRequest, SDKValidationError> {
105
+ return safeParse(
106
+ jsonString,
107
+ (x) => ListApplicationsRequest$inboundSchema.parse(JSON.parse(x)),
108
+ `Failed to parse 'ListApplicationsRequest' from JSON`,
109
+ );
110
+ }
111
+
112
+ /** @internal */
113
+ export const ListApplicationsApplicationsResponseResponseBody$inboundSchema:
114
+ z.ZodType<
115
+ ListApplicationsApplicationsResponseResponseBody,
116
+ z.ZodTypeDef,
117
+ unknown
118
+ > = z.object({
119
+ errors: z.array(components.ResourceNotFound$inboundSchema),
120
+ });
121
+
122
+ /** @internal */
123
+ export type ListApplicationsApplicationsResponseResponseBody$Outbound = {
124
+ errors: Array<components.ResourceNotFound$Outbound>;
125
+ };
126
+
127
+ /** @internal */
128
+ export const ListApplicationsApplicationsResponseResponseBody$outboundSchema:
129
+ z.ZodType<
130
+ ListApplicationsApplicationsResponseResponseBody$Outbound,
131
+ z.ZodTypeDef,
132
+ ListApplicationsApplicationsResponseResponseBody
133
+ > = z.object({
134
+ errors: z.array(components.ResourceNotFound$outboundSchema),
135
+ });
136
+
137
+ /**
138
+ * @internal
139
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
140
+ */
141
+ export namespace ListApplicationsApplicationsResponseResponseBody$ {
142
+ /** @deprecated use `ListApplicationsApplicationsResponseResponseBody$inboundSchema` instead. */
143
+ export const inboundSchema =
144
+ ListApplicationsApplicationsResponseResponseBody$inboundSchema;
145
+ /** @deprecated use `ListApplicationsApplicationsResponseResponseBody$outboundSchema` instead. */
146
+ export const outboundSchema =
147
+ ListApplicationsApplicationsResponseResponseBody$outboundSchema;
148
+ /** @deprecated use `ListApplicationsApplicationsResponseResponseBody$Outbound` instead. */
149
+ export type Outbound =
150
+ ListApplicationsApplicationsResponseResponseBody$Outbound;
151
+ }
152
+
153
+ export function listApplicationsApplicationsResponseResponseBodyToJSON(
154
+ listApplicationsApplicationsResponseResponseBody:
155
+ ListApplicationsApplicationsResponseResponseBody,
156
+ ): string {
157
+ return JSON.stringify(
158
+ ListApplicationsApplicationsResponseResponseBody$outboundSchema.parse(
159
+ listApplicationsApplicationsResponseResponseBody,
160
+ ),
161
+ );
162
+ }
163
+
164
+ export function listApplicationsApplicationsResponseResponseBodyFromJSON(
165
+ jsonString: string,
166
+ ): SafeParseResult<
167
+ ListApplicationsApplicationsResponseResponseBody,
168
+ SDKValidationError
169
+ > {
170
+ return safeParse(
171
+ jsonString,
172
+ (x) =>
173
+ ListApplicationsApplicationsResponseResponseBody$inboundSchema.parse(
174
+ JSON.parse(x),
175
+ ),
176
+ `Failed to parse 'ListApplicationsApplicationsResponseResponseBody' from JSON`,
177
+ );
178
+ }
179
+
180
+ /** @internal */
181
+ export const ListApplicationsApplicationsResponseBody$inboundSchema: z.ZodType<
182
+ ListApplicationsApplicationsResponseBody,
183
+ z.ZodTypeDef,
184
+ unknown
185
+ > = z.object({
186
+ errors: z.array(components.ForbiddenError$inboundSchema),
187
+ });
188
+
189
+ /** @internal */
190
+ export type ListApplicationsApplicationsResponseBody$Outbound = {
191
+ errors: Array<components.ForbiddenError$Outbound>;
192
+ };
193
+
194
+ /** @internal */
195
+ export const ListApplicationsApplicationsResponseBody$outboundSchema: z.ZodType<
196
+ ListApplicationsApplicationsResponseBody$Outbound,
197
+ z.ZodTypeDef,
198
+ ListApplicationsApplicationsResponseBody
199
+ > = z.object({
200
+ errors: z.array(components.ForbiddenError$outboundSchema),
201
+ });
202
+
203
+ /**
204
+ * @internal
205
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
206
+ */
207
+ export namespace ListApplicationsApplicationsResponseBody$ {
208
+ /** @deprecated use `ListApplicationsApplicationsResponseBody$inboundSchema` instead. */
209
+ export const inboundSchema =
210
+ ListApplicationsApplicationsResponseBody$inboundSchema;
211
+ /** @deprecated use `ListApplicationsApplicationsResponseBody$outboundSchema` instead. */
212
+ export const outboundSchema =
213
+ ListApplicationsApplicationsResponseBody$outboundSchema;
214
+ /** @deprecated use `ListApplicationsApplicationsResponseBody$Outbound` instead. */
215
+ export type Outbound = ListApplicationsApplicationsResponseBody$Outbound;
216
+ }
217
+
218
+ export function listApplicationsApplicationsResponseBodyToJSON(
219
+ listApplicationsApplicationsResponseBody:
220
+ ListApplicationsApplicationsResponseBody,
221
+ ): string {
222
+ return JSON.stringify(
223
+ ListApplicationsApplicationsResponseBody$outboundSchema.parse(
224
+ listApplicationsApplicationsResponseBody,
225
+ ),
226
+ );
227
+ }
228
+
229
+ export function listApplicationsApplicationsResponseBodyFromJSON(
230
+ jsonString: string,
231
+ ): SafeParseResult<
232
+ ListApplicationsApplicationsResponseBody,
233
+ SDKValidationError
234
+ > {
235
+ return safeParse(
236
+ jsonString,
237
+ (x) =>
238
+ ListApplicationsApplicationsResponseBody$inboundSchema.parse(
239
+ JSON.parse(x),
240
+ ),
241
+ `Failed to parse 'ListApplicationsApplicationsResponseBody' from JSON`,
242
+ );
243
+ }
244
+
245
+ /** @internal */
246
+ export const ListApplicationsResponseBody$inboundSchema: z.ZodType<
247
+ ListApplicationsResponseBody,
248
+ z.ZodTypeDef,
249
+ unknown
250
+ > = z.object({
251
+ data: z.array(components.ApplicationResource$inboundSchema),
252
+ links: components.PaginationLinks$inboundSchema.optional(),
253
+ meta: components.PaginationMeta$inboundSchema.optional(),
254
+ });
255
+
256
+ /** @internal */
257
+ export type ListApplicationsResponseBody$Outbound = {
258
+ data: Array<components.ApplicationResource$Outbound>;
259
+ links?: components.PaginationLinks$Outbound | undefined;
260
+ meta?: components.PaginationMeta$Outbound | undefined;
261
+ };
262
+
263
+ /** @internal */
264
+ export const ListApplicationsResponseBody$outboundSchema: z.ZodType<
265
+ ListApplicationsResponseBody$Outbound,
266
+ z.ZodTypeDef,
267
+ ListApplicationsResponseBody
268
+ > = z.object({
269
+ data: z.array(components.ApplicationResource$outboundSchema),
270
+ links: components.PaginationLinks$outboundSchema.optional(),
271
+ meta: components.PaginationMeta$outboundSchema.optional(),
272
+ });
273
+
274
+ /**
275
+ * @internal
276
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
277
+ */
278
+ export namespace ListApplicationsResponseBody$ {
279
+ /** @deprecated use `ListApplicationsResponseBody$inboundSchema` instead. */
280
+ export const inboundSchema = ListApplicationsResponseBody$inboundSchema;
281
+ /** @deprecated use `ListApplicationsResponseBody$outboundSchema` instead. */
282
+ export const outboundSchema = ListApplicationsResponseBody$outboundSchema;
283
+ /** @deprecated use `ListApplicationsResponseBody$Outbound` instead. */
284
+ export type Outbound = ListApplicationsResponseBody$Outbound;
285
+ }
286
+
287
+ export function listApplicationsResponseBodyToJSON(
288
+ listApplicationsResponseBody: ListApplicationsResponseBody,
289
+ ): string {
290
+ return JSON.stringify(
291
+ ListApplicationsResponseBody$outboundSchema.parse(
292
+ listApplicationsResponseBody,
293
+ ),
294
+ );
295
+ }
296
+
297
+ export function listApplicationsResponseBodyFromJSON(
298
+ jsonString: string,
299
+ ): SafeParseResult<ListApplicationsResponseBody, SDKValidationError> {
300
+ return safeParse(
301
+ jsonString,
302
+ (x) => ListApplicationsResponseBody$inboundSchema.parse(JSON.parse(x)),
303
+ `Failed to parse 'ListApplicationsResponseBody' from JSON`,
304
+ );
305
+ }
306
+
307
+ /** @internal */
308
+ export const ListApplicationsResponse$inboundSchema: z.ZodType<
309
+ ListApplicationsResponse,
310
+ z.ZodTypeDef,
311
+ unknown
312
+ > = z.union([
313
+ z.lazy(() => ListApplicationsResponseBody$inboundSchema),
314
+ z.lazy(() => ListApplicationsApplicationsResponseBody$inboundSchema),
315
+ z.lazy(() => ListApplicationsApplicationsResponseResponseBody$inboundSchema),
316
+ ]);
317
+
318
+ /** @internal */
319
+ export type ListApplicationsResponse$Outbound =
320
+ | ListApplicationsResponseBody$Outbound
321
+ | ListApplicationsApplicationsResponseBody$Outbound
322
+ | ListApplicationsApplicationsResponseResponseBody$Outbound;
323
+
324
+ /** @internal */
325
+ export const ListApplicationsResponse$outboundSchema: z.ZodType<
326
+ ListApplicationsResponse$Outbound,
327
+ z.ZodTypeDef,
328
+ ListApplicationsResponse
329
+ > = z.union([
330
+ z.lazy(() => ListApplicationsResponseBody$outboundSchema),
331
+ z.lazy(() => ListApplicationsApplicationsResponseBody$outboundSchema),
332
+ z.lazy(() => ListApplicationsApplicationsResponseResponseBody$outboundSchema),
333
+ ]);
334
+
335
+ /**
336
+ * @internal
337
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
338
+ */
339
+ export namespace ListApplicationsResponse$ {
340
+ /** @deprecated use `ListApplicationsResponse$inboundSchema` instead. */
341
+ export const inboundSchema = ListApplicationsResponse$inboundSchema;
342
+ /** @deprecated use `ListApplicationsResponse$outboundSchema` instead. */
343
+ export const outboundSchema = ListApplicationsResponse$outboundSchema;
344
+ /** @deprecated use `ListApplicationsResponse$Outbound` instead. */
345
+ export type Outbound = ListApplicationsResponse$Outbound;
346
+ }
347
+
348
+ export function listApplicationsResponseToJSON(
349
+ listApplicationsResponse: ListApplicationsResponse,
350
+ ): string {
351
+ return JSON.stringify(
352
+ ListApplicationsResponse$outboundSchema.parse(listApplicationsResponse),
353
+ );
354
+ }
355
+
356
+ export function listApplicationsResponseFromJSON(
357
+ jsonString: string,
358
+ ): SafeParseResult<ListApplicationsResponse, SDKValidationError> {
359
+ return safeParse(
360
+ jsonString,
361
+ (x) => ListApplicationsResponse$inboundSchema.parse(JSON.parse(x)),
362
+ `Failed to parse 'ListApplicationsResponse' from JSON`,
363
+ );
364
+ }
@@ -3,6 +3,8 @@
3
3
  */
4
4
 
5
5
  import { applicationsCreate } from "../funcs/applicationsCreate.js";
6
+ import { applicationsGet } from "../funcs/applicationsGet.js";
7
+ import { applicationsList } from "../funcs/applicationsList.js";
6
8
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
9
  import * as operations from "../models/operations/index.js";
8
10
  import { unwrapAsync } from "../types/fp.js";
@@ -21,4 +23,32 @@ export class Applications extends ClientSDK {
21
23
  options,
22
24
  ));
23
25
  }
26
+
27
+ /**
28
+ * List all applications from the tenant. This endpoint does not support the 'include' query parameter; relationships must be fetched via the 'Get Application' endpoint.
29
+ */
30
+ async list(
31
+ request: operations.ListApplicationsRequest,
32
+ options?: RequestOptions,
33
+ ): Promise<operations.ListApplicationsResponse> {
34
+ return unwrapAsync(applicationsList(
35
+ this,
36
+ request,
37
+ options,
38
+ ));
39
+ }
40
+
41
+ /**
42
+ * Retrieve a specific application from the Financeable platform.
43
+ */
44
+ async get(
45
+ request: operations.GetApplicationRequest,
46
+ options?: RequestOptions,
47
+ ): Promise<operations.GetApplicationResponse> {
48
+ return unwrapAsync(applicationsGet(
49
+ this,
50
+ request,
51
+ options,
52
+ ));
53
+ }
24
54
  }