@financeable/aggregation 0.8.3 → 0.9.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.
- package/FUNCTIONS.md +153 -36
- package/README.md +475 -94
- package/docs/sdks/applications/README.md +9 -15
- package/docs/sdks/oauthtoken/README.md +5 -9
- package/docs/sdks/supportingdocuments/README.md +9 -16
- package/funcs/applicationsCreate.d.ts +3 -3
- package/funcs/applicationsCreate.d.ts.map +1 -1
- package/funcs/applicationsCreate.js +4 -6
- package/funcs/applicationsCreate.js.map +1 -1
- package/funcs/oauthTokenGet.d.ts +3 -2
- package/funcs/oauthTokenGet.d.ts.map +1 -1
- package/funcs/oauthTokenGet.js +4 -2
- package/funcs/oauthTokenGet.js.map +1 -1
- package/funcs/supportingDocumentsCreate.d.ts +3 -3
- package/funcs/supportingDocumentsCreate.d.ts.map +1 -1
- package/funcs/supportingDocumentsCreate.js +5 -8
- package/funcs/supportingDocumentsCreate.js.map +1 -1
- package/hooks/types.d.ts +2 -0
- package/hooks/types.d.ts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +7 -3
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/files.d.ts +5 -0
- package/lib/files.d.ts.map +1 -1
- package/lib/files.js +41 -0
- package/lib/files.js.map +1 -1
- package/lib/matchers.d.ts +3 -10
- package/lib/matchers.d.ts.map +1 -1
- package/lib/matchers.js +33 -31
- package/lib/matchers.js.map +1 -1
- package/lib/sdks.d.ts +1 -0
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +3 -3
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts +2 -2
- package/lib/security.d.ts.map +1 -1
- package/models/components/addressattributes.d.ts +8 -8
- package/models/components/addressattributes.d.ts.map +1 -1
- package/models/components/addressattributes.js +14 -13
- package/models/components/addressattributes.js.map +1 -1
- package/models/components/badrequesterror.d.ts +24 -24
- package/models/components/badrequesterror.d.ts.map +1 -1
- package/models/components/badrequesterror.js +37 -38
- package/models/components/badrequesterror.js.map +1 -1
- package/models/components/commercialsecuredapplicationpayload.d.ts +8 -8
- package/models/components/commercialsecuredapplicationpayload.d.ts.map +1 -1
- package/models/components/commercialsecuredapplicationpayload.js +13 -14
- package/models/components/commercialsecuredapplicationpayload.js.map +1 -1
- package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts +90 -90
- package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts.map +1 -1
- package/models/components/commercialsecuredloancommercialapplicationrelationships.js +116 -118
- package/models/components/commercialsecuredloancommercialapplicationrelationships.js.map +1 -1
- package/models/components/customerattributes.d.ts +12 -1
- package/models/components/customerattributes.d.ts.map +1 -1
- package/models/components/customerattributes.js +5 -0
- package/models/components/customerattributes.js.map +1 -1
- package/models/components/forbiddenerror.d.ts +16 -16
- package/models/components/forbiddenerror.d.ts.map +1 -1
- package/models/components/forbiddenerror.js +25 -25
- package/models/components/forbiddenerror.js.map +1 -1
- package/models/components/loandetailsattributes.d.ts +8 -8
- package/models/components/loandetailsattributes.d.ts.map +1 -1
- package/models/components/loandetailsattributes.js +8 -8
- package/models/components/loandetailsattributes.js.map +1 -1
- package/models/components/supportingdocumentrelationships.d.ts +45 -45
- package/models/components/supportingdocumentrelationships.d.ts.map +1 -1
- package/models/components/supportingdocumentrelationships.js +54 -54
- package/models/components/supportingdocumentrelationships.js.map +1 -1
- package/models/components/supportingdocumentresource.d.ts +8 -8
- package/models/components/supportingdocumentresource.d.ts.map +1 -1
- package/models/components/supportingdocumentresource.js +13 -13
- package/models/components/supportingdocumentresource.js.map +1 -1
- package/models/errors/apierror.d.ts +8 -6
- package/models/errors/apierror.d.ts.map +1 -1
- package/models/errors/apierror.js +23 -10
- package/models/errors/apierror.js.map +1 -1
- package/models/errors/financeableerror.d.ts +19 -0
- package/models/errors/financeableerror.d.ts.map +1 -0
- package/models/errors/financeableerror.js +20 -0
- package/models/errors/financeableerror.js.map +1 -0
- package/models/errors/index.d.ts +1 -2
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -2
- package/models/errors/index.js.map +1 -1
- package/models/errors/responsevalidationerror.d.ts +26 -0
- package/models/errors/responsevalidationerror.d.ts.map +1 -0
- package/models/errors/responsevalidationerror.js +66 -0
- package/models/errors/responsevalidationerror.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +1 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/models/errors/sdkvalidationerror.js +14 -0
- package/models/errors/sdkvalidationerror.js.map +1 -1
- package/models/operations/createapplication.d.ts +107 -30
- package/models/operations/createapplication.d.ts.map +1 -1
- package/models/operations/createapplication.js +125 -44
- package/models/operations/createapplication.js.map +1 -1
- package/models/operations/supportingdocumentscreate.d.ts +144 -0
- package/models/operations/supportingdocumentscreate.d.ts.map +1 -1
- package/models/operations/supportingdocumentscreate.js +186 -1
- package/models/operations/supportingdocumentscreate.js.map +1 -1
- package/package.json +1 -1
- package/sdk/applications.d.ts +1 -1
- package/sdk/applications.d.ts.map +1 -1
- package/sdk/sdk.d.ts +2 -2
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +3 -3
- package/sdk/sdk.js.map +1 -1
- package/sdk/supportingdocuments.d.ts +1 -1
- package/sdk/supportingdocuments.d.ts.map +1 -1
- package/src/funcs/applicationsCreate.ts +30 -40
- package/src/funcs/oauthTokenGet.ts +24 -20
- package/src/funcs/supportingDocumentsCreate.ts +31 -42
- package/src/hooks/types.ts +2 -0
- package/src/index.ts +2 -0
- package/src/lib/config.ts +7 -3
- package/src/lib/files.ts +42 -0
- package/src/lib/matchers.ts +44 -41
- package/src/lib/sdks.ts +10 -4
- package/src/lib/security.ts +2 -2
- package/src/models/components/addressattributes.ts +14 -18
- package/src/models/components/badrequesterror.ts +48 -44
- package/src/models/components/commercialsecuredapplicationpayload.ts +15 -20
- package/src/models/components/commercialsecuredloancommercialapplicationrelationships.ts +178 -238
- package/src/models/components/customerattributes.ts +20 -1
- package/src/models/components/forbiddenerror.ts +30 -32
- package/src/models/components/loandetailsattributes.ts +16 -16
- package/src/models/components/supportingdocumentrelationships.ts +117 -82
- package/src/models/components/supportingdocumentresource.ts +18 -15
- package/src/models/errors/apierror.ts +29 -16
- package/src/models/errors/financeableerror.ts +35 -0
- package/src/models/errors/index.ts +1 -2
- package/src/models/errors/responsevalidationerror.ts +50 -0
- package/src/models/errors/sdkvalidationerror.ts +12 -0
- package/src/models/operations/createapplication.ts +299 -64
- package/src/models/operations/supportingdocumentscreate.ts +386 -0
- package/src/sdk/applications.ts +1 -1
- package/src/sdk/sdk.ts +7 -7
- package/src/sdk/supportingdocuments.ts +1 -1
- package/src/types/constdatetime.ts +1 -1
- package/types/constdatetime.js +1 -1
- package/models/errors/createapplication.d.ts +0 -73
- package/models/errors/createapplication.d.ts.map +0 -1
- package/models/errors/createapplication.js +0 -120
- package/models/errors/createapplication.js.map +0 -1
- package/models/errors/supportingdocumentscreate.d.ts +0 -143
- package/models/errors/supportingdocumentscreate.d.ts.map +0 -1
- package/models/errors/supportingdocumentscreate.js +0 -225
- package/models/errors/supportingdocumentscreate.js.map +0 -1
- package/src/models/errors/createapplication.ts +0 -149
- package/src/models/errors/supportingdocumentscreate.ts +0 -342
package/FUNCTIONS.md
CHANGED
|
@@ -20,8 +20,7 @@ specific category of applications.
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { FinanceableCore } from "@financeable/aggregation/core.js";
|
|
23
|
-
import {
|
|
24
|
-
import { SDKValidationError } from "@financeable/aggregation/models/errors/sdkvalidationerror.js";
|
|
23
|
+
import { applicationsCreate } from "@financeable/aggregation/funcs/applicationsCreate.js";
|
|
25
24
|
|
|
26
25
|
// Use `FinanceableCore` for best tree-shaking performance.
|
|
27
26
|
// You can create one instance of it to use across an application.
|
|
@@ -30,48 +29,166 @@ const financeable = new FinanceableCore({
|
|
|
30
29
|
});
|
|
31
30
|
|
|
32
31
|
async function run() {
|
|
33
|
-
const res = await
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
const res = await applicationsCreate(financeable, {
|
|
33
|
+
data: {
|
|
34
|
+
type: "entities",
|
|
35
|
+
attributes: {
|
|
36
|
+
applicationType: "consumerSecured",
|
|
37
|
+
associatedBrokerEmail: "<value>",
|
|
38
|
+
},
|
|
39
|
+
relationships: {
|
|
40
|
+
customers: {
|
|
41
|
+
data: [
|
|
42
|
+
{
|
|
43
|
+
type: "customers",
|
|
44
|
+
attributes: {
|
|
45
|
+
title: "Mr",
|
|
46
|
+
firstName: "Courtney",
|
|
47
|
+
lastName: "Greenfelder",
|
|
48
|
+
dateOfBirth: "1981-06-22",
|
|
49
|
+
idExpiryDate: "<value>",
|
|
50
|
+
},
|
|
51
|
+
relationships: {
|
|
52
|
+
addresses: {
|
|
53
|
+
data: [
|
|
54
|
+
{
|
|
55
|
+
type: "addresses",
|
|
56
|
+
attributes: {
|
|
57
|
+
id: "12345678901",
|
|
58
|
+
addressType: "residential",
|
|
59
|
+
fullAddress: "42 Wallaby Way, Sydney NSW 2000",
|
|
60
|
+
city: "Sydney",
|
|
61
|
+
postCode: "2000",
|
|
62
|
+
streetAddress: "42 Wallaby Way",
|
|
63
|
+
addressLine2: "",
|
|
64
|
+
streetNumber: "42",
|
|
65
|
+
streetType: "Way",
|
|
66
|
+
street: "Wallaby",
|
|
67
|
+
state: "NSW",
|
|
68
|
+
country: "Australia",
|
|
69
|
+
status: "current",
|
|
70
|
+
monthsAt: 24,
|
|
71
|
+
yearsAt: 2,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: "customers",
|
|
80
|
+
attributes: {
|
|
81
|
+
title: "Mr",
|
|
82
|
+
firstName: "Courtney",
|
|
83
|
+
lastName: "Greenfelder",
|
|
84
|
+
dateOfBirth: "1981-06-22",
|
|
85
|
+
idExpiryDate: "<value>",
|
|
86
|
+
},
|
|
87
|
+
relationships: {
|
|
88
|
+
addresses: {
|
|
89
|
+
data: [
|
|
90
|
+
{
|
|
91
|
+
type: "addresses",
|
|
92
|
+
attributes: {
|
|
93
|
+
id: "12345678901",
|
|
94
|
+
addressType: "residential",
|
|
95
|
+
fullAddress: "42 Wallaby Way, Sydney NSW 2000",
|
|
96
|
+
city: "Sydney",
|
|
97
|
+
postCode: "2000",
|
|
98
|
+
streetAddress: "42 Wallaby Way",
|
|
99
|
+
addressLine2: "",
|
|
100
|
+
streetNumber: "42",
|
|
101
|
+
streetType: "Way",
|
|
102
|
+
street: "Wallaby",
|
|
103
|
+
state: "NSW",
|
|
104
|
+
country: "Australia",
|
|
105
|
+
status: "current",
|
|
106
|
+
monthsAt: 24,
|
|
107
|
+
yearsAt: 2,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: "customers",
|
|
116
|
+
attributes: {
|
|
117
|
+
title: "Mr",
|
|
118
|
+
firstName: "Courtney",
|
|
119
|
+
lastName: "Greenfelder",
|
|
120
|
+
dateOfBirth: "1981-06-22",
|
|
121
|
+
idExpiryDate: "<value>",
|
|
122
|
+
},
|
|
123
|
+
relationships: {
|
|
124
|
+
addresses: {
|
|
125
|
+
data: [
|
|
126
|
+
{
|
|
127
|
+
type: "addresses",
|
|
128
|
+
attributes: {
|
|
129
|
+
id: "12345678901",
|
|
130
|
+
addressType: "residential",
|
|
131
|
+
fullAddress: "42 Wallaby Way, Sydney NSW 2000",
|
|
132
|
+
city: "Sydney",
|
|
133
|
+
postCode: "2000",
|
|
134
|
+
streetAddress: "42 Wallaby Way",
|
|
135
|
+
addressLine2: "",
|
|
136
|
+
streetNumber: "42",
|
|
137
|
+
streetType: "Way",
|
|
138
|
+
street: "Wallaby",
|
|
139
|
+
state: "NSW",
|
|
140
|
+
country: "Australia",
|
|
141
|
+
status: "current",
|
|
142
|
+
monthsAt: 24,
|
|
143
|
+
yearsAt: 2,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
],
|
|
41
151
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
id: "
|
|
152
|
+
asset: {
|
|
153
|
+
data: {
|
|
154
|
+
type: "assets",
|
|
155
|
+
attributes: {
|
|
156
|
+
id: "12345678901",
|
|
157
|
+
ageOfAsset: 3,
|
|
158
|
+
ageOfAssetAtEnd: 8,
|
|
159
|
+
condition: "USED",
|
|
160
|
+
assetType: "CARAVAN",
|
|
161
|
+
assetValue: "35000.00",
|
|
162
|
+
make: "Toyota",
|
|
163
|
+
assetModel: "Camry",
|
|
164
|
+
registrationNumber: "ABC123",
|
|
165
|
+
registrationState: "VIC",
|
|
166
|
+
vin: "1HGCM82633A123456",
|
|
167
|
+
supplierName: "Mr and Mrs Smith",
|
|
168
|
+
supplierABN: "12345678901",
|
|
169
|
+
supplierAddress: "123 Car Street, Melbourne VIC 3000",
|
|
170
|
+
supplierPhone: "0412345678",
|
|
171
|
+
supplierContactName: "John Smith",
|
|
172
|
+
supplierEmail: "john.smith@mrandmrssmith.com.au",
|
|
173
|
+
privateSale: false,
|
|
174
|
+
typeOfSale: "AUTHORISED_SELLER",
|
|
175
|
+
description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
|
|
176
|
+
netAssetValue: "32000.00",
|
|
177
|
+
isLuxury: false,
|
|
178
|
+
additionalFees: "995.00",
|
|
179
|
+
additionalTaxes: "0.00",
|
|
47
180
|
},
|
|
48
181
|
},
|
|
49
182
|
},
|
|
50
183
|
},
|
|
51
184
|
},
|
|
52
185
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
case res.error instanceof SDKValidationError:
|
|
59
|
-
// Pretty-print validation errors.
|
|
60
|
-
return console.log(res.error.pretty());
|
|
61
|
-
case res.error instanceof Error:
|
|
62
|
-
return console.log(res.error);
|
|
63
|
-
default:
|
|
64
|
-
// TypeScript's type checking will fail on the following line if the above
|
|
65
|
-
// cases were not exhaustive.
|
|
66
|
-
res.error satisfies never;
|
|
67
|
-
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
|
|
186
|
+
if (res.ok) {
|
|
187
|
+
const { value: result } = res;
|
|
188
|
+
console.log(result);
|
|
189
|
+
} else {
|
|
190
|
+
console.log("applicationsCreate failed:", res.error);
|
|
68
191
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const { value: result } = res;
|
|
72
|
-
|
|
73
|
-
// Handle the result
|
|
74
|
-
console.log(result);
|
|
75
192
|
}
|
|
76
193
|
|
|
77
194
|
run();
|