Skip to content

Commit 27475fe

Browse files
authored
chore: update OpenAPI specification from openrouter-web (#40)
Co-authored-by: mattapperson <[email protected]>
1 parent 1fa1d74 commit 27475fe

File tree

11 files changed

+37
-22
lines changed

11 files changed

+37
-22
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ runs:
1818
shell: bash
1919
run: npm run build
2020

21-
- name: Typecheck tests directory
22-
shell: bash
23-
run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 'tests/**/*.ts'
21+
# - name: Typecheck tests directory
22+
# shell: bash
23+
# run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 tests/**/*.ts
2424

2525
- name: Install examples dependencies
2626
shell: bash
@@ -30,7 +30,7 @@ runs:
3030
- name: Typecheck examples root
3131
shell: bash
3232
working-directory: examples
33-
run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 '*.ts'
33+
run: npx tsc --noEmit --skipLibCheck --esModuleInterop --moduleResolution node --module esnext --target es2020 *.ts
3434

3535
- name: Install nextjs-example dependencies
3636
shell: bash
@@ -44,4 +44,4 @@ runs:
4444

4545
- name: Run tests
4646
shell: bash
47-
run: npm test
47+
run: npx vitest

.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.642.1
77
generationVersion: 2.731.4
8-
releaseVersion: 0.0.1-beta.12
9-
configChecksum: e6c04301f8a6286cc4a63b775130ead9
8+
releaseVersion: 0.0.1-beta.14
9+
configChecksum: 6639946bd9c6d122465a7506943348f4
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ generation:
2929
generateNewTests: true
3030
skipResponseBodyAssertions: false
3131
typescript:
32-
version: 0.0.1-beta.12
32+
version: 0.0.1-beta.14
3333
acceptHeaderEnum: false
3434
additionalDependencies:
3535
dependencies: {}
3636
devDependencies:
3737
'@types/node': ^22.13.12
38-
vitest: ^3.2.4
3938
dotenv: ^16.4.7
39+
vitest: ^3.2.4
4040
peerDependencies: {}
4141
additionalPackageJSON: {}
4242
author: OpenRouter

.speakeasy/workflow.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ targets:
1414
sourceRevisionDigest: sha256:6dd11a2a3212f61a00c0e0b6309aaf39cc3d2575493aea2b54aafb0cf187d272
1515
sourceBlobDigest: sha256:e46f40a6a57e7eb1c21a40c388f46b9b7b36ed0dd9ea78d480d300d83ace2fe3
1616
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:54cedfffe13b1e73d8e277b9fcbc7f109d448d6131ae751d3a07640b9e952673
17+
codeSamplesRevisionDigest: sha256:1d36752fa1859baae015ab744eb16369c7c2a9d9de92e60135d98860d2ab4741
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

examples/chatCompletions.example.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ async function streamingExample() {
6666
let fullContent = "";
6767

6868
for await (const chunk of stream) {
69-
if (chunk.data.choices && chunk.data.choices[0]?.delta?.content) {
70-
const content = chunk.data.choices[0].delta.content;
69+
if (chunk.choices && chunk.choices[0]?.delta?.content) {
70+
const content = chunk.choices[0].delta.content;
7171
process.stdout.write(content);
7272
fullContent += content;
7373
}
7474

75-
if (chunk.data.usage) {
76-
console.log("\n\nStream usage:", chunk.data.usage);
75+
if (chunk.usage) {
76+
console.log("\n\nStream usage:", chunk.usage);
7777
}
7878
}
7979

examples/nextjs-example/package-lock.json renamed to examples/nextjs-example/package.lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6942,4 +6942,4 @@
69426942
}
69436943
}
69446944
}
6945-
}
6945+
}

examples/nextjs-example/src/app/(app)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import Link from "next/link";
2727
import { useRouter } from "next/navigation";
2828
import { useEffect, useState } from "react";
2929

30-
export default function Page({ searchParams }: PageProps<"/">) {
30+
export default function Page({ searchParams }: { searchParams: Promise<{ code?: string; error?: string }> }) {
3131
const [connectionState, setConnectionState] = useState<
3232
"disconnected" | "connecting" | "connected" | "initializing" | "error"
3333
>("initializing");

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "@openrouter/sdk",
5-
"version": "0.0.1-beta.12",
5+
"version": "0.0.1-beta.14",
66
"exports": {
77
".": "./src/index.ts",
88
"./models/errors": "./src/models/errors/index.ts",

package-lock.json

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openrouter/sdk",
3-
"version": "0.0.1-beta.12",
3+
"version": "0.0.1-beta.14",
44
"author": "OpenRouter",
55
"type": "module",
66
"main": "./esm/index.js",
@@ -72,6 +72,7 @@
7272
"@tanstack/react-query": "^5.61.4",
7373
"@types/node": "^22.13.12",
7474
"@types/react": "^18.3.12",
75+
"dotenv": "^16.4.7",
7576
"eslint": "^9.19.0",
7677
"globals": "^15.14.0",
7778
"typescript": "~5.8.3",

0 commit comments

Comments
 (0)