Skip to content

Commit 6856bbb

Browse files
committed
feat: zod v4
1 parent 4c578df commit 6856bbb

File tree

131 files changed

+1244
-1946
lines changed

Some content is hidden

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

131 files changed

+1244
-1946
lines changed

.speakeasy/gen.lock

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 8b6cd71c-ea04-44da-af45-e43968b5928d
33
management:
44
docChecksum: 91fac1777f65751c0821fcc871339214
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.638.2
7-
generationVersion: 2.729.3
8-
releaseVersion: 0.0.1-beta.6
9-
configChecksum: 550c3a591fe28e4437bad9246d74cc8b
6+
speakeasyVersion: 1.639.0
7+
generationVersion: 2.730.0
8+
releaseVersion: 0.0.1-beta.7
9+
configChecksum: bc4180717a0190e99c06ed159dac2dad
1010
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
1111
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
1212
published: true
@@ -15,7 +15,7 @@ features:
1515
acceptHeaders: 2.81.2
1616
additionalDependencies: 0.1.0
1717
constsAndDefaults: 0.1.12
18-
core: 3.23.0
18+
core: 3.24.0
1919
customCodeRegions: 0.1.0
2020
defaultEnabledRetries: 0.1.0
2121
deprecations: 2.81.1
@@ -1370,6 +1370,3 @@ examples:
13701370
5XX:
13711371
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
13721372
examplesVersion: 1.0.2
1373-
releaseNotes: |
1374-
## Typescript SDK Changes Detected:
1375-
* `openrouter.beta.responses.send()`: `response` **Changed**

.speakeasy/gen.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ generation:
2929
generateNewTests: true
3030
skipResponseBodyAssertions: false
3131
typescript:
32-
version: 0.0.1-beta.6
32+
version: 0.0.1-beta.7
3333
acceptHeaderEnum: false
3434
additionalDependencies:
3535
dependencies: {}
@@ -72,3 +72,4 @@ typescript:
7272
templateVersion: v2
7373
usageSDKInitImports: []
7474
useIndexModules: true
75+
zodVersion: v4

.speakeasy/workflow.lock

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
speakeasyVersion: 1.638.2
1+
speakeasyVersion: 1.639.0
22
sources:
33
OpenRouter API:
44
sourceNamespace: open-router-chat-completions-api
55
sourceRevisionDigest: sha256:e02ee82928a7d3f9c1d3efa2cb5015a9a8be0ee1bd83aff728f59d4cf898c842
66
sourceBlobDigest: sha256:87a961c88ed7c186853a3d8221bbf4bcd35108f263bb8e03ab2fd5ab31b81b29
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1761240253
109
- 1.0.0
1110
targets:
1211
openrouter:
1312
source: OpenRouter API
1413
sourceNamespace: open-router-chat-completions-api
1514
sourceRevisionDigest: sha256:e02ee82928a7d3f9c1d3efa2cb5015a9a8be0ee1bd83aff728f59d4cf898c842
1615
sourceBlobDigest: sha256:87a961c88ed7c186853a3d8221bbf4bcd35108f263bb8e03ab2fd5ab31b81b29
17-
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
18-
codeSamplesRevisionDigest: sha256:345e2d0a457fd984dc7ead6ad419a1a7f8245b9441a431f36978d8b22b7ea6c5
1916
workflow:
2017
workflowVersion: 1.0.0
2118
speakeasyVersion: latest

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.6",
5+
"version": "0.0.1-beta.7",
66
"exports": {
77
".": "./src/index.ts",
88
"./models/errors": "./src/models/errors/index.ts",

package-lock.json

Lines changed: 2 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: 1 addition & 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.6",
3+
"version": "0.0.1-beta.7",
44
"author": "OpenRouter",
55
"type": "module",
66
"main": "./esm/index.js",

src/lib/base64.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
33
*/
44

5-
import * as z from "zod/v3";
5+
import * as z from "zod/v4";
66

77
export function bytesToBase64(u8arr: Uint8Array): string {
88
return btoa(String.fromCodePoint(...u8arr));

src/lib/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
5959
export const SDK_METADATA = {
6060
language: "typescript",
6161
openapiDocVersion: "1.0.0",
62-
sdkVersion: "0.0.1-beta.6",
63-
genVersion: "2.729.3",
62+
sdkVersion: "0.0.1-beta.7",
63+
genVersion: "2.730.0",
6464
userAgent:
65-
"speakeasy-sdk/typescript 0.0.1-beta.6 2.729.3 1.0.0 @openrouter/sdk",
65+
"speakeasy-sdk/typescript 0.0.1-beta.7 2.730.0 1.0.0 @openrouter/sdk",
6666
} as const;

src/lib/env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
33
*/
44

5-
import * as z from "zod/v3";
5+
import * as z from "zod/v4";
66
import { dlv } from "./dlv.js";
77

88
export interface Env {
@@ -11,7 +11,7 @@ export interface Env {
1111
OPENROUTER_DEBUG?: boolean | undefined;
1212
}
1313

14-
export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
14+
export const envSchema: z.ZodType<Env, unknown> = z.object({
1515
OPENROUTER_API_KEY: z.string().optional(),
1616

1717
OPENROUTER_DEBUG: z.coerce.boolean().optional(),

src/lib/schemas.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
33
*/
44

5-
import {
6-
output,
7-
ZodEffects,
8-
ZodError,
9-
ZodObject,
10-
ZodRawShape,
11-
ZodTypeAny,
12-
} from "zod/v3";
5+
import * as z from "zod/v4";
6+
import { output, ZodError } from "zod/v4";
137
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
148
import { ERR, OK, Result } from "../types/fp.js";
159

@@ -51,21 +45,28 @@ export function safeParse<Inp, Out>(
5145
}
5246

5347
export function collectExtraKeys<
54-
Shape extends ZodRawShape,
55-
Catchall extends ZodTypeAny,
48+
Shape extends z.ZodRawShape,
49+
Catchall extends z.ZodType,
5650
K extends string,
51+
Optional extends boolean,
5752
>(
58-
obj: ZodObject<Shape, "strip", Catchall>,
53+
obj: z.ZodObject<Shape, z.core.$catchall<Catchall>>,
5954
extrasKey: K,
60-
optional: boolean,
61-
): ZodEffects<
62-
typeof obj,
63-
& output<ZodObject<Shape, "strict">>
64-
& {
65-
[k in K]: Record<string, output<Catchall>>;
66-
}
55+
optional: Optional,
56+
): z.ZodPipe<
57+
z.ZodObject<Shape, z.core.$catchall<Catchall>>,
58+
z.ZodTransform<
59+
& z.output<z.ZodObject<Shape, z.core.$strip>>
60+
& (Optional extends true ? {
61+
[k in K]: Record<string, z.output<Catchall>>;
62+
}
63+
: {
64+
[k in K]?: Record<string, z.output<Catchall>> | undefined;
65+
}),
66+
z.output<z.ZodObject<Shape, z.core.$catchall<Catchall>>>
67+
>
6768
> {
68-
return obj.transform((val) => {
69+
return obj.transform((val: any) => {
6970
const extras: Record<string, output<Catchall>> = {};
7071
const { shape } = obj;
7172
for (const [key] of Object.entries(val)) {

0 commit comments

Comments
 (0)