Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.126.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Dec 12, 2023
1 parent cf34002 commit f996d98
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 61 deletions.
77 changes: 38 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

</div>

<!-- Start SDK Installation -->
<!-- Start SDK Installation [installation] -->
## SDK Installation

### NPM
Expand All @@ -20,56 +20,44 @@ npm add https://github.com/speakeasy-sdks/petstore-typescript-sdk
```bash
yarn add https://github.com/speakeasy-sdks/petstore-typescript-sdk
```
<!-- End SDK Installation -->
<!-- End SDK Installation [installation] -->

<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage
<!-- Start SDK Example Usage -->

### Example

```typescript
import { SwaggerPetstore } from "Swagger-Petstore";

(async () => {
async function run() {
const sdk = new SwaggerPetstore();

const res = await sdk.pets.createPets();

if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->

<!-- Start SDK Available Operations -->
<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations


### [pets](docs/sdks/pets/README.md)

* [createPets](docs/sdks/pets/README.md#createpets) - Create a pet
* [listPets](docs/sdks/pets/README.md#listpets) - List all pets
* [showPetById](docs/sdks/pets/README.md#showpetbyid) - Info for a specific pet
<!-- End SDK Available Operations -->

<!-- Start Dev Containers -->

<!-- End Dev Containers -->

<!-- Start Pagination -->
# Pagination
<!-- End Available Resources and Operations [operations] -->

Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a `next` method that can be called to pull down the next group of results. If the
return value of `next` is `null`, then there are no more pages to be fetched.

Here's an example of one such pagination call:
<!-- End Pagination -->



<!-- Start Error Handling -->
<!-- Start Error Handling [errors] -->
## Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
Expand All @@ -83,25 +71,32 @@ Example
```typescript
import { SwaggerPetstore } from "Swagger-Petstore";

