Skip to content

Commit

Permalink
Merge pull request #25 from ryan-timothy-albert/speakeasy-sdk-regen-1…
Browse files Browse the repository at this point in the history
…731088771

chore: 🐝 Update SDK - Generate 1.5.0
  • Loading branch information
ryan-timothy-albert authored Nov 8, 2024
2 parents 1eaef99 + 297063f commit 160fb97
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 70 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: ede0e8e6-5a63-4cc3-bd29-551cf1036a60
management:
docChecksum: ad9cb329480ffb07cb9dd7fb995b32fe
docVersion: 2.0.0
speakeasyVersion: 1.434.6
generationVersion: 2.452.0
releaseVersion: 0.4.1
configChecksum: 6e0b9c3eb32fc1bb3a1dbc86985a45c6
speakeasyVersion: 1.435.1
generationVersion: 2.455.2
releaseVersion: 1.5.0
configChecksum: 84e156e72154f5fcc510fa0f207cf0fc
repoURL: https://github.com/ryan-timothy-albert/simple-ts-sdk.git
installationURL: https://github.com/ryan-timothy-albert/simple-ts-sdk
published: true
Expand Down
3 changes: 2 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
typescript:
version: 0.4.1
version: 1.5.0
additionalDependencies:
dependencies: {}
devDependencies: {}
peerDependencies: {}
additionalPackageJSON: {}
author: ryan-timothy-albert
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
enumFormat: union
flattenGlobalSecurity: true
flatteningOrder: body-first
Expand Down
8 changes: 4 additions & 4 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
speakeasyVersion: 1.434.6
speakeasyVersion: 1.435.1
sources:
petstore-oas:
sourceNamespace: petstore-oas
sourceRevisionDigest: sha256:ee197ce8001abf2968cfc8a9922accef739a688070f09332faa3d8e1b9cffde3
sourceRevisionDigest: sha256:7d0722d82869451d158c2ef04b0aefbfb86330e5bf52e2635ba534cce99b749e
sourceBlobDigest: sha256:bcfe955261b90d79d9dec6342b95e0bedc0b1160b3db0a78fb002734b92b294e
tags:
- latest
Expand All @@ -11,10 +11,10 @@ targets:
petstore:
source: petstore-oas
sourceNamespace: petstore-oas
sourceRevisionDigest: sha256:ee197ce8001abf2968cfc8a9922accef739a688070f09332faa3d8e1b9cffde3
sourceRevisionDigest: sha256:7d0722d82869451d158c2ef04b0aefbfb86330e5bf52e2635ba534cce99b749e
sourceBlobDigest: sha256:bcfe955261b90d79d9dec6342b95e0bedc0b1160b3db0a78fb002734b92b294e
codeSamplesNamespace: petstore-oas-code-samples
codeSamplesRevisionDigest: sha256:45006c956c752c7e9e452aef0094abff8a3c46c46fac07d9ce1b121cd99781e9
codeSamplesRevisionDigest: sha256:b6df772d0e9d5f87bf7f497cd49ff31e6c438d73f72c0dee2d1a33e6fd68871c
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
66 changes: 13 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ If a HTTP request fails, an operation my also throw an error from the `models/er

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

| Error Type | Status Code | Content Type |
| --------------------------- | --------------------------- | --------------------------- |
| errors.ApiErrorInvalidInput | 400 | application/json |
| errors.ApiErrorUnauthorized | 401 | application/json |
| errors.ApiErrorNotFound | 404 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| --------------------------- | ----------- | ---------------- |
| errors.ApiErrorInvalidInput | 400 | application/json |
| errors.ApiErrorUnauthorized | 401 | application/json |
| errors.ApiErrorNotFound | 404 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

```typescript
import { Petstore } from "ryan-simple-test-act";
Expand Down Expand Up @@ -416,59 +416,19 @@ Validation errors can also occur when either method arguments or data returned f
<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index
### Server Variables

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://{environment}.petstore.io` | `environment` (default is `prod`) |

```typescript
import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
serverIdx: 0,
apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
const result = await petstore.pet.dsfsdff({
id: 10,
name: "doggie",
category: {
id: 1,
name: "Dogs",
},
photoUrls: [
"<value>",
"<value>",
"<value>",
],
});

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

run();

```

#### Variables

Some of the server options above contain variables. If you want to set the values of those variables, the following optional parameters are available when initializing the SDK client instance:
The default server `https://{environment}.petstore.io` contains variables and is set to `https://prod.petstore.io` by default. To override default values, the following parameters are available when initializing the SDK client instance:
* `environment: models.ServerEnvironment`

### Override Server URL Per-Client

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:

The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
```typescript
import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
serverURL: "https://{environment}.petstore.io",
serverURL: "https://prod.petstore.io",
apiKey: "<YOUR_API_KEY_HERE>",
});

Expand Down Expand Up @@ -552,9 +512,9 @@ const sdk = new Petstore({ httpClient });

This SDK supports the following security scheme globally:

| Name | Type | Scheme |
| -------- | -------- | -------- |
| `apiKey` | apiKey | API key |
| Name | Type | Scheme |
| -------- | ------ | ------- |
| `apiKey` | apiKey | API key |

To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
```typescript
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,14 @@ Based on:
### Generated
- [typescript v0.4.1] .
### Releases
- [NPM v0.4.1] https://www.npmjs.com/package/ryan-simple-test-act/v/0.4.1 - .
- [NPM v0.4.1] https://www.npmjs.com/package/ryan-simple-test-act/v/0.4.1 - .

## 2024-11-08 18:04:45
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.435.1 (2.455.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.5.0] .
### Releases
- [NPM v1.5.0] https://www.npmjs.com/package/ryan-simple-test-act/v/1.5.0 - .
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": "ryan-simple-test-act",
"version": "0.4.1",
"version": "1.5.0",
"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": "ryan-simple-test-act",
"version": "0.4.1",
"version": "1.5.0",
"author": "ryan-timothy-albert",
"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 @@ -81,8 +81,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "2.0.0",
sdkVersion: "0.4.1",
genVersion: "2.452.0",
sdkVersion: "1.5.0",
genVersion: "2.455.2",
userAgent:
"speakeasy-sdk/typescript 0.4.1 2.452.0 2.0.0 ryan-simple-test-act",
"speakeasy-sdk/typescript 1.5.0 2.455.2 2.0.0 ryan-simple-test-act",
} as const;

0 comments on commit 160fb97

Please sign in to comment.