@financeable/aggregation 0.4.2 → 0.4.5

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/README.md CHANGED
@@ -994,523 +994,6 @@ const sdk = new Financeable({ debugLogger: console });
994
994
 
995
995
  You can also enable a default debug logger by setting an environment variable `FINANCEABLE_DEBUG` to true.
996
996
 
997
- <!-- Start Summary [summary] -->
998
-
999
- ## Summary
1000
-
1001
- <!-- End Summary [summary] -->
1002
-
1003
- <!-- Start Table of Contents [toc] -->
1004
-
1005
- ## Table of Contents
1006
-
1007
- <!-- $toc-max-depth=2 -->
1008
-
1009
- - [financeable-aggregation-api](#financeable-aggregation-api)
1010
- - [SDK Installation](#sdk-installation)
1011
- - [Requirements](#requirements)
1012
- - [SDK Example Usage](#sdk-example-usage)
1013
- - [Available Resources and Operations](#available-resources-and-operations)
1014
- - [Standalone functions](#standalone-functions)
1015
- - [Retries](#retries)
1016
- - [Error Handling](#error-handling)
1017
- - [Server Selection](#server-selection)
1018
- - [Custom HTTP Client](#custom-http-client)
1019
- - [Debugging](#debugging)
1020
- - [SDK Installation](#sdk-installation-1)
1021
- - [Requirements](#requirements-1)
1022
- - [SDK Example Usage](#sdk-example-usage-1)
1023
- - [Authentication](#authentication)
1024
- - [Available Resources and Operations](#available-resources-and-operations-1)
1025
- - [Standalone functions](#standalone-functions-1)
1026
- - [Retries](#retries-1)
1027
- - [Error Handling](#error-handling-1)
1028
- - [Server Selection](#server-selection-1)
1029
- - [Custom HTTP Client](#custom-http-client-1)
1030
- - [Debugging](#debugging-1)
1031
-
1032
- <!-- End Table of Contents [toc] -->
1033
-
1034
- <!-- Start SDK Installation [installation] -->
1035
-
1036
- ## SDK Installation
1037
-
1038
- The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
1039
-
1040
- ### NPM
1041
-
1042
- ```bash
1043
- npm add @financeable/aggregation
1044
- ```
1045
-
1046
- ### PNPM
1047
-
1048
- ```bash
1049
- pnpm add @financeable/aggregation
1050
- ```
1051
-
1052
- ### Bun
1053
-
1054
- ```bash
1055
- bun add @financeable/aggregation
1056
- ```
1057
-
1058
- ### Yarn
1059
-
1060
- ```bash
1061
- yarn add @financeable/aggregation zod
1062
-
1063
- # Note that Yarn does not install peer dependencies automatically. You will need
1064
- # to install zod as shown above.
1065
- ```
1066
-
1067
- <!-- End SDK Installation [installation] -->
1068
-
1069
- <!-- Start Requirements [requirements] -->
1070
-
1071
- ## Requirements
1072
-
1073
- For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
1074
-
1075
- <!-- End Requirements [requirements] -->
1076
-
1077
- ## SDK Example Usage
1078
-
1079
- ### Example
1080
-
1081
- ```typescript
1082
- import { Financeable } from "@financeable/aggregation";
1083
- import { ConsumerAssetType } from "@financeable/aggregation/models/components"
1084
-
1085
- const financeable = new Financeable({
1086
- serverURL: '<ServerURL>',
1087
- });
1088
-
1089
- async function run() {
1090
- const tokenRequest = await financeable.oauthToken.get({
1091
- grantType: 'client_credentials',
1092
- clientId: '<ClientId>',
1093
- clientSecret: '<ClientSecret>',
1094
- scope: 'application:read application:write',
1095
- });
1096
-
1097
- const result = await financeable.applications.create({
1098
- data: {
1099
- type: "applications",
1100
- attributes: {
1101
- purpose: "Purchase of a motor vehicle",
1102
- applicationType: "consumer",
1103
- },
1104
- relationships: {
1105
- loanDetails: {
1106
- data: {
1107
- type: "loan-details",
1108
- attributes: {
1109
- repayments: 12,
1110
- repaymentFrequency: "monthly",
1111
- repaymentStructure: "group-payments",
1112
- loanAmount: "10280.95",
1113
- purpose: "Purchase of a motor vehicle",
1114
- term: 48,
1115
- balloon: 5,
1116
- deposit: "2500",
1117
- originationFee: 200,
1118
- rate: "0.15",
1119
- rateAdjustment: "-0.01",
1120
- },
1121
- },
1122
- },
1123
- customers: {
1124
- data: [
1125
- {
1126
- type: "customers",
1127
- attributes: {
1128
- title: "Mr",
1129
- firstName: "John",
1130
- lastName: "Smith",
1131
- dateOfBirth: "1990-06-28",
1132
- idExpiryDate: "<value>",
1133
- },
1134
- relationships: {
1135
- addresses: {
1136
- data: [
1137
- {
1138
- type: "addresses",
1139
- attributes: {
1140
- addressType: "residential",
1141
- fullAddress: "42 Wallaby Way, Sydney NSW 2000",
1142
- city: "Sydney",
1143
- postCode: "2000",
1144
- streetAddress: "42 Wallaby Way",
1145
- addressLine2: "",
1146
- streetNumber: "42",
1147
- streetType: "Way",
1148
- street: "Wallaby",
1149
- state: "NSW",
1150
- country: "Australia",
1151
- status: "current",
1152
- monthsAt: 6,
1153
- yearsAt: 2,
1154
- },
1155
- },
1156
- {
1157
- type: "addresses",
1158
- attributes: {
1159
- addressType: "residential",
1160
- fullAddress: "42 Wallaby Way, Sydney NSW 2000",
1161
- city: "Sydney",
1162
- postCode: "2000",
1163
- streetAddress: "42 Wallaby Way",
1164
- addressLine2: "",
1165
- streetNumber: "42",
1166
- streetType: "Way",
1167
- street: "Wallaby",
1168
- state: "NSW",
1169
- country: "Australia",
1170
- status: "previous",
1171
- monthsAt: 0,
1172
- yearsAt: 5,
1173
- },
1174
- },
1175
- ],
1176
- },
1177
- },
1178
- },
1179
- ],
1180
- },
1181
- asset: {
1182
- data: {
1183
- type: "assets",
1184
- attributes: {
1185
- ageOfAsset: 3,
1186
- ageOfAssetAtEnd: 8,
1187
- condition: "USED",
1188
- assetType: ConsumerAssetType.MotorVehicle,
1189
- purpose: "VEHICLE",
1190
- assetValue: "35000.00",
1191
- make: "Toyota",
1192
- assetModel: "Camry",
1193
- registrationNumber: "ABC123",
1194
- registrationState: "VIC",
1195
- vin: "1HGCM82633A123456",
1196
- supplierName: "Mr and Mrs Smith",
1197
- supplierABN: "12345678901",
1198
- supplierAddress: "123 Car Street, Melbourne VIC 3000",
1199
- supplierPhone: "0412345678",
1200
- supplierContactName: "John Smith",
1201
- supplierEmail: "john.smith@mrandmrssmith.com.au",
1202
- privateSale: false,
1203
- typeOfSale: "DEALER",
1204
- description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
1205
- netAssetValue: "32000.00",
1206
- isLuxury: false,
1207
- additionalFees: "995.00",
1208
- additionalTaxes: "0.00",
1209
- },
1210
- },
1211
- },
1212
- },
1213
- },
1214
- {
1215
- fetchOptions: {
1216
- headers: {
1217
- authorization: `Bearer ${tokenRequest.accessToken}`,
1218
- },
1219
- },
1220
- },
1221
- });
1222
-
1223
- // Handle the result
1224
- console.log(result);
1225
- }
1226
-
1227
- run();
1228
-
1229
- ```
1230
-
1231
- <!-- No End SDK Example Usage [usage] -->
1232
-
1233
- <!-- No End Authentication [security] -->
1234
-
1235
- <!-- Start Available Resources and Operations [operations] -->
1236
-
1237
- ## Available Resources and Operations
1238
-
1239
- <details open>
1240
- <summary>Available methods</summary>
1241
-
1242
- ### [applications](docs/sdks/applications/README.md)
1243
-
1244
- - [create](docs/sdks/applications/README.md#create) - Create an application in the Financeable platform.
1245
- - [list](docs/sdks/applications/README.md#list) - Retrieve a list of applications
1246
- - [get](docs/sdks/applications/README.md#get) - Retrieve an application by its ID
1247
-
1248
- ### [oauthToken](docs/sdks/oauthtoken/README.md)
1249
-
1250
- - [get](docs/sdks/oauthtoken/README.md#get) - Obtain an OAuth client_credentials token
1251
-
1252
- </details>
1253
- <!-- End Available Resources and Operations [operations] -->
1254
-
1255
- <!-- Start Standalone functions [standalone-funcs] -->
1256
-
1257
- ## Standalone functions
1258
-
1259
- All the methods listed above are available as standalone functions. These
1260
- functions are ideal for use in applications running in the browser, serverless
1261
- runtimes or other environments where application bundle size is a primary
1262
- concern. When using a bundler to build your application, all unused
1263
- functionality will be either excluded from the final bundle or tree-shaken away.
1264
-
1265
- To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
1266
-
1267
- <details>
1268
-
1269
- <summary>Available standalone functions</summary>
1270
-
1271
- - [`applicationsCreate`](docs/sdks/applications/README.md#create) - Create an application in the Financeable platform.
1272
- - [`applicationsGet`](docs/sdks/applications/README.md#get) - Retrieve an application by its ID
1273
- - [`applicationsList`](docs/sdks/applications/README.md#list) - Retrieve a list of applications
1274
- - [`oauthTokenGet`](docs/sdks/oauthtoken/README.md#get) - Obtain an OAuth client_credentials token
1275
-
1276
- </details>
1277
- <!-- End Standalone functions [standalone-funcs] -->
1278
-
1279
- <!-- Start Retries [retries] -->
1280
-
1281
- ## Retries
1282
-
1283
- Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
1284
-
1285
- To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
1286
-
1287
- ```typescript
1288
- import { Financeable } from "@financeable/aggregation";
1289
- import { CommercialAssetType } from "@financeable/aggregation/models/components";
1290
-
1291
- const financeable = new Financeable({
1292
- clientCredentials: process.env["FINANCEABLE_CLIENT_CREDENTIALS"] ?? "",
1293
- });
1294
-
1295
- async function run() {
1296
- const tokenRequest = await financeable.oauthToken.get({
1297
- grantType: 'client_credentials',
1298
- clientId: '<ClientId>',
1299
- clientSecret: '<ClientSecret>',
1300
- scope: 'application:read application:write',
1301
- });
1302
-
1303
- const result = await financeable.applications.create(
1304
- {
1305
- data: {
1306
- type: "applications",
1307
- attributes: {
1308
- purpose: "Purchase of a motor vehicle",
1309
- applicationType: "consumer",
1310
- },
1311
- relationships: {
1312
- loanDetails: {
1313
- data: {
1314
- type: "loan-details",
1315
- attributes: {
1316
- repayments: 12,
1317
- repaymentFrequency: "monthly",
1318
- repaymentStructure: "group-payments",
1319
- loanAmount: "10280.95",
1320
- purpose: "Purchase of a motor vehicle",
1321
- term: 48,
1322
- balloon: 5,
1323
- deposit: "2500",
1324
- originationFee: 200,
1325
- rate: "0.15",
1326
- rateAdjustment: "-0.01",
1327
- },
1328
- },
1329
- },
1330
- customers: {
1331
- data: [
1332
- {
1333
- type: "customers",
1334
- attributes: {
1335
- title: "Mr",
1336
- firstName: "John",
1337
- lastName: "Smith",
1338
- dateOfBirth: "01-01-1990",
1339
- idExpiryDate: "<value>",
1340
- },
1341
- relationships: {
1342
- addresses: {
1343
- data: [
1344
- {
1345
- type: "addresses",
1346
- attributes: {
1347
- addressType: "residential",
1348
- fullAddress: "42 Wallaby Way, Sydney NSW 2000",
1349
- city: "Sydney",
1350
- postCode: "2000",
1351
- streetAddress: "42 Wallaby Way",
1352
- addressLine2: "",
1353
- streetNumber: "42",
1354
- streetType: "Way",
1355
- street: "Wallaby",
1356
- state: "NSW",
1357
- country: "Australia",
1358
- status: "current",
1359
- monthsAt: 24,
1360
- yearsAt: 2,
1361
- },
1362
- },
1363
- {
1364
- type: "addresses",
1365
- attributes: {
1366
- addressType: "residential",
1367
- fullAddress: "42 Wallaby Way, Sydney NSW 2000",
1368
- city: "Sydney",
1369
- postCode: "2000",
1370
- streetAddress: "42 Wallaby Way",
1371
- addressLine2: "",
1372
- streetNumber: "42",
1373
- streetType: "Way",
1374
- street: "Wallaby",
1375
- state: "NSW",
1376
- country: "Australia",
1377
- status: "current",
1378
- monthsAt: 24,
1379
- yearsAt: 2,
1380
- },
1381
- },
1382
- ],
1383
- },
1384
- },
1385
- },
1386
- ],
1387
- },
1388
- asset: {
1389
- data: {
1390
- type: "assets",
1391
- attributes: {
1392
- ageOfAsset: 3,
1393
- ageOfAssetAtEnd: 8,
1394
- condition: "USED",
1395
- assetType: CommercialAssetType.MotorVehicleLessThan45Tonnes,
1396
- purpose: "VEHICLE",
1397
- assetValue: "35000.00",
1398
- make: "Toyota",
1399
- assetModel: "Camry",
1400
- registrationNumber: "ABC123",
1401
- registrationState: "VIC",
1402
- vin: "1HGCM82633A123456",
1403
- supplierName: "Mr and Mrs Smith",
1404
- supplierABN: "12345678901",
1405
- supplierAddress: "123 Car Street, Melbourne VIC 3000",
1406
- supplierPhone: "0412345678",
1407
- supplierContactName: "John Smith",
1408
- supplierEmail: "john.smith@mrandmrssmith.com.au",
1409
- privateSale: false,
1410
- typeOfSale: "DEALER",
1411
- description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
1412
- netAssetValue: "32000.00",
1413
- isLuxury: false,
1414
- additionalFees: "995.00",
1415
- additionalTaxes: "0.00",
1416
- },
1417
- },
1418
- },
1419
- },
1420
- },
1421
- },
1422
- {
1423
- fetchOptions: {
1424
- headers: {
1425
- authorization: `Bearer ${tokenRequest.accessToken}`,
1426
- },
1427
- },
1428
- retries: {
1429
- strategy: "backoff",
1430
- backoff: {
1431
- initialInterval: 1,
1432
- maxInterval: 50,
1433
- exponent: 1.1,
1434
- maxElapsedTime: 100,
1435
- },
1436
- retryConnectionErrors: false,
1437
- }
1438
- }
1439
- );
1440
-
1441
- // Handle the result
1442
- console.log(result);
1443
- }
1444
-
1445
- run();
1446
-
1447
- ```
1448
-
1449
- ## Custom HTTP Client
1450
-
1451
- The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
1452
- [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
1453
- client is a thin wrapper around `fetch` and provides the ability to attach hooks
1454
- around the request lifecycle that can be used to modify the request or handle
1455
- errors and response.
1456
-
1457
- The `HTTPClient` constructor takes an optional `fetcher` argument that can be
1458
- used to integrate a third-party HTTP client or when writing tests to mock out
1459
- the HTTP client and feed in fixtures.
1460
-
1461
- The following example shows how to use the `"beforeRequest"` hook to to add a
1462
- custom header and a timeout to requests and how to use the `"requestError"` hook
1463
- to log errors:
1464
-
1465
- ```typescript
1466
- import { Financeable } from "@financeable/aggregation";
1467
- import { HTTPClient } from "@financeable/aggregation/lib/http";
1468
-
1469
- const httpClient = new HTTPClient({
1470
- // fetcher takes a function that has the same signature as native `fetch`.
1471
- fetcher: (request) => {
1472
- return fetch(request);
1473
- }
1474
- });
1475
-
1476
- httpClient.addHook("beforeRequest", (request) => {
1477
- const nextRequest = new Request(request, {
1478
- signal: request.signal || AbortSignal.timeout(5000)
1479
- });
1480
-
1481
- nextRequest.headers.set("x-custom-header", "custom value");
1482
-
1483
- return nextRequest;
1484
- });
1485
-
1486
- httpClient.addHook("requestError", (error, request) => {
1487
- console.group("Request Error");
1488
- console.log("Reason:", `${error}`);
1489
- console.log("Endpoint:", `${request.method} ${request.url}`);
1490
- console.groupEnd();
1491
- });
1492
-
1493
- const sdk = new Financeable({ httpClient });
1494
- ```
1495
-
1496
- ## Debugging
1497
-
1498
- You can setup your SDK to emit debug logs for SDK requests and responses.
1499
-
1500
- You can pass a logger that matches `console`'s interface as an SDK option.
1501
-
1502
- > [!WARNING]
1503
- > Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
1504
-
1505
- ```typescript
1506
- import { Financeable } from "@financeable/aggregation";
1507
-
1508
- const sdk = new Financeable({ debugLogger: console });
1509
- ```
1510
-
1511
- You can also enable a default debug logger by setting an environment variable `FINANCEABLE_DEBUG` to true.
1512
-
1513
-
1514
997
  <!-- Start Summary [summary] -->
1515
998
  ## Summary
1516
999
 
@@ -1534,12 +1017,10 @@ You can also enable a default debug logger by setting an environment variable `F
1534
1017
  * [SDK Installation](#sdk-installation-1)
1535
1018
  * [Requirements](#requirements-1)
1536
1019
  * [SDK Example Usage](#sdk-example-usage-1)
1537
- * [Authentication](#authentication)
1538
1020
  * [Available Resources and Operations](#available-resources-and-operations-1)
1539
1021
  * [Standalone functions](#standalone-functions-1)
1540
1022
  * [Retries](#retries-1)
1541
1023
  * [Error Handling](#error-handling-1)
1542
- * [Server Selection](#server-selection-1)
1543
1024
  * [Custom HTTP Client](#custom-http-client-1)
1544
1025
  * [Debugging](#debugging-1)
1545
1026
 
@@ -1584,20 +1065,26 @@ yarn add @financeable/aggregation zod
1584
1065
  For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
1585
1066
  <!-- End Requirements [requirements] -->
1586
1067
 
1587
- <!-- Start SDK Example Usage [usage] -->
1588
1068
  ## SDK Example Usage
1589
1069
 
1590
1070
  ### Example
1591
1071
 
1592
1072
  ```typescript
1593
1073
  import { Financeable } from "@financeable/aggregation";
1594
- import { CommercialAssetType } from "@financeable/aggregation/models/components";
1074
+ import { ConsumerAssetType } from "@financeable/aggregation/models/components"
1595
1075
 
1596
1076
  const financeable = new Financeable({
1597
- clientCredentials: process.env["FINANCEABLE_CLIENT_CREDENTIALS"] ?? "",
1077
+ serverURL: '<ServerURL>',
1598
1078
  });
1599
1079
 
1600
1080
  async function run() {
1081
+ const tokenRequest = await financeable.oauthToken.get({
1082
+ grantType: 'client_credentials',
1083
+ clientId: '<ClientId>',
1084
+ clientSecret: '<ClientSecret>',
1085
+ scope: 'application:read application:write',
1086
+ });
1087
+
1601
1088
  const result = await financeable.applications.create({
1602
1089
  data: {
1603
1090
  type: "applications",
@@ -1632,7 +1119,7 @@ async function run() {
1632
1119
  title: "Mr",
1633
1120
  firstName: "John",
1634
1121
  lastName: "Smith",
1635
- dateOfBirth: "01-01-1990",
1122
+ dateOfBirth: "1990-06-28",
1636
1123
  idExpiryDate: "<value>",
1637
1124
  },
1638
1125
  relationships: {
@@ -1653,7 +1140,7 @@ async function run() {
1653
1140
  state: "NSW",
1654
1141
  country: "Australia",
1655
1142
  status: "current",
1656
- monthsAt: 24,
1143
+ monthsAt: 6,
1657
1144
  yearsAt: 2,
1658
1145
  },
1659
1146
  },
@@ -1671,9 +1158,9 @@ async function run() {
1671
1158
  street: "Wallaby",
1672
1159
  state: "NSW",
1673
1160
  country: "Australia",
1674
- status: "current",
1675
- monthsAt: 24,
1676
- yearsAt: 2,
1161
+ status: "previous",
1162
+ monthsAt: 0,
1163
+ yearsAt: 5,
1677
1164
  },
1678
1165
  },
1679
1166
  ],
@@ -1689,7 +1176,7 @@ async function run() {
1689
1176
  ageOfAsset: 3,
1690
1177
  ageOfAssetAtEnd: 8,
1691
1178
  condition: "USED",
1692
- assetType: CommercialAssetType.MotorVehicleLessThan45Tonnes,
1179
+ assetType: ConsumerAssetType.MotorVehicle,
1693
1180
  purpose: "VEHICLE",
1694
1181
  assetValue: "35000.00",
1695
1182
  make: "Toyota",
@@ -1715,152 +1202,10 @@ async function run() {
1715
1202
  },
1716
1203
  },
1717
1204
  },
1718
- });
1719
-
1720
- // Handle the result
1721
- console.log(result);
1722
- }
1723
-
1724
- run();
1725
-
1726
- ```
1727
- <!-- End SDK Example Usage [usage] -->
1728
-
1729
- <!-- Start Authentication [security] -->
1730
- ## Authentication
1731
-
1732
- ### Per-Client Security Schemes
1733
-
1734
- This SDK supports the following security scheme globally:
1735
-
1736
- | Name | Type | Scheme | Environment Variable |
1737
- | ------------------- | ------ | ------------ | -------------------------------- |
1738
- | `clientCredentials` | oauth2 | OAuth2 token | `FINANCEABLE_CLIENT_CREDENTIALS` |
1739
-
1740
- To authenticate with the API the `clientCredentials` parameter must be set when initializing the SDK client instance. For example:
1741
- ```typescript
1742
- import { Financeable } from "@financeable/aggregation";
1743
- import { CommercialAssetType } from "@financeable/aggregation/models/components";
1744
-
1745
- const financeable = new Financeable({
1746
- clientCredentials: process.env["FINANCEABLE_CLIENT_CREDENTIALS"] ?? "",
1747
- });
1748
-
1749
- async function run() {
1750
- const result = await financeable.applications.create({
1751
- data: {
1752
- type: "applications",
1753
- attributes: {
1754
- purpose: "Purchase of a motor vehicle",
1755
- applicationType: "consumer",
1756
- },
1757
- relationships: {
1758
- loanDetails: {
1759
- data: {
1760
- type: "loan-details",
1761
- attributes: {
1762
- repayments: 12,
1763
- repaymentFrequency: "monthly",
1764
- repaymentStructure: "group-payments",
1765
- loanAmount: "10280.95",
1766
- purpose: "Purchase of a motor vehicle",
1767
- term: 48,
1768
- balloon: 5,
1769
- deposit: "2500",
1770
- originationFee: 200,
1771
- rate: "0.15",
1772
- rateAdjustment: "-0.01",
1773
- },
1774
- },
1775
- },
1776
- customers: {
1777
- data: [
1778
- {
1779
- type: "customers",
1780
- attributes: {
1781
- title: "Mr",
1782
- firstName: "John",
1783
- lastName: "Smith",
1784
- dateOfBirth: "01-01-1990",
1785
- idExpiryDate: "<value>",
1786
- },
1787
- relationships: {
1788
- addresses: {
1789
- data: [
1790
- {
1791
- type: "addresses",
1792
- attributes: {
1793
- addressType: "residential",
1794
- fullAddress: "42 Wallaby Way, Sydney NSW 2000",
1795
- city: "Sydney",
1796
- postCode: "2000",
1797
- streetAddress: "42 Wallaby Way",
1798
- addressLine2: "",
1799
- streetNumber: "42",
1800
- streetType: "Way",
1801
- street: "Wallaby",
1802
- state: "NSW",
1803
- country: "Australia",
1804
- status: "current",
1805
- monthsAt: 24,
1806
- yearsAt: 2,
1807
- },
1808
- },
1809
- {
1810
- type: "addresses",
1811
- attributes: {
1812
- addressType: "residential",
1813
- fullAddress: "42 Wallaby Way, Sydney NSW 2000",
1814
- city: "Sydney",
1815
- postCode: "2000",
1816
- streetAddress: "42 Wallaby Way",
1817
- addressLine2: "",
1818
- streetNumber: "42",
1819
- streetType: "Way",
1820
- street: "Wallaby",
1821
- state: "NSW",
1822
- country: "Australia",
1823
- status: "current",
1824
- monthsAt: 24,
1825
- yearsAt: 2,
1826
- },
1827
- },
1828
- ],
1829
- },
1830
- },
1831
- },
1832
- ],
1833
- },
1834
- asset: {
1835
- data: {
1836
- type: "assets",
1837
- attributes: {
1838
- ageOfAsset: 3,
1839
- ageOfAssetAtEnd: 8,
1840
- condition: "USED",
1841
- assetType: CommercialAssetType.MotorVehicleLessThan45Tonnes,
1842
- purpose: "VEHICLE",
1843
- assetValue: "35000.00",
1844
- make: "Toyota",
1845
- assetModel: "Camry",
1846
- registrationNumber: "ABC123",
1847
- registrationState: "VIC",
1848
- vin: "1HGCM82633A123456",
1849
- supplierName: "Mr and Mrs Smith",
1850
- supplierABN: "12345678901",
1851
- supplierAddress: "123 Car Street, Melbourne VIC 3000",
1852
- supplierPhone: "0412345678",
1853
- supplierContactName: "John Smith",
1854
- supplierEmail: "john.smith@mrandmrssmith.com.au",
1855
- privateSale: false,
1856
- typeOfSale: "DEALER",
1857
- description: "2020 Toyota Camry Hybrid SL, Silver, 45,000km",
1858
- netAssetValue: "32000.00",
1859
- isLuxury: false,
1860
- additionalFees: "995.00",
1861
- additionalTaxes: "0.00",
1862
- },
1863
- },
1205
+ {
1206
+ fetchOptions: {
1207
+ headers: {
1208
+ authorization: `Bearer ${tokenRequest.accessToken}`,
1864
1209
  },
1865
1210
  },
1866
1211
  },
@@ -1873,7 +1218,10 @@ async function run() {
1873
1218
  run();
1874
1219
 
1875
1220
  ```
1876
- <!-- End Authentication [security] -->
1221
+
1222
+ <!-- No End SDK Example Usage [usage] -->
1223
+
1224
+ <!-- No End Authentication [security] -->
1877
1225
 
1878
1226
  <!-- Start Available Resources and Operations [operations] -->
1879
1227
  ## Available Resources and Operations
@@ -1890,7 +1238,7 @@ run();
1890
1238
 
1891
1239
  ### [oauthToken](docs/sdks/oauthtoken/README.md)
1892
1240
 
1893
- * [oauthToken](docs/sdks/oauthtoken/README.md#oauthtoken) - Obtain an OAuth client_credentials token
1241
+ * [get](docs/sdks/oauthtoken/README.md#get) - Obtain an OAuth client_credentials token
1894
1242
 
1895
1243
  </details>
1896
1244
  <!-- End Available Resources and Operations [operations] -->
@@ -1913,7 +1261,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
1913
1261
  - [`applicationsCreate`](docs/sdks/applications/README.md#create) - Create an application in the Financeable platform.
1914
1262
  - [`applicationsGet`](docs/sdks/applications/README.md#get) - Retrieve an application by its ID
1915
1263
  - [`applicationsList`](docs/sdks/applications/README.md#list) - Retrieve a list of applications
1916
- - [`oauthTokenOauthToken`](docs/sdks/oauthtoken/README.md#oauthtoken) - Obtain an OAuth client_credentials token
1264
+ - [`oauthTokenGet`](docs/sdks/oauthtoken/README.md#get) - Obtain an OAuth client_credentials token
1917
1265
 
1918
1266
  </details>
1919
1267
  <!-- End Standalone functions [standalone-funcs] -->
@@ -2072,7 +1420,6 @@ run();
2072
1420
  ```
2073
1421
 
2074
1422
  If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
2075
-
2076
1423
  ```typescript
2077
1424
  import { Financeable } from "@financeable/aggregation";
2078
1425
  import { CommercialAssetType } from "@financeable/aggregation/models/components";
@@ -2088,16 +1435,10 @@ const financeable = new Financeable({
2088
1435
  },
2089
1436
  retryConnectionErrors: false,
2090
1437
  },
1438
+ clientCredentials: process.env["FINANCEABLE_CLIENT_CREDENTIALS"] ?? "",
2091
1439
  });
2092
1440
 
2093
1441
  async function run() {
2094
- const tokenRequest = await financeable.oauthToken.get({
2095
- grantType: 'client_credentials',
2096
- clientId: '<ClientId>',
2097
- clientSecret: '<ClientSecret>',
2098
- scope: 'application:read application:write',
2099
- });
2100
-
2101
1442
  const result = await financeable.applications.create({
2102
1443
  data: {
2103
1444
  type: "applications",
@@ -2132,8 +1473,8 @@ async function run() {
2132
1473
  title: "Mr",
2133
1474
  firstName: "John",
2134
1475
  lastName: "Smith",
2135
- dateOfBirth: "1963-05-24",
2136
- idExpiryDate: "2028-04-20",
1476
+ dateOfBirth: "01-01-1990",
1477
+ idExpiryDate: "<value>",
2137
1478
  },
2138
1479
  relationships: {
2139
1480
  addresses: {
@@ -2153,7 +1494,7 @@ async function run() {
2153
1494
  state: "NSW",
2154
1495
  country: "Australia",
2155
1496
  status: "current",
2156
- monthsAt: 11,
1497
+ monthsAt: 24,
2157
1498
  yearsAt: 2,
2158
1499
  },
2159
1500
  },
@@ -2171,9 +1512,9 @@ async function run() {
2171
1512
  street: "Wallaby",
2172
1513
  state: "NSW",
2173
1514
  country: "Australia",
2174
- status: "previous",
2175
- monthsAt: 4,
2176
- yearsAt: 3,
1515
+ status: "current",
1516
+ monthsAt: 24,
1517
+ yearsAt: 2,
2177
1518
  },
2178
1519
  },
2179
1520
  ],
@@ -2189,7 +1530,7 @@ async function run() {
2189
1530
  ageOfAsset: 3,
2190
1531
  ageOfAssetAtEnd: 8,
2191
1532
  condition: "USED",
2192
- assetType: ConsumerAssetType.MotorVehicle,
1533
+ assetType: CommercialAssetType.MotorVehicleLessThan45Tonnes,
2193
1534
  purpose: "VEHICLE",
2194
1535
  assetValue: "35000.00",
2195
1536
  make: "Toyota",
@@ -2222,15 +1563,14 @@ async function run() {
2222
1563
  }
2223
1564
 
2224
1565
  run();
2225
- ```
2226
1566
 
1567
+ ```
2227
1568
  <!-- End Retries [retries] -->
2228
1569
 
2229
1570
  <!-- Start Error Handling [errors] -->
2230
-
2231
1571
  ## Error Handling
2232
1572
 
2233
- Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the _Errors_ tables in SDK docs. For example, the `create` method may throw the following errors:
1573
+ Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `create` method may throw the following errors:
2234
1574
 
2235
1575
  | Error Type | Status Code | Content Type |
2236
1576
  | ------------------- | ----------- | ---------------- |
@@ -2378,14 +1718,14 @@ async function run() {
2378
1718
  } catch (err) {
2379
1719
  switch (true) {
2380
1720
  // The server response does not match the expected SDK schema
2381
- case err instanceof SDKValidationError: {
1721
+ case (err instanceof SDKValidationError): {
2382
1722
  // Pretty-print will provide a human-readable multi-line error message
2383
1723
  console.error(err.pretty());
2384
1724
  // Raw value may also be inspected
2385
1725
  console.error(err.rawValue);
2386
1726
  return;
2387
1727
  }
2388
- case err instanceof ResponseBody: {
1728
+ case (err instanceof ResponseBody): {
2389
1729
  // Handle err.data$: ResponseBodyData
2390
1730
  console.error(err);
2391
1731
  return;
@@ -2399,26 +1739,25 @@ async function run() {
2399
1739
  }
2400
1740
 
2401
1741
  run();
1742
+
2402
1743
  ```
2403
1744
 
2404
1745
  Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging.
2405
1746
 
2406
1747
  In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `models/errors/httpclienterrors.ts` module:
2407
1748
 
2408
- | HTTP Client Error | Description |
2409
- | --------------------- | ---------------------------------------------------- |
2410
- | RequestAbortedError | HTTP request was aborted by the client |
2411
- | RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
2412
- | ConnectionError | HTTP client was unable to make a request to a server |
2413
- | InvalidRequestError | Any input used to create a request is invalid |
2414
- | UnexpectedClientError | Unrecognised or unexpected error |
2415
-
1749
+ | HTTP Client Error | Description |
1750
+ | ---------------------------------------------------- | ---------------------------------------------------- |
1751
+ | RequestAbortedError | HTTP request was aborted by the client |
1752
+ | RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
1753
+ | ConnectionError | HTTP client was unable to make a request to a server |
1754
+ | InvalidRequestError | Any input used to create a request is invalid |
1755
+ | UnexpectedClientError | Unrecognised or unexpected error |
2416
1756
  <!-- End Error Handling [errors] -->
2417
1757
 
2418
1758
  <!-- No End Server Selection [server] -->
2419
1759
 
2420
1760
  <!-- Start Custom HTTP Client [http-client] -->
2421
-
2422
1761
  ## Custom HTTP Client
2423
1762
 
2424
1763
  The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
@@ -2443,12 +1782,12 @@ const httpClient = new HTTPClient({
2443
1782
  // fetcher takes a function that has the same signature as native `fetch`.
2444
1783
  fetcher: (request) => {
2445
1784
  return fetch(request);
2446
- },
1785
+ }
2447
1786
  });
2448
1787
 
2449
1788
  httpClient.addHook("beforeRequest", (request) => {
2450
1789
  const nextRequest = new Request(request, {
2451
- signal: request.signal || AbortSignal.timeout(5000),
1790
+ signal: request.signal || AbortSignal.timeout(5000)
2452
1791
  });
2453
1792
 
2454
1793
  nextRequest.headers.set("x-custom-header", "custom value");
@@ -2465,11 +1804,9 @@ httpClient.addHook("requestError", (error, request) => {
2465
1804
 
2466
1805
  const sdk = new Financeable({ httpClient });
2467
1806
  ```
2468
-
2469
1807
  <!-- End Custom HTTP Client [http-client] -->
2470
1808
 
2471
1809
  <!-- Start Debugging [debug] -->
2472
-
2473
1810
  ## Debugging
2474
1811
 
2475
1812
  You can setup your SDK to emit debug logs for SDK requests and responses.
@@ -2486,7 +1823,6 @@ const sdk = new Financeable({ debugLogger: console });
2486
1823
  ```
2487
1824
 
2488
1825
  You can also enable a default debug logger by setting an environment variable `FINANCEABLE_DEBUG` to true.
2489
-
2490
1826
  <!-- End Debugging [debug] -->
2491
1827
 
2492
1828
  <!-- Placeholder for Future Speakeasy SDK Sections -->
@@ -5,9 +5,9 @@
5
5
 
6
6
  ### Available Operations
7
7
 
8
- * [oauthToken](#oauthtoken) - Obtain an OAuth client_credentials token
8
+ * [get](#get) - Obtain an OAuth client_credentials token
9
9
 
10
- ## oauthToken
10
+ ## get
11
11
 
12
12
  Obtain an OAuth client_credentials token
13
13
 
@@ -21,7 +21,7 @@ const financeable = new Financeable({
21
21
  });
22
22
 
23
23
  async function run() {
24
- const result = await financeable.oauthToken.oauthToken({
24
+ const result = await financeable.oauthToken.get({
25
25
  grantType: "client_credentials",
26
26
  clientId: "<id>",
27
27
  clientSecret: "<value>",
@@ -41,7 +41,7 @@ The standalone function version of this method:
41
41
 
42
42
  ```typescript
43
43
  import { FinanceableCore } from "@financeable/aggregation/core.js";
44
- import { oauthTokenOauthToken } from "@financeable/aggregation/funcs/oauthTokenOauthToken.js";
44
+ import { oauthTokenGet } from "@financeable/aggregation/funcs/oauthTokenGet.js";
45
45
 
46
46
  // Use `FinanceableCore` for best tree-shaking performance.
47
47
  // You can create one instance of it to use across an application.
@@ -50,7 +50,7 @@ const financeable = new FinanceableCore({
50
50
  });
51
51
 
52
52
  async function run() {
53
- const res = await oauthTokenOauthToken(financeable, {
53
+ const res = await oauthTokenGet(financeable, {
54
54
  grantType: "client_credentials",
55
55
  clientId: "<id>",
56
56
  clientSecret: "<value>",
@@ -9,5 +9,5 @@ import { Result } from "../types/fp.js";
9
9
  /**
10
10
  * Obtain an OAuth client_credentials token
11
11
  */
12
- export declare function oauthTokenOauthToken(client: FinanceableCore, request: components.TokenRequest, options?: RequestOptions): APIPromise<Result<components.TokenResponse, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
13
- //# sourceMappingURL=oauthTokenOauthToken.d.ts.map
12
+ export declare function oauthTokenGet(client: FinanceableCore, request: components.TokenRequest, options?: RequestOptions): APIPromise<Result<components.TokenResponse, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
13
+ //# sourceMappingURL=oauthTokenGet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauthTokenGet.d.ts","sourceRoot":"","sources":["../src/funcs/oauthTokenGet.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,CAAC,YAAY,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,aAAa,EACtB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.oauthTokenOauthToken = oauthTokenOauthToken;
39
+ exports.oauthTokenGet = oauthTokenGet;
40
40
  const encodings_js_1 = require("../lib/encodings.js");
41
41
  const M = __importStar(require("../lib/matchers.js"));
42
42
  const primitives_js_1 = require("../lib/primitives.js");
@@ -48,7 +48,7 @@ const async_js_1 = require("../types/async.js");
48
48
  /**
49
49
  * Obtain an OAuth client_credentials token
50
50
  */
51
- function oauthTokenOauthToken(client, request, options) {
51
+ function oauthTokenGet(client, request, options) {
52
52
  return new async_js_1.APIPromise($do(client, request, options));
53
53
  }
54
54
  async function $do(client, request, options) {
@@ -108,4 +108,4 @@ async function $do(client, request, options) {
108
108
  }
109
109
  return [result, { status: "complete", request: req, response }];
110
110
  }
111
- //# sourceMappingURL=oauthTokenOauthToken.js.map
111
+ //# sourceMappingURL=oauthTokenGet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauthTokenGet.js","sourceRoot":"","sources":["../src/funcs/oauthTokenGet.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BH,sCAqBC;AA5CD,sDAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAC3C,0EAA4D;AAU5D,gDAAwD;AAGxD;;GAEG;AACH,SAAgB,aAAa,CAC3B,MAAuB,EACvB,OAAgC,EAChC,OAAwB;IAaxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAuB,EACvB,OAAgC,EAChC,OAAwB;IAgBxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,2BAA2B,CAAC,KAAK,CAAC,KAAK,CAAC,EAC9D,yBAAyB,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,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@financeable/aggregation",
5
- "version": "0.4.2",
5
+ "version": "0.4.5",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/lib/config.d.ts CHANGED
@@ -27,8 +27,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
27
27
  export declare const SDK_METADATA: {
28
28
  readonly language: "typescript";
29
29
  readonly openapiDocVersion: "0.4.0";
30
- readonly sdkVersion: "0.4.2";
30
+ readonly sdkVersion: "0.4.5";
31
31
  readonly genVersion: "2.552.1";
32
- readonly userAgent: "speakeasy-sdk/typescript 0.4.2 2.552.1 0.4.0 @financeable/aggregation";
32
+ readonly userAgent: "speakeasy-sdk/typescript 0.4.5 2.552.1 0.4.0 @financeable/aggregation";
33
33
  };
34
34
  //# sourceMappingURL=config.d.ts.map
package/lib/config.js CHANGED
@@ -31,8 +31,8 @@ function serverURLFromOptions(options) {
31
31
  exports.SDK_METADATA = {
32
32
  language: "typescript",
33
33
  openapiDocVersion: "0.4.0",
34
- sdkVersion: "0.4.2",
34
+ sdkVersion: "0.4.5",
35
35
  genVersion: "2.552.1",
36
- userAgent: "speakeasy-sdk/typescript 0.4.2 2.552.1 0.4.0 @financeable/aggregation",
36
+ userAgent: "speakeasy-sdk/typescript 0.4.5 2.552.1 0.4.0 @financeable/aggregation",
37
37
  };
38
38
  //# sourceMappingURL=config.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financeable/aggregation",
3
- "version": "0.4.2",
3
+ "version": "0.4.5",
4
4
  "author": "Speakeasy",
5
5
  "main": "./index.js",
6
6
  "sideEffects": false,
@@ -4,6 +4,6 @@ export declare class OauthToken extends ClientSDK {
4
4
  /**
5
5
  * Obtain an OAuth client_credentials token
6
6
  */
7
- oauthToken(request: components.TokenRequest, options?: RequestOptions): Promise<components.TokenResponse>;
7
+ get(request: components.TokenRequest, options?: RequestOptions): Promise<components.TokenResponse>;
8
8
  }
9
9
  //# sourceMappingURL=oauthtoken.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauthtoken.d.ts","sourceRoot":"","sources":["../src/sdk/oauthtoken.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,UAAW,SAAQ,SAAS;IACvC;;OAEG;IACG,UAAU,CACd,OAAO,EAAE,UAAU,CAAC,YAAY,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;CAOrC"}
1
+ {"version":3,"file":"oauthtoken.d.ts","sourceRoot":"","sources":["../src/sdk/oauthtoken.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,UAAW,SAAQ,SAAS;IACvC;;OAEG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,YAAY,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;CAOrC"}
package/sdk/oauthtoken.js CHANGED
@@ -4,15 +4,15 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.OauthToken = void 0;
7
- const oauthTokenOauthToken_js_1 = require("../funcs/oauthTokenOauthToken.js");
7
+ const oauthTokenGet_js_1 = require("../funcs/oauthTokenGet.js");
8
8
  const sdks_js_1 = require("../lib/sdks.js");
9
9
  const fp_js_1 = require("../types/fp.js");
10
10
  class OauthToken extends sdks_js_1.ClientSDK {
11
11
  /**
12
12
  * Obtain an OAuth client_credentials token
13
13
  */
14
- async oauthToken(request, options) {
15
- return (0, fp_js_1.unwrapAsync)((0, oauthTokenOauthToken_js_1.oauthTokenOauthToken)(this, request, options));
14
+ async get(request, options) {
15
+ return (0, fp_js_1.unwrapAsync)((0, oauthTokenGet_js_1.oauthTokenGet)(this, request, options));
16
16
  }
17
17
  }
18
18
  exports.OauthToken = OauthToken;
@@ -1 +1 @@
1
- {"version":3,"file":"oauthtoken.js","sourceRoot":"","sources":["../src/sdk/oauthtoken.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8EAAwE;AACxE,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,UAAW,SAAQ,mBAAS;IACvC;;OAEG;IACH,KAAK,CAAC,UAAU,CACd,OAAgC,EAChC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAdD,gCAcC"}
1
+ {"version":3,"file":"oauthtoken.js","sourceRoot":"","sources":["../src/sdk/oauthtoken.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,gEAA0D;AAC1D,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,UAAW,SAAQ,mBAAS;IACvC;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,OAAgC,EAChC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gCAAa,EAC9B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAdD,gCAcC"}
@@ -26,7 +26,7 @@ import { Result } from "../types/fp.js";
26
26
  /**
27
27
  * Obtain an OAuth client_credentials token
28
28
  */
29
- export function oauthTokenOauthToken(
29
+ export function oauthTokenGet(
30
30
  client: FinanceableCore,
31
31
  request: components.TokenRequest,
32
32
  options?: RequestOptions,
package/src/lib/config.ts CHANGED
@@ -57,8 +57,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
57
57
  export const SDK_METADATA = {
58
58
  language: "typescript",
59
59
  openapiDocVersion: "0.4.0",
60
- sdkVersion: "0.4.2",
60
+ sdkVersion: "0.4.5",
61
61
  genVersion: "2.552.1",
62
62
  userAgent:
63
- "speakeasy-sdk/typescript 0.4.2 2.552.1 0.4.0 @financeable/aggregation",
63
+ "speakeasy-sdk/typescript 0.4.5 2.552.1 0.4.0 @financeable/aggregation",
64
64
  } as const;
@@ -2,7 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { oauthTokenOauthToken } from "../funcs/oauthTokenOauthToken.js";
5
+ import { oauthTokenGet } from "../funcs/oauthTokenGet.js";
6
6
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
7
  import * as components from "../models/components/index.js";
8
8
  import { unwrapAsync } from "../types/fp.js";
@@ -11,11 +11,11 @@ export class OauthToken extends ClientSDK {
11
11
  /**
12
12
  * Obtain an OAuth client_credentials token
13
13
  */
14
- async oauthToken(
14
+ async get(
15
15
  request: components.TokenRequest,
16
16
  options?: RequestOptions,
17
17
  ): Promise<components.TokenResponse> {
18
- return unwrapAsync(oauthTokenOauthToken(
18
+ return unwrapAsync(oauthTokenGet(
19
19
  this,
20
20
  request,
21
21
  options,
@@ -1 +0,0 @@
1
- {"version":3,"file":"oauthTokenOauthToken.d.ts","sourceRoot":"","sources":["../src/funcs/oauthTokenOauthToken.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,CAAC,YAAY,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,aAAa,EACtB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"oauthTokenOauthToken.js","sourceRoot":"","sources":["../src/funcs/oauthTokenOauthToken.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BH,oDAqBC;AA5CD,sDAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAC3C,0EAA4D;AAU5D,gDAAwD;AAGxD;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAAuB,EACvB,OAAgC,EAChC,OAAwB;IAaxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAuB,EACvB,OAAgC,EAChC,OAAwB;IAgBxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,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