@financeable/aggregation 0.9.1 → 0.10.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 (67) hide show
  1. package/docs/sdks/applications/README.md +1 -0
  2. package/docs/sdks/oauthtoken/README.md +1 -0
  3. package/docs/sdks/supportingdocuments/README.md +1 -0
  4. package/examples/README.md +31 -0
  5. package/examples/applicationsCreate.example.ts +179 -0
  6. package/examples/package-lock.json +610 -0
  7. package/examples/package.json +18 -0
  8. package/jsr.json +1 -1
  9. package/lib/config.d.ts +3 -3
  10. package/lib/config.js +3 -3
  11. package/lib/config.js.map +1 -1
  12. package/lib/encodings.d.ts.map +1 -1
  13. package/lib/security.d.ts.map +1 -1
  14. package/lib/security.js.map +1 -1
  15. package/models/components/addressattributes.d.ts +24 -24
  16. package/models/components/addressattributes.d.ts.map +1 -1
  17. package/models/components/addressattributes.js +24 -24
  18. package/models/components/addressattributes.js.map +1 -1
  19. package/models/components/commercialsecuredloanassetattributes.d.ts +8 -8
  20. package/models/components/commercialsecuredloanassetattributes.d.ts.map +1 -1
  21. package/models/components/commercialsecuredloanassetattributes.js +10 -8
  22. package/models/components/commercialsecuredloanassetattributes.js.map +1 -1
  23. package/models/components/consumersecuredloanassetattributes.d.ts +20 -20
  24. package/models/components/consumersecuredloanassetattributes.d.ts.map +1 -1
  25. package/models/components/consumersecuredloanassetattributes.js +25 -23
  26. package/models/components/consumersecuredloanassetattributes.js.map +1 -1
  27. package/models/components/customerassetattributes.d.ts +2 -2
  28. package/models/components/customerassetattributes.d.ts.map +1 -1
  29. package/models/components/customerassetattributes.js +2 -2
  30. package/models/components/customerassetattributes.js.map +1 -1
  31. package/models/components/customerattributes.d.ts +10 -10
  32. package/models/components/customerattributes.d.ts.map +1 -1
  33. package/models/components/customerattributes.js +10 -10
  34. package/models/components/customerattributes.js.map +1 -1
  35. package/models/components/customerliabilityattributes.d.ts +2 -2
  36. package/models/components/customerliabilityattributes.d.ts.map +1 -1
  37. package/models/components/customerliabilityattributes.js +2 -2
  38. package/models/components/customerliabilityattributes.js.map +1 -1
  39. package/models/components/entityattributes.d.ts +4 -4
  40. package/models/components/entityattributes.d.ts.map +1 -1
  41. package/models/components/entityattributes.js +4 -4
  42. package/models/components/entityattributes.js.map +1 -1
  43. package/models/components/expenseattributes.d.ts +2 -2
  44. package/models/components/expenseattributes.d.ts.map +1 -1
  45. package/models/components/expenseattributes.js +2 -2
  46. package/models/components/expenseattributes.js.map +1 -1
  47. package/models/components/incomeattributes.d.ts +2 -2
  48. package/models/components/incomeattributes.d.ts.map +1 -1
  49. package/models/components/incomeattributes.js +2 -2
  50. package/models/components/incomeattributes.js.map +1 -1
  51. package/models/components/loandetailsattributes.d.ts +27 -3
  52. package/models/components/loandetailsattributes.d.ts.map +1 -1
  53. package/models/components/loandetailsattributes.js +26 -3
  54. package/models/components/loandetailsattributes.js.map +1 -1
  55. package/package.json +5 -6
  56. package/src/lib/config.ts +3 -3
  57. package/src/lib/security.ts +4 -1
  58. package/src/models/components/addressattributes.ts +48 -48
  59. package/src/models/components/commercialsecuredloanassetattributes.ts +18 -16
  60. package/src/models/components/consumersecuredloanassetattributes.ts +45 -43
  61. package/src/models/components/customerassetattributes.ts +4 -4
  62. package/src/models/components/customerattributes.ts +20 -20
  63. package/src/models/components/customerliabilityattributes.ts +4 -4
  64. package/src/models/components/entityattributes.ts +8 -8
  65. package/src/models/components/expenseattributes.ts +4 -4
  66. package/src/models/components/incomeattributes.ts +4 -4
  67. package/src/models/components/loandetailsattributes.ts +54 -5
