Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🐝 Update SDK - Generate #38

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/esm
/dist
/.tshy
/.tshy-*
/hooks
/models
/sdk/models/errors
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@

/.eslintrc.js
/cjs
/.tshy
/.tshy-*
37 changes: 23 additions & 14 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 2bb10af9-e48a-4bd7-ae46-a35fa809dc29
management:
docChecksum: 408cf4a96e96e76eaf0f8b23c35b2cb3
docVersion: v2.0.0-rc.33
speakeasyVersion: 1.306.0
generationVersion: 2.340.3
releaseVersion: 2.4.4
configChecksum: c010a22da550696fd9374cdeb229e252
docChecksum: b33f71f21d0e4a446c4e868a3856cdaf
docVersion: v2.0.3
speakeasyVersion: 1.344.1
generationVersion: 2.376.2
releaseVersion: 2.5.0
configChecksum: 88af1fdee43139de1ea5c7988578c717
repoURL: https://github.com/formancehq/formance-sdk-typescript.git
repoSubDirectory: .
installationURL: https://github.com/formancehq/formance-sdk-typescript
Expand All @@ -15,9 +15,10 @@ features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.5
core: 3.9.13
core: 3.11.7
defaultEnabledRetries: 0.1.0
deprecations: 2.81.1
errors: 2.81.10
errors: 2.81.12
globalSecurity: 2.82.9
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
Expand All @@ -26,8 +27,9 @@ features:
ignores: 2.81.1
nullables: 0.1.0
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.1.0
unions: 2.85.5
unions: 2.85.6
generatedFiles:
- src/sdk/auth.ts
- src/sdk/ledger.ts
Expand All @@ -38,7 +40,7 @@ generatedFiles:
- src/sdk/wallets.ts
- src/sdk/webhooks.ts
- src/sdk/sdk.ts
- .eslintrc.js
- .eslintrc.cjs
- .npmignore
- RUNTIMES.md
- jsr.json
Expand Down Expand Up @@ -348,7 +350,7 @@ generatedFiles:
- src/sdk/models/shared/activityreverttransactionoutput.ts
- src/sdk/models/shared/orchestrationtransaction.ts
- src/sdk/models/shared/orchestrationlistwalletsresponse.ts
- src/sdk/models/shared/wallet.ts
- src/sdk/models/shared/orchestrationwallet.ts
- src/sdk/models/shared/activitygetwalletoutput.ts
- src/sdk/models/shared/walletwithbalances.ts
- src/sdk/models/shared/assetholder.ts
Expand Down Expand Up @@ -377,7 +379,7 @@ generatedFiles:
- src/sdk/models/shared/activitydebitwallet.ts
- src/sdk/models/shared/debitwalletrequest.ts
- src/sdk/models/shared/activitycreditwallet.ts
- src/sdk/models/shared/creditwalletrequest.ts
- src/sdk/models/shared/orchestrationcreditwalletrequest.ts
- src/sdk/models/shared/activitycreatetransaction.ts
- src/sdk/models/shared/orchestrationposttransaction.ts
- src/sdk/models/shared/activityconfirmhold.ts
Expand Down Expand Up @@ -549,7 +551,9 @@ generatedFiles:
- src/sdk/models/shared/balance.ts
- src/sdk/models/shared/createbalancerequest.ts
- src/sdk/models/shared/createwalletresponse.ts
- src/sdk/models/shared/wallet.ts
- src/sdk/models/shared/createwalletrequest.ts
- src/sdk/models/shared/creditwalletrequest.ts
- src/sdk/models/shared/debitwalletresponse.ts
- src/sdk/models/shared/getbalanceresponse.ts
- src/sdk/models/shared/balancewithassets.ts
Expand Down Expand Up @@ -1035,7 +1039,7 @@ generatedFiles:
- docs/sdk/models/shared/orchestrationtransaction.md
- docs/sdk/models/shared/orchestrationlistwalletsresponsecursor.md
- docs/sdk/models/shared/orchestrationlistwalletsresponse.md
- docs/sdk/models/shared/wallet.md
- docs/sdk/models/shared/orchestrationwallet.md
- docs/sdk/models/shared/activitygetwalletoutput.md
- docs/sdk/models/shared/walletwithbalancesbalances.md
- docs/sdk/models/shared/walletwithbalances.md
Expand Down Expand Up @@ -1070,7 +1074,7 @@ generatedFiles:
- docs/sdk/models/shared/activitydebitwallet.md
- docs/sdk/models/shared/debitwalletrequest.md
- docs/sdk/models/shared/activitycreditwallet.md
- docs/sdk/models/shared/creditwalletrequest.md
- docs/sdk/models/shared/orchestrationcreditwalletrequest.md
- docs/sdk/models/shared/activitycreatetransaction.md
- docs/sdk/models/shared/orchestrationposttransactionscript.md
- docs/sdk/models/shared/orchestrationposttransaction.md
Expand Down Expand Up @@ -1297,7 +1301,10 @@ generatedFiles:
- docs/sdk/models/shared/balance.md
- docs/sdk/models/shared/createbalancerequest.md
- docs/sdk/models/shared/createwalletresponse.md
- docs/sdk/models/shared/walletbalances.md
- docs/sdk/models/shared/wallet.md
- docs/sdk/models/shared/createwalletrequest.md
- docs/sdk/models/shared/creditwalletrequest.md
- docs/sdk/models/shared/debitwalletresponse.md
- docs/sdk/models/shared/getbalanceresponse.md
- docs/sdk/models/shared/balancewithassets.md
Expand Down Expand Up @@ -1336,6 +1343,7 @@ generatedFiles:
- docs/sdk/models/errors/schemaswalletserrorresponseerrorcode.md
- docs/sdk/models/errors/walletserrorresponse.md
- docs/sdk/models/errors/webhookserrorresponse.md
- docs/lib/utils/retryconfig.md
- docs/sdks/sdk/README.md
- docs/sdks/auth/README.md
- docs/sdks/ledger/README.md
Expand All @@ -1350,3 +1358,4 @@ generatedFiles:
- src/hooks/hooks.ts
- src/hooks/types.ts
- src/hooks/index.ts
- CONTRIBUTING.md
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Contributing to This Repository

Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.

