Skip to content

Commit

Permalink
releng: add speakeasy setup (#22)
Browse files Browse the repository at this point in the history
naively carried over:

    replaced repo
    removed publishing (we'll do that via changesets' action, I think)
    changed the output for the new package

This won't work yet 🚧 It's missing our manually-added SDK pieces. But with
the action defined, I can play around better with the speakeasy setup.

Signed-off-by: Stephan Renatus <[email protected]>
  • Loading branch information
srenatus authored Jun 28, 2024
1 parent e1cd63b commit 05d461f
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/sdk_generation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Generate
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
"on":
workflow_dispatch:
inputs:
force:
description: Force generation of SDKs
type: boolean
default: false
schedule:
- cron: 0 0 * * *
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
with:
force: ${{ github.event.inputs.force }}
mode: pr
speakeasy_version: latest
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
npm_token: ${{ secrets.NPM_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
116 changes: 116 additions & 0 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
lockVersion: 2.0.0
id: 2f8b2839-3001-46b4-b5e0-cec0aad583ed
management:
docChecksum: 04bb432e6968396053d9d2ec5b5ff933
docVersion: 0.2.0
speakeasyVersion: 1.318.0
generationVersion: 2.352.0
releaseVersion: 1.1.3
configChecksum: 0fb5e87d7a937b67b9c25494586477f6
repoURL: https://github.com/StyraInc/opa-typescript.git
installationURL: https://github.com/StyraInc/opa-typescript
published: true
features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.5
core: 3.10.2
examples: 2.81.4
flattening: 2.81.1
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.4
responseFormat: 0.2.3
sdkHooks: 0.1.0
unions: 2.85.5
generatedFiles:
- src/sdk/sdk.ts
- .eslintrc.cjs
- RUNTIMES.md
- jsr.json
- package.json
- src/lib/base64.ts
- src/lib/config.ts
- src/lib/encodings.ts
- src/lib/http.ts
- src/lib/is-plain-object.ts
- src/lib/primitives.ts
- src/lib/retries.ts
- src/lib/schemas.ts
- src/lib/sdks.ts
- src/lib/security.ts
- src/lib/url.ts
- src/sdk/index.ts
- src/sdk/models/errors/sdkerror.ts
- src/sdk/models/errors/sdkvalidationerror.ts
- src/types/blobs.ts
- src/types/enums.ts
- src/types/index.ts
- src/types/operations.ts
- src/types/rfcdate.ts
- tsconfig.json
- src/sdk/models/operations/executedefaultpolicywithinput.ts
- src/sdk/models/operations/health.ts
- src/sdk/models/operations/executebatchpolicywithinput.ts
- src/sdk/models/operations/executepolicy.ts
- src/sdk/models/operations/executepolicywithinput.ts
- src/sdk/models/components/result.ts
- src/sdk/models/components/httpmetadata.ts
- src/sdk/models/components/input.ts
- src/sdk/models/components/gzipacceptencoding.ts
- src/sdk/models/components/healthyserver.ts
- src/sdk/models/components/batchmixedresults.ts
- src/sdk/models/components/provenance.ts
- src/sdk/models/components/batchsuccessfulpolicyevaluation.ts
- src/sdk/models/components/successfulpolicyresponse.ts
- src/sdk/models/components/explain.ts
- src/sdk/models/components/gzipcontentencoding.ts
- src/sdk/models/errors/clienterror.ts
- src/sdk/models/errors/servererror.ts
- src/sdk/models/errors/unhealthyserver.ts
- src/sdk/models/errors/batchservererror.ts
- src/sdk/models/errors/index.ts
- src/sdk/models/operations/index.ts
- src/sdk/models/components/index.ts
- docs/sdk/models/operations/executedefaultpolicywithinputrequest.md
- docs/sdk/models/operations/executedefaultpolicywithinputresponse.md
- docs/sdk/models/operations/healthrequest.md
- docs/sdk/models/operations/healthresponse.md
- docs/sdk/models/operations/executebatchpolicywithinputrequestbody.md
- docs/sdk/models/operations/executebatchpolicywithinputrequest.md
- docs/sdk/models/operations/executebatchpolicywithinputresponse.md
- docs/sdk/models/operations/executepolicyrequest.md
- docs/sdk/models/operations/executepolicyresponse.md
- docs/sdk/models/operations/executepolicywithinputrequestbody.md
- docs/sdk/models/operations/executepolicywithinputrequest.md
- docs/sdk/models/operations/executepolicywithinputresponse.md
- docs/sdk/models/components/result.md
- docs/sdk/models/components/httpmetadata.md
- docs/sdk/models/components/input.md
- docs/sdk/models/components/gzipacceptencoding.md
- docs/sdk/models/components/healthyserver.md
- docs/sdk/models/components/location.md
- docs/sdk/models/components/errors.md
- docs/sdk/models/components/servererror.md
- docs/sdk/models/components/responsessuccessfulpolicyresponse.md
- docs/sdk/models/components/responses.md
- docs/sdk/models/components/batchmixedresults.md
- docs/sdk/models/components/revision.md
- docs/sdk/models/components/provenance.md
- docs/sdk/models/components/batchsuccessfulpolicyevaluation.md
- docs/sdk/models/components/successfulpolicyresponse.md
- docs/sdk/models/components/explain.md
- docs/sdk/models/components/gzipcontentencoding.md
- docs/sdk/models/errors/location.md
- docs/sdk/models/errors/errors.md
- docs/sdk/models/errors/clienterror.md
- docs/sdk/models/errors/servererrorlocation.md
- docs/sdk/models/errors/servererrorerrors.md
- docs/sdk/models/errors/servererror.md
- docs/sdk/models/errors/unhealthyserver.md
- docs/sdk/models/errors/batchservererror.md
- docs/sdks/opaapiclient/README.md
- USAGE.md
- .gitattributes
- src/hooks/hooks.ts
- src/hooks/types.ts
- src/hooks/index.ts
48 changes: 48 additions & 0 deletions .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
configVersion: 2.0.0
generation:
sdkClassName: opaApiClient
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 1.1.3
additionalDependencies:
dependencies: {}
devDependencies:
eslint-plugin-markdown: ^4.0.1
prettier: 3.2.5
testcontainers: ^10.7.2
tsx: ^4.15.6
typedoc: ^0.25.13
typedoc-plugin-extras: ^3.0.0
typedoc-plugin-replace-text: ^3.3.0
peerDependencies: {}
additionalPackageJSON:
license: Apache-2.0
author: Styra
clientServerStatusCodesAsErrors: true
enumFormat: enum
flattenGlobalSecurity: true
imports:
option: openapi
paths:
callbacks: sdk/models/callbacks
errors: sdk/models/errors
operations: sdk/models/operations
shared: sdk/models/components
webhooks: sdk/models/webhooks
inputModelSuffix: input
maxMethodParams: 4
methodArguments: require-security-and-request
outputModelSuffix: output
packageName: '@styra/opa'
responseFormat: envelope-http
templateVersion: v2
useIndexModules: true
13 changes: 13 additions & 0 deletions .speakeasy/overlay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
overlay: 1.0.0
info:
title: Overlay to test the discriminator for the batch API
version: 0.0.1
actions:
- target: "$.components..BatchMixedResults..responses.additionalProperties"
description: add a descrimintor
update:
discriminator:
propertyName: http_status_code
mapping:
"200": "#/components/schemas/SuccessfulPolicyResponse"
"500": "#/components/schemas/ServerError"
34 changes: 34 additions & 0 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
speakeasyVersion: 1.318.0
sources:
openapi:
sourceNamespace: openapi
sourceRevisionDigest: sha256:49c204baa834f49dc7939553e11a3a8664891ba0bd57bdf9757d0cc631673dfe
sourceBlobDigest: sha256:409be84cbd5aff4097f6c56d9ff4fb30a531a8c1da05581bbab8ee735274aaad
tags:
- latest
- sr-batch-eval
targets:
first-target:
source: openapi
sourceNamespace: openapi
sourceRevisionDigest: sha256:49c204baa834f49dc7939553e11a3a8664891ba0bd57bdf9757d0cc631673dfe
sourceBlobDigest: sha256:409be84cbd5aff4097f6c56d9ff4fb30a531a8c1da05581bbab8ee735274aaad
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
openapi:
inputs:
- location: https://raw.githubusercontent.com/StyraInc/enterprise-opa/main/openapi/openapi.yaml
overlays:
- location: ./.speakeasy/overlay.yaml
registry:
location: registry.speakeasyapi.dev/styra/styra/openapi
targets:
first-target:
target: typescript
source: openapi
publish:
npm:
token: $npm_token
15 changes: 15 additions & 0 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
openapi:
inputs:
- location: https://raw.githubusercontent.com/StyraInc/enterprise-opa/main/openapi/openapi.yaml
overlays:
- location: ./.speakeasy/overlay.yaml
registry:
location: registry.speakeasyapi.dev/styra/styra/openapi
targets:
first-target:
target: typescript
source: openapi
output: packages/opa

0 comments on commit 05d461f

Please sign in to comment.