Skip to content

Commit

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

chore: 🐝 Update SDK - Generate THIRD-TARGET 0.5.0
  • Loading branch information
ryan-timothy-albert authored Dec 5, 2024
2 parents 63285bf + 25e1fae commit 0952d78
Show file tree
Hide file tree
Showing 29 changed files with 513 additions and 126 deletions.
10 changes: 6 additions & 4 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ speakeasyVersion: 1.451.5
sources:
petstore:
sourceNamespace: petstore
sourceRevisionDigest: sha256:04dceb84d718c669005ce0085dfbb0e1cc6e947992562d3aed2684354d003408
sourceRevisionDigest: sha256:dc549b80580df16a4afab34b39467505d7570ad17884c039b63a7d951d0b6571
sourceBlobDigest: sha256:012d4be23953adcc7552fbaf9a012f9f2ce1acb929189304bea43cccd9e8e681
tags:
- latest
- speakeasy-sdk-regen-1733358367
- speakeasy-sdk-regen-1733358518
- 1.0.0
targets:
first-target:
Expand All @@ -24,8 +24,10 @@ targets:
third-target:
source: petstore
sourceNamespace: petstore
sourceRevisionDigest: sha256:5139f7eb35bd185e818a5cee58a68734ff027b5a2fa7c7e4bb5c1bff0ecaaf90
sourceBlobDigest: sha256:7c35756702030633a8d2ebb1d378d34f883126319b06edcd798ac7bb2fddb189
sourceRevisionDigest: sha256:dc549b80580df16a4afab34b39467505d7570ad17884c039b63a7d951d0b6571
sourceBlobDigest: sha256:012d4be23953adcc7552fbaf9a012f9f2ce1acb929189304bea43cccd9e8e681
codeSamplesNamespace: petstore-typescript-code-samples
codeSamplesRevisionDigest: sha256:f335eafa55b990fcc6401e16d8afd63d2a43f2fec69e904d38b944f4b3d56666
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
1 change: 1 addition & 0 deletions ts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/react-query
/__tests__
/funcs
/core.*
Expand Down
3 changes: 3 additions & 0 deletions ts/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
**/*
!/FUNCTIONS.md
!/RUNTIMES.md
!/REACT_QUERY.md
!/**/*.ts
!/**/*.js
!/**/*.map
Expand Down
15 changes: 8 additions & 7 deletions ts/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ id: f4be10ce-8651-4157-98c6-d75e2342372f
management:
docChecksum: 1bdb7a6f8bf3995d4b40475228403253
docVersion: 1.0.0
speakeasyVersion: 1.421.0
generationVersion: 2.438.15
releaseVersion: 0.4.0
configChecksum: 0e4d4f7770c9dbcb2f8a13cfc85df0f5
speakeasyVersion: 1.451.5
generationVersion: 2.471.2
releaseVersion: 0.5.0
configChecksum: 6e77ce7fbb1e8f7fb018824a42755c63
repoURL: https://github.com/ryan-timothy-albert/multi-sdk-sample.git
repoSubDirectory: ts
installationURL: https://gitpkg.now.sh/ryan-timothy-albert/multi-sdk-sample/ts
published: true
features:
typescript:
additionalDependencies: 0.1.0
core: 3.18.2
core: 3.18.8
defaultEnabledRetries: 0.1.0
envVarSecurityUsage: 0.1.1
envVarSecurityUsage: 0.1.2
flattening: 2.82.0
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.4
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.1.0
sdkHooks: 0.2.0
generatedFiles:
- .eslintrc.cjs
- .gitattributes
Expand Down Expand Up @@ -116,3 +116,4 @@ examples:
application/json: {"id": 763078, "name": "<value>"}
default:
application/json: {"code": 743784, "message": "<value>"}
generatedTests: {}
5 changes: 4 additions & 1 deletion ts/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ generation:
requestResponseComponentNamesFeb2024: true
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
typescript:
version: 0.4.0
version: 0.5.0
additionalDependencies:
dependencies: {}
devDependencies: {}
peerDependencies: {}
additionalPackageJSON: {}
author: ryantimalbert
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
enableReactQuery: false
enumFormat: enum
flattenGlobalSecurity: true
flatteningOrder: body-first
Expand Down
62 changes: 20 additions & 42 deletions ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,23 @@ It has been generated successfully based on your OpenAPI spec. However, it is no