## How to Report Issues

If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:

- A clear and descriptive title
- Steps to reproduce the issue
- Expected and actual behavior
- Any relevant logs, screenshots, or error messages
- Information about your environment (e.g., operating system, software versions)
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed

## Issue Triage and Upstream Fixes

We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.

## Contact

If you have any questions or need further assistance, please feel free to reach out by opening an issue.

Thank you for your understanding and cooperation!

The Maintainers
86 changes: 83 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,25 @@ It has been generated successfully based on your OpenAPI spec. However, it is no
npm add @formance/formance-sdk
```

### PNPM

```bash
pnpm add @formance/formance-sdk
```

### Bun

```bash
bun add @formance/formance-sdk
```

### Yarn

```bash
yarn add @formance/formance-sdk
yarn add @formance/formance-sdk zod

# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.
```
<!-- End SDK Installation [installation] -->

Expand Down Expand Up @@ -274,7 +289,7 @@ Validation errors can also occur when either method arguments or data returned f

```typescript
import { SDK } from "@formance/formance-sdk";
import * as errors from "@formance/formance-sdk/sdk/models/errors";
import { SDKValidationError } from "@formance/formance-sdk/sdk/models/errors";

const sdk = new SDK({
authorization: "<YOUR_AUTHORIZATION_HERE>",
Expand Down Expand Up @@ -303,7 +318,7 @@ async function run() {
});
} catch (err) {
switch (true) {
case err instanceof errors.SDKValidationError: {
case err instanceof SDKValidationError: {
// Validation errors can be pretty-printed
console.error(err.pretty());
// Raw value may also be inspected
Expand Down Expand Up @@ -464,6 +479,71 @@ run();
```
<!-- End Authentication [security] -->

<!-- Start Retries [retries] -->
## Retries

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.

To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
```typescript
import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
const result = await sdk.getOIDCWellKnowns({
retries: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});

// Handle the result
console.log(result);
}

run();

```

If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
```typescript
import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
retryConfig: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
const result = await sdk.getOIDCWellKnowns();

// Handle the result
console.log(result);
}

run();

```
<!-- End Retries [retries] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# Development
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,14 @@ Based on:
### Generated
- [typescript v2.4.4] .
### Releases
- [NPM v2.4.4] https://www.npmjs.com/package/@formance/formance-sdk/v/2.4.4 - .
- [NPM v2.4.4] https://www.npmjs.com/package/@formance/formance-sdk/v/2.4.4 - .

## 2024-07-22 00:21:00
### Changes
Based on:
- OpenAPI Doc v2.0.3
- Speakeasy CLI 1.344.1 (2.376.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v2.5.0] .
### Releases
- [NPM v2.5.0] https://www.npmjs.com/package/@formance/formance-sdk/v/2.5.0 - .
2 changes: 1 addition & 1 deletion RUNTIMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This SDK is intended to be used in JavaScript runtimes that support the following features:

* [Web Fetch API][web-fetch]
* [Web Streams API](web-streams) and in particular `ReadableStream`
* [Web Streams API][web-streams] and in particular `ReadableStream`
* [Async iterables][async-iter] using `Symbol.asyncIterator`

[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
Expand Down
24 changes: 24 additions & 0 deletions docs/lib/utils/retryconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# RetryConfig

Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies.

## Fields

| Name | Type | Description | Example |
| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- |
| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` |
| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | |
| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` |

## BackoffStrategy

The backoff strategy allows retrying a request with an exponential backoff between each retry.

### Fields

| Name | Type | Description | Example |
| ------------------ | ------------ | ----------------------------------------- | -------- |
| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` |
| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` |
| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` |
| `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` |
1 change: 1 addition & 0 deletions docs/sdk/models/operations/listaccountsresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `accountsCursorResponse` | [shared.AccountsCursorResponse](../../../sdk/models/shared/accountscursorresponse.md) | :heavy_minus_sign: | OK |
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `errorResponse` | *errors.ErrorResponse* | :heavy_minus_sign: | Not found |
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
Loading