Skip to content

Commit ff8b488

Browse files
Switch to speakeasy
1 parent 3fcb3e7 commit ff8b488

File tree

411 files changed

+24330
-6033
lines changed

Some content is hidden

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

411 files changed

+24330
-6033
lines changed

Diff for: .devcontainer/README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
> **Remember to shutdown a GitHub Codespace when it is not in use!**
3+
4+
# Dev Containers Quick Start
5+
6+
The default location for usage snippets is the `samples` directory.
7+
8+
## Running a Usage Sample
9+
10+
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.
11+
12+
```
13+
ts-node root.ts
14+
```
15+
16+
## Generating Additional Usage Samples
17+
18+
The speakeasy CLI allows you to generate more usage snippets. Here's how:
19+
20+
- To generate a sample for a specific operation by providing an operation ID, use:
21+
22+
```
23+
speakeasy generate usage -s https://cloudinary.github.io/api-schemas/analysis/schema.yml -l typescript -i {INPUT_OPERATION_ID} -o ./samples
24+
```
25+
26+
- To generate samples for an entire namespace (like a tag or group name), use:
27+
28+
```
29+
speakeasy generate usage -s https://cloudinary.github.io/api-schemas/analysis/schema.yml -l typescript -n {INPUT_TAG_NAME} -o ./samples
30+
```

Diff for: .devcontainer/devcontainer.json

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/images/tree/main/src/typescript-node
3+
{
4+
"name": "TypeScript",
5+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
6+
// Features to add to the dev container. More info: https://containers.dev/features.
7+
// "features": {},
8+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
9+
// "forwardPorts": [],
10+
// Use 'postCreateCommand' to run commands after the container is created.
11+
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-vscode.vscode-typescript-tslint-plugin",
16+
"esbenp.prettier-vscode",
17+
"github.vscode-pull-request-github"
18+
],
19+
"settings": {
20+
"files.eol": "\n",
21+
"editor.formatOnSave": true,
22+
"typescript.tsc.autoDetect": "on",
23+
"typescript.updateImportsOnFileMove.enabled": "always",
24+
"typescript.preferences.importModuleSpecifier": "relative",
25+
"[typescript]": {
26+
"editor.codeActionsOnSave": {
27+
"source.organizeImports": true
28+
}
29+
},
30+
"[typescriptreact]": {
31+
"editor.codeActionsOnSave": {
32+
"source.organizeImports": true
33+
}
34+
}
35+
}
36+
},
37+
"codespaces": {
38+
"openFiles": [
39+
".devcontainer/README.md"
40+
]
41+
}
42+
}
43+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
44+
// "remoteUser": "root"
45+
}

Diff for: .devcontainer/setup.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Install the speakeasy CLI
4+
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
5+
6+
# Setup samples directory
7+
rmdir samples || true
8+
mkdir samples
9+
10+
npm install
11+
npm install -g ts-node
12+
npm link
13+
npm link @cloudinary/analysis
14+
TS_CONFIG_CONTENT=$(cat <<EOL
15+
{
16+
"compilerOptions": {
17+
"baseUrl": ".",
18+
"paths": {
19+
"openapi": ["../src/index"],
20+
"openapi/*": ["../src/*"]
21+
}
22+
},
23+
"include": ["./**/*.ts"]
24+
}
25+
EOL
26+
)
27+
echo "$TS_CONFIG_CONTENT" > samples/tsconfig.json
28+
29+
# Generate starter usage sample with speakeasy
30+
speakeasy generate usage -s https://cloudinary.github.io/api-schemas/analysis/schema.yml -l typescript -o samples/root.ts

Diff for: .gitattributes

+2
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

Diff for: .github/workflows/npm-publish.yml

-26
This file was deleted.

Diff for: .github/workflows/sdk_generation.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
jobs:
19+
generate:
20+
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
21+
with:
22+
force: ${{ github.event.inputs.force }}
23+
mode: pr
24+
set_version: ${{ github.event.inputs.set_version }}
25+
secrets:
26+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
27+
npm_token: ${{ secrets.SDK_NPM_AUTH_TOKEN }}
28+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

Diff for: .github/workflows/sdk_publish.yaml

+23
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: analysis-js
20+
secrets:
21+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
22+
npm_token: ${{ secrets.SDK_NPM_AUTH_TOKEN }}
23+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

Diff for: .gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/mcp-server
2+
/bin
3+
/models
4+
/models/errors
5+
/types
6+
/node_modules
7+
/lib
8+
/sdk
9+
/funcs
10+
/react-query
11+
/hooks
12+
/index.*
13+
/core.*
14+
/cjs
15+
/esm
16+
/dist
17+
/.tsbuildinfo
18+
/.eslintcache
19+
/.tshy
20+
/.tshy-*
21+
/__tests__
22+
/.speakeasy/reports
123
wwwroot/*.js
224
node_modules
325
typings

Diff for: .npmignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
**/*
2+
!/FUNCTIONS.md
3+
!/RUNTIMES.md
4+
!/REACT_QUERY.md
5+
!/**/*.ts
6+
!/**/*.js
7+
!/**/*.mjs
8+
!/**/*.json
9+
!/**/*.map
10+
11+
/eslint.config.mjs
12+
/cjs
13+
/.tshy
14+
/.tshy-*
15+
/__tests__

Diff for: .openapi-generator-ignore

-23
This file was deleted.

0 commit comments

Comments
 (0)