Skip to content

chore: 🐝 Update SDK - Generate 1.8.0 #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ generation:
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
sdkInitStyle: constructor
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
nameResolutionFeb2025: false
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
securityFeb2025: false
sharedErrorComponentsApr2025: false
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
typescript:
version: 1.7.10
version: 1.8.0
additionalDependencies:
dependencies:
'@styra/ucast-prisma': ^0.1.3
Expand All @@ -40,18 +46,21 @@ typescript:
publishConfig:
access: public
author: Styra
baseErrorName: OpaAPIClientError
clientServerStatusCodesAsErrors: true
compileCommand:
- bash
- -c
- ../../build/compile-opa.sh
constFieldsAlwaysOptional: true
defaultErrorName: SDKError
enableCustomCodeRegions: false
enableMCPServer: true
enableReactQuery: false
enumFormat: enum
flattenGlobalSecurity: true
flatteningOrder: parameters-first
generateExamples: true
imports:
option: openapi
paths:
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.533.0
speakeasyVersion: 1.581.0
sources:
openapi:
sourceNamespace: openapi
sourceRevisionDigest: sha256:c2448c44bc294da72bcfe707ff27429e1fc9996ba62aaa39664b41cbe9ae01d9
sourceBlobDigest: sha256:3688645679b8687bb499064801c3f4e42f0383cafb08095f5d5bd9b341c28c92
sourceRevisionDigest: sha256:cb5c21bd0dd43aabc665ad2531ab966078966f6b3266c5333c25531a6a4589ed
sourceBlobDigest: sha256:f87a02005ac8ebb9dce0869c271206455b1fc3417294066ca32bb35e86eb345a
tags:
- latest
- speakeasy-sdk-regen-1744763210
- speakeasy-sdk-regen-1752176922
- 0.2.0
targets:
first-target:
source: openapi
sourceNamespace: openapi
sourceRevisionDigest: sha256:c2448c44bc294da72bcfe707ff27429e1fc9996ba62aaa39664b41cbe9ae01d9
sourceBlobDigest: sha256:3688645679b8687bb499064801c3f4e42f0383cafb08095f5d5bd9b341c28c92
sourceRevisionDigest: sha256:cb5c21bd0dd43aabc665ad2531ab966078966f6b3266c5333c25531a6a4589ed
sourceBlobDigest: sha256:f87a02005ac8ebb9dce0869c271206455b1fc3417294066ca32bb35e86eb345a
codeSamplesNamespace: openapi-typescript-code-samples
codeSamplesRevisionDigest: sha256:41097a438038c847f3ed4991c7b9779e7e773941bdf860a34fab64fdde20567c
codeSamplesRevisionDigest: sha256:5c33affc39205947daa8d35dc91246a31c19dab4ef44bff113463f24624228d8
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
13 changes: 7 additions & 6 deletions package-lock.json

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