<!-- Start Table of Contents [toc] -->
## Table of Contents
<!-- $toc-max-depth=2 -->
* [openapi](#openapi)
* [🏗 **Welcome to your new SDK!** 🏗](#welcome-to-your-new-sdk)
* [SDK Installation](#sdk-installation)
* [Requirements](#requirements)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Standalone functions](#standalone-functions)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Custom HTTP Client](#custom-http-client)
* [Debugging](#debugging)
* [Development](#development)
* [Maturity](#maturity)
* [Contributions](#contributions)

* [SDK Installation](#sdk-installation)
* [Requirements](#requirements)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Standalone functions](#standalone-functions)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Custom HTTP Client](#custom-http-client)
* [Debugging](#debugging)
<!-- End Table of Contents [toc] -->

<!-- Start SDK Installation [installation] -->
Expand Down Expand Up @@ -215,9 +221,9 @@ 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 `listPets` method may throw the following errors:

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

```typescript
import { RyTs } from "ryan-test-1";
Expand Down Expand Up @@ -258,37 +264,9 @@ Validation errors can also occur when either method arguments or data returned f
<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index

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 | `http://petstore.swagger.io/v1` | None |

```typescript
import { RyTs } from "ryan-test-1";

const ryTs = new RyTs({
serverIdx: 0,
});

async function run() {
const result = await ryTs.pets.listPets();

// 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` 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 { RyTs } from "ryan-test-1";

Expand Down
12 changes: 11 additions & 1 deletion ts/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,14 @@ Based on:
### Generated
- [typescript v0.4.0] ts
### Releases
- [NPM v0.4.0] https://www.npmjs.com/package/ryan-test-1/v/0.4.0 - ts
- [NPM v0.4.0] https://www.npmjs.com/package/ryan-test-1/v/0.4.0 - ts

## 2024-12-05 00:28:35
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.451.5 (2.471.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.5.0] ts
### Releases
- [NPM v0.5.0] https://www.npmjs.com/package/ryan-test-1/v/0.5.0 - ts
4 changes: 3 additions & 1 deletion ts/docs/sdks/ryts/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# RyTs SDK

## Overview
## Overview

### Available Operations
2 changes: 1 addition & 1 deletion ts/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "ryan-test-1",
"version": "0.4.0",
"version": "0.5.0",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
63 changes: 61 additions & 2 deletions ts/package-lock.json

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

4 changes: 3 additions & 1 deletion ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ryan-test-1",
"version": "0.4.0",
"version": "0.5.0",
"author": "ryantimalbert",
"main": "./index.js",
"sideEffects": false,
Expand All @@ -15,6 +15,8 @@
"prepublishOnly": "npm run build"
},
"peerDependencies": {
"react": "^18 || ^19",
"react-dom": "^18 || ^19",
"zod": ">= 3"
},
"devDependencies": {
Expand Down
12 changes: 9 additions & 3 deletions ts/src/funcs/petsCreatePets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ export async function petsCreatePets(
const context = {
operationID: "createPets",
oAuth2Scopes: [],

resolvedSecurity: null,

securitySource: null,
retryConfig: options?.retries
|| client._options.retryConfig
|| { strategy: "none" },
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
};

const requestRes = client._createRequest(context, {
Expand All @@ -79,9 +86,8 @@ export async function petsCreatePets(
const doResult = await client._do(req, {
context,
errorCodes: ["4XX", "5XX"],
retryConfig: options?.retries
|| client._options.retryConfig,
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
return doResult;
Expand Down
12 changes: 9 additions & 3 deletions ts/src/funcs/petsListPets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ export async function petsListPets(
const context = {
operationID: "listPets",
oAuth2Scopes: [],

resolvedSecurity: null,

securitySource: null,
retryConfig: options?.retries
|| client._options.retryConfig
|| { strategy: "none" },
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
};

const requestRes = client._createRequest(context, {
Expand All @@ -86,9 +93,8 @@ export async function petsListPets(
const doResult = await client._do(req, {
context,
errorCodes: ["4XX", "5XX"],
retryConfig: options?.retries
|| client._options.retryConfig,
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
return doResult;
Expand Down
Loading

0 comments on commit 0952d78

Please sign in to comment.