Skip to content

Commit

Permalink
chore: speakeasy sdk regeneration - Generate (#19)
Browse files Browse the repository at this point in the history
* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.8.6

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.8.7

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.9.1

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.9.2

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.9.2

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.11.0

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.12.0

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.12.0

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.12.3

* ci: regenerated with OpenAPI Doc v2, Speakeay CLI 1.12.4

---------

Co-authored-by: speakeasybot <[email protected]>
  • Loading branch information
github-actions[bot] and speakeasybot authored Mar 21, 2023
1 parent 1f92b85 commit 33fd4f7
Show file tree
Hide file tree
Showing 79 changed files with 3,856 additions and 2,935 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,26 @@ yarn add circleci-v2-sdk
```typescript
import {
AddEnvironmentVariableToContextRequest,
AddEnvironmentVariableToContextResponse
AddEnvironmentVariableToContextResponse
} from "circleci-v2-sdk/dist/sdk/models/operations";

import { AxiosError } from "axios";
import { SDK } from "circleci-v2-sdk";

const sdk = new SDK({
security: {
apiKeyHeader: {
apiKey: "YOUR_API_KEY_HERE",
},
}
},
});

const req: AddEnvironmentVariableToContextRequest = {
pathParams: {
contextId: "unde",
envVarName: "deserunt",
contextId: "89bd9d8d-69a6-474e-8f46-7cc8796ed151",
envVarName: "est",
},
request: {
value: "porro",
value: "some-secret-value",
},
};

Expand Down
81 changes: 81 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,84 @@ Based on:
- Speakeasy CLI 1.8.5 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.8.2] https://www.npmjs.com/package/circleci-v2-sdk/v/3.8.2 - .


## 2023-03-08 00:55:45
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.8.6 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.8.3] https://www.npmjs.com/package/circleci-v2-sdk/v/3.8.3 - .

## 2023-03-09 00:55:37
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.8.7 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.8.4] https://www.npmjs.com/package/circleci-v2-sdk/v/3.8.4 - .

## 2023-03-10 00:54:30
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.9.1 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.9.0] https://www.npmjs.com/package/circleci-v2-sdk/v/3.9.0 - .

## 2023-03-11 00:47:12
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.9.2 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.9.1] https://www.npmjs.com/package/circleci-v2-sdk/v/3.9.1 - .

## 2023-03-14 00:43:38
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.9.2 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.9.2] https://www.npmjs.com/package/circleci-v2-sdk/v/3.9.2 - .

## 2023-03-15 00:51:59
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.11.0 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.10.0] https://www.npmjs.com/package/circleci-v2-sdk/v/3.10.0 - .

## 2023-03-16 00:53:36
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.12.0 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.11.0] https://www.npmjs.com/package/circleci-v2-sdk/v/3.11.0 - .

## 2023-03-17 00:52:03
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.12.0 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.11.1] https://www.npmjs.com/package/circleci-v2-sdk/v/3.11.1 - .

## 2023-03-18 00:50:30
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.12.3 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.11.2] https://www.npmjs.com/package/circleci-v2-sdk/v/3.11.2 - .

## 2023-03-21 00:47:22
### Changes
Based on:
- OpenAPI Doc v2 https://circleci.com/api/v2/openapi.json
- Speakeasy CLI 1.12.4 https://github.com/speakeasy-api/speakeasy
### Releases
- [NPM v3.11.3] https://www.npmjs.com/package/circleci-v2-sdk/v/3.11.3 - .
13 changes: 6 additions & 7 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@
```typescript
import {
AddEnvironmentVariableToContextRequest,
AddEnvironmentVariableToContextResponse
AddEnvironmentVariableToContextResponse
} from "circleci-v2-sdk/dist/sdk/models/operations";

import { AxiosError } from "axios";
import { SDK } from "circleci-v2-sdk";

const sdk = new SDK({
security: {
apiKeyHeader: {
apiKey: "YOUR_API_KEY_HERE",
},
}
},
});

const req: AddEnvironmentVariableToContextRequest = {
pathParams: {
contextId: "unde",
envVarName: "deserunt",
contextId: "89bd9d8d-69a6-474e-8f46-7cc8796ed151",
envVarName: "est",
},
request: {
value: "porro",
value: "some-secret-value",
},
};

