@financeable/aggregation 0.9.0 → 0.10.0
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/models/components/addressattributes.d.ts +30 -30
- 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/badrequesterror.d.ts +15 -15
- package/models/components/badrequesterror.d.ts.map +1 -1
- package/models/components/badrequesterror.js.map +1 -1
- package/models/components/commercialapplicationjsonapirelationships.d.ts +84 -84
- package/models/components/commercialapplicationjsonapirelationships.d.ts.map +1 -1
- package/models/components/commercialapplicationjsonapirelationships.js +47 -47
- package/models/components/commercialapplicationjsonapirelationships.js.map +1 -1
- package/models/components/commercialsecuredapplicationpayload.d.ts +27 -27
- package/models/components/commercialsecuredapplicationpayload.d.ts.map +1 -1
- package/models/components/commercialsecuredapplicationpayload.js.map +1 -1
- package/models/components/commercialsecuredapplicationresource.d.ts +36 -36
- package/models/components/commercialsecuredapplicationresource.d.ts.map +1 -1
- package/models/components/commercialsecuredapplicationresource.js.map +1 -1
- package/models/components/commercialsecuredloanassetattributes.d.ts +66 -66
- package/models/components/commercialsecuredloanassetattributes.d.ts.map +1 -1
- package/models/components/commercialsecuredloanassetattributes.js +26 -24
- package/models/components/commercialsecuredloanassetattributes.js.map +1 -1
- package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts +150 -150
- package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts.map +1 -1
- package/models/components/commercialsecuredloancommercialapplicationrelationships.js +92 -92
- package/models/components/commercialsecuredloancommercialapplicationrelationships.js.map +1 -1
- package/models/components/consumerapplicationjsonapirelationships.d.ts +62 -62
- package/models/components/consumerapplicationjsonapirelationships.d.ts.map +1 -1
- package/models/components/consumerapplicationjsonapirelationships.js +32 -32
- package/models/components/consumerapplicationjsonapirelationships.js.map +1 -1
- package/models/components/consumersecuredapplicationpayload.d.ts +27 -27
- package/models/components/consumersecuredapplicationpayload.d.ts.map +1 -1
- package/models/components/consumersecuredapplicationpayload.js.map +1 -1
- package/models/components/consumersecuredapplicationresource.d.ts +36 -36
- package/models/components/consumersecuredapplicationresource.d.ts.map +1 -1
- package/models/components/consumersecuredapplicationresource.js.map +1 -1
- package/models/components/consumersecuredloanassetattributes.d.ts +78 -78
- package/models/components/consumersecuredloanassetattributes.d.ts.map +1 -1
- package/models/components/consumersecuredloanassetattributes.js +41 -39
- package/models/components/consumersecuredloanassetattributes.js.map +1 -1
- package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts +172 -172
- package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts.map +1 -1
- package/models/components/consumersecuredloanconsumerapplicationrelationships.js +107 -107
- package/models/components/consumersecuredloanconsumerapplicationrelationships.js.map +1 -1
- package/models/components/createsupportingdocumentsresponse.d.ts +16 -16
- package/models/components/createsupportingdocumentsresponse.d.ts.map +1 -1
- package/models/components/createsupportingdocumentsresponse.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 +16 -11
- package/models/components/customerattributes.d.ts.map +1 -1
- package/models/components/customerattributes.js +12 -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/forbiddenerror.d.ts +15 -15
- package/models/components/forbiddenerror.d.ts.map +1 -1
- package/models/components/forbiddenerror.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/monetaryquantity.d.ts +11 -11
- package/models/components/monetaryquantity.d.ts.map +1 -1
- package/models/components/monetaryquantity.js.map +1 -1
- package/models/components/percentagequantity.d.ts +7 -7
- package/models/components/percentagequantity.d.ts.map +1 -1
- package/models/components/percentagequantity.js.map +1 -1
- package/models/components/relationshipresourcenotfound.d.ts +12 -12
- package/models/components/relationshipresourcenotfound.d.ts.map +1 -1
- package/models/components/relationshipresourcenotfound.js.map +1 -1
- package/models/components/resourcenotfound.d.ts +15 -15
- package/models/components/resourcenotfound.d.ts.map +1 -1
- package/models/components/resourcenotfound.js.map +1 -1
- package/models/components/supportingdocumentrelationships.d.ts +106 -106
- package/models/components/supportingdocumentrelationships.d.ts.map +1 -1
- package/models/components/supportingdocumentrelationships.js +63 -63
- package/models/components/supportingdocumentrelationships.js.map +1 -1
- package/models/components/supportingdocumentresource.d.ts +11 -11
- package/models/components/supportingdocumentresource.d.ts.map +1 -1
- package/models/components/supportingdocumentresource.js.map +1 -1
- package/models/components/tokenrequest.d.ts +18 -18
- package/models/components/tokenrequest.d.ts.map +1 -1
- package/models/components/tokenrequest.js.map +1 -1
- package/models/operations/createapplication.d.ts +154 -154
- package/models/operations/createapplication.d.ts.map +1 -1
- package/models/operations/createapplication.js +109 -109
- package/models/operations/createapplication.js.map +1 -1
- package/package.json +4 -5
- package/src/lib/config.ts +3 -3
- package/src/models/components/addressattributes.ts +55 -55
- package/src/models/components/badrequesterror.ts +14 -14
- package/src/models/components/commercialapplicationjsonapirelationships.ts +117 -117
- package/src/models/components/commercialsecuredapplicationpayload.ts +27 -27
- package/src/models/components/commercialsecuredapplicationresource.ts +46 -46
- package/src/models/components/commercialsecuredloanassetattributes.ts +63 -61
- package/src/models/components/commercialsecuredloancommercialapplicationrelationships.ts +243 -243
- package/src/models/components/consumerapplicationjsonapirelationships.ts +83 -83
- package/src/models/components/consumersecuredapplicationpayload.ts +27 -27
- package/src/models/components/consumersecuredapplicationresource.ts +47 -47
- package/src/models/components/consumersecuredloanassetattributes.ts +98 -96
- package/src/models/components/consumersecuredloanconsumerapplicationrelationships.ts +279 -279
- package/src/models/components/createsupportingdocumentsresponse.ts +16 -16
- package/src/models/components/customerassetattributes.ts +4 -4
- package/src/models/components/customerattributes.ts +28 -21
- 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/forbiddenerror.ts +14 -14
- package/src/models/components/incomeattributes.ts +4 -4
- package/src/models/components/monetaryquantity.ts +12 -12
- package/src/models/components/percentagequantity.ts +8 -8
- package/src/models/components/relationshipresourcenotfound.ts +11 -11
- package/src/models/components/resourcenotfound.ts +14 -14
- package/src/models/components/supportingdocumentrelationships.ts +129 -129
- package/src/models/components/supportingdocumentresource.ts +8 -8
- package/src/models/components/tokenrequest.ts +19 -19
- package/src/models/operations/createapplication.ts +204 -204
|
@@ -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.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);
|