8 changes: 8 additions & 0 deletions packages/opa/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/examples/node_modules
.DS_Store
**/.speakeasy/temp/
**/.speakeasy/logs/
.DS_Store
.env
.env.local
.env.*.local
/react-query
/mcp-server
/bin
Expand Down
72 changes: 35 additions & 37 deletions packages/opa/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ id: 078615ff-ff96-44f8-8aca-2f4d3e687bf0
management:
docChecksum: 333976f05de9e983392c5aff103b01a1
docVersion: 0.2.0
speakeasyVersion: 1.533.0
generationVersion: 2.578.0
releaseVersion: 1.7.10
configChecksum: 0ba6ca8636f0927c578a36d1aa91350a
speakeasyVersion: 1.581.0
generationVersion: 2.656.5
releaseVersion: 1.8.0
configChecksum: 14d2af1862a40ef2509c43bd127f2c7d
repoURL: https://github.com/StyraInc/opa-typescript.git
repoSubDirectory: packages/opa
installationURL: https://gitpkg.now.sh/StyraInc/opa-typescript/packages/opa
Expand All @@ -15,21 +15,21 @@ features:
acceptHeaders: 2.81.2
additionalDependencies: 0.1.0
additionalProperties: 0.1.1
constsAndDefaults: 0.1.11
core: 3.21.6
constsAndDefaults: 0.1.12
core: 3.21.14
defaultEnabledRetries: 0.1.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.2
examples: 2.81.5
examples: 2.82.1
flattening: 2.82.1
globalSecurity: 2.82.13
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
globalServerURLs: 2.82.4
globalServerURLs: 2.82.5
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.2.0
unions: 2.85.8
sdkHooks: 0.3.0
unions: 2.85.11
generatedFiles:
- .gitattributes
- FUNCTIONS.md
Expand Down Expand Up @@ -103,6 +103,10 @@ generatedFiles:
- docs/sdk/models/operations/healthresponse.md
- docs/sdks/opaapiclient/README.md
- eslint.config.mjs
- examples/.env.template
- examples/README.md
- examples/executeDefaultPolicyWithInput.example.ts
- examples/package.json
- jsr.json
- package.json
- src/core.ts
Expand Down Expand Up @@ -155,6 +159,8 @@ generatedFiles:
- src/sdk/models/errors/clienterror.ts
- src/sdk/models/errors/httpclienterrors.ts
- src/sdk/models/errors/index.ts
- src/sdk/models/errors/opaapiclienterror.ts
- src/sdk/models/errors/responsevalidationerror.ts
- src/sdk/models/errors/sdkerror.ts
- src/sdk/models/errors/sdkvalidationerror.ts
- src/sdk/models/errors/servererror.ts
Expand All @@ -181,10 +187,10 @@ examples:
executeDefaultPolicyWithInput:
speakeasy-default-execute-default-policy-with-input:
requestBody:
application/json: 4963.69
application/json: {"user": "alice", "action": "read", "object": "id123", "type": "dog"}
responses:
"200":
application/json: "<value>"
application/json: {"allow": true, "user_is_admin": true, "user_is_granted": []}
"400":
application/json: {"code": "<value>", "message": "<value>"}
"500":
Expand All @@ -194,11 +200,9 @@ examples:
parameters:
path:
path: "app/rbac"
query: {}
header: {}
responses:
"200":
application/json: {"result": false}
application/json: {"result": {"allow": true, "user_is_admin": true, "user_is_granted": []}}
"400":
application/json: {"code": "<value>", "message": "<value>"}
"500":
Expand All @@ -208,13 +212,11 @@ examples:
parameters:
path:
path: "app/rbac"
query: {}
header: {}
requestBody:
application/json: {"input": true}
application/json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
responses:
"200":
application/json: {"result": true}
application/json: {"result": {"allow": true, "user_is_admin": true, "user_is_granted": []}}
"400":
application/json: {"code": "<value>", "message": "<value>"}
"500":
Expand All @@ -224,15 +226,13 @@ examples:
parameters:
path:
path: "app/rbac"
query: {}
header: {}
requestBody:
application/json: {"inputs": {"key": 6919.52}}
application/json: {"inputs": {}}
responses:
"200":
application/json: {"batch_decision_id": "1bef6b7d-cd13-4890-bfe1-fd2e8de32189", "responses": {"key": {"result": "<value>"}, "key1": {"result": 8210.24}}}
application/json: {"batch_decision_id": "1bef6b7d-cd13-4890-bfe1-fd2e8de32189", "responses": {"key": {"result": {"allow": true, "user_is_admin": true, "user_is_granted": []}}}}
"207":
application/json: {"responses": {"key": {"http_status_code": "200", "result": "<value>", "decision_id": "b84cf736-213c-4932-a8e4-bb5c648f1b4d"}, "key1": {"http_status_code": "200", "result": 6919.52, "decision_id": "b84cf736-213c-4932-a8e4-bb5c648f1b4d"}}}
application/json: {"responses": {"key": {"http_status_code": "200"}}}
"400":
application/json: {"code": "<value>", "message": "<value>"}
"500":
Expand All @@ -242,19 +242,17 @@ examples:
parameters:
path:
path: "app/rbac"
query: {}
header: {}
requestBody:
application/json: {"input": []}
application/vnd.styra.multitarget+json: {"input": []}
application/vnd.styra.ucast.all+json: {"input": []}
application/vnd.styra.ucast.minimal+json: {"input": []}
application/vnd.styra.ucast.linq+json: {"input": []}
application/vnd.styra.ucast.prisma+json: {"input": []}
application/vnd.styra.sql.sqlserver+json: {"input": []}
application/vnd.styra.sql.mysql+json: {"input": []}
application/vnd.styra.sql.postgresql+json: {"input": []}
application/vnd.styra.sql.sqlite+json: {"input": []}
application/json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.multitarget+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.ucast.all+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.ucast.minimal+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.ucast.linq+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.ucast.prisma+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.sql.sqlserver+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.sql.mysql+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.sql.postgresql+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
application/vnd.styra.sql.sqlite+json: {"input": {"user": "alice", "action": "read", "object": "id123", "type": "dog"}}
responses:
"200":
application/json: {}
Expand Down Expand Up @@ -282,5 +280,5 @@ examples:
application/json: {}
"500":
application/json: {"code": "<value>"}
examplesVersion: 1.0.1
examplesVersion: 1.0.2
generatedTests: {}
34 changes: 11 additions & 23 deletions packages/opa/FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,24 @@ specific category of applications.
```typescript
import { OpaApiClientCore } from "@styra/opa/core.js";
import { executeDefaultPolicyWithInput } from "@styra/opa/funcs/executeDefaultPolicyWithInput.js";
import { SDKValidationError } from "@styra/opa/sdk/models/errors/sdkvalidationerror.js";

// Use `OpaApiClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const opaApiClient = new OpaApiClientCore();

