@openrouter/sdk 1.5.98 → 1.5.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
50
50
  export declare const SDK_METADATA: {
51
51
  readonly language: "typescript";
52
52
  readonly openapiDocVersion: "1.0.0";
53
- readonly sdkVersion: "1.5.98";
53
+ readonly sdkVersion: "1.5.100";
54
54
  readonly genVersion: "2.960.8";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.98 2.960.8 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.100 2.960.8 1.0.0 @openrouter/sdk";
56
56
  };
57
57
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
29
29
  export const SDK_METADATA = {
30
30
  language: "typescript",
31
31
  openapiDocVersion: "1.0.0",
32
- sdkVersion: "1.5.98",
32
+ sdkVersion: "1.5.100",
33
33
  genVersion: "2.960.8",
34
- userAgent: "speakeasy-sdk/typescript 1.5.98 2.960.8 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.100 2.960.8 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -1,7 +1,5 @@
1
1
  import * as z from "zod/v4";
2
- import { Result as SafeParseResult } from "../types/fp.js";
3
2
  import { ContentFilterAction } from "./contentfilteraction.js";
4
- import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
3
  /**
6
4
  * A custom regex content filter that scans request messages for matching patterns.
7
5
  */
@@ -20,8 +18,6 @@ export type ContentFilterEntry = {
20
18
  pattern: string;
21
19
  };
22
20
  /** @internal */
23
- export declare const ContentFilterEntry$inboundSchema: z.ZodType<ContentFilterEntry, unknown>;
24
- /** @internal */
25
21
  export type ContentFilterEntry$Outbound = {
26
22
  action: string;
27
23
  label?: string | null | undefined;
@@ -30,5 +26,4 @@ export type ContentFilterEntry$Outbound = {
30
26
  /** @internal */
31
27
  export declare const ContentFilterEntry$outboundSchema: z.ZodType<ContentFilterEntry$Outbound, ContentFilterEntry>;
32
28
  export declare function contentFilterEntryToJSON(contentFilterEntry: ContentFilterEntry): string;
33
- export declare function contentFilterEntryFromJSON(jsonString: string): SafeParseResult<ContentFilterEntry, SDKValidationError>;
34
29
  //# sourceMappingURL=contentfilterentry.d.ts.map
@@ -3,14 +3,7 @@
3
3
  * @generated-id: 309efd3ad069
4
4
  */
5
5
  import * as z from "zod/v4";
6
- import { safeParse } from "../lib/schemas.js";
7
- import { ContentFilterAction$inboundSchema, ContentFilterAction$outboundSchema, } from "./contentfilteraction.js";
8
- /** @internal */
9
- export const ContentFilterEntry$inboundSchema = z.object({
10
- action: ContentFilterAction$inboundSchema,
11
- label: z.nullable(z.string()).optional(),
12
- pattern: z.string(),
13
- });
6
+ import { ContentFilterAction$outboundSchema, } from "./contentfilteraction.js";
14
7
  /** @internal */
15
8
  export const ContentFilterEntry$outboundSchema = z.object({
16
9
  action: ContentFilterAction$outboundSchema,
@@ -20,7 +13,4 @@ export const ContentFilterEntry$outboundSchema = z.object({
20
13
  export function contentFilterEntryToJSON(contentFilterEntry) {
21
14
  return JSON.stringify(ContentFilterEntry$outboundSchema.parse(contentFilterEntry));
22
15
  }
23
- export function contentFilterEntryFromJSON(jsonString) {
24
- return safeParse(jsonString, (x) => ContentFilterEntry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentFilterEntry' from JSON`);
25
- }
26
16
  //# sourceMappingURL=contentfilterentry.js.map
@@ -0,0 +1,29 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { ContentFilterAction } from "./contentfilteraction.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ /**
6
+ * A custom regex content filter, with whether inference enforces it.
7
+ */
8
+ export type ContentFilterReadEntry = {
9
+ /**
10
+ * Action taken when the pattern matches
11
+ */
12
+ action: ContentFilterAction;
13
+ /**
14
+ * Optional label used in redaction placeholders or error messages
15
+ */
16
+ label?: string | null | undefined;
17
+ /**
18
+ * A regex pattern to match against request content
19
+ */
20
+ pattern: string;
21
+ /**
22
+ * Whether inference applies this pattern. False for a pattern saved before pattern validation that is too complex to run safely; it is kept but skipped until replaced.
23
+ */
24
+ isEnforced: boolean;
25
+ };
26
+ /** @internal */
27
+ export declare const ContentFilterReadEntry$inboundSchema: z.ZodType<ContentFilterReadEntry, unknown>;
28
+ export declare function contentFilterReadEntryFromJSON(jsonString: string): SafeParseResult<ContentFilterReadEntry, SDKValidationError>;
29
+ //# sourceMappingURL=contentfilterreadentry.d.ts.map
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b8a70234f549
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { ContentFilterAction$inboundSchema, } from "./contentfilteraction.js";
9
+ /** @internal */
10
+ export const ContentFilterReadEntry$inboundSchema = z.object({
11
+ action: ContentFilterAction$inboundSchema,
12
+ label: z.nullable(z.string()).optional(),
13
+ pattern: z.string(),
14
+ is_enforced: z.boolean(),
15
+ }).transform((v) => {
16
+ return remap$(v, {
17
+ "is_enforced": "isEnforced",
18
+ });
19
+ });
20
+ export function contentFilterReadEntryFromJSON(jsonString) {
21
+ return safeParse(jsonString, (x) => ContentFilterReadEntry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentFilterReadEntry' from JSON`);
22
+ }
23
+ //# sourceMappingURL=contentfilterreadentry.js.map
@@ -1,7 +1,7 @@
1
1
  import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../types/fp.js";
3
3
  import { ContentFilterBuiltinEntry } from "./contentfilterbuiltinentry.js";
4
- import { ContentFilterEntry } from "./contentfilterentry.js";
4
+ import { ContentFilterReadEntry } from "./contentfilterreadentry.js";
5
5
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
6
6
  import { GuardrailDataRegion } from "./guardraildataregion.js";
7
7
  import { GuardrailInterval } from "./guardrailinterval.js";
@@ -33,7 +33,7 @@ export type Guardrail = {
33
33
  /**
34
34
  * Custom regex content filters applied to request messages
35
35
  */
36
- contentFilters?: Array<ContentFilterEntry> | null | undefined;
36
+ contentFilters?: Array<ContentFilterReadEntry> | null | undefined;
37
37
  /**
38
38
  * ISO 8601 timestamp of when the guardrail was created
39
39
  */
@@ -6,7 +6,7 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import { ContentFilterBuiltinEntry$inboundSchema, } from "./contentfilterbuiltinentry.js";
9
- import { ContentFilterEntry$inboundSchema, } from "./contentfilterentry.js";
9
+ import { ContentFilterReadEntry$inboundSchema, } from "./contentfilterreadentry.js";
10
10
  import { GuardrailDataRegion$inboundSchema, } from "./guardraildataregion.js";
11
11
  import { GuardrailInterval$inboundSchema, } from "./guardrailinterval.js";
12
12
  /** @internal */
@@ -18,7 +18,7 @@ export const Guardrail$inboundSchema = z.object({
18
18
  allowed_models: z.nullable(z.array(z.string())).optional(),
19
19
  allowed_providers: z.nullable(z.array(z.string())).optional(),
20
20
  content_filter_builtins: z.nullable(z.array(ContentFilterBuiltinEntry$inboundSchema)).optional(),
21
- content_filters: z.nullable(z.array(ContentFilterEntry$inboundSchema))
21
+ content_filters: z.nullable(z.array(ContentFilterReadEntry$inboundSchema))
22
22
  .optional(),
23
23
  created_at: z.string(),
24
24
  description: z.nullable(z.string()).optional(),
@@ -274,6 +274,7 @@ export * from "./contentfilterbuiltinentry.js";
274
274
  export * from "./contentfilterbuiltinentryinput.js";
275
275
  export * from "./contentfilterbuiltinslug.js";
276
276
  export * from "./contentfilterentry.js";
277
+ export * from "./contentfilterreadentry.js";
277
278
  export * from "./contentpartaddedevent.js";
278
279
  export * from "./contentpartaudio.js";
279
280
  export * from "./contentpartdoneevent.js";
@@ -278,6 +278,7 @@ export * from "./contentfilterbuiltinentry.js";
278
278
  export * from "./contentfilterbuiltinentryinput.js";
279
279
  export * from "./contentfilterbuiltinslug.js";
280
280
  export * from "./contentfilterentry.js";
281
+ export * from "./contentfilterreadentry.js";
281
282
  export * from "./contentpartaddedevent.js";
282
283
  export * from "./contentpartaudio.js";
283
284
  export * from "./contentpartdoneevent.js";
@@ -21,6 +21,10 @@ export type OutputWebFetchServerToolItem = {
21
21
  */
22
22
  httpStatus?: number | undefined;
23
23
  id?: string | undefined;
24
+ /**
25
+ * The time the content was fetched, as an ISO 8601 timestamp.
26
+ */
27
+ retrievedAt?: string | undefined;
24
28
  status: ToolCallStatus;
25
29
  title?: string | undefined;
26
30
  type: OutputWebFetchServerToolItemType;
@@ -38,6 +42,7 @@ export type OutputWebFetchServerToolItem$Outbound = {
38
42
  error?: string | undefined;
39
43
  httpStatus?: number | undefined;
40
44
  id?: string | undefined;
45
+ retrieved_at?: string | undefined;
41
46
  status: string;
42
47
  title?: string | undefined;
43
48
  type: string;
@@ -3,6 +3,7 @@
3
3
  * @generated-id: a28b106c9b49
4
4
  */
5
5
  import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
6
7
  import { safeParse } from "../lib/schemas.js";
7
8
  import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
8
9
  export const OutputWebFetchServerToolItemType = {
@@ -18,10 +19,15 @@ export const OutputWebFetchServerToolItem$inboundSchema = z.object({
18
19
  error: z.string().optional(),
19
20
  httpStatus: z.int().optional(),
20
21
  id: z.string().optional(),
22
+ retrieved_at: z.string().optional(),
21
23
  status: ToolCallStatus$inboundSchema,
22
24
  title: z.string().optional(),
23
25
  type: OutputWebFetchServerToolItemType$inboundSchema,
24
26
  url: z.string().optional(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ "retrieved_at": "retrievedAt",
30
+ });
25
31
  });
26
32
  /** @internal */
27
33
  export const OutputWebFetchServerToolItem$outboundSchema = z.object({
@@ -29,10 +35,15 @@ export const OutputWebFetchServerToolItem$outboundSchema = z.object({
29
35
  error: z.string().optional(),
30
36
  httpStatus: z.int().optional(),
31
37
  id: z.string().optional(),
38
+ retrievedAt: z.string().optional(),
32
39
  status: ToolCallStatus$outboundSchema,
33
40
  title: z.string().optional(),
34
41
  type: OutputWebFetchServerToolItemType$outboundSchema,
35
42
  url: z.string().optional(),
43
+ }).transform((v) => {
44
+ return remap$(v, {
45
+ retrievedAt: "retrieved_at",
46
+ });
36
47
  });
37
48
  export function outputWebFetchServerToolItemToJSON(outputWebFetchServerToolItem) {
38
49
  return JSON.stringify(OutputWebFetchServerToolItem$outboundSchema.parse(outputWebFetchServerToolItem));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.98",
5
+ "version": "1.5.100",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.5.98",
3
+ "version": "1.5.100",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
6
6
  "keywords": [
@@ -73,14 +73,14 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
- "postinstall": "node scripts/check-types.js || true",
77
- "test:e2e": "vitest --run --project e2e",
78
- "typecheck": "tsc --noEmit",
79
76
  "compile": "tsc && node scripts/unbarrel-imports.js",
77
+ "postinstall": "node scripts/check-types.js || true",
80
78
  "prepare": "npm run build",
81
79
  "test": "vitest --run --project unit",
80
+ "test:e2e": "vitest --run --project e2e",
82
81
  "test:transit": "exit 0",
83
82
  "test:watch": "vitest --watch --project unit",
83
+ "typecheck": "tsc --noEmit",
84
84
  "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {