Skip to content

Commit 21a8d21

Browse files
feat: push up sdk
0 parents  commit 21a8d21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+11335
-0
lines changed

.eslintrc.cjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
root: true,
4+
extends: [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:import/recommended",
8+
"plugin:import/typescript",
9+
],
10+
parser: "@typescript-eslint/parser",
11+
plugins: ["@typescript-eslint"],
12+
settings: {
13+
"import/resolver": {
14+
typescript: true,
15+
node: true,
16+
},
17+
},
18+
rules: {
19+
// Handled by typescript compiler
20+
"@typescript-eslint/no-unused-vars": "off",
21+
"@typescript-eslint/ban-types": "off",
22+
"@typescript-eslint/no-namespace": "off",
23+
"@typescript-eslint/no-explicit-any": "off",
24+
"import/no-named-as-default-member": "off",
25+
26+
"import/no-default-export": "error",
27+
},
28+
};

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.ts linguist-generated=false
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Generate
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
workflow_dispatch:
10+
inputs:
11+
force:
12+
description: Force generation of SDKs
13+
type: boolean
14+
default: false
15+
set_version:
16+
description: optionally set a specific SDK version
17+
type: string
18+
schedule:
19+
- cron: 0 0 * * *
20+
jobs:
21+
generate:
22+
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
23+
with:
24+
force: ${{ github.event.inputs.force }}
25+
mode: pr
26+
set_version: ${{ github.event.inputs.set_version }}
27+
secrets:
28+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
29+
npm_token: ${{ secrets.NPM_TOKEN }}
30+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

.github/workflows/sdk_publish.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- .speakeasy/gen.lock
14+
workflow_dispatch: {}
15+
jobs:
16+
publish:
17+
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
18+
with:
19+
target: code_samples_typescript_sdk
20+
secrets:
21+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
22+
npm_token: ${{ secrets.NPM_TOKEN }}
23+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/models
2+
/models/errors
3+
/types
4+
/node_modules
5+
/lib
6+
/sdk
7+
/funcs
8+
/hooks
9+
/index.*
10+
/core.*
11+
/cjs
12+
/esm
13+
/dist
14+
/.tsbuildinfo
15+
/.tshy
16+
/.tshy-*
17+
/__tests__

.npmignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**/*
2+
!/**/*.ts
3+
!/**/*.js
4+
!/**/*.map
5+
6+
/.eslintrc.js
7+
/cjs
8+
/.tshy
9+
/.tshy-*
10+
/__tests__

.speakeasy/gen.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
configVersion: 2.0.0
2+
generation:
3+
sdkClassName: SDK
4+
maintainOpenAPIOrder: true
5+
usageSnippets:
6+
optionalPropertyRendering: withExample
7+
useClassNamesForArrayFields: true
8+
fixes:
9+
nameResolutionDec2023: true
10+
parameterOrderingFeb2024: true
11+
requestResponseComponentNamesFeb2024: true
12+
auth:
13+
oAuth2ClientCredentialsEnabled: false
14+
oAuth2PasswordEnabled: false
15+
typescript:
16+
version: 0.35.0
17+
additionalDependencies:
18+
dependencies: {}
19+
devDependencies: {}
20+
peerDependencies: {}
21+
additionalPackageJSON: {}
22+
author: Speakeasy
23+
clientServerStatusCodesAsErrors: true
24+
defaultErrorName: APIError
25+
enumFormat: enum
26+
flattenGlobalSecurity: true
27+
flatteningOrder: body-first
28+
imports:
29+
option: openapi
30+
paths:
31+
callbacks: models/callbacks
32+
errors: models/errors
33+
operations: models/operations
34+
shared: models/components
35+
webhooks: models/webhooks
36+
inputModelSuffix: input
37+
maxMethodParams: 1
38+
methodArguments: require-security-and-request
39+
moduleFormat: commonjs
40+
outputModelSuffix: output
41+
packageName: '@speakeasy-api/code-samples'
42+
responseFormat: flat
43+
templateVersion: v2
44+
useIndexModules: true

.speakeasy/workflow.lock

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
speakeasyVersion: 1.441.0
2+
sources:
3+
speakeasy-OAS:
4+
sourceNamespace: speakeasy-oas
5+
sourceRevisionDigest: sha256:eed9083bc4ba2cf34738402866ce9bded44a4172874f2728d988479367ca0096
6+
sourceBlobDigest: sha256:0d8cab250914be6d6f0c159e5f64c6690143fb49dce89117d06c3635bdc784b0
7+
tags:
8+
- latest
9+
targets:
10+
code_samples_typescript_sdk:
11+
source: speakeasy-OAS
12+
sourceNamespace: speakeasy-oas
13+
sourceRevisionDigest: sha256:eed9083bc4ba2cf34738402866ce9bded44a4172874f2728d988479367ca0096
14+
sourceBlobDigest: sha256:0d8cab250914be6d6f0c159e5f64c6690143fb49dce89117d06c3635bdc784b0
15+
workflow:
16+
workflowVersion: 1.0.0
17+
speakeasyVersion: latest
18+
sources:
19+
speakeasy-OAS:
20+
inputs:
21+
- location: https://www.speakeasy.com/openapi.yaml
22+
overlays:
23+
- location: overlay.yaml
24+
transformations:
25+
- filterOperations:
26+
operations: generateCodeSamplePreview, generateCodeSamplePreviewAsync, getCodeSamplePreviewAsync
27+
include: true
28+
registry:
29+
location: registry.speakeasyapi.dev/speakeasy-self/speakeasy-self/speakeasy-oas
30+
targets:
31+
code_samples_typescript_sdk:
32+
target: typescript
33+
source: speakeasy-OAS

.speakeasy/workflow.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
workflowVersion: 1.0.0
2+
speakeasyVersion: latest
3+
sources:
4+
speakeasy-OAS:
5+
inputs:
6+
- location: https://www.speakeasy.com/openapi.yaml
7+
overlays:
8+
- location: overlay.yaml
9+
transformations:
10+
- filterOperations:
11+
operations: generateCodeSamplePreview, generateCodeSamplePreviewAsync, getCodeSamplePreviewAsync
12+
include: true
13+
registry:
14+
location: registry.speakeasyapi.dev/speakeasy-self/speakeasy-self/speakeasy-oas
15+
targets:
16+
code_samples_typescript_sdk:
17+
target: typescript
18+
source: speakeasy-OAS
19+
# publish:
20+
# npm:
21+
# token: $npm_token

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Contributing to This Repository
2+
3+
Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.
4+
5+
## How to Report Issues
6+
7+
If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:
8+
9+
- A clear and descriptive title
10+
- Steps to reproduce the issue
11+
- Expected and actual behavior
12+
- Any relevant logs, screenshots, or error messages
13+
- Information about your environment (e.g., operating system, software versions)
14+
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed
15+
16+
## Issue Triage and Upstream Fixes
17+
18+
We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.
19+
20+
## Contact
21+
22+
If you have any questions or need further assistance, please feel free to reach out by opening an issue.
23+
24+
Thank you for your understanding and cooperation!
25+
26+
The Maintainers

0 commit comments

Comments
 (0)