Skip to content

Commit dc9aeb7

Browse files
authored
Merge pull request #646 from codatio/speakeasy-sdk-regen-1736154663
chore: 🐝 Update SDK - Generate Lending library LENDING-LIBRARY 7.1.0
2 parents 089d999 + 0045f95 commit dc9aeb7

File tree

398 files changed

+2383
-828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

398 files changed

+2383
-828
lines changed

.speakeasy/workflow.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.455.5
1+
speakeasyVersion: 1.462.2
22
sources:
33
bank-feeds-source:
44
sourceNamespace: bank-feeds-source
@@ -10,11 +10,11 @@ sources:
1010
- 3.0.0
1111
lending-source:
1212
sourceNamespace: lending-source
13-
sourceRevisionDigest: sha256:92d236683bc6347bb480e5a875864d06d0bf52d7f7d4773fca77e4c475836e67
14-
sourceBlobDigest: sha256:b52d78f87b496418a9a1d7ee5f4b78f4ee3ed0a257fba5a6bd13e82a5ed3548f
13+
sourceRevisionDigest: sha256:39fdb43547a197ae0fd3e96ba42784010d8390e3a80f68e1880194616ac3b2cf
14+
sourceBlobDigest: sha256:c099262909612a8421934ac332897e738611c24f1d6f3878de41ec219fd78b48
1515
tags:
1616
- latest
17-
- speakeasy-sdk-regen-1732640552
17+
- speakeasy-sdk-regen-1736154663
1818
- 3.0.0
1919
platform-source:
2020
sourceNamespace: platform-source
@@ -73,10 +73,10 @@ targets:
7373
lending-library:
7474
source: lending-source
7575
sourceNamespace: lending-source
76-
sourceRevisionDigest: sha256:92d236683bc6347bb480e5a875864d06d0bf52d7f7d4773fca77e4c475836e67
77-
sourceBlobDigest: sha256:b52d78f87b496418a9a1d7ee5f4b78f4ee3ed0a257fba5a6bd13e82a5ed3548f
78-
codeSamplesNamespace: lending-source-code-samples
79-
codeSamplesRevisionDigest: sha256:83f3337ecacef88e2cf654d1fa17afea6f29a12a7a468607f255d77644dc7e25
76+
sourceRevisionDigest: sha256:39fdb43547a197ae0fd3e96ba42784010d8390e3a80f68e1880194616ac3b2cf
77+
sourceBlobDigest: sha256:c099262909612a8421934ac332897e738611c24f1d6f3878de41ec219fd78b48
78+
codeSamplesNamespace: lending-source-typescript-code-samples
79+
codeSamplesRevisionDigest: sha256:68ed48e2d10f460ae87ac774cdea3878a746c9261dc4fa7b7a94b8ea05a5aef5
8080
platform-library:
8181
source: platform-source
8282
sourceNamespace: platform-source

lending/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/react-query
2+
/.speakeasy/reports
13
/models
24
/sdk/models/errors
35
/sdk/types

lending/.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
**/*
2+
!/FUNCTIONS.md
3+
!/RUNTIMES.md
4+
!/REACT_QUERY.md
25
!/**/*.ts
36
!/**/*.js
47
!/**/*.map

lending/.speakeasy/gen.lock

Lines changed: 105 additions & 11 deletions
Large diffs are not rendered by default.

lending/.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ generation:
1414
oAuth2PasswordEnabled: false
1515
telemetryEnabled: true
1616
typescript:
17-
version: 7.0.0
17+
version: 7.1.0
1818
additionalDependencies:
1919
dependencies: {}
2020
devDependencies: {}

lending/FUNCTIONS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ async function run() {
3535
pageSize: 100,
3636
query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee",
3737
orderBy: "-modifiedDate",
38+
tags: "region=uk && team=invoice-finance",
3839
});
3940

