Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.141.1
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Jan 16, 2024
1 parent d1c449a commit e5ac6b2
Show file tree
Hide file tree
Showing 30 changed files with 274 additions and 268 deletions.
10 changes: 6 additions & 4 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ management:
docChecksum: 354db46ad7c46031799521bd155482f1
docVersion: 1.0.0
speakeasyVersion: internal
generationVersion: 2.231.0
releaseVersion: 0.0.1
configChecksum: 24248c6522d1eaad2a69d9fc3401a944
generationVersion: 2.233.2
releaseVersion: 0.1.0
configChecksum: 3dc062b01f85ae3cf752a2f21d096a3b
repoURL: https://github.com/unkeyed/speakeasy.git
repoSubDirectory: .
installationURL: https://github.com/unkeyed/speakeasy
features:
typescript:
core: 3.4.5
constsAndDefaults: 0.1.1
core: 3.4.6
flattening: 2.81.1
globalSecurity: 2.82.2
globalServerURLs: 2.82.1
generatedFiles:
- src/sdk/sdk.ts
- .eslintrc.js
- .npmignore
- RUNTIMES.md
- package-lock.json
- package.json
- src/index.ts
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ generation:
fixes:
nameResolutionDec2023: true
typescript:
version: 0.0.1
version: 0.1.0
author: Speakeasy
clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true
Expand Down
131 changes: 88 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ async function run() {
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.getV1Liveness();
const result = await sdk.getV1Liveness();

if (res?.statusCode !== 200) {
throw new Error("Unexpected status code: " + res?.statusCode || "-");
}

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

run();
Expand Down Expand Up @@ -115,38 +112,47 @@ async function run() {
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.getV1Liveness().catch((err) => {
if (err instanceof errors.ErrBadRequest) {
console.error(err); // handle exception
return null;
} else if (err instanceof errors.ErrUnauthorized) {
console.error(err); // handle exception
return null;
} else if (err instanceof errors.ErrForbidden) {
console.error(err); // handle exception
return null;
} else if (err instanceof errors.ErrNotFound) {
console.error(err); // handle exception
return null;
} else if (err instanceof errors.ErrConflict) {
console.error(err); // handle exception
return null;
} else if (err instanceof errors.ErrTooManyRequests) {
console.error(err); // handle exception
return null;
} else if (err instanceof errors.ErrInternalServerError) {
console.error(err); // handle exception
return null;
} else {
throw err;
let result;
try {
result = await sdk.getV1Liveness();
} catch (err) {
switch (true) {
case err instanceof errors.ErrBadRequest: {
console.error(err); // handle exception
return;
}
case err instanceof errors.ErrUnauthorized: {
console.error(err); // handle exception
return;
}
case err instanceof errors.ErrForbidden: {
console.error(err); // handle exception
return;
}
case err instanceof errors.ErrNotFound: {
console.error(err); // handle exception
return;
}
case err instanceof errors.ErrConflict: {
console.error(err); // handle exception
return;
}
case err instanceof errors.ErrTooManyRequests: {
console.error(err); // handle exception
return;
}
case err instanceof errors.ErrInternalServerError: {
console.error(err); // handle exception
return;
}
default: {
throw err;
}
}
});

if (res?.statusCode !== 200) {
throw new Error("Unexpected status code: " + res?.statusCode || "-");
}

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

run();
Expand All @@ -159,18 +165,54 @@ run();

### Select Server by Index

You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
You can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

| # | Server | Variables |
| - | ------ | --------- |
| 0 | `https://api.unkey.dev` | None |

```typescript
import { SDK } from "openapi";

async function run() {
const sdk = new SDK({
serverIdx: 0,
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const result = await sdk.getV1Liveness();

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

run();

```


### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:
The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example:

```typescript
import { SDK } from "openapi";

async function run() {
const sdk = new SDK({
serverURL: "https://api.unkey.dev",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const result = await sdk.getV1Liveness();

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

run();

```
<!-- End Server Selection [server] -->

<!-- Start Custom HTTP Client [http-client] -->
Expand Down Expand Up @@ -242,20 +284,23 @@ async function run() {
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.getV1Liveness();
const result = await sdk.getV1Liveness();

if (res?.statusCode !== 200) {
throw new Error("Unexpected status code: " + res?.statusCode || "-");
}

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

run();

```
<!-- End Authentication [security] -->

<!-- Start Requirements [requirements] -->
## Requirements

For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
<!-- End Requirements [requirements] -->

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

# Development
Expand Down
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.140.0 (2.231.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.0.1] .
- [typescript v0.0.1] .

## 2024-01-16 00:29:49
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.141.1 (2.233.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.1.0] .
22 changes: 22 additions & 0 deletions RUNTIMES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Supported JavaScript runtimes

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`
* [Async iterables][async-iter] using `Symbol.asyncIterator`

[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
[async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols

Runtime environments that are explicitly supported are:

- Evergreen browsers which include: Chrome, Safari, Edge, Firefox
- Node.js active and maintenance LTS releases
- Currently, this is v18 and v20
- Bun v1 and above
- Deno v1.39
- Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])

[deno-file-streaming]: https://github.com/denoland/deno/issues/11018
9 changes: 3 additions & 6 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ async function run() {
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.getV1Liveness();
const result = await sdk.getV1Liveness();

if (res?.statusCode !== 200) {
throw new Error("Unexpected status code: " + res?.statusCode || "-");
}

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

run();
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/ratelimit.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Unkey comes with per-key ratelimiting out of the box.

| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | [components.TypeT](../../models/components/typet.md) | :heavy_check_mark: | Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.<br/><br/>[Learn more](https://unkey.dev/docs/features/ratelimiting) |
| `type` | [components.TypeT](../../models/components/typet.md) | :heavy_minus_sign: | Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.<br/><br/>[Learn more](https://unkey.dev/docs/features/ratelimiting) |
| `limit` | *number* | :heavy_check_mark: | The total amount of burstable requests. |
| `refillRate` | *number* | :heavy_check_mark: | How many tokens to refill during each refillInterval. |
| `refillInterval` | *number* | :heavy_check_mark: | Determines the speed at which tokens are refilled, in milliseconds. |
2 changes: 1 addition & 1 deletion docs/models/operations/postv1keysratelimit.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Unkey comes with per-key ratelimiting out of the box.

| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | [operations.PostV1KeysType](../../models/operations/postv1keystype.md) | :heavy_check_mark: | Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.<br/><br/>[Learn more](https://unkey.dev/docs/features/ratelimiting) |
| `type` | [operations.PostV1KeysType](../../models/operations/postv1keystype.md) | :heavy_minus_sign: | Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.<br/><br/>[Learn more](https://unkey.dev/docs/features/ratelimiting) |
| `limit` | *number* | :heavy_check_mark: | The total amount of burstable requests. |
| `refillRate` | *number* | :heavy_check_mark: | How many tokens to refill during each refillInterval. |
| `refillInterval` | *number* | :heavy_check_mark: | Determines the speed at which tokens are refilled, in milliseconds. |
Loading

0 comments on commit e5ac6b2

Please sign in to comment.