diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 481c7f7..cf3cd7d 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: ede0e8e6-5a63-4cc3-bd29-551cf1036a60 management: - docChecksum: d5a789891ce0c96a50ecae850b0722ea + docChecksum: 60d27c46481b9d9f9618b01182214273 docVersion: 4.0.0 - speakeasyVersion: 1.452.0 - generationVersion: 2.472.1 - releaseVersion: 5.2.0-alpha.1 - configChecksum: d31541b7e3562c4fb70e3cf5608ca928 + speakeasyVersion: 1.453.6 + generationVersion: 2.474.6 + releaseVersion: 5.2.0-alpha.2 + configChecksum: afe0e4fa8e72100484c2494fbeb8165c repoURL: https://github.com/ryan-timothy-albert/simple-ts-sdk.git installationURL: https://github.com/ryan-timothy-albert/simple-ts-sdk published: true @@ -54,7 +54,7 @@ generatedFiles: - docs/models/operations/deleteorderrequest.md - docs/models/operations/deletepetrequest.md - docs/models/operations/deleteuserrequest.md - - docs/models/operations/findpetsbystatusrequest.md + - docs/models/operations/findpetsbystatustypesrequest.md - docs/models/operations/findpetsbytagsrequest.md - docs/models/operations/getorderbyidrequest.md - docs/models/operations/getpetbyidsrequest.md @@ -72,7 +72,7 @@ generatedFiles: - package.json - src/core.ts - src/funcs/petDeletePet.ts - - src/funcs/petFindPetsByStatus.ts + - src/funcs/petFindPetsByStatusTypes.ts - src/funcs/petFindPetsByTags.ts - src/funcs/petGetPetByIDS.ts - src/funcs/petMyPet123.ts @@ -126,7 +126,7 @@ generatedFiles: - src/models/operations/deleteorder.ts - src/models/operations/deletepet.ts - src/models/operations/deleteuser.ts - - src/models/operations/findpetsbystatus.ts + - src/models/operations/findpetsbystatustypes.ts - src/models/operations/findpetsbytags.ts - src/models/operations/getorderbyid.ts - src/models/operations/getpetbyids.ts @@ -403,4 +403,15 @@ examples: application/json: {"status": 401, "error": "Unauthorized"} "404": application/json: {"status": 404, "error": "Not Found", "code": "object_not_found"} + findPetsByStatusTypes: + speakeasy-default-find-pets-by-status-types: + responses: + "200": + application/json: [{"id": 10, "name": "doggie", "category": {"id": 1, "name": "Dogs"}, "photoUrls": ["", "", ""]}, {"id": 10, "name": "doggie", "category": {"id": 1, "name": "Dogs"}, "photoUrls": ["", ""]}, {"id": 10, "name": "doggie", "category": {"id": 1, "name": "Dogs"}, "photoUrls": [""]}] + "400": + application/json: {"status": 400, "error": "Bad request"} + "401": + application/json: {"status": 401, "error": "Unauthorized"} + "404": + application/json: {"status": 404, "error": "Not Found", "code": "object_not_found"} generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 41afc6d..33194c9 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,7 +16,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false typescript: - version: 5.2.0-alpha.1 + version: 5.2.0-alpha.2 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b9deb0d..dd90f04 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.452.0 +speakeasyVersion: 1.453.6 sources: petstore-oas: sourceNamespace: petstore-oas - sourceRevisionDigest: sha256:72b7f9d31a8851c002e7e79a9c8f94358b8779506992fc92eb8e8a426ddeb2d2 - sourceBlobDigest: sha256:c6c82ed79c2507368596455f17c3e4e4dd8c727feaace70c14db9bed1644ea24 + sourceRevisionDigest: sha256:558595623592288893574691a286b7b0f84a653e88099ea792dab52ecf20113d + sourceBlobDigest: sha256:f02c4f38e98b5b0d5cbcb1cfb791c984d70a54ced9305986b23dadad78683d80 tags: - latest - - speakeasy-sdk-regen-1733427001 + - speakeasy-sdk-regen-1733776001 - 4.0.0 targets: petstore: source: petstore-oas sourceNamespace: petstore-oas - sourceRevisionDigest: sha256:72b7f9d31a8851c002e7e79a9c8f94358b8779506992fc92eb8e8a426ddeb2d2 - sourceBlobDigest: sha256:c6c82ed79c2507368596455f17c3e4e4dd8c727feaace70c14db9bed1644ea24 + sourceRevisionDigest: sha256:558595623592288893574691a286b7b0f84a653e88099ea792dab52ecf20113d + sourceBlobDigest: sha256:f02c4f38e98b5b0d5cbcb1cfb791c984d70a54ced9305986b23dadad78683d80 codeSamplesNamespace: petstore-oas-typescript-code-samples - codeSamplesRevisionDigest: sha256:33c7fc46c0e73ba22318dcebf5c4070d99e7f34e6546c7521fb6404e3804516b + codeSamplesRevisionDigest: sha256:8f1395761bfeab2ff79db70750f75df003f17a571ac173556a4bbc04ae4f5587 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 5de8c6b..1156821 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ run(); * [sit](docs/sdks/pet/README.md#sit) - Update an existing pet * [myPet123](docs/sdks/pet/README.md#mypet123) - Add a new pet to the store -* [findPetsByStatus](docs/sdks/pet/README.md#findpetsbystatus) - Finds Pets by status +* [findPetsByStatusTypes](docs/sdks/pet/README.md#findpetsbystatustypes) - Finds Pets by status * [findPetsByTags](docs/sdks/pet/README.md#findpetsbytags) - Finds Pets by tags * [getPetByIDS](docs/sdks/pet/README.md#getpetbyids) - Find pet by ID * [deletePet](docs/sdks/pet/README.md#deletepet) - Deletes a pet @@ -179,7 +179,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). Available standalone functions - [`petDeletePet`](docs/sdks/pet/README.md#deletepet) - Deletes a pet -- [`petFindPetsByStatus`](docs/sdks/pet/README.md#findpetsbystatus) - Finds Pets by status +- [`petFindPetsByStatusTypes`](docs/sdks/pet/README.md#findpetsbystatustypes) - Finds Pets by status - [`petFindPetsByTags`](docs/sdks/pet/README.md#findpetsbytags) - Finds Pets by tags - [`petGetPetByIDS`](docs/sdks/pet/README.md#getpetbyids) - Find pet by ID - [`petMyPet123`](docs/sdks/pet/README.md#mypet123) - Add a new pet to the store diff --git a/RELEASES.md b/RELEASES.md index 3b91248..d688083 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -442,4 +442,14 @@ Based on: ### Generated - [typescript v5.2.0-alpha.1] . ### Releases -- [NPM v5.2.0-alpha.1] https://www.npmjs.com/package/ryan-simple-test-act/v/5.2.0-alpha.1 - . \ No newline at end of file +- [NPM v5.2.0-alpha.1] https://www.npmjs.com/package/ryan-simple-test-act/v/5.2.0-alpha.1 - . + +## 2024-12-09 20:26:38 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.453.6 (2.474.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v5.2.0-alpha.2] . +### Releases +- [NPM v5.2.0-alpha.2] https://www.npmjs.com/package/ryan-simple-test-act/v/5.2.0-alpha.2 - . \ No newline at end of file diff --git a/docs/models/operations/findpetsbystatusrequest.md b/docs/models/operations/findpetsbystatustypesrequest.md similarity index 81% rename from docs/models/operations/findpetsbystatusrequest.md rename to docs/models/operations/findpetsbystatustypesrequest.md index b3537a3..1659692 100644 --- a/docs/models/operations/findpetsbystatusrequest.md +++ b/docs/models/operations/findpetsbystatustypesrequest.md @@ -1,11 +1,11 @@ -# FindPetsByStatusRequest +# FindPetsByStatusTypesRequest ## Example Usage ```typescript -import { FindPetsByStatusRequest } from "ryan-simple-test-act/models/operations"; +import { FindPetsByStatusTypesRequest } from "ryan-simple-test-act/models/operations"; -let value: FindPetsByStatusRequest = {}; +let value: FindPetsByStatusTypesRequest = {}; ``` ## Fields diff --git a/docs/sdks/pet/README.md b/docs/sdks/pet/README.md index bb80ff2..ad466b3 100644 --- a/docs/sdks/pet/README.md +++ b/docs/sdks/pet/README.md @@ -12,7 +12,7 @@ Find out more dfdsiojfidjs * [sit](#sit) - Update an existing pet * [myPet123](#mypet123) - Add a new pet to the store -* [findPetsByStatus](#findpetsbystatus) - Finds Pets by status +* [findPetsByStatusTypes](#findpetsbystatustypes) - Finds Pets by status * [findPetsByTags](#findpetsbytags) - Finds Pets by tags * [getPetByIDS](#getpetbyids) - Find pet by ID * [deletePet](#deletepet) - Deletes a pet @@ -207,7 +207,7 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | -## findPetsByStatus +## findPetsByStatusTypes Multiple status values can be provided with comma separated strings @@ -221,7 +221,7 @@ const petstore = new Petstore({ }); async function run() { - const result = await petstore.pet.findPetsByStatus({}); + const result = await petstore.pet.findPetsByStatusTypes({}); // Handle the result console.log(result); @@ -236,7 +236,7 @@ The standalone function version of this method: ```typescript import { PetstoreCore } from "ryan-simple-test-act/core.js"; -import { petFindPetsByStatus } from "ryan-simple-test-act/funcs/petFindPetsByStatus.js"; +import { petFindPetsByStatusTypes } from "ryan-simple-test-act/funcs/petFindPetsByStatusTypes.js"; // Use `PetstoreCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -245,7 +245,7 @@ const petstore = new PetstoreCore({ }); async function run() { - const res = await petFindPetsByStatus(petstore, {}); + const res = await petFindPetsByStatusTypes(petstore, {}); if (!res.ok) { throw res.error; @@ -264,7 +264,7 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.FindPetsByStatusRequest](../../models/operations/findpetsbystatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [operations.FindPetsByStatusTypesRequest](../../models/operations/findpetsbystatustypesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | diff --git a/jsr.json b/jsr.json index 0b895ca..6ce839a 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "ryan-simple-test-act", - "version": "5.2.0-alpha.1", + "version": "5.2.0-alpha.2", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index d732841..8881844 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ryan-simple-test-act", - "version": "5.2.0-alpha.1", + "version": "5.2.0-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ryan-simple-test-act", - "version": "5.2.0-alpha.1", + "version": "5.2.0-alpha.2", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", @@ -17,8 +17,6 @@ "zod": "^3.23.4" }, "peerDependencies": { - "react": "^18 || ^19", - "react-dom": "^18 || ^19", "zod": ">= 3" } }, @@ -2068,13 +2066,6 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT", - "peer": true - }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -2160,19 +2151,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "license": "MIT", - "peer": true, - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2488,33 +2466,6 @@ } ] }, - "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" - }, - "peerDependencies": { - "react": "^18.3.1" - } - }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -2652,16 +2603,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - } - }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -4595,12 +4536,6 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "peer": true - }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -4671,15 +4606,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "peer": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4891,25 +4817,6 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, - "react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "peer": true, - "requires": { - "loose-envify": "^1.1.0" - } - }, - "react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "peer": true, - "requires": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" - } - }, "regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -4992,15 +4899,6 @@ "is-regex": "^1.1.4" } }, - "scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "peer": true, - "requires": { - "loose-envify": "^1.1.0" - } - }, "semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", diff --git a/package.json b/package.json index c3e7eea..f7af971 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ryan-simple-test-act", - "version": "5.2.0-alpha.1", + "version": "5.2.0-alpha.2", "author": "ryan-timothy-albert", "main": "./index.js", "sideEffects": false, @@ -14,8 +14,6 @@ "prepublishOnly": "npm run build" }, "peerDependencies": { - "react": "^18 || ^19", - "react-dom": "^18 || ^19", "zod": ">= 3" }, "devDependencies": { diff --git a/src/funcs/petFindPetsByStatus.ts b/src/funcs/petFindPetsByStatusTypes.ts similarity index 94% rename from src/funcs/petFindPetsByStatus.ts rename to src/funcs/petFindPetsByStatusTypes.ts index ee1430b..837ea7a 100644 --- a/src/funcs/petFindPetsByStatus.ts +++ b/src/funcs/petFindPetsByStatusTypes.ts @@ -30,9 +30,9 @@ import { Result } from "../types/fp.js"; * @remarks * Multiple status values can be provided with comma separated strings */ -export async function petFindPetsByStatus( +export async function petFindPetsByStatusTypes( client: PetstoreCore, - request: operations.FindPetsByStatusRequest, + request: operations.FindPetsByStatusTypesRequest, options?: RequestOptions, ): Promise< Result< @@ -51,7 +51,8 @@ export async function petFindPetsByStatus( > { const parsed = safeParse( request, - (value) => operations.FindPetsByStatusRequest$outboundSchema.parse(value), + (value) => + operations.FindPetsByStatusTypesRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { @@ -75,7 +76,7 @@ export async function petFindPetsByStatus( const requestSecurity = resolveGlobalSecurity(securityInput); const context = { - operationID: "findPetsByStatus", + operationID: "findPetsByStatusTypes", oAuth2Scopes: [], resolvedSecurity: requestSecurity, diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts index d1b3396..d34c884 100644 --- a/src/hooks/hooks.ts +++ b/src/hooks/hooks.ts @@ -12,6 +12,7 @@ import { BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, + Hook, Hooks, SDKInitHook, SDKInitOptions, @@ -27,6 +28,25 @@ export class SDKHooks implements Hooks { afterErrorHooks: AfterErrorHook[] = []; constructor() { + const presetHooks: Array = []; + + for (const hook of presetHooks) { + if ("sdkInit" in hook) { + this.registerSDKInitHook(hook); + } + if ("beforeCreateRequest" in hook) { + this.registerBeforeCreateRequestHook(hook); + } + if ("beforeRequest" in hook) { + this.registerBeforeRequestHook(hook); + } + if ("afterSuccess" in hook) { + this.registerAfterSuccessHook(hook); + } + if ("afterError" in hook) { + this.registerAfterErrorHook(hook); + } + } initHooks(this); } diff --git a/src/hooks/types.ts b/src/hooks/types.ts index df5237d..8a27c65 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -100,3 +100,10 @@ export interface Hooks { /** Registers a hook to be used by the SDK for the after error event. */ registerAfterErrorHook(hook: AfterErrorHook): void; } + +export type Hook = + | SDKInitHook + | BeforeCreateRequestHook + | BeforeRequestHook + | AfterSuccessHook + | AfterErrorHook; diff --git a/src/lib/config.ts b/src/lib/config.ts index 087fcd3..d12d1e7 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -81,8 +81,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "4.0.0", - sdkVersion: "5.2.0-alpha.1", - genVersion: "2.472.1", + sdkVersion: "5.2.0-alpha.2", + genVersion: "2.474.6", userAgent: - "speakeasy-sdk/typescript 5.2.0-alpha.1 2.472.1 4.0.0 ryan-simple-test-act", + "speakeasy-sdk/typescript 5.2.0-alpha.2 2.474.6 4.0.0 ryan-simple-test-act", } as const; diff --git a/src/models/operations/findpetsbystatus.ts b/src/models/operations/findpetsbystatustypes.ts similarity index 59% rename from src/models/operations/findpetsbystatus.ts rename to src/models/operations/findpetsbystatustypes.ts index f8f8686..0595512 100644 --- a/src/models/operations/findpetsbystatus.ts +++ b/src/models/operations/findpetsbystatustypes.ts @@ -21,7 +21,7 @@ export const Status = { */ export type Status = ClosedEnum; -export type FindPetsByStatusRequest = { +export type FindPetsByStatusTypesRequest = { /** * Status values that need to be considered for filter */ @@ -48,8 +48,8 @@ export namespace Status$ { } /** @internal */ -export const FindPetsByStatusRequest$inboundSchema: z.ZodType< - FindPetsByStatusRequest, +export const FindPetsByStatusTypesRequest$inboundSchema: z.ZodType< + FindPetsByStatusTypesRequest, z.ZodTypeDef, unknown > = z.object({ @@ -57,15 +57,15 @@ export const FindPetsByStatusRequest$inboundSchema: z.ZodType< }); /** @internal */ -export type FindPetsByStatusRequest$Outbound = { +export type FindPetsByStatusTypesRequest$Outbound = { status: string; }; /** @internal */ -export const FindPetsByStatusRequest$outboundSchema: z.ZodType< - FindPetsByStatusRequest$Outbound, +export const FindPetsByStatusTypesRequest$outboundSchema: z.ZodType< + FindPetsByStatusTypesRequest$Outbound, z.ZodTypeDef, - FindPetsByStatusRequest + FindPetsByStatusTypesRequest > = z.object({ status: Status$outboundSchema.default("available"), }); @@ -74,29 +74,31 @@ export const FindPetsByStatusRequest$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace FindPetsByStatusRequest$ { - /** @deprecated use `FindPetsByStatusRequest$inboundSchema` instead. */ - export const inboundSchema = FindPetsByStatusRequest$inboundSchema; - /** @deprecated use `FindPetsByStatusRequest$outboundSchema` instead. */ - export const outboundSchema = FindPetsByStatusRequest$outboundSchema; - /** @deprecated use `FindPetsByStatusRequest$Outbound` instead. */ - export type Outbound = FindPetsByStatusRequest$Outbound; +export namespace FindPetsByStatusTypesRequest$ { + /** @deprecated use `FindPetsByStatusTypesRequest$inboundSchema` instead. */ + export const inboundSchema = FindPetsByStatusTypesRequest$inboundSchema; + /** @deprecated use `FindPetsByStatusTypesRequest$outboundSchema` instead. */ + export const outboundSchema = FindPetsByStatusTypesRequest$outboundSchema; + /** @deprecated use `FindPetsByStatusTypesRequest$Outbound` instead. */ + export type Outbound = FindPetsByStatusTypesRequest$Outbound; } -export function findPetsByStatusRequestToJSON( - findPetsByStatusRequest: FindPetsByStatusRequest, +export function findPetsByStatusTypesRequestToJSON( + findPetsByStatusTypesRequest: FindPetsByStatusTypesRequest, ): string { return JSON.stringify( - FindPetsByStatusRequest$outboundSchema.parse(findPetsByStatusRequest), + FindPetsByStatusTypesRequest$outboundSchema.parse( + findPetsByStatusTypesRequest, + ), ); } -export function findPetsByStatusRequestFromJSON( +export function findPetsByStatusTypesRequestFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => FindPetsByStatusRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'FindPetsByStatusRequest' from JSON`, + (x) => FindPetsByStatusTypesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'FindPetsByStatusTypesRequest' from JSON`, ); } diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index a1028f0..b7a8492 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -5,7 +5,7 @@ export * from "./deleteorder.js"; export * from "./deletepet.js"; export * from "./deleteuser.js"; -export * from "./findpetsbystatus.js"; +export * from "./findpetsbystatustypes.js"; export * from "./findpetsbytags.js"; export * from "./getorderbyid.js"; export * from "./getpetbyids.js"; diff --git a/src/sdk/pet.ts b/src/sdk/pet.ts index 7917a81..24258ba 100644 --- a/src/sdk/pet.ts +++ b/src/sdk/pet.ts @@ -3,7 +3,7 @@ */ import { petDeletePet } from "../funcs/petDeletePet.js"; -import { petFindPetsByStatus } from "../funcs/petFindPetsByStatus.js"; +import { petFindPetsByStatusTypes } from "../funcs/petFindPetsByStatusTypes.js"; import { petFindPetsByTags } from "../funcs/petFindPetsByTags.js"; import { petGetPetByIDS } from "../funcs/petGetPetByIDS.js"; import { petMyPet123 } from "../funcs/petMyPet123.js"; @@ -55,11 +55,11 @@ export class Pet extends ClientSDK { * @remarks * Multiple status values can be provided with comma separated strings */ - async findPetsByStatus( - request: operations.FindPetsByStatusRequest, + async findPetsByStatusTypes( + request: operations.FindPetsByStatusTypesRequest, options?: RequestOptions, ): Promise> { - return unwrapAsync(petFindPetsByStatus( + return unwrapAsync(petFindPetsByStatusTypes( this, request, options,