Skip to content

Commit 9ab57eb

Browse files
committed
ci: regenerated with OpenAPI Doc 0.1.0, Speakeay CLI 0.20.0
1 parent afdc42b commit 9ab57eb

File tree

8 files changed

+15
-74
lines changed

8 files changed

+15
-74
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ sdk.Apis.getApis(request).then((res: GetApisResponse | AxiosError) => {
5757
<!-- Start SDK Available Operations -->
5858
## SDK Available Operations
5959

60-
### SDK SDK
61-
62-
* `validateApiKey` - Validate the current api key.
63-
6460
### ApiEndpoints
6561

6662
* `deleteApiEndpoint` - Delete an ApiEndpoint.

gen.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
management:
2-
openapi-checksum: 2c73ed56562b78c36624b5eaddb0249b
3-
openapi-version: 0.2.0
4-
speakeasy-version: 0.18.3
2+
openapi-checksum: 8e8183d84cace76310a3208e63cd7855
3+
openapi-version: 0.1.0
4+
speakeasy-version: 0.20.0
55
telemetryenabled: null
66
typescript:
77
author: Speakeasy
88
packagename: '@speakeasy-api/speakeasy-client-sdk-typescript'
9-
version: 0.9.0
9+
version: 0.10.0

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@speakeasy-api/speakeasy-client-sdk-typescript",
3-
"version": "0.9.0",
3+
"version": "0.10.0",
44
"author": "Speakeasy",
55
"scripts": {
66
"prepare": "tsc --build"

src/internal/utils/queryparams.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ export function getQueryParamSerializer(
1111
let paramsSerializer: ParamsSerializerOptions = {
1212
serialize: formSerializerExplode,
1313
};
14-
if (queryParams == null) return paramsSerializer;
14+
if (!queryParams) return paramsSerializer;
1515
const fieldNames: string[] = Object.getOwnPropertyNames(queryParams);
1616
fieldNames.forEach((fname) => {
1717
const qpAnn: string = Reflect.getMetadata(
1818
qpMetadataKey,
1919
queryParams,
2020
fname
2121
);
22-
if (qpAnn == null) return {serialize: (params: any) => ""};
22+
if (!qpAnn) return {serialize: (params: any) => ""};
2323
const qpDecorator: ParamDecorator = parseParamDecorator(
2424
qpAnn,
2525
fname,
2626
"form",
2727
true
2828
);
29-
if (qpDecorator == null) return;
29+
if (!qpDecorator) return;
3030
if (qpDecorator.Serialization === "json")
3131
paramsSerializer = {
3232
serialize: (params: any) => Object.keys(params).map(key =>
@@ -65,6 +65,7 @@ export function getQueryParamSerializer(
6565
function formSerializer(params: any): string {
6666
const query: string[] = [];
6767
Object.entries(Object.assign({}, params)).forEach(([key, value]) => {
68+
if (!value) return;
6869
if (value !== Object(value)) query.push(`${key}=${value}`);
6970
else if (Array.isArray(value)) {
7071
const values: string = value.join(",");
@@ -82,6 +83,7 @@ function formSerializer(params: any): string {
8283
function formSerializerExplode(params: any): string {
8384
const query: string[] = [];
8485
Object.entries(Object.assign({}, params)).forEach(([key, value]) => {
86+
if (!value) return;
8587
if (value !== Object(value)) query.push(`${key}=${value}`);
8688
else if (Array.isArray(value)) {
8789
query.push(value.map((aValue) => `${key}=${aValue}`).join("&"));

src/sdk/models/operations/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ export * from "./registerschema";
2929
export * from "./revokeembedaccesstoken";
3030
export * from "./upsertapi";
3131
export * from "./upsertapiendpoint";
32-
export * from "./validateapikey";

src/sdk/models/operations/validateapikey.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/sdk/sdk.ts

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
2-
import * as operations from "./models/operations";
1+
import axios, { AxiosInstance } from "axios";
32
import * as utils from "../internal/utils";
43
import { Security } from "./models/shared";
54

6-
75
import { ApiEndpoints } from "./apiendpoints";
86
import { Apis } from "./apis";
97
import { Embeds } from "./embeds";
@@ -41,8 +39,8 @@ export class SDK {
4139
public _securityClient: AxiosInstance;
4240
public _serverURL: string;
4341
private _language = "typescript";
44-
private _sdkVersion = "0.9.0";
45-
private _genVersion = "0.18.3";
42+
private _sdkVersion = "0.10.0";
43+
private _genVersion = "0.20.0";
4644

4745
constructor(props: SDKProps) {
4846
this._serverURL = props.serverUrl ?? ServerList[ServerProd];
@@ -60,7 +58,6 @@ export class SDK {
6058
this._securityClient = this._defaultClient;
6159
}
6260

63-
6461
this.apiEndpoints = new ApiEndpoints(
6562
this._defaultClient,
6663
this._securityClient,
@@ -115,42 +112,4 @@ export class SDK {
115112
this._genVersion
116113
);
117114
}
118-
119-
/**
120-
* validateApiKey - Validate the current api key.
121-
**/
122-
validateApiKey(
123-
config?: AxiosRequestConfig
124-
): Promise<operations.ValidateApiKeyResponse> {
125-
const baseURL: string = this._serverURL;
126-
const url: string = baseURL.replace(/\/$/, "") + "/v1/auth/validate";
127-
128-
const client: AxiosInstance = this._securityClient!;
129-
130-
131-
const r = client.request({
132-
url: url,
133-
method: "get",
134-
...config,
135-
});
136-
137-
return r.then((httpRes: AxiosResponse) => {
138-
const contentType: string = httpRes?.headers?.["content-type"] ?? "";
139-
140-
if (httpRes?.status == null) throw new Error(`status code not found in response: ${httpRes}`);
141-
const res: operations.ValidateApiKeyResponse = {statusCode: httpRes.status, contentType: contentType};
142-
switch (true) {
143-
case httpRes?.status == 200:
144-
break;
145-
default:
146-
if (utils.matchContentType(contentType, `application/json`)) {
147-
res.error = httpRes?.data;
148-
}
149-
break;
150-
}
151-
152-
return res;
153-
})
154-
}
155-
156115
}

0 commit comments

Comments
 (0)