@financeable/aggregation 0.3.4 → 0.4.2
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 +119 -6
- package/README.md +1585 -568
- package/docs/sdks/applications/README.md +16 -14
- package/docs/sdks/financeable/README.md +0 -84
- package/docs/sdks/oauthtoken/README.md +90 -0
- package/funcs/applicationsCreate.d.ts +1 -1
- package/funcs/applicationsCreate.d.ts.map +1 -1
- package/funcs/applicationsCreate.js +1 -1
- package/funcs/applicationsCreate.js.map +1 -1
- package/funcs/applicationsGet.d.ts +1 -1
- package/funcs/applicationsGet.d.ts.map +1 -1
- package/funcs/applicationsGet.js +1 -1
- package/funcs/applicationsGet.js.map +1 -1
- package/funcs/applicationsList.d.ts +1 -1
- package/funcs/applicationsList.d.ts.map +1 -1
- package/funcs/applicationsList.js +1 -1
- package/funcs/applicationsList.js.map +1 -1
- package/funcs/{getToken.d.ts → oauthTokenOauthToken.d.ts} +2 -2
- package/funcs/oauthTokenOauthToken.d.ts.map +1 -0
- package/funcs/{getToken.js → oauthTokenOauthToken.js} +3 -3
- package/funcs/oauthTokenOauthToken.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +7 -7
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +4 -4
- package/lib/files.js.map +1 -1
- package/lib/primitives.d.ts +3 -0
- package/lib/primitives.d.ts.map +1 -1
- package/lib/primitives.js +7 -0
- package/lib/primitives.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +2 -8
- package/lib/sdks.js.map +1 -1
- package/models/components/assetattributes.d.ts +17 -94
- package/models/components/assetattributes.d.ts.map +1 -1
- package/models/components/assetattributes.js +27 -37
- package/models/components/assetattributes.js.map +1 -1
- package/models/components/commercialassettype.d.ts +44 -0
- package/models/components/commercialassettype.d.ts.map +1 -0
- package/models/components/commercialassettype.js +85 -0
- package/models/components/commercialassettype.js.map +1 -0
- package/models/components/consumerassettype.d.ts +32 -0
- package/models/components/consumerassettype.d.ts.map +1 -0
- package/models/components/consumerassettype.js +73 -0
- package/models/components/consumerassettype.js.map +1 -0
- package/models/components/customerattributes.d.ts +12 -2
- package/models/components/customerattributes.d.ts.map +1 -1
- package/models/components/customerattributes.js +4 -0
- package/models/components/customerattributes.js.map +1 -1
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/errors/index.d.ts +1 -3
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -3
- package/models/errors/index.js.map +1 -1
- package/models/errors/responsebody.d.ts +38 -0
- package/models/errors/responsebody.d.ts.map +1 -0
- package/models/errors/{getapplication.js → responsebody.js} +15 -15
- package/models/errors/responsebody.js.map +1 -0
- package/package.json +1 -1
- package/sdk/oauthtoken.d.ts +9 -0
- package/sdk/oauthtoken.d.ts.map +1 -0
- package/sdk/oauthtoken.js +19 -0
- package/sdk/oauthtoken.js.map +1 -0
- package/sdk/sdk.d.ts +4 -6
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +3 -7
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/applicationsCreate.ts +4 -4
- package/src/funcs/applicationsGet.ts +4 -4
- package/src/funcs/applicationsList.ts +4 -4
- package/src/funcs/{getToken.ts → oauthTokenOauthToken.ts} +1 -1
- package/src/lib/config.ts +7 -7
- package/src/lib/files.ts +1 -1
- package/src/lib/primitives.ts +14 -0
- package/src/lib/sdks.ts +2 -7
- package/src/models/components/assetattributes.ts +58 -47
- package/src/models/components/commercialassettype.ts +61 -0
- package/src/models/components/consumerassettype.ts +43 -0
- package/src/models/components/customerattributes.ts +16 -2
- package/src/models/components/index.ts +2 -0
- package/src/models/errors/index.ts +1 -3
- package/src/models/errors/{getapplication.ts → responsebody.ts} +20 -20
- package/src/sdk/oauthtoken.ts +24 -0
- package/src/sdk/sdk.ts +5 -16
- package/funcs/getToken.d.ts.map +0 -1
- package/funcs/getToken.js.map +0 -1
- package/models/errors/createapplication.d.ts +0 -38
- package/models/errors/createapplication.d.ts.map +0 -1
- package/models/errors/createapplication.js +0 -81
- package/models/errors/createapplication.js.map +0 -1
- package/models/errors/getapplication.d.ts +0 -38
- package/models/errors/getapplication.d.ts.map +0 -1
- package/models/errors/getapplication.js.map +0 -1
- package/models/errors/getapplications.d.ts +0 -38
- package/models/errors/getapplications.d.ts.map +0 -1
- package/models/errors/getapplications.js +0 -81
- package/models/errors/getapplications.js.map +0 -1
- package/src/models/errors/createapplication.ts +0 -76
- package/src/models/errors/getapplications.ts +0 -76
package/FUNCTIONS.md
CHANGED
|
@@ -20,7 +20,8 @@ specific category of applications.
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { FinanceableCore } from "@financeable/aggregation/core.js";
|
|
23
|
-
import {
|
|
23
|
+
import { applicationsCreate } from "@financeable/aggregation/funcs/applicationsCreate.js";
|
|
24
|
+
import { CommercialAssetType } from "@financeable/aggregation/models/components";
|
|
24
25
|
import { SDKValidationError } from "@financeable/aggregation/models/errors/sdkvalidationerror.js";
|
|
25
26
|
|
|
26
27
|
// Use `FinanceableCore` for best tree-shaking performance.
|
|
@@ -30,11 +31,123 @@ const financeable = new FinanceableCore({
|
|
|
30
31
|
});
|
|
31
32
|
|
|
32
33
|
async function run() {
|
|
33
|
-
const res = await
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const res = await applicationsCreate(financeable, {
|
|
35
|
+
data: {
|
|
36
|
+
type: "applications",
|
|
37
|
+
attributes: {
|
|
38
|
+
purpose: "Purchase of a motor vehicle",
|
|
39
|
+
applicationType: "consumer",
|
|
40
|
+
},
|
|
41
|
+
relationships: {
|
|
42
|
+
loanDetails: {
|
|
43
|
+
data: {
|
|
44
|
+
type: "loan-details",
|
|
45
|
+
attributes: {
|
|
46
|
+
repayments: 12,
|
|
47
|
+
repaymentFrequency: "monthly",
|
|
48
|
+
repaymentStructure: "group-payments",
|
|
49
|
+
loanAmount: "10280.95",
|
|
50
|
+
purpose: "Purchase of a motor vehicle",
|
|
51
|
+
term: 48,
|
|
52
|
+
balloon: 5,
|
|
53
|
+
deposit: "2500",
|
|
54
|
+
originationFee: 200,
|
|
55
|
+
rate: "0.15",
|
|
56
|
+
rateAdjustment: "-0.01",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
customers: {
|
|
61
|
+
data: [
|
|
62
|
+
{
|
|
63
|
+
type: "customers",
|
|
64
|
+
attributes: {
|
|
65
|
+
title: "Mr",
|
|
66
|
+
firstName: "John",
|
|
67
|
+
lastName: "Smith",
|
|
68
|
+
dateOfBirth: "01-01-1990",
|
|
69
|
+
idExpiryDate: "<value>",
|
|
70
|
+
},
|
|
71
|
+
relationships: {
|
|
72
|
+
addresses: {
|
|
73
|
+
data: [
|
|
74
|
+
{
|
|
75
|
+
type: "addresses",
|
|
76
|
+
attributes: {
|
|
77
|
+
addressType: "residential",
|
|
78
|
+
fullAddress: "42 Wallaby Way, Sydney NSW 2000",
|
|
79
|
+
city: "Sydney",
|
|
80
|
+
postCode: "2000",
|
|
81
|
+
streetAddress: "42 Wallaby Way",
|
|
82
|
+
addressLine2: "",
|
|
83
|
+
streetNumber: "42",
|
|
84
|
+
streetType: "Way",
|
|
85
|
+
street: "Wallaby",
|
|
86
|
+
state: "NSW",
|
|
87
|
+
country: "Australia",
|
|
88
|
+
status: "current",
|
|
89
|
+
monthsAt: 24,
|
|
90
|
+
yearsAt: 2,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "addresses",
|
|
95
|
+
attributes: {
|
|
96
|
+
addressType: "residential",
|
|
97
|
+
fullAddress: "42 Wallaby Way, Sydney NSW 2000",
|
|
98
|
+
city: "Sydney",
|
|
99
|
+
postCode: "2000",
|
|
100
|
+
streetAddress: "42 Wallaby Way",
|
|
101
|
+
addressLine2: "",
|
|
102
|
+
streetNumber: "42",
|
|
103
|
+
streetType: "Way",
|
|
104
|
+
street: "Wallaby",
|
|
105
|
+
state: "NSW",
|
|
106
|
+
country: "Australia",
|
|
107
|
+
status: "current",
|
|
108
|
+
monthsAt: 24,
|
|
109
|
+
yearsAt: 2,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
asset: {
|
|
119
|
+
data: {
|
|
120
|
+
type: "assets",
|
|
121
|
+
attributes: {
|
|
122
|
+
ageOfAsset: 3,
|
|
123
|
+
ageOfAssetAtEnd: 8,
|
|
124
|
+
condition: "USED",
|
|
125
|
+
assetType: CommercialAssetType.MotorVehicleLessThan45Tonnes,
|
|
126
|
+
purpose: "VEHICLE",
|
|
127
|
+
assetValue: "35000.00",
|
|
128
|
+
make: "Toyota",
|
|
129
|
+
assetModel: "Camry",
|
|
130
|
+
registrationNumber: "ABC123",
|
|
131
|
+
registrationState: "VIC",
|
|
132
|
+
vin: "1HGCM82633A123456",
|
|
133
|
+
supplierName: "Mr and Mrs Smith",
|
|
134
|
+
supplierABN: "12345678901",
|
|
135
|
+
supplierAddress: "123 Car Street, Melbourne VIC 3000",
|
|
136
|
+
supplierPhone: "0412345678",
|
|
137
|
+
supplierContactName: "John Smith",
|
|
138
|
+
supplierEmail: "john.smith@mrandmrssmith.com.au",
|
|
139
|
+
privateSale: false,
|
|
140
|
+
typeOfSale: "DEALER",
|
|
141
|
+
description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
|
|
142
|
+
netAssetValue: "32000.00",
|
|
143
|
+
isLuxury: false,
|
|
144
|
+
additionalFees: "995.00",
|
|
145
|
+
additionalTaxes: "0.00",
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
38
151
|
});
|
|
39
152
|
|
|
40
153
|
switch (true) {
|