Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.454.2
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Dec 13, 2024
1 parent 59c1a07 commit c276257
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 33 deletions.
8 changes: 4 additions & 4 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ id: 7a2c976b-8158-4d12-8b59-c491e9e10cfd
management:
docChecksum: 7b0a21df5c4526c3e13357d16d9397df
docVersion: 1.0.0
speakeasyVersion: 1.454.0
generationVersion: 2.477.0
releaseVersion: 0.14.36
configChecksum: a7e01bed1bd8d5a57eb89811cfa090b7
speakeasyVersion: 1.454.2
generationVersion: 2.477.4
releaseVersion: 0.14.37
configChecksum: 7a4cb2dcdc40e54267ad5c2c42c5b28e
repoURL: https://github.com/ding-live/ding-typescript.git
repoSubDirectory: .
installationURL: https://github.com/ding-live/ding-typescript
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.454.0
speakeasyVersion: 1.454.2
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:8b34dbd28104f1e349f95ae16935168257e5f74c494763eb901750a9db5deab8
sourceRevisionDigest: sha256:7aff379fac765da161dea1e936aca7c2c699f68f61d076586307705befe60450
sourceBlobDigest: sha256:1bc8346f862d17395d3ec227c51c74504f59eabaf83eb40c2932c517c8a40bf8
tags:
- latest
- speakeasy-sdk-regen-1733961823
- speakeasy-sdk-regen-1734048224
- 1.0.0
targets:
'@ding-live/ding':
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:8b34dbd28104f1e349f95ae16935168257e5f74c494763eb901750a9db5deab8
sourceRevisionDigest: sha256:7aff379fac765da161dea1e936aca7c2c699f68f61d076586307705befe60450
sourceBlobDigest: sha256:1bc8346f862d17395d3ec227c51c74504f59eabaf83eb40c2932c517c8a40bf8
codeSamplesNamespace: my-source-typescript-code-samples
codeSamplesRevisionDigest: sha256:5203b6170d9da0d3152e09f54023d081203ba3e9c5e88466cfa48a5027621a99
codeSamplesRevisionDigest: sha256:813a1cedfac545ab27c1321c3a0b000e23a2279df42c273e3c2f757824d043aa
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,25 +246,15 @@ run();
<!-- Start Error Handling [errors] -->
## Error Handling

All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.SDKError`.

If a HTTP request fails, an operation my also throw an error from the `models/errors/httpclienterrors.ts` module:

| HTTP Client Error | Description |
| ---------------------------------------------------- | ---------------------------------------------------- |
| RequestAbortedError | HTTP request was aborted by the client |
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
| ConnectionError | HTTP client was unable to make a request to a server |
| InvalidRequestError | Any input used to create a request is invalid |
| UnexpectedClientError | Unrecognised or unexpected error |

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 `check` method may throw the following errors:
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 `check` method may throw the following errors:

| Error Type | Status Code | Content Type |
| -------------------- | ----------- | ---------------- |
| errors.ErrorResponse | 400 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

If the method throws an error and it is not captured by the known errors, it will default to throwing a `SDKError`.

```typescript
import { Ding } from "@ding-live/ding";
import {
Expand All @@ -289,8 +279,9 @@ async function run() {
console.log(result);
} catch (err) {
switch (true) {
// The server response does not match the expected SDK schema
case (err instanceof SDKValidationError): {
// Validation errors can be pretty-printed
// Pretty-print will provide a human-readable multi-line error message
console.error(err.pretty());
// Raw value may also be inspected
console.error(err.rawValue);
Expand All @@ -302,6 +293,7 @@ async function run() {
return;
}
default: {
// Other errors such as network errors, see HTTPClientErrors for more details
throw err;
}
}
Expand All @@ -312,7 +304,17 @@ run();

```

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.
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.

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:

| HTTP Client Error | Description |
| ---------------------------------------------------- | ---------------------------------------------------- |
| RequestAbortedError | HTTP request was aborted by the client |
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
| ConnectionError | HTTP client was unable to make a request to a server |
| InvalidRequestError | Any input used to create a request is invalid |
| UnexpectedClientError | Unrecognised or unexpected error |
<!-- End Error Handling [errors] -->

<!-- Start Custom HTTP Client [http-client] -->
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -966,4 +966,14 @@ Based on:
### Generated
- [typescript v0.14.36] .
### Releases
- [NPM v0.14.36] https://www.npmjs.com/package/@ding-live/ding/v/0.14.36 - .
- [NPM v0.14.36] https://www.npmjs.com/package/@ding-live/ding/v/0.14.36 - .

## 2024-12-13 00:03:41
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.454.2 (2.477.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.14.37] .
### Releases
- [NPM v0.14.37] https://www.npmjs.com/package/@ding-live/ding/v/0.14.37 - .
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 0.14.36
version: 0.14.37
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@ding-live/ding",
"version": "0.14.36",
"version": "0.14.37",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ding-live/ding",
"version": "0.14.36",
"version": "0.14.37",
"author": "Ding",
"main": "./index.js",
"sideEffects": false,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "0.14.36",
genVersion: "2.477.0",
userAgent: "speakeasy-sdk/typescript 0.14.36 2.477.0 1.0.0 @ding-live/ding",
sdkVersion: "0.14.37",
genVersion: "2.477.4",
userAgent: "speakeasy-sdk/typescript 0.14.37 2.477.4 1.0.0 @ding-live/ding",
} as const;

0 comments on commit c276257

Please sign in to comment.