@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.
- package/docs/sdks/applications/README.md +1 -0
- package/docs/sdks/oauthtoken/README.md +1 -0
- package/docs/sdks/supportingdocuments/README.md +1 -0
- package/examples/README.md +31 -0
- package/examples/applicationsCreate.example.ts +179 -0
- package/examples/package-lock.json +610 -0
- package/examples/package.json +18 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/encodings.d.ts.map +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js.map +1 -1
- package/models/components/addressattributes.d.ts +24 -24
- package/models/components/addressattributes.d.ts.map +1 -1
- package/models/components/addressattributes.js +24 -24
- package/models/components/addressattributes.js.map +1 -1
- package/models/components/commercialsecuredloanassetattributes.d.ts +8 -8
- package/models/components/commercialsecuredloanassetattributes.d.ts.map +1 -1
- package/models/components/commercialsecuredloanassetattributes.js +10 -8
- package/models/components/commercialsecuredloanassetattributes.js.map +1 -1
- package/models/components/consumersecuredloanassetattributes.d.ts +20 -20
- package/models/components/consumersecuredloanassetattributes.d.ts.map +1 -1
- package/models/components/consumersecuredloanassetattributes.js +25 -23
- package/models/components/consumersecuredloanassetattributes.js.map +1 -1
- package/models/components/customerassetattributes.d.ts +2 -2
- package/models/components/customerassetattributes.d.ts.map +1 -1
- package/models/components/customerassetattributes.js +2 -2
- package/models/components/customerassetattributes.js.map +1 -1
- package/models/components/customerattributes.d.ts +10 -10
- package/models/components/customerattributes.d.ts.map +1 -1
- package/models/components/customerattributes.js +10 -10
- package/models/components/customerattributes.js.map +1 -1
- package/models/components/customerliabilityattributes.d.ts +2 -2
- package/models/components/customerliabilityattributes.d.ts.map +1 -1
- package/models/components/customerliabilityattributes.js +2 -2
- package/models/components/customerliabilityattributes.js.map +1 -1
- package/models/components/entityattributes.d.ts +4 -4
- package/models/components/entityattributes.d.ts.map +1 -1
- package/models/components/entityattributes.js +4 -4
- package/models/components/entityattributes.js.map +1 -1
- package/models/components/expenseattributes.d.ts +2 -2
- package/models/components/expenseattributes.d.ts.map +1 -1
- package/models/components/expenseattributes.js +2 -2
- package/models/components/expenseattributes.js.map +1 -1
- package/models/components/incomeattributes.d.ts +2 -2
- package/models/components/incomeattributes.d.ts.map +1 -1
- package/models/components/incomeattributes.js +2 -2
- package/models/components/incomeattributes.js.map +1 -1
- package/models/components/loandetailsattributes.d.ts +27 -3
- package/models/components/loandetailsattributes.d.ts.map +1 -1
- package/models/components/loandetailsattributes.js +26 -3
- package/models/components/loandetailsattributes.js.map +1 -1
- package/package.json +5 -6
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +4 -1
- package/src/models/components/addressattributes.ts +48 -48
- package/src/models/components/commercialsecuredloanassetattributes.ts +18 -16
- package/src/models/components/consumersecuredloanassetattributes.ts +45 -43
- package/src/models/components/customerassetattributes.ts +4 -4
- package/src/models/components/customerattributes.ts +20 -20
- package/src/models/components/customerliabilityattributes.ts +4 -4
- package/src/models/components/entityattributes.ts +8 -8
- package/src/models/components/expenseattributes.ts +4 -4
- package/src/models/components/incomeattributes.ts +4 -4
- package/src/models/components/loandetailsattributes.ts +54 -5
|
@@ -13,6 +13,7 @@ Create an application in the Financeable platform.
|
|
|
13
13
|
|
|
14
14
|
### Example Usage
|
|
15
15
|
|
|
16
|
+
<!-- UsageSnippet language="typescript" operationID="createApplication" method="post" path="/applications" -->
|
|
16
17
|
```typescript
|
|
17
18
|
import { Financeable } from "@financeable/aggregation";
|
|
18
19
|
|
|
@@ -13,6 +13,7 @@ Create a supporting document record in Financeable, and returns a pre-signed URL
|
|
|
13
13
|
|
|
14
14
|
### Example Usage
|
|
15
15
|
|
|
16
|
+
<!-- UsageSnippet language="typescript" operationID="SupportingDocuments_create" method="post" path="/supporting-documents" -->
|
|
16
17
|
```typescript
|
|
17
18
|
import { Financeable } from "@financeable/aggregation";
|
|
18
19
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @financeable/aggregation Examples
|
|
2
|
+
|
|
3
|
+
This directory contains example scripts demonstrating how to use the @financeable/aggregation SDK.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js (v18 or higher)
|
|
8
|
+
- npm
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
1. Copy `.env.template` to `.env`:
|
|
13
|
+
```bash
|
|
14
|
+
cp .env.template .env
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Edit `.env` and add your actual credentials (API keys, tokens, etc.)
|
|
18
|
+
|
|
19
|
+
## Running the Examples
|
|
20
|
+
|
|
21
|
+
To run an example file from the examples directory:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run build && npx tsx example.ts
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Creating new examples
|
|
28
|
+
|
|
29
|
+
Duplicate an existing example file, they won't be overwritten by the generation process.
|
|
30
|
+
|
|
31
|
+
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import dotenv from "dotenv";
|
|
6
|
+
dotenv.config();
|
|
7
|
+
/**
|
|
8
|
+
* Example usage of the @financeable/aggregation SDK
|
|
9
|
+
*
|
|
10
|
+
* To run this example from the examples directory:
|
|
11
|
+
* npm run build && npx tsx applicationsCreate.example.ts
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { Financeable } from "@financeable/aggregation";
|
|
15
|
+
|
|
16
|
+
const financeable = new Financeable({
|
|
17
|
+
clientCredentials: process.env["FINANCEABLE_CLIENT_CREDENTIALS"] ?? "",
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
async function main() {
|
|
21
|
+
const result = await financeable.create({
|
|
22
|
+
data: {
|
|
23
|
+
type: "entities",
|
|
24
|
+
attributes: {
|
|
25
|
+
applicationType: "consumerSecured",
|
|
26
|
+
associatedBrokerEmail: "<value>",
|
|
27
|
+
},
|
|
28
|
+
relationships: {
|
|
29
|
+
customers: {
|
|
30
|
+
data: [
|
|
31
|
+
{
|
|
32
|
+
type: "customers",
|
|
33
|
+
attributes: {
|
|
34
|
+
title: "Mr",
|
|
35
|
+
firstName: "Courtney",
|
|
36
|
+
lastName: "Greenfelder",
|
|
37
|
+
dateOfBirth: "1981-06-22",
|
|
38
|
+
idExpiryDate: "<value>",
|
|
39
|
+
},
|
|
40
|
+
relationships: {
|
|
41
|
+
addresses: {
|
|
42
|
+
data: [
|
|
43
|
+
{
|
|
44
|
+
type: "addresses",
|
|
45
|
+
attributes: {
|
|
46
|
+
id: "12345678901",
|
|
47
|
+
addressType: "residential",
|
|
48
|
+
fullAddress: "42 Wallaby Way, Sydney NSW 2000",
|
|
49
|
+
city: "Sydney",
|
|
50
|
+
postCode: "2000",
|
|
51
|
+
streetAddress: "42 Wallaby Way",
|
|
52
|
+
addressLine2: "",
|
|
53
|
+
streetNumber: "42",
|
|
54
|
+
streetType: "Way",
|
|
55
|
+
street: "Wallaby",
|
|
56
|
+
state: "NSW",
|
|
57
|
+
country: "Australia",
|
|
58
|
+
status: "current",
|
|
59
|
+
monthsAt: 24,
|
|
60
|
+
yearsAt: 2,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "customers",
|
|
69
|
+
attributes: {
|
|
70
|
+
title: "Mr",
|
|
71
|
+
firstName: "Courtney",
|
|
72
|
+
lastName: "Greenfelder",
|
|
73
|
+
dateOfBirth: "1981-06-22",
|
|
74
|
+
idExpiryDate: "<value>",
|
|
75
|
+
},
|
|
76
|
+
relationships: {
|
|
77
|
+
addresses: {
|
|
78
|
+
data: [
|
|
79
|
+
{
|
|
80
|
+
type: "addresses",
|
|
81
|
+
attributes: {
|
|
82
|
+
id: "12345678901",
|
|
83
|
+
addressType: "residential",
|
|
84
|
+
fullAddress: "42 Wallaby Way, Sydney NSW 2000",
|
|
85
|
+
city: "Sydney",
|
|
86
|
+
postCode: "2000",
|
|
87
|
+
streetAddress: "42 Wallaby Way",
|
|
88
|
+
addressLine2: "",
|
|
89
|
+
streetNumber: "42",
|
|
90
|
+
streetType: "Way",
|
|
91
|
+
street: "Wallaby",
|
|
92
|
+
state: "NSW",
|
|
93
|
+
country: "Australia",
|
|
94
|
+
status: "current",
|
|
95
|
+
monthsAt: 24,
|
|
96
|
+
yearsAt: 2,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: "customers",
|
|
105
|
+
attributes: {
|
|
106
|
+
title: "Mr",
|
|
107
|
+
firstName: "Courtney",
|
|
108
|
+
lastName: "Greenfelder",
|
|
109
|
+
dateOfBirth: "1981-06-22",
|
|
110
|
+
idExpiryDate: "<value>",
|
|
111
|
+
},
|
|
112
|
+
relationships: {
|
|
113
|
+
addresses: {
|
|
114
|
+
data: [
|
|
115
|
+
{
|
|
116
|
+
type: "addresses",
|
|
117
|
+
attributes: {
|
|
118
|
+
id: "12345678901",
|
|
119
|
+
addressType: "residential",
|
|
120
|
+
fullAddress: "42 Wallaby Way, Sydney NSW 2000",
|
|
121
|
+
city: "Sydney",
|
|
122
|
+
postCode: "2000",
|
|
123
|
+
streetAddress: "42 Wallaby Way",
|
|
124
|
+
addressLine2: "",
|
|
125
|
+
streetNumber: "42",
|
|
126
|
+
streetType: "Way",
|
|
127
|
+
street: "Wallaby",
|
|
128
|
+
state: "NSW",
|
|
129
|
+
country: "Australia",
|
|
130
|
+
status: "current",
|
|
131
|
+
monthsAt: 24,
|
|
132
|
+
yearsAt: 2,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
asset: {
|
|
142
|
+
data: {
|
|
143
|
+
type: "assets",
|
|
144
|
+
attributes: {
|
|
145
|
+
id: "12345678901",
|
|
146
|
+
ageOfAsset: 3,
|
|
147
|
+
ageOfAssetAtEnd: 8,
|
|
148
|
+
condition: "USED",
|
|
149
|
+
assetType: "CARAVAN",
|
|
150
|
+
assetValue: "35000.00",
|
|
151
|
+
make: "Toyota",
|
|
152
|
+
assetModel: "Camry",
|
|
153
|
+
registrationNumber: "ABC123",
|
|
154
|
+
registrationState: "VIC",
|
|
155
|
+
vin: "1HGCM82633A123456",
|
|
156
|
+
supplierName: "Mr and Mrs Smith",
|
|
157
|
+
supplierABN: "12345678901",
|
|
158
|
+
supplierAddress: "123 Car Street, Melbourne VIC 3000",
|
|
159
|
+
supplierPhone: "0412345678",
|
|
160
|
+
supplierContactName: "John Smith",
|
|
161
|
+
supplierEmail: "john.smith@mrandmrssmith.com.au",
|
|
162
|
+
privateSale: false,
|
|
163
|
+
typeOfSale: "AUTHORISED_SELLER",
|
|
164
|
+
description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
|
|
165
|
+
netAssetValue: "32000.00",
|
|
166
|
+
isLuxury: false,
|
|
167
|
+
additionalFees: "995.00",
|
|
168
|
+
additionalTaxes: "0.00",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
console.log(result);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
main().catch(console.error);
|