Skip to content

Commit 4c426c6

Browse files
OpenRouter TeamOpenRouter Team
authored andcommitted
Project import generated by Copybara.
GitOrigin-RevId: c0eba1d9fad6b78c625ce4c192855bd63d87d58c
1 parent 5acc749 commit 4c426c6

Some content is hidden

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

55 files changed

+8783
-18238
lines changed

.github/actions/validate-sdk/action.yaml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,54 @@ inputs:
99
runs:
1010
using: 'composite'
1111
steps:
12+
- name: Install pnpm
13+
uses: pnpm/action-setup@v4
14+
with:
15+
version: 10
16+
1217
- name: Setup Node.js
1318
uses: actions/setup-node@v4
1419
with:
1520
node-version: '22'
16-
cache: 'npm'
21+
cache: 'pnpm'
1722

1823
- name: Install dependencies
1924
shell: bash
20-
run: npm install
25+
run: pnpm install
2126

2227
- name: Build SDK
2328
shell: bash
24-
run: npm run build
25-
26-
# - name: Typecheck tests directory
27-
# shell: bash
28-
# run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 tests/**/*.ts
29+
run: pnpm run build
2930

3031
- name: Install examples dependencies
3132
shell: bash
3233
working-directory: examples
33-
run: npm install
34+
run: pnpm install
3435

36+
# TODO: Re-enable when Speakeasy fixes generated code type errors
3537
- name: Typecheck examples root
3638
shell: bash
3739
working-directory: examples
38-
run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 *.ts
40+
run: pnpm exec tsc
3941

4042
- name: Install nextjs-example dependencies
4143
shell: bash
4244
working-directory: examples/nextjs-example
43-
run: npm install
45+
run: pnpm install
4446

4547
- name: Typecheck nextjs-example
4648
shell: bash
4749
working-directory: examples/nextjs-example
48-
run: npx tsc --noEmit
50+
run: pnpm exec tsc --noEmit
51+
52+
- name: Run unit tests
53+
shell: bash
54+
env:
55+
OPENROUTER_API_KEY: ${{ inputs.openrouter-api-key }}
56+
run: pnpm exec vitest --run --exclude 'tests/e2e/**'
4957

50-
- name: Run tests
58+
- name: Run e2e tests
5159
shell: bash
5260
env:
5361
OPENROUTER_API_KEY: ${{ inputs.openrouter-api-key }}
54-
run: npx vitest --run
62+
run: pnpm exec vitest --run tests/e2e/

.github/workflows/speakeasy_run_on_pr.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ jobs:
2020
ref: ${{ github.event.pull_request.head.ref }}
2121
token: ${{ secrets.GITHUB_TOKEN }}
2222

23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
version: 10
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '22'
32+
cache: 'pnpm'
33+
2334
- name: Install Speakeasy CLI
2435
run: |
2536
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@
3030
.env.*.local
3131
/examples/.env
3232
/examples/package-lock.json
33+
/examples/nextjs-example/package-lock.json
34+
/examples/nextjs-example/package.lock.json
3335
/temp

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=false
2+
strict-peer-dependencies=true

.speakeasy/gen.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ management:
55
docVersion: 1.0.0
66
speakeasyVersion: 1.666.0
77
generationVersion: 2.768.0
8-
releaseVersion: 0.2.2
9-
configChecksum: 18e3ab6a8a0d2fbb81ed748650739b3d
8+
releaseVersion: 0.3.1
9+
configChecksum: 2ebf79caacefe8cd3647823595fe3688
1010
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
1111
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
1212
published: true

.speakeasy/gen.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ generation:
1717
securityFeb2025: true
1818
sharedErrorComponentsApr2025: true
1919
auth:
20-
oAuth2ClientCredentialsEnabled: false
21-
oAuth2PasswordEnabled: false
20+
oAuth2ClientCredentialsEnabled: true
21+
oAuth2PasswordEnabled: true
2222
hoistGlobalSecurity: true
2323
inferSSEOverload: true
2424
sdkHooksConfigAccess: true
@@ -31,7 +31,7 @@ generation:
3131
skipResponseBodyAssertions: false
3232
preApplyUnionDiscriminators: true
3333
typescript:
34-
version: 0.2.2
34+
version: 0.3.1
3535
acceptHeaderEnum: false
3636
additionalDependencies:
3737
dependencies: {}

.speakeasy/workflow.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ sources:
66
sourceBlobDigest: sha256:6bbf6ab7123261f7e0604f1c640e32b5fc8fb6bb503b1bc8b12d0d78ed19fefc
77
tags:
88
- latest
9+
- subtree-sync-import-typescript-sdk
910
- 1.0.0
1011
targets:
1112
openrouter:
@@ -14,7 +15,7 @@ targets:
1415
sourceRevisionDigest: sha256:92f6f1568ba089ae8e52bd55d859a97e446ae232c4c9ca9302ea64705313c7a0
1516
sourceBlobDigest: sha256:6bbf6ab7123261f7e0604f1c640e32b5fc8fb6bb503b1bc8b12d0d78ed19fefc
1617
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:0ac460d1b6ebab411430eae7b520d5337bcf5298aad60af53b02e17dc67ce241
18+
codeSamplesRevisionDigest: sha256:ed65c8a0156ab4cccf319bd085cd624af9a4814e66054c83fba738c67871e436
1819
workflow:
1920
workflowVersion: 1.0.0
2021
speakeasyVersion: 1.666.0

0 commit comments

Comments
 (0)