Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.326.3
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Jul 5, 2024
1 parent acc017b commit 672daaa
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 36 deletions.
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
speakeasyVersion: 1.326.0
speakeasyVersion: 1.326.3
sources:
source1:
sourceNamespace: source-1
sourceRevisionDigest: sha256:fa12d729164441d38e10168379d030992371d56c5c1e450902936678b79e872c
sourceBlobDigest: sha256:7d5025103f5f83ffe0d1a94b5a28b4f06a7e9c9516a5b5ea19fd5d2b48db83ea
sourceRevisionDigest: sha256:ac49c0f4c6476fb2b93161605a5d4f97663215a7835cac19e7c0d16cd2e9d39b
sourceBlobDigest: sha256:ee8b7da07674ee2a33ec867b19b8c8a8d3cd5490061478d253dea544ac5d2d75
tags:
- latest
- main
Expand All @@ -23,8 +23,8 @@ targets:
lending:
source: source1
sourceNamespace: source-1
sourceRevisionDigest: sha256:fa12d729164441d38e10168379d030992371d56c5c1e450902936678b79e872c
sourceBlobDigest: sha256:7d5025103f5f83ffe0d1a94b5a28b4f06a7e9c9516a5b5ea19fd5d2b48db83ea
sourceRevisionDigest: sha256:ac49c0f4c6476fb2b93161605a5d4f97663215a7835cac19e7c0d16cd2e9d39b
sourceBlobDigest: sha256:ee8b7da07674ee2a33ec867b19b8c8a8d3cd5490061478d253dea544ac5d2d75
outLocation: lending
workflow:
workflowVersion: 1.0.0
Expand Down
10 changes: 5 additions & 5 deletions lending/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ id: 7caa457a-d738-4713-931d-4e4f19784732
management:
docChecksum: 1bdb7a6f8bf3995d4b40475228403253
docVersion: 1.0.0
speakeasyVersion: 1.326.0
generationVersion: 2.359.0
releaseVersion: 0.0.15
configChecksum: 492e7e7fbc6bd7641e87827be058016d
speakeasyVersion: 1.326.3
generationVersion: 2.359.6
releaseVersion: 0.0.16
configChecksum: 0368e5830f9c2a4b6b705a6ad5ce4534
repoURL: https://github.com/ryan-timothy-albert/sample-ts-monorepo.git
repoSubDirectory: lending
installationURL: https://gitpkg.now.sh/ryan-timothy-albert/sample-ts-monorepo/lending
published: true
features:
typescript:
additionalDependencies: 0.1.0
core: 3.11.0
core: 3.11.3
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.4
responseFormat: 0.2.3
Expand Down
2 changes: 1 addition & 1 deletion lending/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
typescript:
version: 0.0.15
version: 0.0.16
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
12 changes: 11 additions & 1 deletion lending/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,14 @@ Based on:
### Generated
- [typescript v0.0.15] lending
### Releases
- [NPM v0.0.15] https://www.npmjs.com/package/ryan-lending/v/0.0.15 - lending
- [NPM v0.0.15] https://www.npmjs.com/package/ryan-lending/v/0.0.15 - lending

## 2024-07-05 00:50:00
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.326.3 (2.359.6) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.0.16] lending
### Releases
- [NPM v0.0.16] https://www.npmjs.com/package/ryan-lending/v/0.0.16 - lending
2 changes: 1 addition & 1 deletion lending/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "ryan-lending",
"version": "0.0.15",
"version": "0.0.16",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions lending/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 lending/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ryan-lending",
"version": "0.0.15",
"version": "0.0.16",
"author": "ryan-timothy-albert",
"main": "./index.js",
"sideEffects": false,
Expand Down
6 changes: 3 additions & 3 deletions lending/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "0.0.15",
genVersion: "2.359.0",
userAgent: "speakeasy-sdk/typescript 0.0.15 2.359.0 1.0.0 ryan-lending",
sdkVersion: "0.0.16",
genVersion: "2.359.6",
userAgent: "speakeasy-sdk/typescript 0.0.16 2.359.6 1.0.0 ryan-lending",
} as const;
19 changes: 19 additions & 0 deletions lending/src/lib/sdks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SecurityState, resolveSecurity } from "./security.js";
import { pathToFunc } from "./url.js";
import { encodeForm } from "./encodings.js";
import { stringToBase64 } from "./base64.js";
import { SDK_METADATA } from "./config.js";
import { SDKHooks } from "../hooks/hooks.js";
import { HookContext } from "../hooks/types.js";

