From c5fd565225bb4c522bb7d9c4476042916a92b2ed Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 12 Nov 2024 00:57:31 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.1 --- .speakeasy/workflow.lock | 8 +++---- lending/.speakeasy/gen.lock | 8 +++---- lending/.speakeasy/gen.yaml | 2 +- lending/RELEASES.md | 12 +++++++++- lending/jsr.json | 2 +- lending/package-lock.json | 4 ++-- lending/package.json | 2 +- lending/src/funcs/petsCreatePets.ts | 3 +++ lending/src/funcs/petsListPets.ts | 3 +++ lending/src/funcs/petsShowPetById.ts | 3 +++ lending/src/hooks/types.ts | 2 ++ lending/src/lib/config.ts | 6 ++--- lending/src/lib/primitives.ts | 20 ++++++++++++++++ lending/src/lib/security.ts | 35 ++++++++++++++++++++++++++-- 14 files changed, 91 insertions(+), 19 deletions(-) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 7081ea3..e441f20 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,8 +1,8 @@ -speakeasyVersion: 1.436.0 +speakeasyVersion: 1.438.1 sources: source1: sourceNamespace: source-1 - sourceRevisionDigest: sha256:d1a45d3d136d4ec3bdc89ed376b36b7f13e780cfd038da70119ae2dc69a5ee71 + sourceRevisionDigest: sha256:92d980b20c5f6d648c19fb260d0a77bee98fe9879fdcf521b4b6d32993ff48e5 sourceBlobDigest: sha256:b51ff396c812e5270dad2ba1c47700f138d9a263866fb02f197d9cb5d9b87c08 tags: - latest @@ -21,10 +21,10 @@ targets: lending: source: source1 sourceNamespace: source-1 - sourceRevisionDigest: sha256:d1a45d3d136d4ec3bdc89ed376b36b7f13e780cfd038da70119ae2dc69a5ee71 + sourceRevisionDigest: sha256:92d980b20c5f6d648c19fb260d0a77bee98fe9879fdcf521b4b6d32993ff48e5 sourceBlobDigest: sha256:b51ff396c812e5270dad2ba1c47700f138d9a263866fb02f197d9cb5d9b87c08 codeSamplesNamespace: source-1-code-samples - codeSamplesRevisionDigest: sha256:cd73df6f790edf799b2cf99aef6f232eb5cd323dca9a14a65ed428bdd1b7b8ae + codeSamplesRevisionDigest: sha256:42ca01a1e18e9f381605dc0939ee4c71984345bcc303f7e1dc352d868c4127a8 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/lending/.speakeasy/gen.lock b/lending/.speakeasy/gen.lock index a48eac2..29ddaf7 100755 --- a/lending/.speakeasy/gen.lock +++ b/lending/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 7caa457a-d738-4713-931d-4e4f19784732 management: docChecksum: 1bdb7a6f8bf3995d4b40475228403253 docVersion: 1.0.0 - speakeasyVersion: 1.436.0 - generationVersion: 2.455.2 - releaseVersion: 0.6.5 - configChecksum: 6db5e286a6547bfffeae0431925ffcb6 + speakeasyVersion: 1.438.1 + generationVersion: 2.457.2 + releaseVersion: 0.6.6 + configChecksum: 11b4563e9eda8f89c01c5c4d8543ff88 repoURL: https://github.com/ryan-timothy-albert/sample-ts-monorepo.git repoSubDirectory: lending installationURL: https://gitpkg.now.sh/ryan-timothy-albert/sample-ts-monorepo/lending diff --git a/lending/.speakeasy/gen.yaml b/lending/.speakeasy/gen.yaml index 983d143..cc31b84 100644 --- a/lending/.speakeasy/gen.yaml +++ b/lending/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false typescript: - version: 0.6.5 + version: 0.6.6 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/lending/RELEASES.md b/lending/RELEASES.md index f682c0d..9e23446 100644 --- a/lending/RELEASES.md +++ b/lending/RELEASES.md @@ -568,4 +568,14 @@ Based on: ### Generated - [typescript v0.6.5] lending ### Releases -- [NPM v0.6.5] https://www.npmjs.com/package/ryan-lending/v/0.6.5 - lending \ No newline at end of file +- [NPM v0.6.5] https://www.npmjs.com/package/ryan-lending/v/0.6.5 - lending + +## 2024-11-12 00:57:03 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.438.1 (2.457.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.6.6] lending +### Releases +- [NPM v0.6.6] https://www.npmjs.com/package/ryan-lending/v/0.6.6 - lending \ No newline at end of file diff --git a/lending/jsr.json b/lending/jsr.json index a159868..7925505 100644 --- a/lending/jsr.json +++ b/lending/jsr.json @@ -2,7 +2,7 @@ { "name": "ryan-lending", - "version": "0.6.5", + "version": "0.6.6", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/lending/package-lock.json b/lending/package-lock.json index 55ed662..a0fce73 100644 --- a/lending/package-lock.json +++ b/lending/package-lock.json @@ -1,12 +1,12 @@ { "name": "ryan-lending", - "version": "0.6.5", + "version": "0.6.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ryan-lending", - "version": "0.6.5", + "version": "0.6.6", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/lending/package.json b/lending/package.json index 1ce2f23..0281b54 100644 --- a/lending/package.json +++ b/lending/package.json @@ -1,6 +1,6 @@ { "name": "ryan-lending", - "version": "0.6.5", + "version": "0.6.6", "author": "ryan-timothy-albert", "main": "./index.js", "sideEffects": false, diff --git a/lending/src/funcs/petsCreatePets.ts b/lending/src/funcs/petsCreatePets.ts index 18204d9..371c9cd 100644 --- a/lending/src/funcs/petsCreatePets.ts +++ b/lending/src/funcs/petsCreatePets.ts @@ -60,6 +60,9 @@ export async function petsCreatePets( const context = { operationID: "createPets", oAuth2Scopes: [], + + resolvedSecurity: null, + securitySource: null, retryConfig: options?.retries || client._options.retryConfig diff --git a/lending/src/funcs/petsListPets.ts b/lending/src/funcs/petsListPets.ts index b25aff4..e886d29 100644 --- a/lending/src/funcs/petsListPets.ts +++ b/lending/src/funcs/petsListPets.ts @@ -63,6 +63,9 @@ export async function petsListPets( const context = { operationID: "listPets", oAuth2Scopes: [], + + resolvedSecurity: null, + securitySource: null, retryConfig: options?.retries || client._options.retryConfig diff --git a/lending/src/funcs/petsShowPetById.ts b/lending/src/funcs/petsShowPetById.ts index 0fc8f8e..c551664 100644 --- a/lending/src/funcs/petsShowPetById.ts +++ b/lending/src/funcs/petsShowPetById.ts @@ -66,6 +66,9 @@ export async function petsShowPetById( const context = { operationID: "showPetById", oAuth2Scopes: [], + + resolvedSecurity: null, + securitySource: null, retryConfig: options?.retries || client._options.retryConfig diff --git a/lending/src/hooks/types.ts b/lending/src/hooks/types.ts index 4079cc9..df5237d 100644 --- a/lending/src/hooks/types.ts +++ b/lending/src/hooks/types.ts @@ -4,12 +4,14 @@ import { HTTPClient, RequestInput } from "../lib/http.js"; import { RetryConfig } from "../lib/retries.js"; +import { SecurityState } from "../lib/security.js"; export type HookContext = { operationID: string; oAuth2Scopes?: string[]; securitySource?: any | (() => Promise); retryConfig: RetryConfig; + resolvedSecurity: SecurityState | null; }; export type Awaitable = T | Promise; diff --git a/lending/src/lib/config.ts b/lending/src/lib/config.ts index 4ef6edb..457ed39 100644 --- a/lending/src/lib/config.ts +++ b/lending/src/lib/config.ts @@ -52,7 +52,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.6.5", - genVersion: "2.455.2", - userAgent: "speakeasy-sdk/typescript 0.6.5 2.455.2 1.0.0 ryan-lending", + sdkVersion: "0.6.6", + genVersion: "2.457.2", + userAgent: "speakeasy-sdk/typescript 0.6.6 2.457.2 1.0.0 ryan-lending", } as const; diff --git a/lending/src/lib/primitives.ts b/lending/src/lib/primitives.ts index 23794a2..48b2867 100644 --- a/lending/src/lib/primitives.ts +++ b/lending/src/lib/primitives.ts @@ -2,6 +2,26 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +class InvariantError extends Error { + constructor(message: string) { + super(message); + this.name = "InvariantError"; + } +} + +export function invariant( + condition: unknown, + message: string, +): asserts condition { + if (!condition) { + throw new InvariantError(message); + } +} + +export type ExactPartial = { + [P in keyof T]?: T[P] | undefined; +}; + export type Remap = { [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ ? Mapping[k] diff --git a/lending/src/lib/security.ts b/lending/src/lib/security.ts index 0e75079..321e02f 100644 --- a/lending/src/lib/security.ts +++ b/lending/src/lib/security.ts @@ -2,6 +2,14 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +type OAuth2PasswordFlow = { + username: string; + password?: string | undefined; + clientID: string; + clientSecret?: string | undefined; + tokenURL: string; +}; + export enum SecurityErrorCode { Incomplete = "incomplete", UnrecognisedSecurityType = "unrecognized_security_type", @@ -35,6 +43,7 @@ export type SecurityState = { headers: Record; queryParams: Record; cookies: Record; + oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; }; type SecurityInputBasic = { @@ -77,6 +86,15 @@ type SecurityInputOAuth2ClientCredentials = { | undefined; }; +type SecurityInputOAuth2PasswordCredentials = { + type: "oauth2:password"; + value: + | string + | null + | undefined; + fieldName: string; +}; + type SecurityInputCustom = { type: "http:custom"; value: any | null | undefined; @@ -89,6 +107,7 @@ export type SecurityInput = | SecurityInputAPIKey | SecurityInputOAuth2 | SecurityInputOAuth2ClientCredentials + | SecurityInputOAuth2PasswordCredentials | SecurityInputOIDC | SecurityInputCustom; @@ -100,6 +119,7 @@ export function resolveSecurity( headers: {}, queryParams: {}, cookies: {}, + oauth2: { type: "none" }, }; const option = options.find((opts) => { @@ -110,6 +130,10 @@ export function resolveSecurity( return o.value.username != null || o.value.password != null; } else if (o.type === "http:custom") { return null; + } else if (o.type === "oauth2:password") { + return ( + typeof o.value === "string" && !!o.value + ); } else if (o.type === "oauth2:client_credentials") { return o.value.clientID != null || o.value.clientSecret != null; } else if (typeof o.value === "string") { @@ -154,6 +178,9 @@ export function resolveSecurity( case "oauth2": applyBearer(state, spec); break; + case "oauth2:password": + applyBearer(state, spec); + break; case "oauth2:client_credentials": break; case "openIdConnect": @@ -181,9 +208,13 @@ function applyBasic( function applyBearer( state: SecurityState, - spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC, + spec: + | SecurityInputBearer + | SecurityInputOAuth2 + | SecurityInputOIDC + | SecurityInputOAuth2PasswordCredentials, ) { - if (spec.value == null) { + if (typeof spec.value !== "string" || !spec.value) { return; }