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 authored and srenatus committed Jul 5, 2024
1 parent 469de81 commit 0091cbb
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 1.2.0
version: 1.2.1
additionalDependencies:
dependencies: {}
devDependencies:
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
speakeasyVersion: 1.326.1
speakeasyVersion: 1.326.3
sources:
openapi:
sourceNamespace: openapi
sourceRevisionDigest: sha256:9b1bd7f43a72b086a5fbae09d043496cfc42f718fab8386268d8e5f721ee8dd9
sourceBlobDigest: sha256:09895c78584d1e89a0c639e04731f710347d6a6ac6e42e13e73629448dc1faaf
sourceRevisionDigest: sha256:2a80ee0a4531d2998cdeb1df282b732501fbdad1b6c3a38c013edc86515e2137
sourceBlobDigest: sha256:2ffbcc63a301ea97849aeb0d4945dfd551200736615c28e8f3b1e80aa5fd0abc
tags:
- latest
- main
targets:
first-target:
source: openapi
sourceNamespace: openapi
sourceRevisionDigest: sha256:9b1bd7f43a72b086a5fbae09d043496cfc42f718fab8386268d8e5f721ee8dd9
sourceBlobDigest: sha256:09895c78584d1e89a0c639e04731f710347d6a6ac6e42e13e73629448dc1faaf
sourceRevisionDigest: sha256:2a80ee0a4531d2998cdeb1df282b732501fbdad1b6c3a38c013edc86515e2137
sourceBlobDigest: sha256:2ffbcc63a301ea97849aeb0d4945dfd551200736615c28e8f3b1e80aa5fd0abc
outLocation: packages/opa
workflow:
workflowVersion: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions packages/opa/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ id: 078615ff-ff96-44f8-8aca-2f4d3e687bf0
management:
docChecksum: 04bb432e6968396053d9d2ec5b5ff933
docVersion: 0.2.0
speakeasyVersion: 1.326.1
generationVersion: 2.359.0
releaseVersion: 1.2.0
configChecksum: a1fe1d21514528377b830170ba0a684e
speakeasyVersion: 1.326.3
generationVersion: 2.359.6
releaseVersion: 1.2.1
configChecksum: df4bb56ea6d73b882ba0ad32ecfcd8eb
repoURL: https://github.com/StyraInc/opa-typescript.git
repoSubDirectory: packages/opa
installationURL: https://gitpkg.now.sh/StyraInc/opa-typescript/packages/opa
features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.5
core: 3.11.0
core: 3.11.3
examples: 2.81.4
flattening: 2.81.1
globalSecurityCallbacks: 0.1.0
Expand Down
10 changes: 9 additions & 1 deletion packages/opa/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,12 @@ Based on:
- OpenAPI Doc
- Speakeasy CLI 1.326.1 (2.359.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.2.0] packages/opa
- [typescript v1.2.0] packages/opa

## 2024-07-05 00:19:51
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.326.3 (2.359.6) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.2.1] packages/opa
2 changes: 1 addition & 1 deletion packages/opa/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@styra/opa",
"version": "1.2.0",
"version": "1.2.1",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
Expand Down
10 changes: 5 additions & 5 deletions packages/opa/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"name": "@styra/opa",
"version": "1.2.0",
"version": "1.2.1",
"author": "Styra",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"keywords": [
"OPA",
"Open Policy Agent",
Expand All @@ -15,6 +11,10 @@
"rbac",
"role based access control"
],
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"main": "./index.js",
"sideEffects": false,
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions packages/opa/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "0.2.0",
sdkVersion: "1.2.0",
genVersion: "2.359.0",
userAgent: "speakeasy-sdk/typescript 1.2.0 2.359.0 0.2.0 @styra/opa",
sdkVersion: "1.2.1",
genVersion: "2.359.6",
userAgent: "speakeasy-sdk/typescript 1.2.1 2.359.6 0.2.0 @styra/opa",
} as const;
19 changes: 19 additions & 0 deletions packages/opa/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
Loading

0 comments on commit 0091cbb

Please sign in to comment.