Skip to content

Commit

Permalink
Merge pull request #6 from speakeasy-sdks/speakeasy-sdk-regen-1717422272
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate
  • Loading branch information
ndimares authored Jun 3, 2024
2 parents d7ad03d + f7838bc commit 78b1279
Show file tree
Hide file tree
Showing 20 changed files with 254 additions and 31 deletions.
12 changes: 7 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 906577a1-c369-4ae0-9074-3e1b5123889d
management:
docChecksum: df07f1659dbc7224abd8310507e51bb9
docChecksum: fab38c1a1497782cd907b141c241cd90
docVersion: 1.0.0
speakeasyVersion: 1.299.4
generationVersion: 2.338.7
releaseVersion: 0.10.1
configChecksum: 58abeac190d3b7951125b3bf71f39708
speakeasyVersion: 1.299.5
generationVersion: 2.338.10
releaseVersion: 0.11.0
configChecksum: c1045fb4983de64f4e20966a0314340e
repoURL: https://github.com/speakeasy-sdks/bar-typescript.git
repoSubDirectory: .
installationURL: https://github.com/speakeasy-sdks/bar-typescript
Expand All @@ -25,6 +25,7 @@ features:
globalServerURLs: 2.82.4
inputOutputModels: 2.82.0
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.1.0
serverIDs: 2.81.2
webhooks: 1.0.0
Expand Down Expand Up @@ -117,6 +118,7 @@ generatedFiles:
- docs/sdk/models/webhooks/stockupdateresponse.md
- docs/sdk/models/webhooks/stockupdaterequestbody.md
- docs/sdks/barsdk/README.md
- docs/lib/utils/retryconfig.md
- docs/sdks/authentication/README.md
- docs/sdks/drinks/README.md
- docs/sdks/ingredients/README.md
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 0.10.1
version: 0.11.0
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
speakeasyVersion: 1.299.4
speakeasyVersion: 1.299.5
sources:
bar-api:
sourceNamespace: bar-api
sourceRevisionDigest: sha256:04b578e1d2f4ddc2701e42c2ba1b44052dc54efa609fb8e9bf7f0a135618b186
sourceBlobDigest: sha256:ee45d59cc42036c9f421054d9c48c48bca1398802bbe0d854a3a0a08609f8083
sourceRevisionDigest: sha256:3120c462d1c30b38cd1b0ba33d0fa57c2ff9386104f1c11e015921a269499e57
sourceBlobDigest: sha256:530552747d874f53b6894e4f59d46a89c671bbcc29b837b570a5feb43e5059c9
tags:
- latest
- main
targets:
bar-typescript:
source: bar-api
sourceNamespace: bar-api
sourceRevisionDigest: sha256:04b578e1d2f4ddc2701e42c2ba1b44052dc54efa609fb8e9bf7f0a135618b186
sourceBlobDigest: sha256:ee45d59cc42036c9f421054d9c48c48bca1398802bbe0d854a3a0a08609f8083
sourceRevisionDigest: sha256:3120c462d1c30b38cd1b0ba33d0fa57c2ff9386104f1c11e015921a269499e57
sourceBlobDigest: sha256:530552747d874f53b6894e4f59d46a89c671bbcc29b837b570a5feb43e5059c9
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,71 @@ yarn add @speakeasy-sdks/speakeasy-bar
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
<!-- End Requirements [requirements] -->

<!-- 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 { BarSDK } from "@speakeasy-sdks/speakeasy-bar";

const barSDK = new BarSDK();

async function run() {
const result = await barSDK.authentication.authenticate(
{},
{
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 { BarSDK } from "@speakeasy-sdks/speakeasy-bar";

const barSDK = new BarSDK({
retryConfig: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});

async function run() {
const result = await barSDK.authentication.authenticate({});

// 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 @@ -174,4 +174,14 @@ Based on:
### Generated
- [typescript v0.10.1] .
### Releases
- [NPM v0.10.1] https://www.npmjs.com/package/@speakeasy-sdks/speakeasy-bar/v/0.10.1 - .
- [NPM v0.10.1] https://www.npmjs.com/package/@speakeasy-sdks/speakeasy-bar/v/0.10.1 - .

## 2024-06-03 13:44:29
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.299.5 (2.338.10) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.11.0] .
### Releases
- [NPM v0.11.0] https://www.npmjs.com/package/@speakeasy-sdks/speakeasy-bar/v/0.11.0 - .
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/sdks/authentication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ run();
| `request` | [operations.AuthenticateRequestBody](../../sdk/models/operations/authenticaterequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response
Expand Down
1 change: 1 addition & 0 deletions docs/sdks/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ run();
| `request` | [operations.RequestBody[]](../../models/.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response
Expand Down
2 changes: 2 additions & 0 deletions docs/sdks/drinks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ run();
| `name` | *string* | :heavy_check_mark: | N/A |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response
Expand Down Expand Up @@ -81,6 +82,7 @@ run();
| `drinkType` | [shared.DrinkType](../../sdk/models/shared/drinktype.md) | :heavy_minus_sign: | The type of drink to filter by. If not provided all drinks will be returned. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response
Expand Down
Loading

0 comments on commit 78b1279

Please sign in to comment.