(async () => {
async function run() {
const sdk = new SwaggerPetstore();

let res;
try {
res = await sdk.pets.createPets();
} catch (e) {}
} catch (err) {
if (err instanceof errors.SDKError) {
console.error(err); // handle exception
throw err;
}
}

if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```
<!-- End Error Handling -->
<!-- End Error Handling [errors] -->



<!-- Start Server Selection -->
<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index
Expand All @@ -117,7 +112,7 @@ You can override the default server globally by passing a server index to the `s
```typescript
import { SwaggerPetstore } from "Swagger-Petstore";

(async () => {
async function run() {
const sdk = new SwaggerPetstore({
serverIdx: 0,
});
Expand All @@ -127,7 +122,9 @@ import { SwaggerPetstore } from "Swagger-Petstore";
if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```

Expand All @@ -138,7 +135,7 @@ The default server can also be overridden globally by passing a URL to the `serv
```typescript
import { SwaggerPetstore } from "Swagger-Petstore";

(async () => {
async function run() {
const sdk = new SwaggerPetstore({
serverURL: "http://petstore.swagger.io/v1",
});
Expand All @@ -148,31 +145,33 @@ import { SwaggerPetstore } from "Swagger-Petstore";
if (res.statusCode == 200) {
// handle response
}
})();
}

run();

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



<!-- Start Custom HTTP Client -->
<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Typescript SDK makes API calls using the (axios)[https://axios-http.com/docs/intro] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.
The Typescript SDK makes API calls using the [axios](https://axios-http.com/docs/intro) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.

For example, you could specify a header for every request that your sdk makes as follows:

```typescript
from Swagger-Petstore import SwaggerPetstore;
import axios;
import { Swagger-Petstore } from "SwaggerPetstore";
import axios from "axios";

const httpClient = axios.create({
headers: {'x-custom-header': 'someValue'}
})

const sdk = new SwaggerPetstore({defaultClient: httpClient});
```
<!-- End Custom HTTP Client -->
<!-- End Custom HTTP Client [http-client] -->

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

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

## 2023-12-12 01:25:17
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.126.0 (2.213.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.5.0] .
10 changes: 6 additions & 4 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<!-- Start SDK Example Usage -->
<!-- Start SDK Example Usage [usage] -->
```typescript
import { SwaggerPetstore } from "Swagger-Petstore";

(async () => {
async function run() {
const sdk = new SwaggerPetstore();

const res = await sdk.pets.createPets();

if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->
18 changes: 12 additions & 6 deletions docs/sdks/pets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ Create a pet
```typescript
import { SwaggerPetstore } from "Swagger-Petstore";

(async() => {
async function run() {
const sdk = new SwaggerPetstore();

const res = await sdk.pets.createPets();

if (res.statusCode == 200) {
// handle response
}
})();
}

run();
```

### Parameters
Expand Down Expand Up @@ -52,15 +54,17 @@ List all pets
```typescript
import { SwaggerPetstore } from "Swagger-Petstore";

(async() => {
async function run() {
const sdk = new SwaggerPetstore();

const res = await sdk.pets.listPets({});

if (res.statusCode == 200) {
// handle response
}
})();
}

run();
```

### Parameters
Expand Down Expand Up @@ -89,7 +93,7 @@ Info for a specific pet
```typescript
import { SwaggerPetstore } from "Swagger-Petstore";

(async() => {
async function run() {
const sdk = new SwaggerPetstore();

const res = await sdk.pets.showPetById({
Expand All @@ -99,7 +103,9 @@ import { SwaggerPetstore } from "Swagger-Petstore";
if (res.statusCode == 200) {
// handle response
}
})();
}

run();
```

### Parameters
Expand Down
2 changes: 1 addition & 1 deletion files.gen
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ src/sdk/models/shared/pet.ts
src/sdk/models/errors/index.ts
src/sdk/models/operations/index.ts
src/sdk/models/shared/index.ts
USAGE.md
docs/sdk/models/operations/createpetsresponse.md
docs/sdk/models/operations/listpetsrequest.md
docs/sdk/models/operations/listpetsresponse.md
Expand All @@ -37,4 +36,5 @@ docs/sdk/models/shared/errort.md
docs/sdk/models/shared/pet.md
docs/sdks/swaggerpetstore/README.md
docs/sdks/pets/README.md
USAGE.md
.gitattributes
9 changes: 5 additions & 4 deletions gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ configVersion: 1.0.0
management:
docChecksum: 2516596125ef223fbbef6c434d22eaac
docVersion: 1.0.0
speakeasyVersion: 1.121.1
generationVersion: 2.194.1
speakeasyVersion: 1.126.0
generationVersion: 2.213.3
generation:
comments: {}
sdkClassName: Swagger-Petstore
Expand All @@ -12,10 +12,10 @@ generation:
optionalPropertyRendering: withExample
features:
typescript:
core: 3.1.4
core: 3.3.0
globalServerURLs: 2.82.1
typescript:
version: 0.4.4
version: 0.5.0
author: demo
clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true
Expand All @@ -33,3 +33,4 @@ typescript:
outputModelSuffix: output
packageName: Swagger-Petstore
repoSubDirectory: .
templateVersion: v1
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": "Swagger-Petstore",
"version": "0.4.4",
"version": "0.5.0",
"author": "demo",
"scripts": {
"prepare": "tsc --build",
Expand Down
6 changes: 3 additions & 3 deletions src/sdk/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export class SDKConfiguration {
serverDefaults: any;
language = "typescript";
openapiDocVersion = "1.0.0";
sdkVersion = "0.4.4";
genVersion = "2.194.1";
userAgent = "speakeasy-sdk/typescript 0.4.4 2.194.1 1.0.0 Swagger-Petstore";
sdkVersion = "0.5.0";
genVersion = "2.213.3";
userAgent = "speakeasy-sdk/typescript 0.5.0 2.213.3 1.0.0 Swagger-Petstore";
retryConfig?: utils.RetryConfig;
public constructor(init?: Partial<SDKConfiguration>) {
Object.assign(this, init);
Expand Down

0 comments on commit f996d98

Please sign in to comment.