@openrouter/sdk 1.4.8 → 1.4.10
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/alignment.d.ts +17 -0
- package/esm/models/alignment.js +15 -0
- package/esm/models/alignmentallowedcallrecord.d.ts +19 -0
- package/esm/models/alignmentallowedcallrecord.js +17 -0
- package/esm/models/alignmentblockedcallrecord.d.ts +19 -0
- package/esm/models/alignmentblockedcallrecord.js +17 -0
- package/esm/models/alignmentcallrecord.d.ts +12 -0
- package/esm/models/alignmentcallrecord.js +19 -0
- package/esm/models/alignmentchataudio.d.ts +20 -0
- package/esm/models/alignmentchataudio.js +15 -0
- package/esm/models/alignmentchatimage.d.ts +24 -0
- package/esm/models/alignmentchatimage.js +32 -0
- package/esm/models/alignmentchatrejected.d.ts +31 -0
- package/esm/models/alignmentchatrejected.js +32 -0
- package/esm/models/alignmentchattoolcall.d.ts +26 -0
- package/esm/models/alignmentchattoolcall.js +29 -0
- package/esm/models/alignmentplugin.d.ts +54 -0
- package/esm/models/alignmentplugin.js +33 -0
- package/esm/models/alignmentrejected.d.ts +10 -0
- package/esm/models/alignmentrejected.js +17 -0
- package/esm/models/alignmentresponsesrejected.d.ts +18 -0
- package/esm/models/alignmentresponsesrejected.js +31 -0
- package/esm/models/alignmentrulerecord.d.ts +17 -0
- package/esm/models/alignmentrulerecord.js +15 -0
- package/esm/models/alignmentunavailablecallrecord.d.ts +25 -0
- package/esm/models/alignmentunavailablecallrecord.js +25 -0
- package/esm/models/batchobject.d.ts +5 -0
- package/esm/models/batchobject.js +2 -0
- package/esm/models/chatrequest.d.ts +5 -4
- package/esm/models/chatrequest.js +3 -0
- package/esm/models/index.d.ts +22 -1
- package/esm/models/index.js +22 -1
- package/esm/models/messagesrequest.d.ts +5 -4
- package/esm/models/messagesrequest.js +3 -0
- package/esm/models/{responseserrorfield.d.ts → openresponseserrorfield.d.ts} +10 -5
- package/esm/models/{responseserrorfield.js → openresponseserrorfield.js} +7 -5
- package/esm/models/openresponseserrormetadata.d.ts +31 -0
- package/esm/models/openresponseserrormetadata.js +25 -0
- package/esm/models/openresponsesresult.d.ts +8 -3
- package/esm/models/openresponsesresult.js +4 -2
- package/esm/models/operations/listcontainerfiles.d.ts +1 -1
- package/esm/models/outputitemapplypatchcall.d.ts +31 -0
- package/esm/models/outputitemapplypatchcall.js +49 -0
- package/esm/models/outputitemcodeinterpretercall.d.ts +37 -0
- package/esm/models/outputitemcodeinterpretercall.js +51 -0
- package/esm/models/outputitemcustomtoolcall.d.ts +32 -0
- package/esm/models/outputitemcustomtoolcall.js +34 -0
- package/esm/models/outputitemfilesearchcall.d.ts +14 -0
- package/esm/models/outputitemfilesearchcall.js +18 -0
- package/esm/models/outputitemfunctioncall.d.ts +46 -0
- package/esm/models/outputitemfunctioncall.js +54 -0
- package/esm/models/outputitemimagegenerationcall.d.ts +1 -8
- package/esm/models/outputitemimagegenerationcall.js +1 -6
- package/esm/models/outputitemreasoning.d.ts +40 -0
- package/esm/models/outputitemreasoning.js +54 -0
- package/esm/models/outputitemwebsearchcall.d.ts +47 -0
- package/esm/models/outputitemwebsearchcall.js +60 -0
- package/esm/models/outputmessage.d.ts +1 -7
- package/esm/models/outputmessage.js +1 -6
- package/esm/models/outputwebsearchcallitem.d.ts +25 -25
- package/esm/models/outputwebsearchcallitem.js +31 -32
- package/esm/models/responsesrequest.d.ts +5 -4
- package/esm/models/responsesrequest.js +3 -0
- package/jsr.json +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 82c9449590f6
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
export const AlignmentUnavailableCallRecordReason = {
|
|
9
|
+
Cut: "cut",
|
|
10
|
+
EvaluatorError: "evaluator_error",
|
|
11
|
+
MalformedAnswer: "malformed_answer",
|
|
12
|
+
TimeLimit: "time_limit",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const AlignmentUnavailableCallRecordReason$inboundSchema = openEnums.inboundSchema(AlignmentUnavailableCallRecordReason);
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const AlignmentUnavailableCallRecord$inboundSchema = z.object({
|
|
18
|
+
call: z.int(),
|
|
19
|
+
outcome: z.literal("unavailable"),
|
|
20
|
+
reason: AlignmentUnavailableCallRecordReason$inboundSchema,
|
|
21
|
+
});
|
|
22
|
+
export function alignmentUnavailableCallRecordFromJSON(jsonString) {
|
|
23
|
+
return safeParse(jsonString, (x) => AlignmentUnavailableCallRecord$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AlignmentUnavailableCallRecord' from JSON`);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=alignmentunavailablecallrecord.js.map
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
3
|
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
4
4
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
5
|
+
import { Alignment } from "./alignment.js";
|
|
5
6
|
import { AnthropicCacheCreation } from "./anthropiccachecreation.js";
|
|
6
7
|
import { AnthropicContainer } from "./anthropiccontainer.js";
|
|
7
8
|
import { AnthropicInputTransformation } from "./anthropicinputtransformation.js";
|
|
@@ -429,6 +430,10 @@ export type BodyUsage1 = {
|
|
|
429
430
|
totalTokens: number;
|
|
430
431
|
};
|
|
431
432
|
export type BodyChatCompletion = {
|
|
433
|
+
/**
|
|
434
|
+
* Beta. The result of the alignment plugin for this request; the shape may change.
|
|
435
|
+
*/
|
|
436
|
+
alignment?: Alignment | undefined;
|
|
432
437
|
choices: Array<Choice>;
|
|
433
438
|
created: number;
|
|
434
439
|
debug?: BatchObjectDebug | undefined;
|
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schemas.js";
|
|
8
8
|
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
9
9
|
import * as openEnums from "../types/enums.js";
|
|
10
|
+
import { Alignment$inboundSchema } from "./alignment.js";
|
|
10
11
|
import { AnthropicCacheCreation$inboundSchema, } from "./anthropiccachecreation.js";
|
|
11
12
|
import { AnthropicContainer$inboundSchema, } from "./anthropiccontainer.js";
|
|
12
13
|
import { AnthropicInputTransformation$inboundSchema, } from "./anthropicinputtransformation.js";
|
|
@@ -633,6 +634,7 @@ export function bodyUsage1FromJSON(jsonString) {
|
|
|
633
634
|
}
|
|
634
635
|
/** @internal */
|
|
635
636
|
export const BodyChatCompletion$inboundSchema = z.object({
|
|
637
|
+
alignment: Alignment$inboundSchema.optional(),
|
|
636
638
|
choices: z.array(z.lazy(() => Choice$inboundSchema)),
|
|
637
639
|
created: z.int(),
|
|
638
640
|
debug: z.lazy(() => BatchObjectDebug$inboundSchema).optional(),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { AlignmentPlugin, AlignmentPlugin$Outbound } from "./alignmentplugin.js";
|
|
3
4
|
import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
|
|
4
5
|
import { AutoBetaRouterPlugin, AutoBetaRouterPlugin$Outbound } from "./autobetarouterplugin.js";
|
|
5
6
|
import { AutoRouterPlugin, AutoRouterPlugin$Outbound } from "./autorouterplugin.js";
|
|
@@ -36,7 +37,7 @@ export declare const Modality: {
|
|
|
36
37
|
readonly Audio: "audio";
|
|
37
38
|
};
|
|
38
39
|
export type Modality = OpenEnum<typeof Modality>;
|
|
39
|
-
export type ChatRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
40
|
+
export type ChatRequestPlugin = AlignmentPlugin | AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
40
41
|
/**
|
|
41
42
|
* Constrains effort on reasoning for reasoning models
|
|
42
43
|
*/
|
|
@@ -176,7 +177,7 @@ export type ChatRequest = {
|
|
|
176
177
|
/**
|
|
177
178
|
* Plugins you want to enable for this request, including their settings.
|
|
178
179
|
*/
|
|
179
|
-
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
180
|
+
plugins?: Array<AlignmentPlugin | AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
180
181
|
/**
|
|
181
182
|
* Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
|
|
182
183
|
*/
|
|
@@ -278,7 +279,7 @@ export type ChatRequest = {
|
|
|
278
279
|
/** @internal */
|
|
279
280
|
export declare const Modality$outboundSchema: z.ZodType<string, Modality>;
|
|
280
281
|
/** @internal */
|
|
281
|
-
export type ChatRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
282
|
+
export type ChatRequestPlugin$Outbound = AlignmentPlugin$Outbound | AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
282
283
|
/** @internal */
|
|
283
284
|
export declare const ChatRequestPlugin$outboundSchema: z.ZodType<ChatRequestPlugin$Outbound, ChatRequestPlugin>;
|
|
284
285
|
export declare function chatRequestPluginToJSON(chatRequestPlugin: ChatRequestPlugin): string;
|
|
@@ -329,7 +330,7 @@ export type ChatRequest$Outbound = {
|
|
|
329
330
|
model?: string | undefined;
|
|
330
331
|
models?: Array<string> | undefined;
|
|
331
332
|
parallel_tool_calls?: boolean | null | undefined;
|
|
332
|
-
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
333
|
+
plugins?: Array<AlignmentPlugin$Outbound | AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
333
334
|
prediction?: Prediction$Outbound | null | undefined;
|
|
334
335
|
presence_penalty?: number | null | undefined;
|
|
335
336
|
prompt_cache_key?: string | null | undefined;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { AlignmentPlugin$outboundSchema, } from "./alignmentplugin.js";
|
|
8
9
|
import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
|
|
9
10
|
import { AutoBetaRouterPlugin$outboundSchema, } from "./autobetarouterplugin.js";
|
|
10
11
|
import { AutoRouterPlugin$outboundSchema, } from "./autorouterplugin.js";
|
|
@@ -81,6 +82,7 @@ export const Modality$outboundSchema = openEnums
|
|
|
81
82
|
.outboundSchema(Modality);
|
|
82
83
|
/** @internal */
|
|
83
84
|
export const ChatRequestPlugin$outboundSchema = z.union([
|
|
85
|
+
AlignmentPlugin$outboundSchema,
|
|
84
86
|
AutoBetaRouterPlugin$outboundSchema,
|
|
85
87
|
AutoRouterPlugin$outboundSchema,
|
|
86
88
|
ContextCompressionPlugin$outboundSchema,
|
|
@@ -149,6 +151,7 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
149
151
|
models: z.array(z.string()).optional(),
|
|
150
152
|
parallelToolCalls: z.nullable(z.boolean()).optional(),
|
|
151
153
|
plugins: z.array(z.union([
|
|
154
|
+
AlignmentPlugin$outboundSchema,
|
|
152
155
|
AutoBetaRouterPlugin$outboundSchema,
|
|
153
156
|
AutoRouterPlugin$outboundSchema,
|
|
154
157
|
ContextCompressionPlugin$outboundSchema,
|
package/esm/models/index.d.ts
CHANGED
|
@@ -6,6 +6,19 @@ export * from "./advisorreasoning.js";
|
|
|
6
6
|
export * from "./advisorservertoolconfig.js";
|
|
7
7
|
export * from "./advisorservertoolopenrouter.js";
|
|
8
8
|
export * from "./agentmessageitem.js";
|
|
9
|
+
export * from "./alignment.js";
|
|
10
|
+
export * from "./alignmentallowedcallrecord.js";
|
|
11
|
+
export * from "./alignmentblockedcallrecord.js";
|
|
12
|
+
export * from "./alignmentcallrecord.js";
|
|
13
|
+
export * from "./alignmentchataudio.js";
|
|
14
|
+
export * from "./alignmentchatimage.js";
|
|
15
|
+
export * from "./alignmentchatrejected.js";
|
|
16
|
+
export * from "./alignmentchattoolcall.js";
|
|
17
|
+
export * from "./alignmentplugin.js";
|
|
18
|
+
export * from "./alignmentrejected.js";
|
|
19
|
+
export * from "./alignmentresponsesrejected.js";
|
|
20
|
+
export * from "./alignmentrulerecord.js";
|
|
21
|
+
export * from "./alignmentunavailablecallrecord.js";
|
|
9
22
|
export * from "./annotationaddedevent.js";
|
|
10
23
|
export * from "./anthropicadvisormessageusageiteration.js";
|
|
11
24
|
export * from "./anthropicadvisortoolresult.js";
|
|
@@ -520,6 +533,8 @@ export * from "./openairesponsesresponsestatus.js";
|
|
|
520
533
|
export * from "./openairesponsestoolchoiceunion.js";
|
|
521
534
|
export * from "./openairesponsestruncation.js";
|
|
522
535
|
export * from "./openresponsescreatedevent.js";
|
|
536
|
+
export * from "./openresponseserrorfield.js";
|
|
537
|
+
export * from "./openresponseserrormetadata.js";
|
|
523
538
|
export * from "./openresponsesinprogressevent.js";
|
|
524
539
|
export * from "./openresponsesresult.js";
|
|
525
540
|
export * from "./openrouterfile.js";
|
|
@@ -550,8 +565,15 @@ export * from "./outputfunctioncallitem.js";
|
|
|
550
565
|
export * from "./outputfusionservertoolitem.js";
|
|
551
566
|
export * from "./outputimagegenerationcallitem.js";
|
|
552
567
|
export * from "./outputimagegenerationservertoolitem.js";
|
|
568
|
+
export * from "./outputitemapplypatchcall.js";
|
|
569
|
+
export * from "./outputitemcodeinterpretercall.js";
|
|
570
|
+
export * from "./outputitemcustomtoolcall.js";
|
|
571
|
+
export * from "./outputitemfilesearchcall.js";
|
|
572
|
+
export * from "./outputitemfunctioncall.js";
|
|
553
573
|
export * from "./outputitemimagegenerationcall.js";
|
|
574
|
+
export * from "./outputitemreasoning.js";
|
|
554
575
|
export * from "./outputitems.js";
|
|
576
|
+
export * from "./outputitemwebsearchcall.js";
|
|
555
577
|
export * from "./outputmcpservertoolitem.js";
|
|
556
578
|
export * from "./outputmemoryservertoolitem.js";
|
|
557
579
|
export * from "./outputmessage.js";
|
|
@@ -648,7 +670,6 @@ export * from "./requesttimeoutresponseerrordata.js";
|
|
|
648
670
|
export * from "./responsehealingplugin.js";
|
|
649
671
|
export * from "./responseincludesenum.js";
|
|
650
672
|
export * from "./responseoutputtext.js";
|
|
651
|
-
export * from "./responseserrorfield.js";
|
|
652
673
|
export * from "./responsesrequest.js";
|
|
653
674
|
export * from "./responsesstreamingresponse.js";
|
|
654
675
|
export * from "./routerattempt.js";
|
package/esm/models/index.js
CHANGED
|
@@ -10,6 +10,19 @@ export * from "./advisorreasoning.js";
|
|
|
10
10
|
export * from "./advisorservertoolconfig.js";
|
|
11
11
|
export * from "./advisorservertoolopenrouter.js";
|
|
12
12
|
export * from "./agentmessageitem.js";
|
|
13
|
+
export * from "./alignment.js";
|
|
14
|
+
export * from "./alignmentallowedcallrecord.js";
|
|
15
|
+
export * from "./alignmentblockedcallrecord.js";
|
|
16
|
+
export * from "./alignmentcallrecord.js";
|
|
17
|
+
export * from "./alignmentchataudio.js";
|
|
18
|
+
export * from "./alignmentchatimage.js";
|
|
19
|
+
export * from "./alignmentchatrejected.js";
|
|
20
|
+
export * from "./alignmentchattoolcall.js";
|
|
21
|
+
export * from "./alignmentplugin.js";
|
|
22
|
+
export * from "./alignmentrejected.js";
|
|
23
|
+
export * from "./alignmentresponsesrejected.js";
|
|
24
|
+
export * from "./alignmentrulerecord.js";
|
|
25
|
+
export * from "./alignmentunavailablecallrecord.js";
|
|
13
26
|
export * from "./annotationaddedevent.js";
|
|
14
27
|
export * from "./anthropicadvisormessageusageiteration.js";
|
|
15
28
|
export * from "./anthropicadvisortoolresult.js";
|
|
@@ -524,6 +537,8 @@ export * from "./openairesponsesresponsestatus.js";
|
|
|
524
537
|
export * from "./openairesponsestoolchoiceunion.js";
|
|
525
538
|
export * from "./openairesponsestruncation.js";
|
|
526
539
|
export * from "./openresponsescreatedevent.js";
|
|
540
|
+
export * from "./openresponseserrorfield.js";
|
|
541
|
+
export * from "./openresponseserrormetadata.js";
|
|
527
542
|
export * from "./openresponsesinprogressevent.js";
|
|
528
543
|
export * from "./openresponsesresult.js";
|
|
529
544
|
export * from "./openrouterfile.js";
|
|
@@ -554,8 +569,15 @@ export * from "./outputfunctioncallitem.js";
|
|
|
554
569
|
export * from "./outputfusionservertoolitem.js";
|
|
555
570
|
export * from "./outputimagegenerationcallitem.js";
|
|
556
571
|
export * from "./outputimagegenerationservertoolitem.js";
|
|
572
|
+
export * from "./outputitemapplypatchcall.js";
|
|
573
|
+
export * from "./outputitemcodeinterpretercall.js";
|
|
574
|
+
export * from "./outputitemcustomtoolcall.js";
|
|
575
|
+
export * from "./outputitemfilesearchcall.js";
|
|
576
|
+
export * from "./outputitemfunctioncall.js";
|
|
557
577
|
export * from "./outputitemimagegenerationcall.js";
|
|
578
|
+
export * from "./outputitemreasoning.js";
|
|
558
579
|
export * from "./outputitems.js";
|
|
580
|
+
export * from "./outputitemwebsearchcall.js";
|
|
559
581
|
export * from "./outputmcpservertoolitem.js";
|
|
560
582
|
export * from "./outputmemoryservertoolitem.js";
|
|
561
583
|
export * from "./outputmessage.js";
|
|
@@ -652,7 +674,6 @@ export * from "./requesttimeoutresponseerrordata.js";
|
|
|
652
674
|
export * from "./responsehealingplugin.js";
|
|
653
675
|
export * from "./responseincludesenum.js";
|
|
654
676
|
export * from "./responseoutputtext.js";
|
|
655
|
-
export * from "./responseserrorfield.js";
|
|
656
677
|
export * from "./responsesrequest.js";
|
|
657
678
|
export * from "./responsesstreamingresponse.js";
|
|
658
679
|
export * from "./routerattempt.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { AlignmentPlugin, AlignmentPlugin$Outbound } from "./alignmentplugin.js";
|
|
3
4
|
import { AnthropicAllowedCallers } from "./anthropicallowedcallers.js";
|
|
4
5
|
import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
|
|
5
6
|
import { AnthropicInputTokensClearAtLeast, AnthropicInputTokensClearAtLeast$Outbound } from "./anthropicinputtokensclearatleast.js";
|
|
@@ -87,7 +88,7 @@ export type ContextManagement = {
|
|
|
87
88
|
export type MessagesRequestMetadata = {
|
|
88
89
|
userId?: string | null | undefined;
|
|
89
90
|
};
|
|
90
|
-
export type MessagesRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
91
|
+
export type MessagesRequestPlugin = AlignmentPlugin | AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
91
92
|
/**
|
|
92
93
|
* Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted.
|
|
93
94
|
*/
|
|
@@ -285,7 +286,7 @@ export type MessagesRequest = {
|
|
|
285
286
|
/**
|
|
286
287
|
* Plugins you want to enable for this request, including their settings.
|
|
287
288
|
*/
|
|
288
|
-
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
289
|
+
plugins?: Array<AlignmentPlugin | AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
289
290
|
/**
|
|
290
291
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
291
292
|
*/
|
|
@@ -405,7 +406,7 @@ export type MessagesRequestMetadata$Outbound = {
|
|
|
405
406
|
export declare const MessagesRequestMetadata$outboundSchema: z.ZodType<MessagesRequestMetadata$Outbound, MessagesRequestMetadata>;
|
|
406
407
|
export declare function messagesRequestMetadataToJSON(messagesRequestMetadata: MessagesRequestMetadata): string;
|
|
407
408
|
/** @internal */
|
|
408
|
-
export type MessagesRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
409
|
+
export type MessagesRequestPlugin$Outbound = AlignmentPlugin$Outbound | AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
409
410
|
/** @internal */
|
|
410
411
|
export declare const MessagesRequestPlugin$outboundSchema: z.ZodType<MessagesRequestPlugin$Outbound, MessagesRequestPlugin>;
|
|
411
412
|
export declare function messagesRequestPluginToJSON(messagesRequestPlugin: MessagesRequestPlugin): string;
|
|
@@ -619,7 +620,7 @@ export type MessagesRequest$Outbound = {
|
|
|
619
620
|
model: string;
|
|
620
621
|
models?: Array<string> | undefined;
|
|
621
622
|
output_config?: MessagesOutputConfig$Outbound | undefined;
|
|
622
|
-
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
623
|
+
plugins?: Array<AlignmentPlugin$Outbound | AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
623
624
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
624
625
|
safeguards?: Array<AnthropicSafeguard$Outbound> | null | undefined;
|
|
625
626
|
service_tier?: string | undefined;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { AlignmentPlugin$outboundSchema, } from "./alignmentplugin.js";
|
|
8
9
|
import { AnthropicAllowedCallers$outboundSchema, } from "./anthropicallowedcallers.js";
|
|
9
10
|
import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
|
|
10
11
|
import { AnthropicInputTokensClearAtLeast$outboundSchema, } from "./anthropicinputtokensclearatleast.js";
|
|
@@ -222,6 +223,7 @@ export function messagesRequestMetadataToJSON(messagesRequestMetadata) {
|
|
|
222
223
|
}
|
|
223
224
|
/** @internal */
|
|
224
225
|
export const MessagesRequestPlugin$outboundSchema = z.union([
|
|
226
|
+
AlignmentPlugin$outboundSchema,
|
|
225
227
|
AutoBetaRouterPlugin$outboundSchema,
|
|
226
228
|
AutoRouterPlugin$outboundSchema,
|
|
227
229
|
ContextCompressionPlugin$outboundSchema,
|
|
@@ -562,6 +564,7 @@ export const MessagesRequest$outboundSchema = z.object({
|
|
|
562
564
|
models: z.array(z.string()).optional(),
|
|
563
565
|
outputConfig: MessagesOutputConfig$outboundSchema.optional(),
|
|
564
566
|
plugins: z.array(z.union([
|
|
567
|
+
AlignmentPlugin$outboundSchema,
|
|
565
568
|
AutoBetaRouterPlugin$outboundSchema,
|
|
566
569
|
AutoRouterPlugin$outboundSchema,
|
|
567
570
|
ContextCompressionPlugin$outboundSchema,
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { OpenResponsesErrorMetadata } from "./openresponseserrormetadata.js";
|
|
5
6
|
export declare const CodeEnum: {
|
|
6
7
|
readonly ServerError: "server_error";
|
|
7
8
|
readonly RateLimitExceeded: "rate_limit_exceeded";
|
|
@@ -28,15 +29,19 @@ export declare const CodeEnum: {
|
|
|
28
29
|
};
|
|
29
30
|
export type CodeEnum = OpenEnum<typeof CodeEnum>;
|
|
30
31
|
/**
|
|
31
|
-
* Error
|
|
32
|
+
* Error of a failed response; `metadata` carries OpenRouter-specific details.
|
|
32
33
|
*/
|
|
33
|
-
export type
|
|
34
|
+
export type OpenResponsesErrorField = {
|
|
34
35
|
code: CodeEnum;
|
|
35
36
|
message: string;
|
|
37
|
+
/**
|
|
38
|
+
* OpenRouter-specific details of a failed response, such as the alignment object of an alignment error.
|
|
39
|
+
*/
|
|
40
|
+
metadata?: OpenResponsesErrorMetadata | undefined;
|
|
36
41
|
};
|
|
37
42
|
/** @internal */
|
|
38
43
|
export declare const CodeEnum$inboundSchema: z.ZodType<CodeEnum, unknown>;
|
|
39
44
|
/** @internal */
|
|
40
|
-
export declare const
|
|
41
|
-
export declare function
|
|
42
|
-
//# sourceMappingURL=
|
|
45
|
+
export declare const OpenResponsesErrorField$inboundSchema: z.ZodType<OpenResponsesErrorField, unknown>;
|
|
46
|
+
export declare function openResponsesErrorFieldFromJSON(jsonString: string): SafeParseResult<OpenResponsesErrorField, SDKValidationError>;
|
|
47
|
+
//# sourceMappingURL=openresponseserrorfield.d.ts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id:
|
|
3
|
+
* @generated-id: 5e6568bba8ea
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { OpenResponsesErrorMetadata$inboundSchema, } from "./openresponseserrormetadata.js";
|
|
8
9
|
export const CodeEnum = {
|
|
9
10
|
ServerError: "server_error",
|
|
10
11
|
RateLimitExceeded: "rate_limit_exceeded",
|
|
@@ -33,11 +34,12 @@ export const CodeEnum = {
|
|
|
33
34
|
export const CodeEnum$inboundSchema = openEnums
|
|
34
35
|
.inboundSchema(CodeEnum);
|
|
35
36
|
/** @internal */
|
|
36
|
-
export const
|
|
37
|
+
export const OpenResponsesErrorField$inboundSchema = z.object({
|
|
37
38
|
code: CodeEnum$inboundSchema,
|
|
38
39
|
message: z.string(),
|
|
40
|
+
metadata: OpenResponsesErrorMetadata$inboundSchema.optional(),
|
|
39
41
|
});
|
|
40
|
-
export function
|
|
41
|
-
return safeParse(jsonString, (x) =>
|
|
42
|
+
export function openResponsesErrorFieldFromJSON(jsonString) {
|
|
43
|
+
return safeParse(jsonString, (x) => OpenResponsesErrorField$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesErrorField' from JSON`);
|
|
42
44
|
}
|
|
43
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=openresponseserrorfield.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { AlignmentCallRecord } from "./alignmentcallrecord.js";
|
|
4
|
+
import { AlignmentRejected } from "./alignmentrejected.js";
|
|
5
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
|
+
/**
|
|
7
|
+
* Beta. The result of the alignment plugin for this request; the shape may change.
|
|
8
|
+
*/
|
|
9
|
+
export type OpenResponsesErrorMetadataAlignment = {
|
|
10
|
+
/**
|
|
11
|
+
* One record per evaluated assistant message of the request, in the order the messages were produced.
|
|
12
|
+
*/
|
|
13
|
+
calls: Array<AlignmentCallRecord>;
|
|
14
|
+
rejected?: AlignmentRejected | undefined;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* OpenRouter-specific details of a failed response, such as the alignment object of an alignment error.
|
|
18
|
+
*/
|
|
19
|
+
export type OpenResponsesErrorMetadata = {
|
|
20
|
+
/**
|
|
21
|
+
* Beta. The result of the alignment plugin for this request; the shape may change.
|
|
22
|
+
*/
|
|
23
|
+
alignment?: OpenResponsesErrorMetadataAlignment | undefined;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const OpenResponsesErrorMetadataAlignment$inboundSchema: z.ZodType<OpenResponsesErrorMetadataAlignment, unknown>;
|
|
27
|
+
export declare function openResponsesErrorMetadataAlignmentFromJSON(jsonString: string): SafeParseResult<OpenResponsesErrorMetadataAlignment, SDKValidationError>;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const OpenResponsesErrorMetadata$inboundSchema: z.ZodType<OpenResponsesErrorMetadata, unknown>;
|
|
30
|
+
export declare function openResponsesErrorMetadataFromJSON(jsonString: string): SafeParseResult<OpenResponsesErrorMetadata, SDKValidationError>;
|
|
31
|
+
//# sourceMappingURL=openresponseserrormetadata.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ddcf2da5f265
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { AlignmentCallRecord$inboundSchema, } from "./alignmentcallrecord.js";
|
|
8
|
+
import { AlignmentRejected$inboundSchema, } from "./alignmentrejected.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const OpenResponsesErrorMetadataAlignment$inboundSchema = z.object({
|
|
11
|
+
calls: z.array(AlignmentCallRecord$inboundSchema),
|
|
12
|
+
rejected: AlignmentRejected$inboundSchema.optional(),
|
|
13
|
+
});
|
|
14
|
+
export function openResponsesErrorMetadataAlignmentFromJSON(jsonString) {
|
|
15
|
+
return safeParse(jsonString, (x) => OpenResponsesErrorMetadataAlignment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesErrorMetadataAlignment' from JSON`);
|
|
16
|
+
}
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const OpenResponsesErrorMetadata$inboundSchema = z.object({
|
|
19
|
+
alignment: z.lazy(() => OpenResponsesErrorMetadataAlignment$inboundSchema)
|
|
20
|
+
.optional(),
|
|
21
|
+
});
|
|
22
|
+
export function openResponsesErrorMetadataFromJSON(jsonString) {
|
|
23
|
+
return safeParse(jsonString, (x) => OpenResponsesErrorMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesErrorMetadata' from JSON`);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=openresponseserrormetadata.js.map
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
3
|
import { ClosedEnum } from "../types/enums.js";
|
|
4
4
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
5
|
+
import { Alignment } from "./alignment.js";
|
|
5
6
|
import { ApiErrorType } from "./apierrortype.js";
|
|
6
7
|
import { ApplyPatchServerTool } from "./applypatchservertool.js";
|
|
7
8
|
import { BaseInputsUnion } from "./baseinputsunion.js";
|
|
@@ -19,12 +20,12 @@ import { McpServerTool } from "./mcpservertool.js";
|
|
|
19
20
|
import { NamespaceTool } from "./namespacetool.js";
|
|
20
21
|
import { OpenAIResponsesResponseStatus } from "./openairesponsesresponsestatus.js";
|
|
21
22
|
import { OpenAIResponsesToolChoiceUnion } from "./openairesponsestoolchoiceunion.js";
|
|
23
|
+
import { OpenResponsesErrorField } from "./openresponseserrorfield.js";
|
|
22
24
|
import { OpenRouterMetadata } from "./openroutermetadata.js";
|
|
23
25
|
import { OutputItems } from "./outputitems.js";
|
|
24
26
|
import { Preview20250311WebSearchServerTool } from "./preview20250311websearchservertool.js";
|
|
25
27
|
import { PreviewWebSearchServerTool } from "./previewwebsearchservertool.js";
|
|
26
28
|
import { PromptCacheOptions } from "./promptcacheoptions.js";
|
|
27
|
-
import { ResponsesErrorField } from "./responseserrorfield.js";
|
|
28
29
|
import { ServerToolUseDetails } from "./servertoolusedetails.js";
|
|
29
30
|
import { ShellServerTool } from "./shellservertool.js";
|
|
30
31
|
import { StoredPromptTemplate } from "./storedprompttemplate.js";
|
|
@@ -128,9 +129,9 @@ export type OpenResponsesResult = {
|
|
|
128
129
|
completedAt: number | null;
|
|
129
130
|
createdAt: number;
|
|
130
131
|
/**
|
|
131
|
-
* Error
|
|
132
|
+
* Error of a failed response; `metadata` carries OpenRouter-specific details.
|
|
132
133
|
*/
|
|
133
|
-
error:
|
|
134
|
+
error: OpenResponsesErrorField | null;
|
|
134
135
|
frequencyPenalty: number | null;
|
|
135
136
|
id: string;
|
|
136
137
|
incompleteDetails: IncompleteDetails | null;
|
|
@@ -204,6 +205,10 @@ export type OpenResponsesResult = {
|
|
|
204
205
|
*/
|
|
205
206
|
usage?: Usage | null | undefined;
|
|
206
207
|
user?: string | null | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* Beta. The result of the alignment plugin for this request; the shape may change.
|
|
210
|
+
*/
|
|
211
|
+
alignment?: Alignment | undefined;
|
|
207
212
|
/**
|
|
208
213
|
* Canonical OpenRouter error type, stable across all API formats
|
|
209
214
|
*/
|
|
@@ -6,6 +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 { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
9
|
+
import { Alignment$inboundSchema } from "./alignment.js";
|
|
9
10
|
import { ApiErrorType$inboundSchema } from "./apierrortype.js";
|
|
10
11
|
import { ApplyPatchServerTool$inboundSchema, } from "./applypatchservertool.js";
|
|
11
12
|
import { BaseInputsUnion$inboundSchema, } from "./baseinputsunion.js";
|
|
@@ -22,12 +23,12 @@ import { McpServerTool$inboundSchema } from "./mcpservertool.js";
|
|
|
22
23
|
import { NamespaceTool$inboundSchema } from "./namespacetool.js";
|
|
23
24
|
import { OpenAIResponsesResponseStatus$inboundSchema, } from "./openairesponsesresponsestatus.js";
|
|
24
25
|
import { OpenAIResponsesToolChoiceUnion$inboundSchema, } from "./openairesponsestoolchoiceunion.js";
|
|
26
|
+
import { OpenResponsesErrorField$inboundSchema, } from "./openresponseserrorfield.js";
|
|
25
27
|
import { OpenRouterMetadata$inboundSchema, } from "./openroutermetadata.js";
|
|
26
28
|
import { OutputItems$inboundSchema } from "./outputitems.js";
|
|
27
29
|
import { Preview20250311WebSearchServerTool$inboundSchema, } from "./preview20250311websearchservertool.js";
|
|
28
30
|
import { PreviewWebSearchServerTool$inboundSchema, } from "./previewwebsearchservertool.js";
|
|
29
31
|
import { PromptCacheOptions$inboundSchema, } from "./promptcacheoptions.js";
|
|
30
|
-
import { ResponsesErrorField$inboundSchema, } from "./responseserrorfield.js";
|
|
31
32
|
import { ServerToolUseDetails$inboundSchema, } from "./servertoolusedetails.js";
|
|
32
33
|
import { ShellServerTool$inboundSchema, } from "./shellservertool.js";
|
|
33
34
|
import { StoredPromptTemplate$inboundSchema, } from "./storedprompttemplate.js";
|
|
@@ -150,7 +151,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
150
151
|
background: z.nullable(z.boolean()).optional(),
|
|
151
152
|
completed_at: z.nullable(z.int()),
|
|
152
153
|
created_at: z.int(),
|
|
153
|
-
error: z.nullable(
|
|
154
|
+
error: z.nullable(OpenResponsesErrorField$inboundSchema),
|
|
154
155
|
frequency_penalty: z.nullable(z.number()),
|
|
155
156
|
id: z.string(),
|
|
156
157
|
incomplete_details: z.nullable(IncompleteDetails$inboundSchema),
|
|
@@ -198,6 +199,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
198
199
|
truncation: z.nullable(Truncation$inboundSchema).optional(),
|
|
199
200
|
usage: z.nullable(z.lazy(() => Usage$inboundSchema)).optional(),
|
|
200
201
|
user: z.nullable(z.string()).optional(),
|
|
202
|
+
alignment: Alignment$inboundSchema.optional(),
|
|
201
203
|
error_type: ApiErrorType$inboundSchema.optional(),
|
|
202
204
|
openrouter_metadata: OpenRouterMetadata$inboundSchema.optional(),
|
|
203
205
|
}).transform((v) => {
|
|
@@ -49,7 +49,7 @@ export type ListContainerFilesRequest = {
|
|
|
49
49
|
*/
|
|
50
50
|
limit?: number | undefined;
|
|
51
51
|
/**
|
|
52
|
-
* Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path.
|
|
52
|
+
* Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path. A `last_id` from a page that stopped at the scan bound may name a directory-marker path (trailing `/`) that was never listed as a file; such cursors are accepted.
|
|
53
53
|
*/
|
|
54
54
|
after?: string | undefined;
|
|
55
55
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
|
+
import { OpenEnum } from "../types/enums.js";
|
|
4
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
5
|
+
import { ApplyPatchCreateFileOperation } from "./applypatchcreatefileoperation.js";
|
|
6
|
+
import { ApplyPatchDeleteFileOperation } from "./applypatchdeletefileoperation.js";
|
|
7
|
+
import { ApplyPatchUpdateFileOperation } from "./applypatchupdatefileoperation.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
export type Operation = ApplyPatchCreateFileOperation | ApplyPatchDeleteFileOperation | ApplyPatchUpdateFileOperation | discriminatedUnionTypes.Unknown<"type">;
|
|
10
|
+
export declare const OutputItemApplyPatchCallStatus: {
|
|
11
|
+
readonly InProgress: "in_progress";
|
|
12
|
+
readonly Completed: "completed";
|
|
13
|
+
};
|
|
14
|
+
export type OutputItemApplyPatchCallStatus = OpenEnum<typeof OutputItemApplyPatchCallStatus>;
|
|
15
|
+
export type OutputItemApplyPatchCall = {
|
|
16
|
+
callId: string;
|
|
17
|
+
createdBy?: string | undefined;
|
|
18
|
+
id: string;
|
|
19
|
+
operation: ApplyPatchCreateFileOperation | ApplyPatchDeleteFileOperation | ApplyPatchUpdateFileOperation | discriminatedUnionTypes.Unknown<"type">;
|
|
20
|
+
status: OutputItemApplyPatchCallStatus;
|
|
21
|
+
type: "apply_patch_call";
|
|
22
|
+
};
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const Operation$inboundSchema: z.ZodType<Operation, unknown>;
|
|
25
|
+
export declare function operationFromJSON(jsonString: string): SafeParseResult<Operation, SDKValidationError>;
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const OutputItemApplyPatchCallStatus$inboundSchema: z.ZodType<OutputItemApplyPatchCallStatus, unknown>;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const OutputItemApplyPatchCall$inboundSchema: z.ZodType<OutputItemApplyPatchCall, unknown>;
|
|
30
|
+
export declare function outputItemApplyPatchCallFromJSON(jsonString: string): SafeParseResult<OutputItemApplyPatchCall, SDKValidationError>;
|
|
31
|
+
//# sourceMappingURL=outputitemapplypatchcall.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e89e86568a78
|
|
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 { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
9
|
+
import * as openEnums from "../types/enums.js";
|
|
10
|
+
import { ApplyPatchCreateFileOperation$inboundSchema, } from "./applypatchcreatefileoperation.js";
|
|
11
|
+
import { ApplyPatchDeleteFileOperation$inboundSchema, } from "./applypatchdeletefileoperation.js";
|
|
12
|
+
import { ApplyPatchUpdateFileOperation$inboundSchema, } from "./applypatchupdatefileoperation.js";
|
|
13
|
+
export const OutputItemApplyPatchCallStatus = {
|
|
14
|
+
InProgress: "in_progress",
|
|
15
|
+
Completed: "completed",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const Operation$inboundSchema = discriminatedUnion("type", {
|
|
19
|
+
create_file: ApplyPatchCreateFileOperation$inboundSchema,
|
|
20
|
+
delete_file: ApplyPatchDeleteFileOperation$inboundSchema,
|
|
21
|
+
update_file: ApplyPatchUpdateFileOperation$inboundSchema,
|
|
22
|
+
});
|
|
23
|
+
export function operationFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => Operation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Operation' from JSON`);
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const OutputItemApplyPatchCallStatus$inboundSchema = openEnums.inboundSchema(OutputItemApplyPatchCallStatus);
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const OutputItemApplyPatchCall$inboundSchema = z.object({
|
|
30
|
+
call_id: z.string(),
|
|
31
|
+
created_by: z.string().optional(),
|
|
32
|
+
id: z.string(),
|
|
33
|
+
operation: discriminatedUnion("type", {
|
|
34
|
+
create_file: ApplyPatchCreateFileOperation$inboundSchema,
|
|
35
|
+
delete_file: ApplyPatchDeleteFileOperation$inboundSchema,
|
|
36
|
+
update_file: ApplyPatchUpdateFileOperation$inboundSchema,
|
|
37
|
+
}),
|
|
38
|
+
status: OutputItemApplyPatchCallStatus$inboundSchema,
|
|
39
|
+
type: z.literal("apply_patch_call"),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"call_id": "callId",
|
|
43
|
+
"created_by": "createdBy",
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
export function outputItemApplyPatchCallFromJSON(jsonString) {
|
|
47
|
+
return safeParse(jsonString, (x) => OutputItemApplyPatchCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputItemApplyPatchCall' from JSON`);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=outputitemapplypatchcall.js.map
|