@openrouter/sdk 1.2.2 → 1.2.4
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/funcs/guardrailsUpdate.d.ts +1 -1
- package/esm/funcs/guardrailsUpdate.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/inputsunion.d.ts +5 -5
- package/esm/models/inputsunion.js +3 -3
- package/esm/models/workspace.d.ts +1 -1
- package/esm/sdk/guardrails.d.ts +1 -1
- package/esm/sdk/guardrails.js +1 -1
- package/jsr.json +1 -1
- package/package.json +8 -8
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Update a guardrail
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
|
+
* Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
export declare function guardrailsUpdate(client: OpenRouterCore, request: operations.UpdateGuardrailRequest, options?: RequestOptions): APIPromise<Result<models.UpdateGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=guardrailsUpdate.d.ts.map
|
|
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
17
17
|
* Update a guardrail
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
-
* Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
|
+
* Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
21
|
*/
|
|
22
22
|
export function guardrailsUpdate(client, request, options) {
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "1.2.
|
|
52
|
+
readonly sdkVersion: "1.2.4";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.4 2.914.0 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "1.2.
|
|
29
|
+
sdkVersion: "1.2.4",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.2.4 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -132,13 +132,13 @@ export type InputsMessage = {
|
|
|
132
132
|
phase?: InputsPhaseCommentary | InputsPhaseFinalAnswer | null | undefined;
|
|
133
133
|
role: InputsRole;
|
|
134
134
|
status?: InputsStatusCompleted1 | InputsStatusIncomplete1 | InputsStatusInProgress1 | undefined;
|
|
135
|
-
type
|
|
135
|
+
type?: InputsTypeMessage | undefined;
|
|
136
136
|
};
|
|
137
|
-
export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem |
|
|
137
|
+
export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem | ContextCompactionItem;
|
|
138
138
|
/**
|
|
139
139
|
* Input for a response request - can be a string or array of items
|
|
140
140
|
*/
|
|
141
|
-
export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem |
|
|
141
|
+
export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem | ContextCompactionItem>;
|
|
142
142
|
/** @internal */
|
|
143
143
|
export declare const InputsStatusInProgress2$outboundSchema: z.ZodEnum<typeof InputsStatusInProgress2>;
|
|
144
144
|
/** @internal */
|
|
@@ -213,12 +213,12 @@ export type InputsMessage$Outbound = {
|
|
|
213
213
|
export declare const InputsMessage$outboundSchema: z.ZodType<InputsMessage$Outbound, InputsMessage>;
|
|
214
214
|
export declare function inputsMessageToJSON(inputsMessage: InputsMessage): string;
|
|
215
215
|
/** @internal */
|
|
216
|
-
export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound |
|
|
216
|
+
export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsMessage$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound;
|
|
217
217
|
/** @internal */
|
|
218
218
|
export declare const InputsUnion1$outboundSchema: z.ZodType<InputsUnion1$Outbound, InputsUnion1>;
|
|
219
219
|
export declare function inputsUnion1ToJSON(inputsUnion1: InputsUnion1): string;
|
|
220
220
|
/** @internal */
|
|
221
|
-
export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound |
|
|
221
|
+
export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsMessage$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound>;
|
|
222
222
|
/** @internal */
|
|
223
223
|
export declare const InputsUnion$outboundSchema: z.ZodType<InputsUnion$Outbound, InputsUnion>;
|
|
224
224
|
export declare function inputsUnionToJSON(inputsUnion: InputsUnion): string;
|
|
@@ -198,7 +198,7 @@ export const InputsMessage$outboundSchema = z.object({
|
|
|
198
198
|
InputsStatusIncomplete1$outboundSchema,
|
|
199
199
|
InputsStatusInProgress1$outboundSchema,
|
|
200
200
|
]).optional(),
|
|
201
|
-
type: InputsTypeMessage$outboundSchema,
|
|
201
|
+
type: InputsTypeMessage$outboundSchema.default("message"),
|
|
202
202
|
});
|
|
203
203
|
export function inputsMessageToJSON(inputsMessage) {
|
|
204
204
|
return JSON.stringify(InputsMessage$outboundSchema.parse(inputsMessage));
|
|
@@ -211,7 +211,6 @@ export const InputsUnion1$outboundSchema = z.union([
|
|
|
211
211
|
McpApprovalRequestItem$outboundSchema,
|
|
212
212
|
McpCallItem$outboundSchema,
|
|
213
213
|
ApplyPatchCallItem$outboundSchema,
|
|
214
|
-
z.lazy(() => InputsMessage$outboundSchema),
|
|
215
214
|
OutputFunctionCallItem$outboundSchema,
|
|
216
215
|
OutputCustomToolCallItem$outboundSchema,
|
|
217
216
|
OutputFileSearchCallItem$outboundSchema,
|
|
@@ -223,6 +222,7 @@ export const InputsUnion1$outboundSchema = z.union([
|
|
|
223
222
|
ReasoningItem$outboundSchema,
|
|
224
223
|
FunctionCallOutputItem$outboundSchema,
|
|
225
224
|
ApplyPatchCallOutputItem$outboundSchema,
|
|
225
|
+
z.lazy(() => InputsMessage$outboundSchema),
|
|
226
226
|
z.lazy(() => InputsReasoning$outboundSchema),
|
|
227
227
|
OutputWebSearchCallItem$outboundSchema,
|
|
228
228
|
OutputImageGenerationCallItem$outboundSchema,
|
|
@@ -268,7 +268,6 @@ export const InputsUnion$outboundSchema = z.union([
|
|
|
268
268
|
McpApprovalRequestItem$outboundSchema,
|
|
269
269
|
McpCallItem$outboundSchema,
|
|
270
270
|
ApplyPatchCallItem$outboundSchema,
|
|
271
|
-
z.lazy(() => InputsMessage$outboundSchema),
|
|
272
271
|
OutputFunctionCallItem$outboundSchema,
|
|
273
272
|
OutputCustomToolCallItem$outboundSchema,
|
|
274
273
|
OutputFileSearchCallItem$outboundSchema,
|
|
@@ -280,6 +279,7 @@ export const InputsUnion$outboundSchema = z.union([
|
|
|
280
279
|
ReasoningItem$outboundSchema,
|
|
281
280
|
FunctionCallOutputItem$outboundSchema,
|
|
282
281
|
ApplyPatchCallOutputItem$outboundSchema,
|
|
282
|
+
z.lazy(() => InputsMessage$outboundSchema),
|
|
283
283
|
z.lazy(() => InputsReasoning$outboundSchema),
|
|
284
284
|
OutputWebSearchCallItem$outboundSchema,
|
|
285
285
|
OutputImageGenerationCallItem$outboundSchema,
|
|
@@ -11,7 +11,7 @@ export type Workspace = {
|
|
|
11
11
|
*/
|
|
12
12
|
createdBy: string | null;
|
|
13
13
|
/**
|
|
14
|
-
* Deterministic ID
|
|
14
|
+
* Deterministic ID derived from the workspace ID. The default guardrail is materialized when its configuration is first written.
|
|
15
15
|
*/
|
|
16
16
|
defaultGuardrailId: string;
|
|
17
17
|
/**
|
package/esm/sdk/guardrails.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare class Guardrails extends ClientSDK {
|
|
|
37
37
|
* Update a guardrail
|
|
38
38
|
*
|
|
39
39
|
* @remarks
|
|
40
|
-
* Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
40
|
+
* Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
41
41
|
*/
|
|
42
42
|
update(request: operations.UpdateGuardrailRequest, options?: RequestOptions): Promise<models.UpdateGuardrailResponse>;
|
|
43
43
|
/**
|
package/esm/sdk/guardrails.js
CHANGED
|
@@ -59,7 +59,7 @@ export class Guardrails extends ClientSDK {
|
|
|
59
59
|
* Update a guardrail
|
|
60
60
|
*
|
|
61
61
|
* @remarks
|
|
62
|
-
* Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
62
|
+
* Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
63
63
|
*/
|
|
64
64
|
async update(request, options) {
|
|
65
65
|
return unwrapAsync(guardrailsUpdate(this, request, options));
|
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.4",
|
|
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": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"compile": "tsc",
|
|
77
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
-
"test:e2e": "vitest --run --project e2e",
|
|
79
|
-
"test:transit": "exit 0",
|
|
80
77
|
"typecheck": "tsc --noEmit",
|
|
78
|
+
"typecheck:transit": "exit 0",
|
|
79
|
+
"compile": "tsc",
|
|
81
80
|
"prepare": "npm run build",
|
|
82
81
|
"test": "vitest --run --project unit",
|
|
83
|
-
"test:
|
|
84
|
-
"
|
|
82
|
+
"test:e2e": "vitest --run --project e2e",
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
|
+
"test:watch": "vitest --watch --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|