@openrouter/sdk 1.2.61 → 1.2.62
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.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/containerautoenvironment.d.ts +6 -0
- package/esm/models/containerautoenvironment.js +7 -0
- package/esm/models/containernetworkpolicy.d.ts +42 -0
- package/esm/models/containernetworkpolicy.js +34 -0
- package/esm/models/containerreferenceenvironment.d.ts +6 -0
- package/esm/models/containerreferenceenvironment.js +3 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.2.
|
|
53
|
+
readonly sdkVersion: "1.2.62";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.62 2.914.0 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.2.
|
|
32
|
+
sdkVersion: "1.2.62",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.62 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ContainerNetworkPolicy, ContainerNetworkPolicy$Outbound } from "./containernetworkpolicy.js";
|
|
2
3
|
/**
|
|
3
4
|
* An OpenRouter-managed, auto-provisioned ephemeral container.
|
|
4
5
|
*/
|
|
5
6
|
export type ContainerAutoEnvironment = {
|
|
7
|
+
/**
|
|
8
|
+
* Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].
|
|
9
|
+
*/
|
|
10
|
+
networkPolicy?: ContainerNetworkPolicy | undefined;
|
|
6
11
|
type: "container_auto";
|
|
7
12
|
};
|
|
8
13
|
/** @internal */
|
|
9
14
|
export type ContainerAutoEnvironment$Outbound = {
|
|
15
|
+
network_policy?: ContainerNetworkPolicy$Outbound | undefined;
|
|
10
16
|
type: "container_auto";
|
|
11
17
|
};
|
|
12
18
|
/** @internal */
|
|
@@ -3,9 +3,16 @@
|
|
|
3
3
|
* @generated-id: 49526688017e
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { ContainerNetworkPolicy$outboundSchema, } from "./containernetworkpolicy.js";
|
|
6
8
|
/** @internal */
|
|
7
9
|
export const ContainerAutoEnvironment$outboundSchema = z.object({
|
|
10
|
+
networkPolicy: ContainerNetworkPolicy$outboundSchema.optional(),
|
|
8
11
|
type: z.literal("container_auto"),
|
|
12
|
+
}).transform((v) => {
|
|
13
|
+
return remap$(v, {
|
|
14
|
+
networkPolicy: "network_policy",
|
|
15
|
+
});
|
|
9
16
|
});
|
|
10
17
|
export function containerAutoEnvironmentToJSON(containerAutoEnvironment) {
|
|
11
18
|
return JSON.stringify(ContainerAutoEnvironment$outboundSchema.parse(containerAutoEnvironment));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type ContainerNetworkPolicyAllowlist = {
|
|
3
|
+
/**
|
|
4
|
+
* Hostnames the container may reach over ports 80/443 (max 50). Entries are lowercase hostnames or glob patterns where * matches any run of characters (e.g. *.example.com). An exact hostname does not cover its subdomains — use a glob or list each hostname. pip needs both pypi.org and files.pythonhosted.org (or *.pythonhosted.org).
|
|
5
|
+
*/
|
|
6
|
+
allowedDomains: Array<string>;
|
|
7
|
+
/**
|
|
8
|
+
* Outbound access restricted to the listed domains.
|
|
9
|
+
*/
|
|
10
|
+
type: "allowlist";
|
|
11
|
+
};
|
|
12
|
+
export type ContainerNetworkPolicyDisabled = {
|
|
13
|
+
/**
|
|
14
|
+
* No outbound internet access.
|
|
15
|
+
*/
|
|
16
|
+
type: "disabled";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].
|
|
20
|
+
*/
|
|
21
|
+
export type ContainerNetworkPolicy = ContainerNetworkPolicyDisabled | ContainerNetworkPolicyAllowlist;
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type ContainerNetworkPolicyAllowlist$Outbound = {
|
|
24
|
+
allowed_domains: Array<string>;
|
|
25
|
+
type: "allowlist";
|
|
26
|
+
};
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const ContainerNetworkPolicyAllowlist$outboundSchema: z.ZodType<ContainerNetworkPolicyAllowlist$Outbound, ContainerNetworkPolicyAllowlist>;
|
|
29
|
+
export declare function containerNetworkPolicyAllowlistToJSON(containerNetworkPolicyAllowlist: ContainerNetworkPolicyAllowlist): string;
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type ContainerNetworkPolicyDisabled$Outbound = {
|
|
32
|
+
type: "disabled";
|
|
33
|
+
};
|
|
34
|
+
/** @internal */
|
|
35
|
+
export declare const ContainerNetworkPolicyDisabled$outboundSchema: z.ZodType<ContainerNetworkPolicyDisabled$Outbound, ContainerNetworkPolicyDisabled>;
|
|
36
|
+
export declare function containerNetworkPolicyDisabledToJSON(containerNetworkPolicyDisabled: ContainerNetworkPolicyDisabled): string;
|
|
37
|
+
/** @internal */
|
|
38
|
+
export type ContainerNetworkPolicy$Outbound = ContainerNetworkPolicyDisabled$Outbound | ContainerNetworkPolicyAllowlist$Outbound;
|
|
39
|
+
/** @internal */
|
|
40
|
+
export declare const ContainerNetworkPolicy$outboundSchema: z.ZodType<ContainerNetworkPolicy$Outbound, ContainerNetworkPolicy>;
|
|
41
|
+
export declare function containerNetworkPolicyToJSON(containerNetworkPolicy: ContainerNetworkPolicy): string;
|
|
42
|
+
//# sourceMappingURL=containernetworkpolicy.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ee44c31a3adf
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ContainerNetworkPolicyAllowlist$outboundSchema = z.object({
|
|
9
|
+
allowedDomains: z.array(z.string()),
|
|
10
|
+
type: z.literal("allowlist"),
|
|
11
|
+
}).transform((v) => {
|
|
12
|
+
return remap$(v, {
|
|
13
|
+
allowedDomains: "allowed_domains",
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
export function containerNetworkPolicyAllowlistToJSON(containerNetworkPolicyAllowlist) {
|
|
17
|
+
return JSON.stringify(ContainerNetworkPolicyAllowlist$outboundSchema.parse(containerNetworkPolicyAllowlist));
|
|
18
|
+
}
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const ContainerNetworkPolicyDisabled$outboundSchema = z.object({
|
|
21
|
+
type: z.literal("disabled"),
|
|
22
|
+
});
|
|
23
|
+
export function containerNetworkPolicyDisabledToJSON(containerNetworkPolicyDisabled) {
|
|
24
|
+
return JSON.stringify(ContainerNetworkPolicyDisabled$outboundSchema.parse(containerNetworkPolicyDisabled));
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const ContainerNetworkPolicy$outboundSchema = z.union([
|
|
28
|
+
z.lazy(() => ContainerNetworkPolicyDisabled$outboundSchema),
|
|
29
|
+
z.lazy(() => ContainerNetworkPolicyAllowlist$outboundSchema),
|
|
30
|
+
]);
|
|
31
|
+
export function containerNetworkPolicyToJSON(containerNetworkPolicy) {
|
|
32
|
+
return JSON.stringify(ContainerNetworkPolicy$outboundSchema.parse(containerNetworkPolicy));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=containernetworkpolicy.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ContainerNetworkPolicy, ContainerNetworkPolicy$Outbound } from "./containernetworkpolicy.js";
|
|
2
3
|
/**
|
|
3
4
|
* Reference to a container by its canonical id — a previously returned container_id or a fresh name to create a persistent container.
|
|
4
5
|
*/
|
|
@@ -7,11 +8,16 @@ export type ContainerReferenceEnvironment = {
|
|
|
7
8
|
* Canonical container id to reuse (max 40 characters, letters/digits/underscores/hyphens). Any container_id previously returned by a bash or shell tool result works here and reattaches to the same container and files — including session-derived ids (sess_...) and generation-derived ids (gen_...). Note that a session-derived id is always sess_ + the sanitized session key, which is not necessarily the raw session id you sent. Using the same container_id from both the bash and shell tools shares the same files, with last-write-wins when both flush concurrently. A fresh name creates a new persistent container. Containers are always scoped to your account and workspace.
|
|
8
9
|
*/
|
|
9
10
|
containerId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].
|
|
13
|
+
*/
|
|
14
|
+
networkPolicy?: ContainerNetworkPolicy | undefined;
|
|
10
15
|
type: "container_reference";
|
|
11
16
|
};
|
|
12
17
|
/** @internal */
|
|
13
18
|
export type ContainerReferenceEnvironment$Outbound = {
|
|
14
19
|
container_id: string;
|
|
20
|
+
network_policy?: ContainerNetworkPolicy$Outbound | undefined;
|
|
15
21
|
type: "container_reference";
|
|
16
22
|
};
|
|
17
23
|
/** @internal */
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { ContainerNetworkPolicy$outboundSchema, } from "./containernetworkpolicy.js";
|
|
7
8
|
/** @internal */
|
|
8
9
|
export const ContainerReferenceEnvironment$outboundSchema = z.object({
|
|
9
10
|
containerId: z.string(),
|
|
11
|
+
networkPolicy: ContainerNetworkPolicy$outboundSchema.optional(),
|
|
10
12
|
type: z.literal("container_reference"),
|
|
11
13
|
}).transform((v) => {
|
|
12
14
|
return remap$(v, {
|
|
13
15
|
containerId: "container_id",
|
|
16
|
+
networkPolicy: "network_policy",
|
|
14
17
|
});
|
|
15
18
|
});
|
|
16
19
|
export function containerReferenceEnvironmentToJSON(containerReferenceEnvironment) {
|
package/esm/models/index.d.ts
CHANGED
|
@@ -150,6 +150,7 @@ export * from "./conflictresponseerrordata.js";
|
|
|
150
150
|
export * from "./containerautoenvironment.js";
|
|
151
151
|
export * from "./containerfile.js";
|
|
152
152
|
export * from "./containerfilelistresponse.js";
|
|
153
|
+
export * from "./containernetworkpolicy.js";
|
|
153
154
|
export * from "./containerreferenceenvironment.js";
|
|
154
155
|
export * from "./contentfilteraction.js";
|
|
155
156
|
export * from "./contentfilterbuiltinaction.js";
|
package/esm/models/index.js
CHANGED
|
@@ -154,6 +154,7 @@ export * from "./conflictresponseerrordata.js";
|
|
|
154
154
|
export * from "./containerautoenvironment.js";
|
|
155
155
|
export * from "./containerfile.js";
|
|
156
156
|
export * from "./containerfilelistresponse.js";
|
|
157
|
+
export * from "./containernetworkpolicy.js";
|
|
157
158
|
export * from "./containerreferenceenvironment.js";
|
|
158
159
|
export * from "./contentfilteraction.js";
|
|
159
160
|
export * from "./contentfilterbuiltinaction.js";
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.62",
|
|
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,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"test:watch": "vitest --watch --project unit",
|
|
76
77
|
"typecheck:transit": "exit 0",
|
|
77
|
-
"compile": "tsc",
|
|
78
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
79
|
-
"test:e2e": "vitest --run --project e2e",
|
|
80
|
-
"test:transit": "exit 0",
|
|
81
78
|
"prepare": "npm run build",
|
|
82
79
|
"test": "vitest --run --project unit",
|
|
83
|
-
"test:
|
|
84
|
-
"typecheck": "tsc --noEmit"
|
|
80
|
+
"test:transit": "exit 0",
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
82
|
+
"compile": "tsc",
|
|
83
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
+
"test:e2e": "vitest --run --project e2e"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|