@financeable/aggregation 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/FUNCTIONS.md +0 -4
  2. package/README.md +945 -28
  3. package/docs/sdks/applications/README.md +0 -8
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +3 -3
  6. package/lib/config.js +3 -3
  7. package/models/components/applicationresourcebulksubmission.d.ts +0 -6
  8. package/models/components/applicationresourcebulksubmission.d.ts.map +1 -1
  9. package/models/components/applicationresourcebulksubmission.js +0 -6
  10. package/models/components/applicationresourcebulksubmission.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/lib/config.ts +3 -3
  13. package/src/models/components/applicationresourcebulksubmission.ts +0 -12
  14. package/financeable-typescript/.devcontainer/README.md +0 -30
  15. package/financeable-typescript/FUNCTIONS.md +0 -205
  16. package/financeable-typescript/README.md +0 -895
  17. package/financeable-typescript/RUNTIMES.md +0 -22
  18. package/financeable-typescript/docs/sdks/applications/README.md +0 -427
  19. package/financeable-typescript/docs/sdks/financeable/README.md +0 -5
  20. package/financeable-typescript/src/core.ts +0 -13
  21. package/financeable-typescript/src/funcs/applicationsCreate.ts +0 -124
  22. package/financeable-typescript/src/funcs/applicationsGet.ts +0 -128
  23. package/financeable-typescript/src/funcs/applicationsList.ts +0 -126
  24. package/financeable-typescript/src/hooks/hooks.ts +0 -129
  25. package/financeable-typescript/src/hooks/index.ts +0 -6
  26. package/financeable-typescript/src/hooks/types.ts +0 -109
  27. package/financeable-typescript/src/index.ts +0 -7
  28. package/financeable-typescript/src/lib/base64.ts +0 -37
  29. package/financeable-typescript/src/lib/config.ts +0 -59
  30. package/financeable-typescript/src/lib/dlv.ts +0 -53
  31. package/financeable-typescript/src/lib/encodings.ts +0 -449
  32. package/financeable-typescript/src/lib/env.ts +0 -37
  33. package/financeable-typescript/src/lib/files.ts +0 -40
  34. package/financeable-typescript/src/lib/http.ts +0 -323
  35. package/financeable-typescript/src/lib/is-plain-object.ts +0 -43
  36. package/financeable-typescript/src/lib/logger.ts +0 -9
  37. package/financeable-typescript/src/lib/matchers.ts +0 -322
  38. package/financeable-typescript/src/lib/primitives.ts +0 -122
  39. package/financeable-typescript/src/lib/retries.ts +0 -219
  40. package/financeable-typescript/src/lib/schemas.ts +0 -86
  41. package/financeable-typescript/src/lib/sdks.ts +0 -392
  42. package/financeable-typescript/src/lib/security.ts +0 -227
  43. package/financeable-typescript/src/lib/url.ts +0 -33
  44. package/financeable-typescript/src/models/components/addressattributes.ts +0 -148
  45. package/financeable-typescript/src/models/components/apierrorlinks.ts +0 -65
  46. package/financeable-typescript/src/models/components/applicationattributes.ts +0 -128
  47. package/financeable-typescript/src/models/components/applicationattributescreate.ts +0 -90
  48. package/financeable-typescript/src/models/components/applicationresourcebulksubmission.ts +0 -1000
  49. package/financeable-typescript/src/models/components/applicationstatus.ts +0 -39
  50. package/financeable-typescript/src/models/components/applicationtype.ts +0 -33
  51. package/financeable-typescript/src/models/components/assetattributes.ts +0 -400
  52. package/financeable-typescript/src/models/components/customerattributes.ts +0 -171
  53. package/financeable-typescript/src/models/components/customertitle.ts +0 -35
  54. package/financeable-typescript/src/models/components/errorsource.ts +0 -79
  55. package/financeable-typescript/src/models/components/forbiddenerror.ts +0 -207
  56. package/financeable-typescript/src/models/components/frequencytype.ts +0 -40
  57. package/financeable-typescript/src/models/components/index.ts +0 -20
  58. package/financeable-typescript/src/models/components/links.ts +0 -72
  59. package/financeable-typescript/src/models/components/loandetailsattributes.ts +0 -187
  60. package/financeable-typescript/src/models/components/repaymentstructure.ts +0 -40
  61. package/financeable-typescript/src/models/errors/apierror.ts +0 -27
  62. package/financeable-typescript/src/models/errors/createapplication.ts +0 -76
  63. package/financeable-typescript/src/models/errors/getapplication.ts +0 -76
  64. package/financeable-typescript/src/models/errors/getapplications.ts +0 -76
  65. package/financeable-typescript/src/models/errors/httpclienterrors.ts +0 -62
  66. package/financeable-typescript/src/models/errors/index.ts +0 -10
  67. package/financeable-typescript/src/models/errors/sdkvalidationerror.ts +0 -97
  68. package/financeable-typescript/src/models/operations/createapplication.ts +0 -1649
  69. package/financeable-typescript/src/models/operations/getapplication.ts +0 -1829
  70. package/financeable-typescript/src/models/operations/getapplications.ts +0 -1790
  71. package/financeable-typescript/src/models/operations/index.ts +0 -7
  72. package/financeable-typescript/src/sdk/applications.ts +0 -55
  73. package/financeable-typescript/src/sdk/index.ts +0 -5
  74. package/financeable-typescript/src/sdk/sdk.ts +0 -13
  75. package/financeable-typescript/src/types/blobs.ts +0 -31
  76. package/financeable-typescript/src/types/constdatetime.ts +0 -15
  77. package/financeable-typescript/src/types/enums.ts +0 -16
  78. package/financeable-typescript/src/types/fp.ts +0 -50
  79. package/financeable-typescript/src/types/index.ts +0 -11
  80. package/financeable-typescript/src/types/operations.ts +0 -105
  81. package/financeable-typescript/src/types/rfcdate.ts +0 -54
  82. package/financeable-typescript/src/types/streams.ts +0 -21
