@financeable/aggregation 0.9.1 → 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.
Files changed (139) 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/models/components/addressattributes.d.ts +30 -30
  12. package/models/components/addressattributes.d.ts.map +1 -1
  13. package/models/components/addressattributes.js +24 -24
  14. package/models/components/addressattributes.js.map +1 -1
  15. package/models/components/badrequesterror.d.ts +15 -15
  16. package/models/components/badrequesterror.d.ts.map +1 -1
  17. package/models/components/badrequesterror.js.map +1 -1
  18. package/models/components/commercialapplicationjsonapirelationships.d.ts +84 -84
  19. package/models/components/commercialapplicationjsonapirelationships.d.ts.map +1 -1
  20. package/models/components/commercialapplicationjsonapirelationships.js +47 -47
  21. package/models/components/commercialapplicationjsonapirelationships.js.map +1 -1
  22. package/models/components/commercialsecuredapplicationpayload.d.ts +27 -27
  23. package/models/components/commercialsecuredapplicationpayload.d.ts.map +1 -1
  24. package/models/components/commercialsecuredapplicationpayload.js.map +1 -1
  25. package/models/components/commercialsecuredapplicationresource.d.ts +36 -36
  26. package/models/components/commercialsecuredapplicationresource.d.ts.map +1 -1
  27. package/models/components/commercialsecuredapplicationresource.js.map +1 -1
  28. package/models/components/commercialsecuredloanassetattributes.d.ts +66 -66
  29. package/models/components/commercialsecuredloanassetattributes.d.ts.map +1 -1
  30. package/models/components/commercialsecuredloanassetattributes.js +26 -24
  31. package/models/components/commercialsecuredloanassetattributes.js.map +1 -1
  32. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts +150 -150
  33. package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts.map +1 -1
  34. package/models/components/commercialsecuredloancommercialapplicationrelationships.js +92 -92
  35. package/models/components/commercialsecuredloancommercialapplicationrelationships.js.map +1 -1
  36. package/models/components/consumerapplicationjsonapirelationships.d.ts +62 -62
  37. package/models/components/consumerapplicationjsonapirelationships.d.ts.map +1 -1
  38. package/models/components/consumerapplicationjsonapirelationships.js +32 -32
  39. package/models/components/consumerapplicationjsonapirelationships.js.map +1 -1
  40. package/models/components/consumersecuredapplicationpayload.d.ts +27 -27
  41. package/models/components/consumersecuredapplicationpayload.d.ts.map +1 -1
  42. package/models/components/consumersecuredapplicationpayload.js.map +1 -1
  43. package/models/components/consumersecuredapplicationresource.d.ts +36 -36
  44. package/models/components/consumersecuredapplicationresource.d.ts.map +1 -1
  45. package/models/components/consumersecuredapplicationresource.js.map +1 -1
  46. package/models/components/consumersecuredloanassetattributes.d.ts +78 -78
  47. package/models/components/consumersecuredloanassetattributes.d.ts.map +1 -1
  48. package/models/components/consumersecuredloanassetattributes.js +41 -39
  49. package/models/components/consumersecuredloanassetattributes.js.map +1 -1
  50. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts +172 -172
  51. package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts.map +1 -1
  52. package/models/components/consumersecuredloanconsumerapplicationrelationships.js +107 -107
  53. package/models/components/consumersecuredloanconsumerapplicationrelationships.js.map +1 -1
  54. package/models/components/createsupportingdocumentsresponse.d.ts +16 -16
  55. package/models/components/createsupportingdocumentsresponse.d.ts.map +1 -1
  56. package/models/components/createsupportingdocumentsresponse.js.map +1 -1
  57. package/models/components/customerassetattributes.d.ts +2 -2
  58. package/models/components/customerassetattributes.d.ts.map +1 -1
  59. package/models/components/customerassetattributes.js +2 -2
  60. package/models/components/customerassetattributes.js.map +1 -1
  61. package/models/components/customerattributes.d.ts +10 -10
  62. package/models/components/customerattributes.d.ts.map +1 -1
  63. package/models/components/customerattributes.js +10 -10
  64. package/models/components/customerattributes.js.map +1 -1
  65. package/models/components/customerliabilityattributes.d.ts +2 -2
  66. package/models/components/customerliabilityattributes.d.ts.map +1 -1
  67. package/models/components/customerliabilityattributes.js +2 -2
  68. package/models/components/customerliabilityattributes.js.map +1 -1
  69. package/models/components/entityattributes.d.ts +4 -4
  70. package/models/components/entityattributes.d.ts.map +1 -1
  71. package/models/components/entityattributes.js +4 -4
  72. package/models/components/entityattributes.js.map +1 -1
  73. package/models/components/expenseattributes.d.ts +2 -2
  74. package/models/components/expenseattributes.d.ts.map +1 -1
  75. package/models/components/expenseattributes.js +2 -2
  76. package/models/components/expenseattributes.js.map +1 -1
  77. package/models/components/forbiddenerror.d.ts +15 -15
  78. package/models/components/forbiddenerror.d.ts.map +1 -1
  79. package/models/components/forbiddenerror.js.map +1 -1
  80. package/models/components/incomeattributes.d.ts +2 -2
  81. package/models/components/incomeattributes.d.ts.map +1 -1
  82. package/models/components/incomeattributes.js +2 -2
  83. package/models/components/incomeattributes.js.map +1 -1
  84. package/models/components/monetaryquantity.d.ts +11 -11
  85. package/models/components/monetaryquantity.d.ts.map +1 -1
  86. package/models/components/monetaryquantity.js.map +1 -1
  87. package/models/components/percentagequantity.d.ts +7 -7
  88. package/models/components/percentagequantity.d.ts.map +1 -1
  89. package/models/components/percentagequantity.js.map +1 -1
  90. package/models/components/relationshipresourcenotfound.d.ts +12 -12
  91. package/models/components/relationshipresourcenotfound.d.ts.map +1 -1
  92. package/models/components/relationshipresourcenotfound.js.map +1 -1
  93. package/models/components/resourcenotfound.d.ts +15 -15
  94. package/models/components/resourcenotfound.d.ts.map +1 -1
  95. package/models/components/resourcenotfound.js.map +1 -1
  96. package/models/components/supportingdocumentrelationships.d.ts +106 -106
  97. package/models/components/supportingdocumentrelationships.d.ts.map +1 -1
  98. package/models/components/supportingdocumentrelationships.js +63 -63
  99. package/models/components/supportingdocumentrelationships.js.map +1 -1
  100. package/models/components/supportingdocumentresource.d.ts +11 -11
  101. package/models/components/supportingdocumentresource.d.ts.map +1 -1
  102. package/models/components/supportingdocumentresource.js.map +1 -1
  103. package/models/components/tokenrequest.d.ts +18 -18
  104. package/models/components/tokenrequest.d.ts.map +1 -1
  105. package/models/components/tokenrequest.js.map +1 -1
  106. package/models/operations/createapplication.d.ts +154 -154
  107. package/models/operations/createapplication.d.ts.map +1 -1
  108. package/models/operations/createapplication.js +109 -109
  109. package/models/operations/createapplication.js.map +1 -1
  110. package/package.json +4 -5
  111. package/src/lib/config.ts +3 -3
  112. package/src/models/components/addressattributes.ts +55 -55
  113. package/src/models/components/badrequesterror.ts +14 -14
  114. package/src/models/components/commercialapplicationjsonapirelationships.ts +117 -117
  115. package/src/models/components/commercialsecuredapplicationpayload.ts +27 -27
  116. package/src/models/components/commercialsecuredapplicationresource.ts +46 -46
  117. package/src/models/components/commercialsecuredloanassetattributes.ts +63 -61
  118. package/src/models/components/commercialsecuredloancommercialapplicationrelationships.ts +243 -243
  119. package/src/models/components/consumerapplicationjsonapirelationships.ts +83 -83
  120. package/src/models/components/consumersecuredapplicationpayload.ts +27 -27
  121. package/src/models/components/consumersecuredapplicationresource.ts +47 -47
  122. package/src/models/components/consumersecuredloanassetattributes.ts +98 -96
  123. package/src/models/components/consumersecuredloanconsumerapplicationrelationships.ts +279 -279
  124. package/src/models/components/createsupportingdocumentsresponse.ts +16 -16
  125. package/src/models/components/customerassetattributes.ts +4 -4
  126. package/src/models/components/customerattributes.ts +20 -20
  127. package/src/models/components/customerliabilityattributes.ts +4 -4
  128. package/src/models/components/entityattributes.ts +8 -8
  129. package/src/models/components/expenseattributes.ts +4 -4
  130. package/src/models/components/forbiddenerror.ts +14 -14
  131. package/src/models/components/incomeattributes.ts +4 -4
  132. package/src/models/components/monetaryquantity.ts +12 -12
  133. package/src/models/components/percentagequantity.ts +8 -8
  134. package/src/models/components/relationshipresourcenotfound.ts +11 -11
  135. package/src/models/components/resourcenotfound.ts +14 -14
  136. package/src/models/components/supportingdocumentrelationships.ts +129 -129
  137. package/src/models/components/supportingdocumentresource.ts +8 -8
  138. package/src/models/components/tokenrequest.ts +19 -19
  139. 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 @@ Obtain an OAuth client_credentials token
13
13
 
14
14
  ### Example Usage
15
15
 
16
+ <!-- UsageSnippet language="typescript" operationID="getToken" method="post" path="/oauth/token" -->
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);