Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.455.3
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Dec 16, 2024
1 parent 484b621 commit 4a2cd0e
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 149 deletions.
14 changes: 7 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: edadaac9-e645-4ef4-a6c7-a1f73bc19385
management:
docChecksum: 51ce9eed19d52c005de8a312c57c1412
docChecksum: 0eb8574bd95da2d1c115594014d40a94
docVersion: v1.0.0
speakeasyVersion: 1.453.0
generationVersion: 2.472.1
releaseVersion: 4.19.3
configChecksum: 2ddd1125c515d8eccb2f834d6c7918a3
speakeasyVersion: 1.455.3
generationVersion: 2.479.3
releaseVersion: 4.19.4
configChecksum: 118cbb29c8410dfaef73567dc32f4a2a
repoURL: https://github.com/Leonardo-Interactive/leonardo-ts-sdk.git
repoSubDirectory: .
installationURL: https://github.com/Leonardo-Interactive/leonardo-ts-sdk
Expand All @@ -15,13 +15,13 @@ features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
core: 3.18.8
core: 3.18.9
defaultEnabledRetries: 0.1.0
deprecations: 2.81.1
devContainers: 2.90.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.2
flattening: 2.82.0
flattening: 2.82.1
globalSecurity: 2.82.11
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.453.0
speakeasyVersion: 1.455.3
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:24563d98521fc4801cd81def4ae096fe504ba5d601da2932b2633405925ab7b4
sourceBlobDigest: sha256:6b838453aac021bd812fffc15722345c429003ebdd41263b5508a8dc708848fc
sourceRevisionDigest: sha256:f934cc3bf8452768e37e5ab15b4fb8b2f74a72bc6806141c7999514ff3c9cae0
sourceBlobDigest: sha256:0490e0a6c2d2eea9cadf67e79f0da91194c9aefbf66cc6ebd5af2f160cd7cd31
tags:
- latest
- speakeasy-sdk-regen-1733443536
- speakeasy-sdk-regen-1734312569
- v1.0.0
targets:
leonardo-ts-sdk:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:24563d98521fc4801cd81def4ae096fe504ba5d601da2932b2633405925ab7b4
sourceBlobDigest: sha256:6b838453aac021bd812fffc15722345c429003ebdd41263b5508a8dc708848fc
sourceRevisionDigest: sha256:f934cc3bf8452768e37e5ab15b4fb8b2f74a72bc6806141c7999514ff3c9cae0
sourceBlobDigest: sha256:0490e0a6c2d2eea9cadf67e79f0da91194c9aefbf66cc6ebd5af2f160cd7cd31
codeSamplesNamespace: my-source-typescript-code-samples
codeSamplesRevisionDigest: sha256:ba930e110f851245a4a44a9ea8fa72d9de45c36850e7ef1200c2166698c99dcb
codeSamplesRevisionDigest: sha256:509bede085de4d3ad952e13ddd3e7eea14a34c94da82de125982501fad9d70d7
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
46 changes: 27 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,7 @@ 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 `sdk/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 `deleteInitImageById` method may throw the following errors:
If the request fails due to, for example 4XX or 5XX status codes, it will throw a `SDKError`.

| Error Type | Status Code | Content Type |
| --------------- | ----------- | ------------ |
Expand All @@ -224,14 +212,24 @@ async function run() {
console.log(result);
} catch (err) {
switch (true) {
case (err instanceof SDKValidationError): {
// Validation errors can be pretty-printed
console.error(err.pretty());
// Raw value may also be inspected
console.error(err.rawValue);
// The server response does not match the expected SDK schema
case (err instanceof SDKValidationError):
{
// 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);
return;
}
sdkerror.js;
// Server returned an error status code or an unknown content type
case (err instanceof SDKError): {
console.error(err.statusCode);
console.error(err.rawResponse.body);
return;
}
default: {
// Other errors such as network errors, see HTTPClientErrors for more details
throw err;
}
}
Expand All @@ -242,7 +240,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 `sdk/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] -->


Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2529,4 +2529,14 @@ Based on:
### Generated
- [typescript v4.19.3] .
### Releases
- [NPM v4.19.3] https://www.npmjs.com/package/@leonardo-ai/sdk/v/4.19.3 - .
- [NPM v4.19.3] https://www.npmjs.com/package/@leonardo-ai/sdk/v/4.19.3 - .

## 2024-12-16 01:29:25
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.455.3 (2.479.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v4.19.4] .
### Releases
- [NPM v4.19.4] https://www.npmjs.com/package/@leonardo-ai/sdk/v/4.19.4 - .
2 changes: 2 additions & 0 deletions docs/sdk/models/operations/creategenerationrequestbody.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ let value: CreateGenerationRequestBody = {};
| ~~`controlNetType`~~ | [shared.ControlnetType](../../../sdk/models/shared/controlnettype.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>This parameter will be deprecated in September 2024. Please use the controlnets array instead. |
| `controlnets` | [shared.ControlnetInput](../../../sdk/models/shared/controlnetinput.md)[] | :heavy_minus_sign: | N/A |
| `elements` | [shared.ElementInput](../../../sdk/models/shared/elementinput.md)[] | :heavy_minus_sign: | N/A |
| `enhancePrompt` | *boolean* | :heavy_minus_sign: | When enabled, your prompt is expanded to include more detail. |
| `enhancePromptInstruction` | *string* | :heavy_minus_sign: | When enhancePrompt is enabled, the prompt is enhanced based on the given instructions. |
| `expandedDomain` | *boolean* | :heavy_minus_sign: | Enable to use the Expanded Domain feature of Alchemy. |
| `fantasyAvatar` | *boolean* | :heavy_minus_sign: | Enable to use the Fantasy Avatar feature. |
| `guidanceScale` | *number* | :heavy_minus_sign: | How strongly the generation should reflect the prompt. 7 is recommended. Must be between 1 and 20. |
Expand Down
7 changes: 4 additions & 3 deletions docs/sdk/models/operations/promptimproverequestbody.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let value: PromptImproveRequestBody = {

## Fields

| Field | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `prompt` | *string* | :heavy_check_mark: | The prompt to improve. |
| Field | Type | Required | Description |
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| `prompt` | *string* | :heavy_check_mark: | The prompt to improve. |
| `promptInstructions` | *string* | :heavy_minus_sign: | The prompt is improved based on the given instructions. |
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 4.19.3
version: 4.19.4
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": "@leonardo-ai/sdk",
"version": "4.19.3",
"version": "4.19.4",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
Expand Down
Loading

0 comments on commit 4a2cd0e

Please sign in to comment.