async function run() {
const res = await executeDefaultPolicyWithInput(opaApiClient, 4963.69);

switch (true) {
case res.ok:
// The success case will be handled outside of the switch block
break;
case res.error instanceof SDKValidationError:
// Pretty-print validation errors.
return console.log(res.error.pretty());
case res.error instanceof Error:
return console.log(res.error);
default:
// TypeScript's type checking will fail on the following line if the above
// cases were not exhaustive.
res.error satisfies never;
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
const res = await executeDefaultPolicyWithInput(opaApiClient, {
"user": "alice",
"action": "read",
"object": "id123",
"type": "dog",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("executeDefaultPolicyWithInput failed:", res.error);
}


const { value: result } = res;

// Handle the result
console.log(result);
}

run();
Expand Down
24 changes: 18 additions & 6 deletions packages/opa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,12 @@ import { OpaApiClient } from "@styra/opa";
const opaApiClient = new OpaApiClient();

async function run() {
const result = await opaApiClient.executeDefaultPolicyWithInput(4963.69, {
const result = await opaApiClient.executeDefaultPolicyWithInput({
"user": "alice",
"action": "read",
"object": "id123",
"type": "dog",
}, {
retries: {
strategy: "backoff",
backoff: {
Expand All @@ -347,7 +352,6 @@ async function run() {
},
});

// Handle the result
console.log(result);
}

Expand All @@ -373,9 +377,13 @@ const opaApiClient = new OpaApiClient({
});

async function run() {
const result = await opaApiClient.executeDefaultPolicyWithInput(4963.69);
const result = await opaApiClient.executeDefaultPolicyWithInput({
"user": "alice",
"action": "read",
"object": "id123",
"type": "dog",
});

// Handle the result
console.log(result);
}

Expand Down Expand Up @@ -404,9 +412,13 @@ const opaApiClient = new OpaApiClient({
});

async function run() {
const result = await opaApiClient.executeDefaultPolicyWithInput(4963.69);
const result = await opaApiClient.executeDefaultPolicyWithInput({
"user": "alice",
"action": "read",
"object": "id123",
"type": "dog",
});

// Handle the result
console.log(result);
}

Expand Down
Loading
Loading