Expand All @@ -22,8 +23,20 @@ type RequestConfig = {
body?: RequestInit["body"];
headers?: HeadersInit;
security?: SecurityState | null;
uaHeader?: string;
};

const gt: unknown = typeof globalThis === "undefined" ? null : globalThis;
const webWorkerLike =
typeof gt === "object" &&
gt != null &&
"importScripts" in gt &&
typeof gt["importScripts"] === "function";
const isBrowserLike =
webWorkerLike ||
(typeof navigator !== "undefined" && "serviceWorker" in navigator) ||
typeof window === "object";

export class ClientSDK {
private readonly client: HTTPClient;
protected readonly baseURL: URL | null;
Expand Down Expand Up @@ -100,6 +113,12 @@ export class ClientSDK {
headers.set(k, v);
}

// Only set user agent header in non-browser-like environments since CORS
// policy disallows setting it in browsers e.g. Chrome throws an error.
if (!isBrowserLike) {
headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
}

const input = this.hooks$.beforeCreateRequest(context, {
url: reqURL,
options: {
Expand Down
34 changes: 17 additions & 17 deletions lending/src/sdk/pets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { SDKHooks } from "../hooks/hooks.js";
import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
Expand Down Expand Up @@ -50,9 +50,6 @@ export class Pets extends ClientSDK {
options?: RequestOptions
): Promise<operations.ListPetsResponse> {
const input$ = typeof request === "undefined" ? {} : request;
const headers$ = new Headers();
headers$.set("user-agent", SDK_METADATA.userAgent);
headers$.set("Accept", "application/json");

const payload$ = schemas$.parse(
input$,
Expand All @@ -67,16 +64,19 @@ export class Pets extends ClientSDK {
limit: payload$.limit,
});

const headers$ = new Headers({
Accept: "application/json",
});

const context = { operationID: "listPets", oAuth2Scopes: [], securitySource: null };

const doOptions = { context, errorCodes: ["4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{ method: "GET", path: path$, headers: headers$, query: query$, body: body$ },
options
);

const response = await this.do$(request$, doOptions);
const response = await this.do$(request$, { context, errorCodes: ["4XX", "5XX"] });

const responseFields$ = {
HttpMeta: { Response: response, Request: request$ },
Expand All @@ -99,10 +99,6 @@ export class Pets extends ClientSDK {
options?: RequestOptions
): Promise<components.ErrorT | undefined> {
const input$ = request;
const headers$ = new Headers();
headers$.set("user-agent", SDK_METADATA.userAgent);
headers$.set("Content-Type", "application/json");
headers$.set("Accept", "application/json");

const payload$ = schemas$.parse(
input$,
Expand All @@ -115,16 +111,20 @@ export class Pets extends ClientSDK {

const query$ = "";

const headers$ = new Headers({
"Content-Type": "application/json",
Accept: "application/json",
});

const context = { operationID: "createPets", oAuth2Scopes: [], securitySource: null };

const doOptions = { context, errorCodes: ["4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{ method: "POST", path: path$, headers: headers$, query: query$, body: body$ },
options
);

const response = await this.do$(request$, doOptions);
const response = await this.do$(request$, { context, errorCodes: ["4XX", "5XX"] });

const [result$] = await this.matcher<components.ErrorT | undefined>()
.void(201, components.ErrorT$.inboundSchema.optional())
Expand All @@ -143,9 +143,6 @@ export class Pets extends ClientSDK {
options?: RequestOptions
): Promise<operations.ShowPetByIdResponse> {
const input$ = request;
const headers$ = new Headers();
headers$.set("user-agent", SDK_METADATA.userAgent);
headers$.set("Accept", "application/json");

const payload$ = schemas$.parse(
input$,
Expand All @@ -164,16 +161,19 @@ export class Pets extends ClientSDK {

const query$ = "";

const headers$ = new Headers({
Accept: "application/json",
});

const context = { operationID: "showPetById", oAuth2Scopes: [], securitySource: null };

const doOptions = { context, errorCodes: ["4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{ method: "GET", path: path$, headers: headers$, query: query$, body: body$ },
options
);

const response = await this.do$(request$, doOptions);
const response = await this.do$(request$, { context, errorCodes: ["4XX", "5XX"] });

const [result$] = await this.matcher<operations.ShowPetByIdResponse>()
.json(200, operations.ShowPetByIdResponse$)
Expand Down

0 comments on commit 672daaa

Please sign in to comment.