Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0, Speakeay CLI 1.29.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed May 5, 2023
1 parent 64ac7cd commit 0b0b14c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 20 deletions.
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,12 @@ Based on:
- OpenAPI Doc 1.0 https://prod.speakeasyapi.dev/v1/apis/Structure/version/1.0.0/schema/download
- Speakeasy CLI 1.27.0 (2.24.0) https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v0.8.0] https://www.npmjs.com/package/structure-ac/v/0.8.0 - .
- [NPM v0.8.0] https://www.npmjs.com/package/structure-ac/v/0.8.0 - .

## 2023-05-05 00:33:00
### Changes
Based on:
- OpenAPI Doc 1.0 https://prod.speakeasyapi.dev/v1/apis/Structure/version/1.0.0/schema/download
- Speakeasy CLI 1.29.0 (2.26.0) https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v0.9.0] https://www.npmjs.com/package/structure-ac/v/0.9.0 - .
7 changes: 4 additions & 3 deletions gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ configVersion: 1.0.0
management:
docChecksum: e0bf2d205ca94a0d32bd91d6ea558d5b
docVersion: "1.0"
speakeasyVersion: 1.27.0
generationVersion: 2.24.0
speakeasyVersion: 1.29.0
generationVersion: 2.26.0
generation:
telemetryEnabled: false
sdkClassName: structure
singleTagPerOp: false
typescript:
version: 0.8.0
version: 0.9.0
author: structure
maxMethodParams: 0
packageName: structure-ac
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,6 +1,6 @@
{
"name": "structure-ac",
"version": "0.8.0",
"version": "0.9.0",
"author": "structure",
"scripts": {
"prepare": "tsc --build"
Expand Down
32 changes: 21 additions & 11 deletions src/internal/utils/queryparams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
*/

import { parseParamDecorator, populateFromGlobals, valToString } from "./utils";
import {ParamDecorator, parseParamDecorator, populateFromGlobals, valToString} from "./utils";

import { requestMetadataKey } from "./requestbody";
import { ParamDecorator } from "./utils";
import {requestMetadataKey} from "./requestbody";

export const qpMetadataKey = "queryParam";
const queryStringPrefix = "?";
Expand Down Expand Up @@ -34,7 +33,7 @@ export function serializeQueryParams(queryParams: any, globals?: any): string {
fname
);

if (!qpAnn) return { serialize: () => "" };
if (!qpAnn) return {serialize: () => ""};

const qpDecorator: ParamDecorator = parseParamDecorator(
qpAnn,
Expand All @@ -49,27 +48,38 @@ export function serializeQueryParams(queryParams: any, globals?: any): string {
value = populateFromGlobals(value, fname, "queryParam", globals);

if (qpDecorator.Serialization === "json")
queryStringParts.push(jsonSerializer({ [qpDecorator.ParamName]: value }));
queryStringParts.push(jsonSerializer({[qpDecorator.ParamName]: value}));
else {
switch (qpDecorator.Style) {
case "deepObject":
queryStringParts.push(
deepObjectSerializer({ [qpDecorator.ParamName]: value })
deepObjectSerializer({[qpDecorator.ParamName]: value})
);
return;
case "form":
if (!qpDecorator.Explode)
queryStringParts.push(
formSerializer({ [qpDecorator.ParamName]: value })
noExplodeSerializer({[qpDecorator.ParamName]: value})
);
else
queryStringParts.push(
formSerializerExplode({ [qpDecorator.ParamName]: value })
formSerializerExplode({[qpDecorator.ParamName]: value})
);
return;
case "pipeDelimited":
if (!qpDecorator.Explode) {
queryStringParts.push(
noExplodeSerializer({[qpDecorator.ParamName]: value}, "|")
);
} else {
queryStringParts.push(
formSerializerExplode({[qpDecorator.ParamName]: value})
);
}
return;
default:
queryStringParts.push(
formSerializerExplode({ [qpDecorator.ParamName]: value })
formSerializerExplode({[qpDecorator.ParamName]: value})
);
}
}
Expand All @@ -88,15 +98,15 @@ function jsonSerializer(params: Record<string, any>): string {
}

// TODO: Add support for disabling percent encoding for reserved characters
function formSerializer(params: Record<string, any>): string {
function noExplodeSerializer(params: Record<string, any>, delimiter = ","): string {
const query: string[] = [];

Object.entries(Object.assign({}, params)).forEach(([key, value]) => {
if (!value) return;
if (value !== Object(value))
query.push(`${key}=${encodeURIComponent(valToString(value))}`);
else if (Array.isArray(value)) {
const values: string = value.map((aValue) => aValue).join(",");
const values: string = value.map((aValue) => aValue).join(delimiter);

query.push(`${key}=${encodeURIComponent(values)}`);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export class Structure {
public _securityClient: AxiosInstance;
public _serverURL: string;
private _language = "typescript";
private _sdkVersion = "0.8.0";
private _genVersion = "2.24.0";
private _sdkVersion = "0.9.0";
private _genVersion = "2.26.0";
private _globals: any;

constructor(props?: SDKProps) {
Expand Down

0 comments on commit 0b0b14c

Please sign in to comment.