From 253f4e8a5a7c71669484286fab2a9264e88da6ce Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 11 Apr 2024 18:30:50 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.250.0 --- .speakeasy/gen.lock | 11 ++++---- .speakeasy/gen.yaml | 5 ++-- README.md | 32 +++++++++++------------ RELEASES.md | 10 ++++++- USAGE.md | 4 +-- docs/sdks/{opa => opaapiclient}/README.md | 14 +++++----- package-lock.json | 8 +++--- package.json | 4 +-- src/lib/config.ts | 6 ++--- src/sdk/sdk.ts | 2 +- 10 files changed, 52 insertions(+), 44 deletions(-) rename docs/sdks/{opa => opaapiclient}/README.md (98%) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 60a5b52..a198108 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 2f8b2839-3001-46b4-b5e0-cec0aad583ed management: docChecksum: 2401c7030f847f72ab31c8f75de58a66 docVersion: 0.2.0 - speakeasyVersion: 1.245.0 - generationVersion: 2.301.3 - releaseVersion: 0.2.2 - configChecksum: 803675afb1d98123e2574559539201e5 + speakeasyVersion: 1.250.0 + generationVersion: 2.304.1 + releaseVersion: 0.2.3 + configChecksum: 191f7a8d3ea477752ba4f1cf7facee4b repoURL: https://github.com/StyraInc/opa-typescript.git installationURL: https://github.com/StyraInc/opa-typescript features: @@ -20,7 +20,6 @@ features: unions: 2.85.3 generatedFiles: - src/sdk/sdk.ts - - .eslintrc.js - .npmignore - RUNTIMES.md - package.json @@ -83,7 +82,7 @@ generatedFiles: - docs/models/errors/servererrorerrors.md - docs/models/errors/servererror.md - docs/models/errors/unhealthyserver.md - - docs/sdks/opa/README.md + - docs/sdks/opaapiclient/README.md - USAGE.md - .gitattributes - src/hooks/hooks.ts diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index feeddb6..884870c 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.2.2 + version: 0.2.3 additionalDependencies: dependencies: {} devDependencies: @@ -25,6 +25,7 @@ typescript: peerDependencies: {} author: Styra clientServerStatusCodesAsErrors: true + enumFormat: enum flattenGlobalSecurity: true imports: option: openapi @@ -37,6 +38,6 @@ typescript: inputModelSuffix: input maxMethodParams: 4 outputModelSuffix: output - packageName: "@styra/opa" + packageName: '@styra/opa' responseFormat: envelope-http templateVersion: v2 diff --git a/README.md b/README.md index 964e958..6213cca 100644 --- a/README.md +++ b/README.md @@ -201,10 +201,10 @@ console.log(allowed ? "allowed!" : "denied!"); ### Example ```typescript -import { Opa } from "opa"; +import { OpaApiClient } from "@styra/opa"; async function run() { - const sdk = new Opa(); + const sdk = new OpaApiClient(); const result = await sdk.executePolicyWithInput({ path: "app/rbac", @@ -230,11 +230,11 @@ run(); ## Available Resources and Operations -### [Opa SDK](docs/sdks/opa/README.md) +### [OpaApiClient SDK](docs/sdks/opaapiclient/README.md) -* [executePolicy](docs/sdks/opa/README.md#executepolicy) - Execute a policy -* [executePolicyWithInput](docs/sdks/opa/README.md#executepolicywithinput) - Execute a policy given an input -* [health](docs/sdks/opa/README.md#health) - Verify the server is operational +* [executePolicy](docs/sdks/opaapiclient/README.md#executepolicy) - Execute a policy +* [executePolicyWithInput](docs/sdks/opaapiclient/README.md#executepolicywithinput) - Execute a policy given an input +* [health](docs/sdks/opaapiclient/README.md#health) - Verify the server is operational @@ -252,11 +252,11 @@ Validation errors can also occur when either method arguments or data returned f ```typescript -import { Opa } from "opa"; -import * as errors from "opa/models/errors"; +import { OpaApiClient } from "@styra/opa"; +import * as errors from "@styra/opa/models/errors"; async function run() { - const sdk = new Opa(); + const sdk = new OpaApiClient(); let result; try { @@ -307,10 +307,10 @@ You can override the default server globally by passing a server index to the `s | 0 | `http://localhost:8181` | None | ```typescript -import { Opa } from "opa"; +import { OpaApiClient } from "@styra/opa"; async function run() { - const sdk = new Opa({ + const sdk = new OpaApiClient({ serverIdx: 0, }); @@ -332,10 +332,10 @@ run(); The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example: ```typescript -import { Opa } from "opa"; +import { OpaApiClient } from "@styra/opa"; async function run() { - const sdk = new Opa({ + const sdk = new OpaApiClient({ serverURL: "http://localhost:8181", }); @@ -370,8 +370,8 @@ custom header and a timeout to requests and how to use the `"requestError"` hook to log errors: ```typescript -import { Opa } from "opa"; -import { HTTPClient } from "opa/lib/http"; +import { OpaApiClient } from "@styra/opa"; +import { HTTPClient } from "@styra/opa/lib/http"; const httpClient = new HTTPClient({ // fetcher takes a function that has the same signature as native `fetch`. @@ -397,7 +397,7 @@ httpClient.addHook("requestError", (error, request) => { console.groupEnd(); }); -const sdk = new Opa({ httpClient }); +const sdk = new OpaApiClient({ httpClient }); ``` diff --git a/RELEASES.md b/RELEASES.md index f23d224..8ccd569 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -62,4 +62,12 @@ Based on: - OpenAPI Doc - Speakeasy CLI 1.245.0 (2.301.3) https://github.com/speakeasy-api/speakeasy ### Generated -- [typescript v0.2.2] . \ No newline at end of file +- [typescript v0.2.2] . + +## 2024-04-11 18:30:10 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.250.0 (2.304.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.2.3] . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 947c612..a5dbeca 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,9 +1,9 @@ ```typescript -import { Opa } from "opa"; +import { OpaApiClient } from "@styra/opa"; async function run() { - const sdk = new Opa(); + const sdk = new OpaApiClient(); const result = await sdk.executePolicyWithInput({ path: "app/rbac", diff --git a/docs/sdks/opa/README.md b/docs/sdks/opaapiclient/README.md similarity index 98% rename from docs/sdks/opa/README.md rename to docs/sdks/opaapiclient/README.md index 4fdc7b8..3394f33 100644 --- a/docs/sdks/opa/README.md +++ b/docs/sdks/opaapiclient/README.md @@ -1,4 +1,4 @@ -# Opa SDK +# OpaApiClient SDK ## Overview @@ -18,10 +18,10 @@ Execute a policy ### Example Usage ```typescript -import { Opa } from "opa"; +import { OpaApiClient } from "@styra/opa"; async function run() { - const sdk = new Opa(); + const sdk = new OpaApiClient(); const result = await sdk.executePolicy({ path: "app/rbac", @@ -61,10 +61,10 @@ Execute a policy given an input ### Example Usage ```typescript -import { Opa } from "opa"; +import { OpaApiClient } from "@styra/opa"; async function run() { - const sdk = new Opa(); + const sdk = new OpaApiClient(); const result = await sdk.executePolicyWithInput({ path: "app/rbac", @@ -112,10 +112,10 @@ The health API endpoint executes a simple built-in policy query to verify that t ### Example Usage ```typescript -import { Opa } from "opa"; +import { OpaApiClient } from "@styra/opa"; async function run() { - const sdk = new Opa(); + const sdk = new OpaApiClient(); const bundles = false; const plugins = false; diff --git a/package-lock.json b/package-lock.json index 5cf85f2..f779507 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "opa", - "version": "0.2.2", + "name": "@styra/opa", + "version": "0.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "opa", - "version": "0.2.2", + "name": "@styra/opa", + "version": "0.2.3", "devDependencies": { "@types/jsonpath": "^0.2.4", "@typescript-eslint/eslint-plugin": "^6.13.2", diff --git a/package.json b/package.json index 8a01618..de1abe7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "opa", - "version": "0.2.2", + "name": "@styra/opa", + "version": "0.2.3", "author": "Styra", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index 80ba914..da820aa 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -52,7 +52,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = Object.freeze({ language: "typescript", openapiDocVersion: "0.2.0", - sdkVersion: "0.2.2", - genVersion: "2.301.3", - userAgent: "speakeasy-sdk/typescript 0.2.2 2.301.3 0.2.0 opa", + sdkVersion: "0.2.3", + genVersion: "2.304.1", + userAgent: "speakeasy-sdk/typescript 0.2.3 2.304.1 0.2.0 @styra/opa", }); diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index e3af551..bfcd2f3 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -11,7 +11,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks"; import * as errors from "../models/errors"; import * as operations from "../models/operations"; -export class Opa extends ClientSDK { +export class OpaApiClient extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; constructor(options: SDKOptions = {}) {