Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc v1.0.0, Speakeasy CLI 1.174.2
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Feb 8, 2024
1 parent c911e63 commit 086dc39
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 19 deletions.
12 changes: 6 additions & 6 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ management:
docChecksum: f44cbfdd8643f7b10165cb4138d184e0
docVersion: v1.0.0
speakeasyVersion: internal
generationVersion: 2.237.3
releaseVersion: 3.0.0
configChecksum: 7af8434b9c8bbc7e8caee695375d37cd
generationVersion: 2.250.19
releaseVersion: 4.0.0
configChecksum: 0e7c9e9d543a37b93a611843462c9e0c
repoURL: https://github.com/Leonardo-Interactive/leonardo-ts-sdk.git
repoSubDirectory: .
installationURL: https://github.com/Leonardo-Interactive/leonardo-ts-sdk
published: true
features:
typescript:
constsAndDefaults: 0.1.1
core: 3.4.7
constsAndDefaults: 0.1.2
core: 3.4.9
devContainers: 2.90.0
flattening: 2.81.1
globalSecurity: 2.82.2
globalServerURLs: 2.82.1
globalServerURLs: 2.82.2
generatedFiles:
- src/sdk/dataset.ts
- src/sdk/element.ts
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1779,4 +1779,14 @@ Based on:
### Generated
- [typescript v3.0.0] .
### Releases
- [NPM v3.0.0] https://www.npmjs.com/package/@leonardo-ai/sdk/v/3.0.0 - .
- [NPM v3.0.0] https://www.npmjs.com/package/@leonardo-ai/sdk/v/3.0.0 - .

## 2024-02-08 16:02:06
### Changes
Based on:
- OpenAPI Doc v1.0.0 https://api-docs-nine-delta.vercel.app/cloud/openapi.json
- Speakeasy CLI 1.174.2 (2.250.19) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v4.0.0] .
### Releases
- [NPM v4.0.0] https://www.npmjs.com/package/@leonardo-ai/sdk/v/4.0.0 - .
4 changes: 3 additions & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ generation:
optionalPropertyRendering: withExample
fixes:
nameResolutionDec2023: false
parameterOrderingFeb2024: false
requestResponseComponentNamesFeb2024: false
typescript:
version: 3.0.0
version: 4.0.0
author: leonardoai
clientServerStatusCodesAsErrors: false
flattenGlobalSecurity: true
Expand Down
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,7 +1,7 @@
{
"type": "commonjs",
"name": "@leonardo-ai/sdk",
"version": "3.0.0",
"version": "4.0.0",
"author": "leonardoai",
"main": "./index.js",
"sideEffects": false,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type SDKOptions = {
retryConfig?: RetryConfig;
};

export function serverURLFromOptions(options: SDKOptions): URL {
export function serverURLFromOptions(options: SDKOptions): URL | null {
let serverURL = options.serverURL;

const params: Record<string, string> = {};
Expand All @@ -51,7 +51,7 @@ export function serverURLFromOptions(options: SDKOptions): URL {
export const SDK_METADATA = Object.freeze({
language: "typescript",
openapiDocVersion: "v1.0.0",
sdkVersion: "3.0.0",
genVersion: "2.237.3",
userAgent: "speakeasy-sdk/typescript 3.0.0 2.237.3 v1.0.0 @leonardo-ai/sdk",
sdkVersion: "4.0.0",
genVersion: "2.250.19",
userAgent: "speakeasy-sdk/typescript 4.0.0 2.250.19 v1.0.0 @leonardo-ai/sdk",
});
14 changes: 10 additions & 4 deletions src/lib/sdks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ type RequestConfig = {

export class ClientSDK {
private readonly client: HTTPClient;
protected readonly baseURL: URL;
protected readonly baseURL: URL | null;

constructor(init: { client: HTTPClient; baseURL: URL }) {
constructor(init: { client: HTTPClient; baseURL: URL | null }) {
const url = init.baseURL;
url.pathname = url.pathname.replace(/\/+$/, "") + "/";
if (url) {
url.pathname = url.pathname.replace(/\/+$/, "") + "/";
}

this.client = init.client;
this.baseURL = url;
Expand All @@ -37,7 +39,11 @@ export class ClientSDK {
protected async fetch$(conf: RequestConfig, options?: RequestOptions) {
const { method, path, query, headers: opHeaders, security } = conf;

const reqURL = new URL(conf.baseURL ?? this.baseURL);
const base = conf.baseURL ?? this.baseURL;
if (!base) {
throw new TypeError("No base URL provided for operation");
}
const reqURL = new URL(base);
const inputURL = new URL(path, reqURL);

if (path) {
Expand Down

0 comments on commit 086dc39

Please sign in to comment.