Expand Down
6 changes: 3 additions & 3 deletions gen.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
configVersion: 1.0.0
management:
docChecksum: c6b315cae9e6c5b729c72984151171cd
docChecksum: 24670579f3cbf0c0388e3ab6ba1b8be6
docVersion: v2
speakeasyVersion: 1.8.5
speakeasyVersion: 1.12.4
generation:
baseServerUrl: https://circleci.com/api/v2/
telemetryEnabled: false
sdkClassName: circleci
sdkFlattening: true
typescript:
version: 3.8.2
version: 3.11.3
author: Speakeasy API
packageName: circleci-v2-sdk
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": "circleci-v2-sdk",
"version": "3.8.2",
"version": "3.11.3",
"author": "Speakeasy API",
"scripts": {
"prepare": "tsc --build"
Expand Down
9 changes: 9 additions & 0 deletions src/internal/utils/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ParamDecorator,
convertIfDateObjectToISOString,
} from "./utils";
import {requestMetadataKey} from "./requestbody";

export const headerMetadataKey = "header";

Expand All @@ -18,6 +19,14 @@ export function getHeadersFromRequest(headerParams: any): any {

const fieldNames: string[] = Object.getOwnPropertyNames(headerParams);
fieldNames.forEach((fname) => {
const requestBodyAnn: string = Reflect.getMetadata(
requestMetadataKey,
headerParams,
fname
);

if (requestBodyAnn) return;

const headerAnn: string = Reflect.getMetadata(
headerMetadataKey,
headerParams,
Expand Down
42 changes: 26 additions & 16 deletions src/internal/utils/queryparams.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
import { ParamDecorator } from "./utils";
import {
convertIfDateObjectToISOString,
encodeAndConvertPrimitiveVal,
parseParamDecorator,
populateFromGlobals,
} from "./utils";

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

export const qpMetadataKey = "queryParam";
const queryStringPrefix = "?";

export function serializeQueryParams(queryParams: any): string {
export function serializeQueryParams(queryParams: any, globals?: any): string {
let queryStringParts: string[] = [];
if (!queryParams) return queryStringParts.join("&");

const fieldNames: string[] = Object.getOwnPropertyNames(queryParams);
const fieldNames: string[] =
"__props__" in queryParams
? queryParams["__props__"].map((prop: any) => prop.key)
: Object.getOwnPropertyNames(queryParams);

fieldNames.forEach((fname) => {
const requestBodyAnn: string = Reflect.getMetadata(
requestMetadataKey,
queryParams,
fname
);

if (requestBodyAnn) return;

const qpAnn: string = Reflect.getMetadata(
qpMetadataKey,
queryParams,
Expand All @@ -31,38 +46,35 @@ export function serializeQueryParams(queryParams: any): string {

if (!qpDecorator) return;

let value = queryParams[fname];
value = populateFromGlobals(value, fname, "queryParam", globals);

if (qpDecorator.Serialization === "json")
queryStringParts.push(jsonSerializer({ [fname]: queryParams[fname] }));
queryStringParts.push(jsonSerializer({ [qpDecorator.ParamName]: value }));
else {
switch (qpDecorator.Style) {
case "deepObject":
queryStringParts.push(
deepObjectSerializer(
{ [fname]: queryParams[fname] },
qpDecorator.DateTimeFormat
)
deepObjectSerializer({ [qpDecorator.ParamName]: value }, qpDecorator.DateTimeFormat)
);
return;
case "form":
if (!qpDecorator.Explode)
queryStringParts.push(
formSerializer(
{ [fname]: queryParams[fname] },
qpDecorator.DateTimeFormat
)
formSerializer({ [qpDecorator.ParamName]: value }, qpDecorator.DateTimeFormat)
);
else
queryStringParts.push(
formSerializerExplode(
{ [fname]: queryParams[fname] },
{ [qpDecorator.ParamName]: value },
qpDecorator.DateTimeFormat
)
);
return;
default:
queryStringParts.push(
formSerializerExplode(
{ [fname]: queryParams[fname] },
{ [qpDecorator.ParamName]: value },
qpDecorator.DateTimeFormat
)
);
Expand Down Expand Up @@ -182,7 +194,6 @@ function formSerializerExplode(
query.push(
Object.getOwnPropertyNames(value)
.map((paramKey: string) => {

const qpAnn: string = Reflect.getMetadata(
qpMetadataKey,
value,
Expand Down Expand Up @@ -238,7 +249,6 @@ function deepObjectSerializer(
query.push(
Object.getOwnPropertyNames(value)
.map((paramKey: string) => {

const qpAnn: string = Reflect.getMetadata(
qpMetadataKey,
value,
Expand Down
Loading

0 comments on commit 33fd4f7

Please sign in to comment.