4041
switch (true) {

lending/README.md

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,24 @@ The Lending API is built on top of the latest accounting, commerce, and banking
3838

3939
<!-- Start Table of Contents [toc] -->
4040
## Table of Contents
41+
<!-- $toc-max-depth=2 -->
42+
* [Lending](#lending)
43+
* [Endpoints](#endpoints)
44+
* [SDK Installation](#sdk-installation)
45+
* [Example Usage](#example-usage)
46+
* [Requirements](#requirements)
47+
* [SDK Example Usage](#sdk-example-usage)
48+
* [Available Resources and Operations](#available-resources-and-operations)
49+
* [Standalone functions](#standalone-functions)
50+
* [File uploads](#file-uploads)
51+
* [Retries](#retries)
52+
* [Error Handling](#error-handling)
53+
* [Server Selection](#server-selection)
54+
* [Custom HTTP Client](#custom-http-client)
55+
* [Authentication](#authentication)
56+
* [Debugging](#debugging)
57+
* [Support](#support)
4158

42-
* [SDK Installation](#sdk-installation)
43-
* [Requirements](#requirements)
44-
* [SDK Example Usage](#sdk-example-usage)
45-
* [Available Resources and Operations](#available-resources-and-operations)
46-
* [Standalone functions](#standalone-functions)
47-
* [File uploads](#file-uploads)
48-
* [Retries](#retries)
49-
* [Error Handling](#error-handling)
50-
* [Server Selection](#server-selection)
51-
* [Custom HTTP Client](#custom-http-client)
52-
* [Authentication](#authentication)
53-
* [Debugging](#debugging)
5459
<!-- End Table of Contents [toc] -->
5560

5661
<!-- Start SDK Installation [installation] -->
@@ -101,20 +106,23 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
101106
```typescript
102107
import { CodatLending } from "@codat/lending";
103108

104-
const codatLending = new CodatLending({
105-
authHeader: "Basic BASE_64_ENCODED(API_KEY)",
106-
});
109+
const codatLending = new CodatLending();
107110

108111
async function run() {
109-
const result = await codatLending.companies.list({
110-
page: 1,
111-
pageSize: 100,
112-
query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee",
113-
orderBy: "-modifiedDate",
112+
await codatLending.accountCategoriesUpdated({
113+
clientId: "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
114+
clientName: "Bank of Dave",
115+
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
116+
dataConnectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
117+
ruleId: "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
118+
ruleType: "Account Categories Updated",
119+
alertId: "a9367074-b5c3-42c4-9be4-be129f43577e",
120+
message:
121+
"Account categories updated for company f1c35bdc-1546-41b9-baf4-3f31135af968.",
122+
data: {
123+
modifiedDate: "2022-10-23",
124+
},
114125
});
115-
116-
// Handle the result
117-
console.log(result);
118126
}
119127

120128
run();
@@ -351,6 +359,7 @@ run();
351359
#### [loanWriteback.sourceAccounts](docs/sdks/sourceaccounts/README.md)
352360

353361
* [create](docs/sdks/sourceaccounts/README.md#create) - Create source account
362+
* [listMappings](docs/sdks/sourceaccounts/README.md#listmappings) - List bank feed account mappings
354363
* [createMapping](docs/sdks/sourceaccounts/README.md#createmapping) - Create bank feed account mapping
355364

356365
#### [loanWriteback.suppliers](docs/sdks/codatlendingsuppliers/README.md)
@@ -593,6 +602,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
593602
- [`loanWritebackPaymentsGetCreateModel`](docs/sdks/codatlendingloanwritebackpayments/README.md#getcreatemodel) - Get create payment model
594603
- [`loanWritebackSourceAccountsCreate`](docs/sdks/sourceaccounts/README.md#create) - Create source account
595604
- [`loanWritebackSourceAccountsCreateMapping`](docs/sdks/sourceaccounts/README.md#createmapping) - Create bank feed account mapping
605+
- [`loanWritebackSourceAccountsListMappings`](docs/sdks/sourceaccounts/README.md#listmappings) - List bank feed account mappings
596606
- [`loanWritebackSuppliersCreate`](docs/sdks/codatlendingsuppliers/README.md#create) - Create supplier
597607
- [`loanWritebackSuppliersGetCreateUpdateModel`](docs/sdks/codatlendingsuppliers/README.md#getcreateupdatemodel) - Get create/update supplier model
598608
- [`loanWritebackTransfersCreate`](docs/sdks/codatlendingtransfers/README.md#create) - Create transfer
@@ -696,6 +706,7 @@ async function run() {
696706
pageSize: 100,
697707
query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee",
698708
orderBy: "-modifiedDate",
709+
tags: "region=uk && team=invoice-finance",
699710
}, {
700711
retries: {
701712
strategy: "backoff",
@@ -741,6 +752,7 @@ async function run() {
741752
pageSize: 100,
742753
query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee",
743754
orderBy: "-modifiedDate",
755+
tags: "region=uk && team=invoice-finance",
744756
});
745757

746758
// Handle the result
@@ -755,25 +767,15 @@ run();
755767
<!-- Start Error Handling [errors] -->
756768
## Error Handling
757769

758-
All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.SDKError`.
759-
760-
If a HTTP request fails, an operation my also throw an error from the `sdk/models/errors/httpclienterrors.ts` module:
761-
762-
| HTTP Client Error | Description |
763-
| ---------------------------------------------------- | ---------------------------------------------------- |
764-
| RequestAbortedError | HTTP request was aborted by the client |
765-
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
766-
| ConnectionError | HTTP client was unable to make a request to a server |
767-
| InvalidRequestError | Any input used to create a request is invalid |
768-
| UnexpectedClientError | Unrecognised or unexpected error |
769-
770-
In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `list` method may throw the following errors:
770+
Some methods specify known errors which can be thrown. All the known errors are enumerated in the `sdk/models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `list` method may throw the following errors:
771771

772772
| Error Type | Status Code | Content Type |
773773
| ------------------- | -------------------------------------- | ---------------- |
774774
| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json |
775775
| errors.SDKError | 4XX, 5XX | \*/\* |
776776

777+
If the method throws an error and it is not captured by the known errors, it will default to throwing a `SDKError`.
778+
777779
```typescript
778780
import { CodatLending } from "@codat/lending";
779781
import {
@@ -793,14 +795,16 @@ async function run() {
793795
pageSize: 100,
794796
query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee",
795797
orderBy: "-modifiedDate",
798+
tags: "region=uk && team=invoice-finance",
796799
});
797800

798801
// Handle the result
799802
console.log(result);
800803
} catch (err) {
801804
switch (true) {
805+
// The server response does not match the expected SDK schema
802806
case (err instanceof SDKValidationError): {
803-
// Validation errors can be pretty-printed
807+
// Pretty-print will provide a human-readable multi-line error message
804808
console.error(err.pretty());
805809
// Raw value may also be inspected
806810
console.error(err.rawValue);
@@ -812,6 +816,7 @@ async function run() {
812816
return;
813817
}
814818
default: {
819+
// Other errors such as network errors, see HTTPClientErrors for more details
815820
throw err;
816821
}
817822
}
@@ -822,7 +827,17 @@ run();
822827

823828
```
824829

825-
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 string since validation errors can list many issues and the plain error string may be difficult read when debugging.
830+
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.
831+
832+
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 `sdk/models/errors/httpclienterrors.ts` module:
833+
834+
| HTTP Client Error | Description |
835+
| ---------------------------------------------------- | ---------------------------------------------------- |
836+
| RequestAbortedError | HTTP request was aborted by the client |
837+
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
838+
| ConnectionError | HTTP client was unable to make a request to a server |
839+
| InvalidRequestError | Any input used to create a request is invalid |
840+
| UnexpectedClientError | Unrecognised or unexpected error |
826841
<!-- End Error Handling [errors] -->
827842

828843
<!-- Start Server Selection [server] -->
@@ -845,6 +860,7 @@ async function run() {
845860
pageSize: 100,
846861
query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee",
847862
orderBy: "-modifiedDate",
863+
tags: "region=uk && team=invoice-finance",
848864
});
849865

850866
// Handle the result
@@ -930,6 +946,7 @@ async function run() {
930946
pageSize: 100,
931947
query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee",
932948
orderBy: "-modifiedDate",
949+
tags: "region=uk && team=invoice-finance",
933950
});
934951

935952
// Handle the result

lending/RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,14 @@ Based on:
138138
### Generated
139139
- [typescript v7.0.0] lending
140140
### Releases
141-
- [NPM v7.0.0] https://www.npmjs.com/package/@codat/lending/v/7.0.0 - lending
141+
- [NPM v7.0.0] https://www.npmjs.com/package/@codat/lending/v/7.0.0 - lending
142+
143+
## 2025-01-06 09:10:53
144+
### Changes
145+
Based on:
146+
- OpenAPI Doc
147+
- Speakeasy CLI 1.462.2 (2.486.1) https://github.com/speakeasy-api/speakeasy
148+
### Generated
149+
- [typescript v7.1.0] lending
150+
### Releases
151+
- [NPM v7.1.0] https://www.npmjs.com/package/@codat/lending/v/7.1.0 - lending

lending/RUNTIMES.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Supported JavaScript runtimes
22

3-
This SDK is intended to be used in JavaScript runtimes that support the following features:
3+
This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:
44

55
* [Web Fetch API][web-fetch]
66
* [Web Streams API][web-streams] and in particular `ReadableStream`
@@ -20,3 +20,29 @@ Runtime environments that are explicitly supported are:
2020
- Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])
2121

2222
[deno-file-streaming]: https://github.com/denoland/deno/issues/11018
23+
24+
## Recommended TypeScript compiler options
25+
26+
The following `tsconfig.json` options are recommended for projects using this
27+
SDK in order to get static type support for features like async iterables,
28+
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
29+
[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
30+
so on):
31+
32+
[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
33+
[abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
34+
[request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
35+
[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
36+
37+
```jsonc
38+
{
39+
"compilerOptions": {
40+
"target": "es2020", // or higher
41+
"lib": ["es2020", "dom", "dom.iterable"],
42+
}
43+
}
44+
```
45+
46+
While `target` can be set to older ECMAScript versions, it may result in extra,
47+
unnecessary compatibility code being generated if you are not targeting old
48+
runtimes.

lending/USAGE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ async function run() {
1212
pageSize: 100,
1313
query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee",
1414
orderBy: "-modifiedDate",
15+
tags: "region=uk && team=invoice-finance",
1516
});
1617

1718
// Handle the result

0 commit comments

Comments
 (0)