@@ -51,11 +51,11 @@ export type CustomerAttributes = {
51
51
  /**
52
52
  * Title of the customer
53
53
  */
54
- title: CustomerTitle;
54
+ title?: CustomerTitle | undefined;
55
55
  /**
56
56
  * First name of the customer
57
57
  */
58
- firstName: string;
58
+ firstName?: string | undefined;
59
59
  /**
60
60
  * Middle names of the customer
61
61
  */
@@ -63,15 +63,15 @@ export type CustomerAttributes = {
63
63
  /**
64
64
  * Last name of the customer
65
65
  */
66
- lastName: string;
66
+ lastName?: string | undefined;
67
67
  /**
68
68
  * Date of birth in format YYYY-MM-DD
69
69
  */
70
- dateOfBirth: string;
70
+ dateOfBirth?: string | undefined;
71
71
  /**
72
72
  * Date of expiry of the ID in format YYYY-MM-DD
73
73
  */
74
- idExpiryDate: string;
74
+ idExpiryDate?: string | undefined;
75
75
  /**
76
76
  * Type of ID, either drivers' license or passport
77
77
  */
@@ -113,12 +113,12 @@ export const CustomerAttributes$inboundSchema: z.ZodType<
113
113
  unknown
114
114
  > = z.object({
115
115
  id: z.string().optional(),
116
- title: CustomerTitle$inboundSchema,
117
- firstName: z.string(),
116
+ title: CustomerTitle$inboundSchema.optional(),
117
+ firstName: z.string().optional(),
118
118
  middleNames: z.string().optional(),
119
- lastName: z.string(),
120
- dateOfBirth: z.string(),
121
- idExpiryDate: z.string(),
119
+ lastName: z.string().optional(),
120
+ dateOfBirth: z.string().optional(),
121
+ idExpiryDate: z.string().optional(),
122
122
  idType: CustomerIDType$inboundSchema.optional(),
123
123
  idState: AustralianStatesAndTerritories$inboundSchema.optional(),
124
124
  idNumber: z.string().optional(),
@@ -135,12 +135,12 @@ export const CustomerAttributes$inboundSchema: z.ZodType<
135
135
  /** @internal */
136
136
  export type CustomerAttributes$Outbound = {
137
137
  id?: string | undefined;
138
- title: string;
139
- firstName: string;
138
+ title?: string | undefined;
139
+ firstName?: string | undefined;
140
140
  middleNames?: string | undefined;
141
- lastName: string;
142
- dateOfBirth: string;
143
- idExpiryDate: string;
141
+ lastName?: string | undefined;
142
+ dateOfBirth?: string | undefined;
143
+ idExpiryDate?: string | undefined;
144
144
  idType?: string | undefined;
145
145
  idState?: string | undefined;
146
146
  idNumber?: string | undefined;
@@ -161,12 +161,12 @@ export const CustomerAttributes$outboundSchema: z.ZodType<
161
161
  CustomerAttributes
162
162
  > = z.object({
163
163
  id: z.string().optional(),
164
- title: CustomerTitle$outboundSchema,
165
- firstName: z.string(),
164
+ title: CustomerTitle$outboundSchema.optional(),
165
+ firstName: z.string().optional(),
166
166
  middleNames: z.string().optional(),
167
- lastName: z.string(),
168
- dateOfBirth: z.string(),
169
- idExpiryDate: z.string(),
167
+ lastName: z.string().optional(),
168
+ dateOfBirth: z.string().optional(),
169
+ idExpiryDate: z.string().optional(),
170
170
  idType: CustomerIDType$outboundSchema.optional(),
171
171
  idState: AustralianStatesAndTerritories$outboundSchema.optional(),
172
172
  idNumber: z.string().optional(),
@@ -25,7 +25,7 @@ import {
25
25
 
26
26
  export type CustomerLiabilityAttributes = {
27
27
  id?: string | undefined;
28
- liabilityType: CustomerLiabilityType;
28
+ liabilityType?: CustomerLiabilityType | undefined;
29
29
  outstandingAmount?: MonetaryQuantity | undefined;
30
30
  limit?: MonetaryQuantity | undefined;
31
31
  financier?: string | undefined;
@@ -41,7 +41,7 @@ export const CustomerLiabilityAttributes$inboundSchema: z.ZodType<
41
41
  unknown
42
42
  > = z.object({
43
43
  id: z.string().optional(),
44
- liabilityType: CustomerLiabilityType$inboundSchema,
44
+ liabilityType: CustomerLiabilityType$inboundSchema.optional(),
45
45
  outstandingAmount: MonetaryQuantity$inboundSchema.optional(),
46
46
  limit: MonetaryQuantity$inboundSchema.optional(),
47
47
  financier: z.string().optional(),
@@ -54,7 +54,7 @@ export const CustomerLiabilityAttributes$inboundSchema: z.ZodType<
54
54
  /** @internal */
55
55
  export type CustomerLiabilityAttributes$Outbound = {
56
56
  id?: string | undefined;
57
- liabilityType: string;
57
+ liabilityType?: string | undefined;
58
58
  outstandingAmount?: MonetaryQuantity$Outbound | undefined;
59
59
  limit?: MonetaryQuantity$Outbound | undefined;
60
60
  financier?: string | undefined;
@@ -70,7 +70,7 @@ export const CustomerLiabilityAttributes$outboundSchema: z.ZodType<
70
70
  CustomerLiabilityAttributes
71
71
  > = z.object({
72
72
  id: z.string().optional(),
73
- liabilityType: CustomerLiabilityType$outboundSchema,
73
+ liabilityType: CustomerLiabilityType$outboundSchema.optional(),
74
74
  outstandingAmount: MonetaryQuantity$outboundSchema.optional(),
75
75
  limit: MonetaryQuantity$outboundSchema.optional(),
76
76
  financier: z.string().optional(),
@@ -9,8 +9,8 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  export type EntityAttributes = {
11
11
  id?: string | undefined;
12
- entityName: string;
13
- abn: string;
12
+ entityName?: string | undefined;
13
+ abn?: string | undefined;
14
14
  turnover?: number | undefined;
15
15
  industryType?: string | undefined;
16
16
  emails?: Array<string> | undefined;
@@ -24,8 +24,8 @@ export const EntityAttributes$inboundSchema: z.ZodType<
24
24
  unknown
25
25
  > = z.object({
26
26
  id: z.string().optional(),
27
- entityName: z.string(),
28
- abn: z.string(),
27
+ entityName: z.string().optional(),
28
+ abn: z.string().optional(),
29
29
  turnover: z.number().int().optional(),
30
30
  industryType: z.string().optional(),
31
31
  emails: z.array(z.string()).optional(),
@@ -35,8 +35,8 @@ export const EntityAttributes$inboundSchema: z.ZodType<
35
35
  /** @internal */
36
36
  export type EntityAttributes$Outbound = {
37
37
  id?: string | undefined;
38
- entityName: string;
39
- abn: string;
38
+ entityName?: string | undefined;
39
+ abn?: string | undefined;
40
40
  turnover?: number | undefined;
41
41
  industryType?: string | undefined;
42
42
  emails?: Array<string> | undefined;
@@ -50,8 +50,8 @@ export const EntityAttributes$outboundSchema: z.ZodType<
50
50
  EntityAttributes
51
51
  > = z.object({
52
52
  id: z.string().optional(),
53
- entityName: z.string(),
54
- abn: z.string(),
53
+ entityName: z.string().optional(),
54
+ abn: z.string().optional(),
55
55
  turnover: z.number().int().optional(),
56
56
  industryType: z.string().optional(),
57
57
  emails: z.array(z.string()).optional(),
@@ -25,7 +25,7 @@ import {
25
25
 
26
26
  export type ExpenseAttributes = {
27
27
  id?: string | undefined;
28
- expenseType: ExpenseType;
28
+ expenseType?: ExpenseType | undefined;
29
29
  frequency?: ExpenseFrequency | undefined;
30
30
  amount?: MonetaryQuantity | undefined;
31
31
  };
@@ -37,7 +37,7 @@ export const ExpenseAttributes$inboundSchema: z.ZodType<
37
37
  unknown
38
38
  > = z.object({
39
39
  id: z.string().optional(),
40
- expenseType: ExpenseType$inboundSchema,
40
+ expenseType: ExpenseType$inboundSchema.optional(),
41
41
  frequency: ExpenseFrequency$inboundSchema.optional(),
42
42
  amount: MonetaryQuantity$inboundSchema.optional(),
43
43
  });
@@ -45,7 +45,7 @@ export const ExpenseAttributes$inboundSchema: z.ZodType<
45
45
  /** @internal */
46
46
  export type ExpenseAttributes$Outbound = {
47
47
  id?: string | undefined;
48
- expenseType: string;
48
+ expenseType?: string | undefined;
49
49
  frequency?: string | undefined;
50
50
  amount?: MonetaryQuantity$Outbound | undefined;
51
51
  };
@@ -57,7 +57,7 @@ export const ExpenseAttributes$outboundSchema: z.ZodType<
57
57
  ExpenseAttributes
58
58
  > = z.object({
59
59
  id: z.string().optional(),
60
- expenseType: ExpenseType$outboundSchema,
60
+ expenseType: ExpenseType$outboundSchema.optional(),
61
61
  frequency: ExpenseFrequency$outboundSchema.optional(),
62
62
  amount: MonetaryQuantity$outboundSchema.optional(),
63
63
  });
@@ -25,7 +25,7 @@ import {
25
25
 
26
26
  export type IncomeAttributes = {
27
27
  id?: string | undefined;
28
- incomeType: IncomeType;
28
+ incomeType?: IncomeType | undefined;
29
29
  frequency?: IncomeFrequency | undefined;
30
30
  amount?: MonetaryQuantity | undefined;
31
31
  };
@@ -37,7 +37,7 @@ export const IncomeAttributes$inboundSchema: z.ZodType<
37
37
  unknown
38
38
  > = z.object({
39
39
  id: z.string().optional(),
40
- incomeType: IncomeType$inboundSchema,
40
+ incomeType: IncomeType$inboundSchema.optional(),
41
41
  frequency: IncomeFrequency$inboundSchema.optional(),
42
42
  amount: MonetaryQuantity$inboundSchema.optional(),
43
43
  });
@@ -45,7 +45,7 @@ export const IncomeAttributes$inboundSchema: z.ZodType<
45
45
  /** @internal */
46
46
  export type IncomeAttributes$Outbound = {
47
47
  id?: string | undefined;
48
- incomeType: string;
48
+ incomeType?: string | undefined;
49
49
  frequency?: string | undefined;
50
50
  amount?: MonetaryQuantity$Outbound | undefined;
51
51
  };
@@ -57,7 +57,7 @@ export const IncomeAttributes$outboundSchema: z.ZodType<
57
57
  IncomeAttributes
58
58
  > = z.object({
59
59
  id: z.string().optional(),
60
- incomeType: IncomeType$outboundSchema,
60
+ incomeType: IncomeType$outboundSchema.optional(),
61
61
  frequency: IncomeFrequency$outboundSchema.optional(),
62
62
  amount: MonetaryQuantity$outboundSchema.optional(),
63
63
  });
@@ -29,6 +29,11 @@ import {
29
29
  RepaymentStructure$outboundSchema,
30
30
  } from "./repaymentstructure.js";
31
31
 
32
+ /**
33
+ * Repayment amount as either MonetaryQuantity model (preferred) or floating point dollars (string). The latter will be deprecated.
34
+ */
35
+ export type Repayments = MonetaryQuantity | string;
36
+
32
37
  /**
33
38
  * Total loan amount, either MonetaryQuantity model (preferred) or floating point dollars as string. The latter will be deprecated.
34
39
  */
@@ -80,9 +85,9 @@ export type RateAdjustment = PercentageQuantity | string;
80
85
  export type LoanDetailsAttributes = {
81
86
  id?: string | undefined;
82
87
  /**
83
- * Number of repayments as integer
88
+ * Repayment amount as either MonetaryQuantity model (preferred) or floating point dollars (string). The latter will be deprecated.
84
89
  */
85
- repayments?: number | undefined;
90
+ repayments?: MonetaryQuantity | string | undefined;
86
91
  /**
87
92
  * Frequency of repayments
88
93
  */
@@ -149,6 +154,50 @@ export type LoanDetailsAttributes = {
149
154
  rateAdjustment?: PercentageQuantity | string | undefined;
150
155
  };
151
156
 
157
+ /** @internal */
158
+ export const Repayments$inboundSchema: z.ZodType<
159
+ Repayments,
160
+ z.ZodTypeDef,
161
+ unknown
162
+ > = z.union([MonetaryQuantity$inboundSchema, z.string()]);
163
+
164
+ /** @internal */
165
+ export type Repayments$Outbound = MonetaryQuantity$Outbound | string;
166
+
167
+ /** @internal */
168
+ export const Repayments$outboundSchema: z.ZodType<
169
+ Repayments$Outbound,
170
+ z.ZodTypeDef,
171
+ Repayments
172
+ > = z.union([MonetaryQuantity$outboundSchema, z.string()]);
173
+
174
+ /**
175
+ * @internal
176
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
177
+ */
178
+ export namespace Repayments$ {
179
+ /** @deprecated use `Repayments$inboundSchema` instead. */
180
+ export const inboundSchema = Repayments$inboundSchema;
181
+ /** @deprecated use `Repayments$outboundSchema` instead. */
182
+ export const outboundSchema = Repayments$outboundSchema;
183
+ /** @deprecated use `Repayments$Outbound` instead. */
184
+ export type Outbound = Repayments$Outbound;
185
+ }
186
+
187
+ export function repaymentsToJSON(repayments: Repayments): string {
188
+ return JSON.stringify(Repayments$outboundSchema.parse(repayments));
189
+ }
190
+
191
+ export function repaymentsFromJSON(
192
+ jsonString: string,
193
+ ): SafeParseResult<Repayments, SDKValidationError> {
194
+ return safeParse(
195
+ jsonString,
196
+ (x) => Repayments$inboundSchema.parse(JSON.parse(x)),
197
+ `Failed to parse 'Repayments' from JSON`,
198
+ );
199
+ }
200
+
152
201
  /** @internal */
153
202
  export const LoanAmount$inboundSchema: z.ZodType<
154
203
  LoanAmount,
@@ -556,7 +605,7 @@ export const LoanDetailsAttributes$inboundSchema: z.ZodType<
556
605
  unknown
557
606
  > = z.object({
558
607
  id: z.string().optional(),
559
- repayments: z.number().int().optional(),
608
+ repayments: z.union([MonetaryQuantity$inboundSchema, z.string()]).optional(),
560
609
  repaymentFrequency: FrequencyType$inboundSchema.optional(),
561
610
  repaymentStructure: RepaymentStructure$inboundSchema.optional(),
562
611
  loanAmount: z.union([MonetaryQuantity$inboundSchema, z.string()]).optional(),
@@ -587,7 +636,7 @@ export const LoanDetailsAttributes$inboundSchema: z.ZodType<
587
636
  /** @internal */
588
637
  export type LoanDetailsAttributes$Outbound = {
589
638
  id?: string | undefined;
590
- repayments?: number | undefined;
639
+ repayments?: MonetaryQuantity$Outbound | string | undefined;
591
640
  repaymentFrequency?: string | undefined;
592
641
  repaymentStructure?: string | undefined;
593
642
  loanAmount?: MonetaryQuantity$Outbound | string | undefined;
@@ -620,7 +669,7 @@ export const LoanDetailsAttributes$outboundSchema: z.ZodType<
620
669
  LoanDetailsAttributes
621
670
  > = z.object({
622
671
  id: z.string().optional(),
623
- repayments: z.number().int().optional(),
672
+ repayments: z.union([MonetaryQuantity$outboundSchema, z.string()]).optional(),
624
673
  repaymentFrequency: FrequencyType$outboundSchema.optional(),
625
674
  repaymentStructure: RepaymentStructure$outboundSchema.optional(),
626
675
  loanAmount: z.union([MonetaryQuantity$outboundSchema, z.string()]).optional(),