-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 291bbfd
Showing
281 changed files
with
29,687 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
<div align="center"> | ||
<a href="https://codespaces.new/byteleaphq/athena-typescript.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a> | ||
</div> | ||
<br> | ||
|
||
> **Remember to shutdown a GitHub Codespace when it is not in use!** | ||
# Dev Containers Quick Start | ||
|
||
The default location for usage snippets is the `samples` directory. | ||
|
||
## Running a Usage Sample | ||
|
||
A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below. | ||
|
||
``` | ||
ts-node root.ts | ||
``` | ||
|
||
## Generating Additional Usage Samples | ||
|
||
The speakeasy CLI allows you to generate more usage snippets. Here's how: | ||
|
||
- To generate a sample for a specific operation by providing an operation ID, use: | ||
|
||
``` | ||
speakeasy generate usage -s ./Athena.openapi.yaml -l typescript -i {INPUT_OPERATION_ID} -o ./samples | ||
``` | ||
|
||
- To generate samples for an entire namespace (like a tag or group name), use: | ||
|
||
``` | ||
speakeasy generate usage -s ./Athena.openapi.yaml -l typescript -n {INPUT_TAG_NAME} -o ./samples | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/images/tree/main/src/typescript-node | ||
{ | ||
"name": "TypeScript", | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.vscode-typescript-tslint-plugin", | ||
"esbenp.prettier-vscode", | ||
"github.vscode-pull-request-github" | ||
], | ||
"settings": { | ||
"files.eol": "\n", | ||
"editor.formatOnSave": true, | ||
"typescript.tsc.autoDetect": "on", | ||
"typescript.updateImportsOnFileMove.enabled": "always", | ||
"typescript.preferences.importModuleSpecifier": "relative", | ||
"[typescript]": { | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"[typescriptreact]": { | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
} | ||
} | ||
}, | ||
"codespaces": { | ||
"openFiles": [ | ||
".devcontainer/README.md" | ||
] | ||
} | ||
} | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# Install the speakeasy CLI | ||
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh | ||
|
||
# Setup samples directory | ||
rmdir samples || true | ||
mkdir samples | ||
|
||
npm install | ||
npm install -g ts-node | ||
npm link | ||
npm link @isosceles-ai/sdk | ||
TS_CONFIG_CONTENT=$(cat <<EOL | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"openapi": ["../src/index"], | ||
"openapi/*": ["../src/*"] | ||
} | ||
}, | ||
"include": ["./**/*.ts"] | ||
} | ||
EOL | ||
) | ||
echo "$TS_CONFIG_CONTENT" > samples/tsconfig.json | ||
|
||
# Generate starter usage sample with speakeasy | ||
speakeasy generate usage -s ./Athena.openapi.yaml -l typescript -o samples/root.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint"], | ||
settings: { | ||
"import/resolver": { | ||
typescript: true, | ||
node: true, | ||
}, | ||
}, | ||
rules: { | ||
// Handled by typescript compiler | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/ban-types": "off", | ||
"@typescript-eslint/no-namespace": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"import/no-named-as-default-member": "off", | ||
|
||
"import/no-default-export": "error", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This allows generated code to be indexed correctly | ||
*.ts linguist-generated=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 | ||
set_version: | ||
description: optionally set a specific SDK version | ||
type: string | ||
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 | ||
set_version: ${{ github.event.inputs.set_version }} | ||
speakeasy_version: latest | ||
secrets: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
npm_token: ${{ secrets.NPM_TOKEN }} | ||
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Publish | ||
permissions: | ||
checks: write | ||
contents: write | ||
pull-requests: write | ||
statuses: write | ||
"on": | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- RELEASES.md | ||
- '*/RELEASES.md' | ||
jobs: | ||
publish: | ||
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15 | ||
secrets: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
npm_token: ${{ secrets.NPM_TOKEN }} | ||
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/models | ||
/models/errors | ||
/types | ||
/node_modules | ||
/lib | ||
/sdk | ||
/funcs | ||
/hooks | ||
/index.* | ||
/core.* | ||
/cjs | ||
/esm | ||
/dist | ||
/.tsbuildinfo | ||
/.tshy | ||
/.tshy-* | ||
/__tests__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
**/* | ||
!/**/*.ts | ||
!/**/*.js | ||
!/**/*.map | ||
|
||
/.eslintrc.js | ||
/cjs | ||
/.tshy | ||
/.tshy-* | ||
/__tests__ |
Oops, something went wrong.