Skip to content
Merged
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
27 changes: 27 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: ['@typescript-eslint'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
rules: {
// Generated code often has these issues, so we'll be lenient
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-interface': 'off',
// Allow console for SDK logging
'no-console': 'off',
},
ignorePatterns: [
'dist/**/*',
'node_modules/**/*',
'.openapi-generator/**/*',
'example.js'
]
};
106 changes: 106 additions & 0 deletions .github/workflows/auto-release-simple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Auto Release (Simple)

on:
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint

- name: Build package
run: npm run build

- name: Test package can be imported
run: node -e "require('./dist/index.js')"

check-version:
runs-on: ubuntu-latest
outputs:
version-changed: ${{ steps.version-check.outputs.changed }}
new-version: ${{ steps.version-check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Check if version changed
id: version-check
run: |
# Get current version
CURRENT_VERSION=$(node -p "require('./package.json').version")

# Get previous version (from previous commit)
git checkout HEAD~1
PREVIOUS_VERSION=$(node -p "require('./package.json').version")
git checkout -

echo "Previous version: $PREVIOUS_VERSION"
echo "Current version: $CURRENT_VERSION"

if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi

release-and-publish:
needs: [test, check-version]
runs-on: ubuntu-latest
if: needs.check-version.outputs.version-changed == 'true'

steps:
- uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.check-version.outputs.new-version }}
release_name: Release v${{ needs.check-version.outputs.new-version }}
draft: false
prerelease: false
body: |
Changes in this release:
- Version bump to ${{ needs.check-version.outputs.new-version }}

For detailed changes, see the commit history.

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: CI/CD

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint

- name: Build package
run: npm run build

- name: Test package can be imported
run: node -e "require('./dist/index.js')"

# Semantic Release - automatically creates releases and publishes on merge to main
release:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for semantic-release
token: ${{ secrets.GITHUB_TOKEN }}

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

# Keep the old publish job for manual releases (optional)
publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release'

steps:
- uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ pids/

# Generated types (will be regenerated)
src/types/generated.ts
wwwroot/*.js
typings

# Temporary files
tmp/
Expand Down
47 changes: 47 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm

# Source files (only include the built dist folder)
*.ts
!*.d.ts

# Development files
.openapi-generator/
.openapi-generator-ignore
git_push.sh
docs/
tsconfig*.json
.eslintrc.js

# Node.js
node_modules/
.npm
.nvmrc

# Testing
coverage/
.nyc_output/
*.test.*
*.spec.*

# Development
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Environment
.env
.env.local
.env.*.local
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
23 changes: 23 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
40 changes: 40 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
base.ts
common.ts
configuration.ts
docs/CreateReplacementRuleset201Response.md
docs/CreateReplacementRulesetRequest.md
docs/ErrorResponse.md
docs/ExactRule.md
docs/OpenAIAudioResponseFormat.md
docs/OpenAICompatibleSpeechToTextApi.md
docs/OpenAICreateTranscriptionResponseJson.md
docs/OpenAICreateTranscriptionResponseVerboseJson.md
docs/OpenAICreateTranslationRequestModel.md
docs/OpenAICreateTranslationResponseJson.md
docs/OpenAICreateTranslationResponseVerboseJson.md
docs/OpenAITranscriptionSegment.md
docs/OpenAITranscriptionWord.md
docs/OpenaiCompatibleCreateTranscription200Response.md
docs/OpenaiCompatibleCreateTranslation200Response.md
docs/RegexGroupRule.md
docs/RegexRule.md
docs/ReplacementRule.md
docs/ReplacementRulesApi.md
docs/SpeechToTextApi.md
docs/SpeechToTextModel.md
docs/TranscriptLanguageCode.md
docs/TranscriptOutputFormat.md
docs/TranscriptionDetailed.md
docs/TranscriptionModelIdentifier.md
docs/TranscriptionOnlyText.md
docs/TranscriptionOptions.md
docs/TranscriptionProvider.md
docs/TranscriptionResponse.md
docs/TranscriptionSegment.md
docs/TranscriptionWord.md
git_push.sh
index.ts
1 change: 1 addition & 0 deletions .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.13.0
32 changes: 32 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": true
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "CHANGELOG.md",
"label": "Changelog"
}
]
}
],
[
"@semantic-release/git",
{
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Loading