@@ -1,39 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { ClosedEnum } from "../../types/enums.js";
7
-
8
- export const ApplicationStatus = {
9
- Workshop: "workshop",
10
- Calculator: "calculator",
11
- Quote: "quote",
12
- Declined: "declined",
13
- Approved: "approved",
14
- Settled: "settled",
15
- Deleted: "deleted",
16
- Archive: "archive",
17
- } as const;
18
- export type ApplicationStatus = ClosedEnum<typeof ApplicationStatus>;
19
-
20
- /** @internal */
21
- export const ApplicationStatus$inboundSchema: z.ZodNativeEnum<
22
- typeof ApplicationStatus
23
- > = z.nativeEnum(ApplicationStatus);
24
-
25
- /** @internal */
26
- export const ApplicationStatus$outboundSchema: z.ZodNativeEnum<
27
- typeof ApplicationStatus
28
- > = ApplicationStatus$inboundSchema;
29
-
30
- /**
31
- * @internal
32
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
33
- */
34
- export namespace ApplicationStatus$ {
35
- /** @deprecated use `ApplicationStatus$inboundSchema` instead. */
36
- export const inboundSchema = ApplicationStatus$inboundSchema;
37
- /** @deprecated use `ApplicationStatus$outboundSchema` instead. */
38
- export const outboundSchema = ApplicationStatus$outboundSchema;
39
- }
@@ -1,33 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { ClosedEnum } from "../../types/enums.js";
7
-
8
- export const ApplicationType = {
9
- Consumer: "consumer",
10
- Commercial: "commercial",
11
- } as const;
12
- export type ApplicationType = ClosedEnum<typeof ApplicationType>;
13
-
14
- /** @internal */
15
- export const ApplicationType$inboundSchema: z.ZodNativeEnum<
16
- typeof ApplicationType
17
- > = z.nativeEnum(ApplicationType);
18
-
19
- /** @internal */
20
- export const ApplicationType$outboundSchema: z.ZodNativeEnum<
21
- typeof ApplicationType
22
- > = ApplicationType$inboundSchema;
23
-
24
- /**
25
- * @internal
26
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
27
- */
28
- export namespace ApplicationType$ {
29
- /** @deprecated use `ApplicationType$inboundSchema` instead. */
30
- export const inboundSchema = ApplicationType$inboundSchema;
31
- /** @deprecated use `ApplicationType$outboundSchema` instead. */
32
- export const outboundSchema = ApplicationType$outboundSchema;
33
- }
@@ -1,400 +0,0 @@
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
-
11
- /**
12
- * Condition of asset
13
- */
14
- export const Condition = {
15
- New: "NEW",
16
- Demo: "DEMO",
17
- Used: "USED",
18
- } as const;
19
- /**
20
- * Condition of asset
21
- */
22
- export type Condition = ClosedEnum<typeof Condition>;
23
-
24
- /**
25
- * Type of asset
26
- */
27
- export const AssetType = {
28
- MOTORVEHICLELessThan45TONNES: "MOTOR_VEHICLE_(<4.5_TONNES)",
29
- ELECTRICMOTORVEHICLELessThan45TONNES: "ELECTRIC_MOTOR_VEHICLE_(<4.5_TONNES)",
30
- COMMERCIALSMALLTOMEDIUMVEHICLESLessThan12TONNES:
31
- "COMMERCIAL_(SMALL_TO_MEDIUM)_VEHICLES_(<12_TONNES)",
32
- COMMERCIALHEAVYVEHICLESGreaterThan12TONNES:
33
- "COMMERCIAL_(HEAVY)_VEHICLES_(>12_TONNES)",
34
- WarehouseEquipmentWheeledOrTracked:
35
- "WAREHOUSE_EQUIPMENT_(WHEELED_OR_TRACKED)",
36
- EARTHMOVINGAndCONSTRUCTIONWHEELEDORTRACKED:
37
- "EARTH_MOVING_&_CONSTRUCTION_(WHEELED_OR_TRACKED)",
38
- AGRICULTURALAndLANDSCAPINGEQUIPMENTWHEELEDORTRACKED:
39
- "AGRICULTURAL_&_LANDSCAPING_EQUIPMENT_(WHEELED_OR_TRACKED)",
40
- MINIBUSESAndROUTEBUSESLessThan25SEATS: "MINI_BUSES_&_ROUTE_BUSES_(<25_SEATS)",
41
- TrailersAndCaravans: "TRAILERS_AND_CARAVANS",
42
- INDUSTRIALPLANTAndPRINTING: "INDUSTRIAL_PLANT_&_PRINTING",
43
- ManufacturingEquipment: "MANUFACTURING_EQUIPMENT",
44
- MedicalEquipment: "MEDICAL_EQUIPMENT",
45
- ITCOMPUTERAndAUDIOEQUIPMENT: "IT_COMPUTER_&_AUDIO_EQUIPMENT",
46
- HEALTHAndBEAUTYEQUIPMENT: "HEALTH_&_BEAUTY_EQUIPMENT",
47
- OfficeEquipment: "OFFICE_EQUIPMENT",
48
- OfficeFitout: "OFFICE_FITOUT",
49
- RESTAURANTAndCATERINGEQUIPMENT: "RESTAURANT_&_CATERING_EQUIPMENT",
50
- OfficeFurniture: "OFFICE_FURNITURE",
51
- Solar: "SOLAR",
52
- MotorbikesAtvs: "MOTORBIKES_ATVS",
53
- ClassicCar: "CLASSIC_CAR",
54
- TraileredBoats: "TRAILERED_BOATS",
55
- Jetskis: "JETSKIS",
56
- RideOnMowers: "RIDE_ON_MOWERS",
57
- GolfCarts: "GOLF_CARTS",
58
- Other: "OTHER",
59
- } as const;
60
- /**
61
- * Type of asset
62
- */
63
- export type AssetType = ClosedEnum<typeof AssetType>;
64
-
65
- export const Purpose = {
66
- Vehicle: "VEHICLE",
67
- DebtConsolidation: "DEBT_CONSOLIDATION",
68
- HomeImprovements: "HOME_IMPROVEMENTS",
69
- MEDICALAndDENTAL: "MEDICAL_&_DENTAL",
70
- HouseholdFurnishings: "HOUSEHOLD_FURNISHINGS",
71
- Education: "EDUCATION",
72
- Travel: "TRAVEL",
73
- Wedding: "WEDDING",
74
- MortgageCostFunding: "MORTGAGE_COST_FUNDING",
75
- OtherPersonalUse: "OTHER_PERSONAL_USE",
76
- } as const;
77
- export type Purpose = ClosedEnum<typeof Purpose>;
78
-
79
- /**
80
- * Registration state (or territory) of asset
81
- */
82
- export const RegistrationState = {
83
- Vic: "VIC",
84
- Nsw: "NSW",
85
- Qld: "QLD",
86
- Sa: "SA",
87
- Wa: "WA",
88
- Tas: "TAS",
89
- Nt: "NT",
90
- Act: "ACT",
91
- } as const;
92
- /**
93
- * Registration state (or territory) of asset
94
- */
95
- export type RegistrationState = ClosedEnum<typeof RegistrationState>;
96
-
97
- /**
98
- * The asset to be obtained by the customer, using the proposed loan financing.
99
- */
100
- export type AssetAttributes = {
101
- /**
102
- * Current age of asset as number (integer) of years
103
- */
104
- ageOfAsset: number;
105
- /**
106
- * Age of asset at the end of the loan term, in years
107
- */
108
- ageOfAssetAtEnd: number;
109
- /**
110
- * Condition of asset
111
- */
112
- condition: Condition;
113
- /**
114
- * Type of asset
115
- */
116
- assetType: AssetType;
117
- purpose: Purpose;
118
- /**
119
- * Value of asset
120
- */
121
- assetValue: string;
122
- /**
123
- * Make of asset
124
- */
125
- make: string;
126
- /**
127
- * Model of asset
128
- */
129
- assetModel: string;
130
- /**
131
- * Registration number of asset
132
- */
133
- registrationNumber: string;
134
- /**
135
- * Registration state (or territory) of asset
136
- */
137
- registrationState?: RegistrationState | undefined;
138
- /**
139
- * VIN of asset
140
- */
141
- vin?: string | undefined;
142
- /**
143
- * Name of asset supplier
144
- */
145
- supplierName?: string | undefined;
146
- /**
147
- * ABN of asset supplier
148
- */
149
- supplierABN?: string | undefined;
150
- /**
151
- * Address of asset supplier
152
- */
153
- supplierAddress?: string | undefined;
154
- /**
155
- * Phone number of asset supplier
156
- */
157
- supplierPhone?: string | undefined;
158
- /**
159
- * Contact name of the asset supplier
160
- */
161
- supplierContactName?: string | undefined;
162
- /**
163
- * Email address of the asset supplier
164
- */
165
- supplierEmail?: string | undefined;
166
- /**
167
- * Is this asset obtained via private sale?
168
- */
169
- privateSale: boolean;
170
- /**
171
- * Type of sale
172
- */
173
- typeOfSale: string;
174
- /**
175
- * Description of asset
176
- */
177
- description: string;
178
- /**
179
- * Net asset value of asset, floating point value as string
180
- */
181
- netAssetValue: string;
182
- /**
183
- * Is this asset a luxury asset?
184
- */
185
- isLuxury: boolean;
186
- /**
187
- * Luxury GST, floating point value as string
188
- */
189
- luxuryGst?: string | undefined;
190
- /**
191
- * Additional fees concerning the asset, floating point value as string
192
- */
193
- additionalFees?: string | undefined;
194
- /**
195
- * Additional taxes concerning the asset, floating point value as string
196
- */
197
- additionalTaxes?: string | undefined;
198
- };
199
-
200
- /** @internal */
201
- export const Condition$inboundSchema: z.ZodNativeEnum<typeof Condition> = z
202
- .nativeEnum(Condition);
203
-
204
- /** @internal */
205
- export const Condition$outboundSchema: z.ZodNativeEnum<typeof Condition> =
206
- Condition$inboundSchema;
207
-
208
- /**
209
- * @internal
210
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
211
- */
212
- export namespace Condition$ {
213
- /** @deprecated use `Condition$inboundSchema` instead. */
214
- export const inboundSchema = Condition$inboundSchema;
215
- /** @deprecated use `Condition$outboundSchema` instead. */
216
- export const outboundSchema = Condition$outboundSchema;
217
- }
218
-
219
- /** @internal */
220
- export const AssetType$inboundSchema: z.ZodNativeEnum<typeof AssetType> = z
221
- .nativeEnum(AssetType);
222
-
223
- /** @internal */
224
- export const AssetType$outboundSchema: z.ZodNativeEnum<typeof AssetType> =
225
- AssetType$inboundSchema;
226
-
227
- /**
228
- * @internal
229
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
230
- */
231
- export namespace AssetType$ {
232
- /** @deprecated use `AssetType$inboundSchema` instead. */
233
- export const inboundSchema = AssetType$inboundSchema;
234
- /** @deprecated use `AssetType$outboundSchema` instead. */
235
- export const outboundSchema = AssetType$outboundSchema;
236
- }
237
-
238
- /** @internal */
239
- export const Purpose$inboundSchema: z.ZodNativeEnum<typeof Purpose> = z
240
- .nativeEnum(Purpose);
241
-
242
- /** @internal */
243
- export const Purpose$outboundSchema: z.ZodNativeEnum<typeof Purpose> =
244
- Purpose$inboundSchema;
245
-
246
- /**
247
- * @internal
248
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
249
- */
250
- export namespace Purpose$ {
251
- /** @deprecated use `Purpose$inboundSchema` instead. */
252
- export const inboundSchema = Purpose$inboundSchema;
253
- /** @deprecated use `Purpose$outboundSchema` instead. */
254
- export const outboundSchema = Purpose$outboundSchema;
255
- }
256
-
257
- /** @internal */
258
- export const RegistrationState$inboundSchema: z.ZodNativeEnum<
259
- typeof RegistrationState
260
- > = z.nativeEnum(RegistrationState);
261
-
262
- /** @internal */
263
- export const RegistrationState$outboundSchema: z.ZodNativeEnum<
264
- typeof RegistrationState
265
- > = RegistrationState$inboundSchema;
266
-
267
- /**
268
- * @internal
269
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
270
- */
271
- export namespace RegistrationState$ {
272
- /** @deprecated use `RegistrationState$inboundSchema` instead. */
273
- export const inboundSchema = RegistrationState$inboundSchema;
274
- /** @deprecated use `RegistrationState$outboundSchema` instead. */
275
- export const outboundSchema = RegistrationState$outboundSchema;
276
- }
277
-
278
- /** @internal */
279
- export const AssetAttributes$inboundSchema: z.ZodType<
280
- AssetAttributes,
281
- z.ZodTypeDef,
282
- unknown
283
- > = z.object({
284
- ageOfAsset: z.number().int(),
285
- ageOfAssetAtEnd: z.number().int(),
286
- condition: Condition$inboundSchema,
287
- assetType: AssetType$inboundSchema,
288
- purpose: Purpose$inboundSchema,
289
- assetValue: z.string(),
290
- make: z.string(),
291
- assetModel: z.string(),
292
- registrationNumber: z.string(),
293
- registrationState: RegistrationState$inboundSchema.optional(),
294
- vin: z.string().optional(),
295
- supplierName: z.string().optional(),
296
- supplierABN: z.string().optional(),
297
- supplierAddress: z.string().optional(),
298
- supplierPhone: z.string().optional(),
299
- supplierContactName: z.string().optional(),
300
- supplierEmail: z.string().optional(),
301
- privateSale: z.boolean(),
302
- typeOfSale: z.string(),
303
- description: z.string(),
304
- netAssetValue: z.string(),
305
- isLuxury: z.boolean(),
306
- luxuryGst: z.string().optional(),
307
- additionalFees: z.string().optional(),
308
- additionalTaxes: z.string().optional(),
309
- });
310
-
311
- /** @internal */
312
- export type AssetAttributes$Outbound = {
313
- ageOfAsset: number;
314
- ageOfAssetAtEnd: number;
315
- condition: string;
316
- assetType: string;
317
- purpose: string;
318
- assetValue: string;
319
- make: string;
320
- assetModel: string;
321
- registrationNumber: string;
322
- registrationState?: string | undefined;
323
- vin?: string | undefined;
324
- supplierName?: string | undefined;
325
- supplierABN?: string | undefined;
326
- supplierAddress?: string | undefined;
327
- supplierPhone?: string | undefined;
328
- supplierContactName?: string | undefined;
329
- supplierEmail?: string | undefined;
330
- privateSale: boolean;
331
- typeOfSale: string;
332
- description: string;
333
- netAssetValue: string;
334
- isLuxury: boolean;
335
- luxuryGst?: string | undefined;
336
- additionalFees?: string | undefined;
337
- additionalTaxes?: string | undefined;
338
- };
339
-
340
- /** @internal */
341
- export const AssetAttributes$outboundSchema: z.ZodType<
342
- AssetAttributes$Outbound,
343
- z.ZodTypeDef,
344
- AssetAttributes
345
- > = z.object({
346
- ageOfAsset: z.number().int(),
347
- ageOfAssetAtEnd: z.number().int(),
348
- condition: Condition$outboundSchema,
349
- assetType: AssetType$outboundSchema,
350
- purpose: Purpose$outboundSchema,
351
- assetValue: z.string(),
352
- make: z.string(),
353
- assetModel: z.string(),
354
- registrationNumber: z.string(),
355
- registrationState: RegistrationState$outboundSchema.optional(),
356
- vin: z.string().optional(),
357
- supplierName: z.string().optional(),
358
- supplierABN: z.string().optional(),
359
- supplierAddress: z.string().optional(),
360
- supplierPhone: z.string().optional(),
361
- supplierContactName: z.string().optional(),
362
- supplierEmail: z.string().optional(),
363
- privateSale: z.boolean(),
364
- typeOfSale: z.string(),
365
- description: z.string(),
366
- netAssetValue: z.string(),
367
- isLuxury: z.boolean(),
368
- luxuryGst: z.string().optional(),
369
- additionalFees: z.string().optional(),
370
- additionalTaxes: z.string().optional(),
371
- });
372
-
373
- /**
374
- * @internal
375
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
376
- */
377
- export namespace AssetAttributes$ {
378
- /** @deprecated use `AssetAttributes$inboundSchema` instead. */
379
- export const inboundSchema = AssetAttributes$inboundSchema;
380
- /** @deprecated use `AssetAttributes$outboundSchema` instead. */
381
- export const outboundSchema = AssetAttributes$outboundSchema;
382
- /** @deprecated use `AssetAttributes$Outbound` instead. */
383
- export type Outbound = AssetAttributes$Outbound;
384
- }
385
-
386
- export function assetAttributesToJSON(
387
- assetAttributes: AssetAttributes,
388
- ): string {
389
- return JSON.stringify(AssetAttributes$outboundSchema.parse(assetAttributes));
390
- }
391
-
392
- export function assetAttributesFromJSON(
393
- jsonString: string,
394
- ): SafeParseResult<AssetAttributes, SDKValidationError> {
395
- return safeParse(
396
- jsonString,
397
- (x) => AssetAttributes$inboundSchema.parse(JSON.parse(x)),
398
- `Failed to parse 'AssetAttributes' from JSON`,
399
- );
400
- }
@@ -1,171 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
- import { Result as SafeParseResult } from "../../types/fp.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
- import {
12
- CustomerTitle,
13
- CustomerTitle$inboundSchema,
14
- CustomerTitle$outboundSchema,
15
- } from "./customertitle.js";
16
-
17
- /**
18
- * Type of ID, either drivers' license or passport
19
- */
20
- export const IDType = {
21
- Licence: "licence",
22
- Passport: "passport",
23
- } as const;
24
- /**
25
- * Type of ID, either drivers' license or passport
26
- */
27
- export type IDType = ClosedEnum<typeof IDType>;
28
-
29
- /**
30
- * A customer of the proposed financing
31
- */
32
- export type CustomerAttributes = {
33
- /**
34
- * Title of the customer
35
- */
36
- title: CustomerTitle;
37
- /**
38
- * First name of the customer
39
- */
40
- firstName: string;
41
- /**
42
- * Middle names of the customer
43
- */
44
- middleNames?: string | undefined;
45
- /**
46
- * Last name of the customer
47
- */
48
- lastName: string;
49
- /**
50
- * Date of birth in format DD-MM-YYYY
51
- */
52
- dateOfBirth: string;
53
- /**
54
- * Date of expiry of the ID in format DD-MM-YYYY
55
- */
56
- idExpiryDate: string;
57
- /**
58
- * Type of ID, either drivers' license or passport
59
- */
60
- idType?: IDType | undefined;
61
- /**
62
- * Number of the ID
63
- */
64
- idNumber?: string | undefined;
65
- };
66
-
67
- /** @internal */
68
- export const IDType$inboundSchema: z.ZodNativeEnum<typeof IDType> = z
69
- .nativeEnum(IDType);
70
-
71
- /** @internal */
72
- export const IDType$outboundSchema: z.ZodNativeEnum<typeof IDType> =
73
- IDType$inboundSchema;
74
-
75
- /**
76
- * @internal
77
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
78
- */
79
- export namespace IDType$ {
80
- /** @deprecated use `IDType$inboundSchema` instead. */
81
- export const inboundSchema = IDType$inboundSchema;
82
- /** @deprecated use `IDType$outboundSchema` instead. */
83
- export const outboundSchema = IDType$outboundSchema;
84
- }
85
-
86
- /** @internal */
87
- export const CustomerAttributes$inboundSchema: z.ZodType<
88
- CustomerAttributes,
89
- z.ZodTypeDef,
90
- unknown
91
- > = z.object({
92
- title: CustomerTitle$inboundSchema,
93
- firstName: z.string(),
94
- middleNames: z.string().optional(),
95
- lastName: z.string(),
96
- dateOfBirth: z.string(),
97
- IDExpiryDate: z.string(),
98
- IDType: IDType$inboundSchema.optional(),
99
- IDNumber: z.string().optional(),
100
- }).transform((v) => {
101
- return remap$(v, {
102
- "IDExpiryDate": "idExpiryDate",
103
- "IDType": "idType",
104
- "IDNumber": "idNumber",
105
- });
106
- });
107
-
108
- /** @internal */
109
- export type CustomerAttributes$Outbound = {
110
- title: string;
111
- firstName: string;
112
- middleNames?: string | undefined;
113
- lastName: string;
114
- dateOfBirth: string;
115
- IDExpiryDate: string;
116
- IDType?: string | undefined;
117
- IDNumber?: string | undefined;
118
- };
119
-
120
- /** @internal */
121
- export const CustomerAttributes$outboundSchema: z.ZodType<
122
- CustomerAttributes$Outbound,
123
- z.ZodTypeDef,
124
- CustomerAttributes
125
- > = z.object({
126
- title: CustomerTitle$outboundSchema,
127
- firstName: z.string(),
128
- middleNames: z.string().optional(),
129
- lastName: z.string(),
130
- dateOfBirth: z.string(),
131
- idExpiryDate: z.string(),
132
- idType: IDType$outboundSchema.optional(),
133
- idNumber: z.string().optional(),
134
- }).transform((v) => {
135
- return remap$(v, {
136
- idExpiryDate: "IDExpiryDate",
137
- idType: "IDType",
138
- idNumber: "IDNumber",
139
- });
140
- });
141
-
142
- /**
143
- * @internal
144
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
145
- */
146
- export namespace CustomerAttributes$ {
147
- /** @deprecated use `CustomerAttributes$inboundSchema` instead. */
148
- export const inboundSchema = CustomerAttributes$inboundSchema;
149
- /** @deprecated use `CustomerAttributes$outboundSchema` instead. */
150
- export const outboundSchema = CustomerAttributes$outboundSchema;
151
- /** @deprecated use `CustomerAttributes$Outbound` instead. */
152
- export type Outbound = CustomerAttributes$Outbound;
153
- }
154
-
155
- export function customerAttributesToJSON(
156
- customerAttributes: CustomerAttributes,
157
- ): string {
158
- return JSON.stringify(
159
- CustomerAttributes$outboundSchema.parse(customerAttributes),
160
- );
161
- }
162
-
163
- export function customerAttributesFromJSON(
164
- jsonString: string,
165
- ): SafeParseResult<CustomerAttributes, SDKValidationError> {
166
- return safeParse(
167
- jsonString,
168
- (x) => CustomerAttributes$inboundSchema.parse(JSON.parse(x)),
169
- `Failed to parse 'CustomerAttributes' from JSON`,
170
- );
171
- }
@@ -1,35 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { ClosedEnum } from "../../types/enums.js";
7
-
8
- export const CustomerTitle = {
9
- Mr: "Mr",
10
- Ms: "Ms",
11
- Mrs: "Mrs",
12
- Miss: "Miss",
13
- } as const;
14
- export type CustomerTitle = ClosedEnum<typeof CustomerTitle>;
15
-
16
- /** @internal */
17
- export const CustomerTitle$inboundSchema: z.ZodNativeEnum<
18
- typeof CustomerTitle
19
- > = z.nativeEnum(CustomerTitle);
20
-
21
- /** @internal */
22
- export const CustomerTitle$outboundSchema: z.ZodNativeEnum<
23
- typeof CustomerTitle
24
- > = CustomerTitle$inboundSchema;
25
-
26
- /**
27
- * @internal
28
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
29
- */
30
- export namespace CustomerTitle$ {
31
- /** @deprecated use `CustomerTitle$inboundSchema` instead. */
32
- export const inboundSchema = CustomerTitle$inboundSchema;
33
- /** @deprecated use `CustomerTitle$outboundSchema` instead. */
34
- export const outboundSchema = CustomerTitle$outboundSchema;
35
- }