From ffe7017ac879b83ca3aafebc3a8739c404b428be Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 17 Feb 2024 00:28:03 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.183.2 --- .speakeasy/gen.lock | 2 +- RELEASES.md | 8 ++++++++ src/lib/config.ts | 4 ++-- src/lib/retries.ts | 27 +++++++++++++++++++++++---- src/sdk/sdk.ts | 4 ---- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a15b1ab..dda637b 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -4,7 +4,7 @@ management: docChecksum: 354db46ad7c46031799521bd155482f1 docVersion: 1.0.0 speakeasyVersion: internal - generationVersion: 2.258.0 + generationVersion: 2.262.2 releaseVersion: 0.1.4 configChecksum: 0a09ed2158bb08e3a5d6b66ceeff3034 repoURL: https://github.com/unkeyed/speakeasy.git diff --git a/RELEASES.md b/RELEASES.md index e9059ee..685555c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -54,4 +54,12 @@ Based on: - OpenAPI Doc 1.0.0 - Speakeasy CLI 1.180.0 (2.258.0) https://github.com/speakeasy-api/speakeasy ### Generated +- [typescript v0.1.4] . + +## 2024-02-17 00:27:40 +### Changes +Based on: +- OpenAPI Doc 1.0.0 +- Speakeasy CLI 1.183.2 (2.262.2) https://github.com/speakeasy-api/speakeasy +### Generated - [typescript v0.1.4] . \ No newline at end of file diff --git a/src/lib/config.ts b/src/lib/config.ts index 1d4a0b7..86a0321 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -52,6 +52,6 @@ export const SDK_METADATA = Object.freeze({ language: "typescript", openapiDocVersion: "1.0.0", sdkVersion: "0.1.4", - genVersion: "2.258.0", - userAgent: "speakeasy-sdk/typescript 0.1.4 2.258.0 1.0.0 openapi", + genVersion: "2.262.2", + userAgent: "speakeasy-sdk/typescript 0.1.4 2.262.2 1.0.0 openapi", }); diff --git a/src/lib/retries.ts b/src/lib/retries.ts index f5e4a5b..ed9b495 100644 --- a/src/lib/retries.ts +++ b/src/lib/retries.ts @@ -191,10 +191,29 @@ async function retryBackoff( throw err; } - const d = Math.min( - initialInterval * Math.pow(x, exponent) + Math.random() * 1000, - maxInterval, - ); + let retryInterval = 0; + if (err instanceof TemporaryError && err.res && err.res.headers) { + const retryVal = err.res.headers.get("retry-after") || ""; + if (retryVal != "") { + const parsedNumber = Number(retryVal); + if (!isNaN(parsedNumber) && Number.isInteger(parsedNumber)) { + retryInterval = parsedNumber * 1000; + } else { + const parsedDate = Date.parse(retryVal); + if (!isNaN(parsedDate)) { + const deltaMS = parsedDate - Date.now(); + retryInterval = deltaMS > 0 ? Math.ceil(deltaMS) : 0; + } + } + } + } + + if (retryInterval == 0) { + retryInterval = + initialInterval * Math.pow(x, exponent) + Math.random() * 1000; + } + + const d = Math.min(retryInterval, maxInterval); await delay(d); x++; diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 93a4f80..479171b 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -1444,7 +1444,6 @@ export class SDK extends ClientSDK { charEncoding: "percent", }), }; - const path$ = this.templateURLComponent("/v1/keys/{keyId}")(pathParams$); let security$; @@ -2051,7 +2050,6 @@ export class SDK extends ClientSDK { charEncoding: "percent", }), }; - const path$ = this.templateURLComponent("/v1/apis/{apiId}")(pathParams$); let security$; @@ -2163,7 +2161,6 @@ export class SDK extends ClientSDK { charEncoding: "percent", }), }; - const path$ = this.templateURLComponent("/v1/apis/{apiId}")(pathParams$); let security$; @@ -2281,7 +2278,6 @@ export class SDK extends ClientSDK { charEncoding: "percent", }), }; - const path$ = this.templateURLComponent("/v1/apis/{apiId}/keys")(pathParams$); const query$ = [