Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.176.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Feb 9, 2024
1 parent 94df9be commit 65d3daa
Show file tree
Hide file tree
Showing 7 changed files with 35 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,19 +4,19 @@ management:
docChecksum: 354db46ad7c46031799521bd155482f1
docVersion: 1.0.0
speakeasyVersion: internal
generationVersion: 2.245.1
releaseVersion: 0.1.1
configChecksum: 938a84ec2866c02fa465e4e761d31341
generationVersion: 2.250.22
releaseVersion: 0.1.2
configChecksum: 3c6d3c91c337227927d9cec81c93dde2
repoURL: https://github.com/unkeyed/speakeasy.git
repoSubDirectory: .
installationURL: https://github.com/unkeyed/speakeasy
features:
typescript:
constsAndDefaults: 0.1.1
core: 3.4.8
constsAndDefaults: 0.1.2
core: 3.4.9
flattening: 2.81.1
globalSecurity: 2.82.2
globalServerURLs: 2.82.1
globalServerURLs: 2.82.2
generatedFiles:
- src/sdk/sdk.ts
- .eslintrc.js
Expand Down
4 changes: 3 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ generation:
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
parameterOrderingFeb2024: false
requestResponseComponentNamesFeb2024: false
typescript:
version: 0.1.1
version: 0.1.2
author: Speakeasy
clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true
Expand Down
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.161.0 (2.245.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.1.1] .
- [typescript v0.1.1] .

## 2024-02-09 00:27:16
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.176.0 (2.250.22) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.1.2] .
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": "openapi",
"version": "0.1.1",
"version": "0.1.2",
"author": "Speakeasy",
"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: "1.0.0",
sdkVersion: "0.1.1",
genVersion: "2.245.1",
userAgent: "speakeasy-sdk/typescript 0.1.1 2.245.1 1.0.0 openapi",
sdkVersion: "0.1.2",
genVersion: "2.250.22",
userAgent: "speakeasy-sdk/typescript 0.1.2 2.250.22 1.0.0 openapi",
});
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 65d3daa

Please sign in to comment.