syllable-sdk 1.0.13-rc.4 → 1.0.13-rc.6
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/bin/mcp-server.js +2001 -59
- package/bin/mcp-server.js.map +34 -11
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/components/bodyinsightsfolderuploadfile.d.ts +8 -8
- package/models/components/bodyinsightsfolderuploadfile.d.ts.map +1 -1
- package/models/components/bodyinsightsfolderuploadfile.js +11 -12
- package/models/components/bodyinsightsfolderuploadfile.js.map +1 -1
- package/models/components/callaction.d.ts +113 -0
- package/models/components/callaction.d.ts.map +1 -0
- package/models/components/callaction.js +174 -0
- package/models/components/callaction.js.map +1 -0
- package/models/components/caseexpression.d.ts +18 -0
- package/models/components/caseexpression.d.ts.map +1 -0
- package/models/components/caseexpression.js +59 -0
- package/models/components/caseexpression.js.map +1 -0
- package/models/components/celexpression.d.ts +28 -0
- package/models/components/celexpression.d.ts.map +1 -0
- package/models/components/celexpression.js +60 -0
- package/models/components/celexpression.js.map +1 -0
- package/models/components/conditionaltext.d.ts +85 -0
- package/models/components/conditionaltext.d.ts.map +1 -0
- package/models/components/conditionaltext.js +147 -0
- package/models/components/conditionaltext.js.map +1 -0
- package/models/components/conditionalvalue.d.ts +147 -0
- package/models/components/conditionalvalue.d.ts.map +1 -0
- package/models/components/conditionalvalue.js +248 -0
- package/models/components/conditionalvalue.js.map +1 -0
- package/models/components/context.d.ts +122 -8
- package/models/components/context.d.ts.map +1 -1
- package/models/components/context.js +199 -6
- package/models/components/context.js.map +1 -1
- package/models/components/contexttaskmetadata.d.ts +22 -0
- package/models/components/contexttaskmetadata.d.ts.map +1 -0
- package/models/components/contexttaskmetadata.js +69 -0
- package/models/components/contexttaskmetadata.js.map +1 -0
- package/models/components/contexttoolinfo.d.ts +25 -0
- package/models/components/contexttoolinfo.d.ts.map +1 -0
- package/models/components/contexttoolinfo.js +60 -0
- package/models/components/contexttoolinfo.js.map +1 -0
- package/models/components/eventtask.d.ts +42 -0
- package/models/components/eventtask.d.ts.map +1 -0
- package/models/components/eventtask.js +76 -0
- package/models/components/eventtask.js.map +1 -0
- package/models/components/eventtaskevents.d.ts +74 -0
- package/models/components/eventtaskevents.d.ts.map +1 -0
- package/models/components/eventtaskevents.js +139 -0
- package/models/components/eventtaskevents.js.map +1 -0
- package/models/components/expressiontask.d.ts +109 -0
- package/models/components/expressiontask.d.ts.map +1 -0
- package/models/components/expressiontask.js +170 -0
- package/models/components/expressiontask.js.map +1 -0
- package/models/components/expressiontaskevents.d.ts +131 -0
- package/models/components/expressiontaskevents.d.ts.map +1 -0
- package/models/components/expressiontaskevents.js +219 -0
- package/models/components/expressiontaskevents.js.map +1 -0
- package/models/components/incrementaction.d.ts +92 -0
- package/models/components/incrementaction.d.ts.map +1 -0
- package/models/components/incrementaction.js +151 -0
- package/models/components/incrementaction.js.map +1 -0
- package/models/components/index.d.ts +24 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +24 -1
- package/models/components/index.js.map +1 -1
- package/models/components/inputparameter.d.ts +51 -0
- package/models/components/inputparameter.d.ts.map +1 -0
- package/models/components/inputparameter.js +87 -0
- package/models/components/inputparameter.js.map +1 -0
- package/models/components/jmespathexpression.d.ts +44 -0
- package/models/components/jmespathexpression.d.ts.map +1 -0
- package/models/components/jmespathexpression.js +71 -0
- package/models/components/jmespathexpression.js.map +1 -0
- package/models/components/loadtoolfromfiletask.d.ts +59 -0
- package/models/components/loadtoolfromfiletask.d.ts.map +1 -0
- package/models/components/loadtoolfromfiletask.js +88 -0
- package/models/components/loadtoolfromfiletask.js.map +1 -0
- package/models/components/nextstep.d.ts +93 -0
- package/models/components/nextstep.d.ts.map +1 -0
- package/models/components/nextstep.js +149 -0
- package/models/components/nextstep.js.map +1 -0
- package/models/components/saveaction.d.ts +92 -0
- package/models/components/saveaction.d.ts.map +1 -0
- package/models/components/saveaction.js +151 -0
- package/models/components/saveaction.js.map +1 -0
- package/models/components/sayaction.d.ts +108 -0
- package/models/components/sayaction.d.ts.map +1 -0
- package/models/components/sayaction.js +162 -0
- package/models/components/sayaction.js.map +1 -0
- package/models/components/session.d.ts +5 -0
- package/models/components/session.d.ts.map +1 -1
- package/models/components/session.js +4 -0
- package/models/components/session.js.map +1 -1
- package/models/components/setvalueaction.d.ts +154 -0
- package/models/components/setvalueaction.d.ts.map +1 -0
- package/models/components/setvalueaction.js +246 -0
- package/models/components/setvalueaction.js.map +1 -0
- package/models/components/step.d.ts +73 -0
- package/models/components/step.d.ts.map +1 -0
- package/models/components/step.js +103 -0
- package/models/components/step.js.map +1 -0
- package/models/components/stepeventactions.d.ts +185 -0
- package/models/components/stepeventactions.d.ts.map +1 -0
- package/models/components/stepeventactions.js +296 -0
- package/models/components/stepeventactions.js.map +1 -0
- package/models/components/stepstask.d.ts +42 -0
- package/models/components/stepstask.d.ts.map +1 -0
- package/models/components/stepstask.js +76 -0
- package/models/components/stepstask.js.map +1 -0
- package/models/components/steptools.d.ts +33 -0
- package/models/components/steptools.d.ts.map +1 -0
- package/models/components/{contexttask.js → steptools.js} +24 -22
- package/models/components/steptools.js.map +1 -0
- package/models/components/variable.d.ts +119 -0
- package/models/components/variable.d.ts.map +1 -0
- package/models/components/variable.js +186 -0
- package/models/components/variable.js.map +1 -0
- package/openapi.json +2453 -662
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/bodyinsightsfolderuploadfile.ts +36 -25
- package/src/models/components/callaction.ts +331 -0
- package/src/models/components/caseexpression.ts +53 -0
- package/src/models/components/celexpression.ts +60 -0
- package/src/models/components/conditionaltext.ts +280 -0
- package/src/models/components/conditionalvalue.ts +477 -0
- package/src/models/components/context.ts +413 -16
- package/src/models/components/contexttaskmetadata.ts +67 -0
- package/src/models/components/contexttoolinfo.ts +59 -0
- package/src/models/components/eventtask.ts +102 -0
- package/src/models/components/eventtaskevents.ts +257 -0
- package/src/models/components/expressiontask.ts +333 -0
- package/src/models/components/expressiontaskevents.ts +430 -0
- package/src/models/components/incrementaction.ts +291 -0
- package/src/models/components/index.ts +24 -1
- package/src/models/components/inputparameter.ts +103 -0
- package/src/models/components/jmespathexpression.ts +86 -0
- package/src/models/components/loadtoolfromfiletask.ts +137 -0
- package/src/models/components/nextstep.ts +280 -0
- package/src/models/components/saveaction.ts +281 -0
- package/src/models/components/sayaction.ts +302 -0
- package/src/models/components/session.ts +9 -0
- package/src/models/components/setvalueaction.ts +508 -0
- package/src/models/components/step.ts +174 -0
- package/src/models/components/stepeventactions.ts +619 -0
- package/src/models/components/stepstask.ts +102 -0
- package/src/models/components/steptools.ts +76 -0
- package/src/models/components/variable.ts +332 -0
- package/models/components/contexttask.d.ts +0 -32
- package/models/components/contexttask.d.ts.map +0 -1
- package/models/components/contexttask.js.map +0 -1
- package/src/models/components/contexttask.ts +0 -78
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.2",
|
|
64
|
-
sdkVersion: "1.0.13-rc.
|
|
64
|
+
sdkVersion: "1.0.13-rc.6",
|
|
65
65
|
genVersion: "2.760.2",
|
|
66
|
-
userAgent: "speakeasy-sdk/typescript 1.0.13-rc.
|
|
66
|
+
userAgent: "speakeasy-sdk/typescript 1.0.13-rc.6 2.760.2 0.0.2 syllable-sdk",
|
|
67
67
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -8,37 +8,40 @@ import { blobLikeSchema } from "../../types/blobs.js";
|
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
|
-
export type
|
|
11
|
+
export type BodyInsightsFolderUploadFileFile = {
|
|
12
12
|
fileName: string;
|
|
13
13
|
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export type BodyInsightsFolderUploadFile = {
|
|
17
|
-
file?:
|
|
17
|
+
file?: BodyInsightsFolderUploadFileFile | Blob | undefined;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
/** @internal */
|
|
21
|
-
export const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
export const BodyInsightsFolderUploadFileFile$inboundSchema: z.ZodType<
|
|
22
|
+
BodyInsightsFolderUploadFileFile,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
fileName: z.string(),
|
|
27
|
+
content: z.union([
|
|
28
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
29
|
+
z.instanceof(Blob),
|
|
30
|
+
z.instanceof(ArrayBuffer),
|
|
31
|
+
z.instanceof(Uint8Array),
|
|
32
|
+
]),
|
|
33
|
+
});
|
|
31
34
|
/** @internal */
|
|
32
|
-
export type
|
|
35
|
+
export type BodyInsightsFolderUploadFileFile$Outbound = {
|
|
33
36
|
fileName: string;
|
|
34
37
|
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
35
38
|
};
|
|
36
39
|
|
|
37
40
|
/** @internal */
|
|
38
|
-
export const
|
|
39
|
-
|
|
41
|
+
export const BodyInsightsFolderUploadFileFile$outboundSchema: z.ZodType<
|
|
42
|
+
BodyInsightsFolderUploadFileFile$Outbound,
|
|
40
43
|
z.ZodTypeDef,
|
|
41
|
-
|
|
44
|
+
BodyInsightsFolderUploadFileFile
|
|
42
45
|
> = z.object({
|
|
43
46
|
fileName: z.string(),
|
|
44
47
|
content: z.union([
|
|
@@ -49,16 +52,22 @@ export const FileT$outboundSchema: z.ZodType<
|
|
|
49
52
|
]),
|
|
50
53
|
});
|
|
51
54
|
|
|
52
|
-
export function
|
|
53
|
-
|
|
55
|
+
export function bodyInsightsFolderUploadFileFileToJSON(
|
|
56
|
+
bodyInsightsFolderUploadFileFile: BodyInsightsFolderUploadFileFile,
|
|
57
|
+
): string {
|
|
58
|
+
return JSON.stringify(
|
|
59
|
+
BodyInsightsFolderUploadFileFile$outboundSchema.parse(
|
|
60
|
+
bodyInsightsFolderUploadFileFile,
|
|
61
|
+
),
|
|
62
|
+
);
|
|
54
63
|
}
|
|
55
|
-
export function
|
|
64
|
+
export function bodyInsightsFolderUploadFileFileFromJSON(
|
|
56
65
|
jsonString: string,
|
|
57
|
-
): SafeParseResult<
|
|
66
|
+
): SafeParseResult<BodyInsightsFolderUploadFileFile, SDKValidationError> {
|
|
58
67
|
return safeParse(
|
|
59
68
|
jsonString,
|
|
60
|
-
(x) =>
|
|
61
|
-
`Failed to parse '
|
|
69
|
+
(x) => BodyInsightsFolderUploadFileFile$inboundSchema.parse(JSON.parse(x)),
|
|
70
|
+
`Failed to parse 'BodyInsightsFolderUploadFileFile' from JSON`,
|
|
62
71
|
);
|
|
63
72
|
}
|
|
64
73
|
|
|
@@ -68,11 +77,11 @@ export const BodyInsightsFolderUploadFile$inboundSchema: z.ZodType<
|
|
|
68
77
|
z.ZodTypeDef,
|
|
69
78
|
unknown
|
|
70
79
|
> = z.object({
|
|
71
|
-
file: z.lazy(() =>
|
|
80
|
+
file: z.lazy(() => BodyInsightsFolderUploadFileFile$inboundSchema).optional(),
|
|
72
81
|
});
|
|
73
82
|
/** @internal */
|
|
74
83
|
export type BodyInsightsFolderUploadFile$Outbound = {
|
|
75
|
-
file?:
|
|
84
|
+
file?: BodyInsightsFolderUploadFileFile$Outbound | Blob | undefined;
|
|
76
85
|
};
|
|
77
86
|
|
|
78
87
|
/** @internal */
|
|
@@ -81,7 +90,9 @@ export const BodyInsightsFolderUploadFile$outboundSchema: z.ZodType<
|
|
|
81
90
|
z.ZodTypeDef,
|
|
82
91
|
BodyInsightsFolderUploadFile
|
|
83
92
|
> = z.object({
|
|
84
|
-
file: z.lazy(() =>
|
|
93
|
+
file: z.lazy(() => BodyInsightsFolderUploadFileFile$outboundSchema).or(
|
|
94
|
+
blobLikeSchema,
|
|
95
|
+
).optional(),
|
|
85
96
|
});
|
|
86
97
|
|
|
87
98
|
export function bodyInsightsFolderUploadFileToJSON(
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
CaseExpression,
|
|
12
|
+
CaseExpression$inboundSchema,
|
|
13
|
+
CaseExpression$Outbound,
|
|
14
|
+
CaseExpression$outboundSchema,
|
|
15
|
+
} from "./caseexpression.js";
|
|
16
|
+
import {
|
|
17
|
+
CelExpression,
|
|
18
|
+
CelExpression$inboundSchema,
|
|
19
|
+
CelExpression$Outbound,
|
|
20
|
+
CelExpression$outboundSchema,
|
|
21
|
+
} from "./celexpression.js";
|
|
22
|
+
import {
|
|
23
|
+
JMESPathExpression,
|
|
24
|
+
JMESPathExpression$inboundSchema,
|
|
25
|
+
JMESPathExpression$Outbound,
|
|
26
|
+
JMESPathExpression$outboundSchema,
|
|
27
|
+
} from "./jmespathexpression.js";
|
|
28
|
+
|
|
29
|
+
export type CallActionIf1 =
|
|
30
|
+
| (CelExpression & { type: "cel" })
|
|
31
|
+
| (JMESPathExpression & { type: "jmespath" })
|
|
32
|
+
| (JMESPathExpression & { type: "jp" });
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* An expression that must evaluate to true for the action to be applied.
|
|
36
|
+
*/
|
|
37
|
+
export type CallActionIf =
|
|
38
|
+
| CaseExpression
|
|
39
|
+
| (CelExpression & { type: "cel" })
|
|
40
|
+
| (JMESPathExpression & { type: "jmespath" })
|
|
41
|
+
| (JMESPathExpression & { type: "jp" })
|
|
42
|
+
| string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Auto-population strategy: True (hybrid - synthetic or LLM), False (always LLM), "required" (synthetic only if all required args available, else LLM)
|
|
46
|
+
*/
|
|
47
|
+
export type AutoPopulate = boolean | string;
|
|
48
|
+
|
|
49
|
+
export type CallAction = {
|
|
50
|
+
/**
|
|
51
|
+
* An expression that must evaluate to true for the action to be applied.
|
|
52
|
+
*/
|
|
53
|
+
if?:
|
|
54
|
+
| CaseExpression
|
|
55
|
+
| (CelExpression & { type: "cel" })
|
|
56
|
+
| (JMESPathExpression & { type: "jmespath" })
|
|
57
|
+
| (JMESPathExpression & { type: "jp" })
|
|
58
|
+
| string
|
|
59
|
+
| null
|
|
60
|
+
| undefined;
|
|
61
|
+
action?: "call" | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The name of the tool to call.
|
|
64
|
+
*/
|
|
65
|
+
name: string;
|
|
66
|
+
/**
|
|
67
|
+
* Optional arguments to pass to the tool (supports template strings)
|
|
68
|
+
*/
|
|
69
|
+
arguments?: { [k: string]: any } | null | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Auto-population strategy: True (hybrid - synthetic or LLM), False (always LLM), "required" (synthetic only if all required args available, else LLM)
|
|
72
|
+
*/
|
|
73
|
+
autoPopulate?: boolean | string | undefined;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const CallActionIf1$inboundSchema: z.ZodType<
|
|
78
|
+
CallActionIf1,
|
|
79
|
+
z.ZodTypeDef,
|
|
80
|
+
unknown
|
|
81
|
+
> = z.union([
|
|
82
|
+
CelExpression$inboundSchema.and(
|
|
83
|
+
z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
|
|
84
|
+
),
|
|
85
|
+
JMESPathExpression$inboundSchema.and(
|
|
86
|
+
z.object({ type: z.literal("jmespath") }).transform((v) => ({
|
|
87
|
+
type: v.type,
|
|
88
|
+
})),
|
|
89
|
+
),
|
|
90
|
+
JMESPathExpression$inboundSchema.and(
|
|
91
|
+
z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
|
|
92
|
+
),
|
|
93
|
+
]);
|
|
94
|
+
/** @internal */
|
|
95
|
+
export type CallActionIf1$Outbound =
|
|
96
|
+
| (CelExpression$Outbound & { type: "cel" })
|
|
97
|
+
| (JMESPathExpression$Outbound & { type: "jmespath" })
|
|
98
|
+
| (JMESPathExpression$Outbound & { type: "jp" });
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export const CallActionIf1$outboundSchema: z.ZodType<
|
|
102
|
+
CallActionIf1$Outbound,
|
|
103
|
+
z.ZodTypeDef,
|
|
104
|
+
CallActionIf1
|
|
105
|
+
> = z.union([
|
|
106
|
+
CelExpression$outboundSchema.and(
|
|
107
|
+
z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
|
|
108
|
+
),
|
|
109
|
+
JMESPathExpression$outboundSchema.and(
|
|
110
|
+
z.object({ type: z.literal("jmespath") }).transform((v) => ({
|
|
111
|
+
type: v.type,
|
|
112
|
+
})),
|
|
113
|
+
),
|
|
114
|
+
JMESPathExpression$outboundSchema.and(
|
|
115
|
+
z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
|
|
116
|
+
),
|
|
117
|
+
]);
|
|
118
|
+
|
|
119
|
+
export function callActionIf1ToJSON(callActionIf1: CallActionIf1): string {
|
|
120
|
+
return JSON.stringify(CallActionIf1$outboundSchema.parse(callActionIf1));
|
|
121
|
+
}
|
|
122
|
+
export function callActionIf1FromJSON(
|
|
123
|
+
jsonString: string,
|
|
124
|
+
): SafeParseResult<CallActionIf1, SDKValidationError> {
|
|
125
|
+
return safeParse(
|
|
126
|
+
jsonString,
|
|
127
|
+
(x) => CallActionIf1$inboundSchema.parse(JSON.parse(x)),
|
|
128
|
+
`Failed to parse 'CallActionIf1' from JSON`,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** @internal */
|
|
133
|
+
export const CallActionIf$inboundSchema: z.ZodType<
|
|
134
|
+
CallActionIf,
|
|
135
|
+
z.ZodTypeDef,
|
|
136
|
+
unknown
|
|
137
|
+
> = z.union([
|
|
138
|
+
CaseExpression$inboundSchema,
|
|
139
|
+
z.union([
|
|
140
|
+
CelExpression$inboundSchema.and(
|
|
141
|
+
z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
|
|
142
|
+
),
|
|
143
|
+
JMESPathExpression$inboundSchema.and(
|
|
144
|
+
z.object({ type: z.literal("jmespath") }).transform((v) => ({
|
|
145
|
+
type: v.type,
|
|
146
|
+
})),
|
|
147
|
+
),
|
|
148
|
+
JMESPathExpression$inboundSchema.and(
|
|
149
|
+
z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
|
|
150
|
+
),
|
|
151
|
+
]),
|
|
152
|
+
z.string(),
|
|
153
|
+
]);
|
|
154
|
+
/** @internal */
|
|
155
|
+
export type CallActionIf$Outbound =
|
|
156
|
+
| CaseExpression$Outbound
|
|
157
|
+
| (CelExpression$Outbound & { type: "cel" })
|
|
158
|
+
| (JMESPathExpression$Outbound & { type: "jmespath" })
|
|
159
|
+
| (JMESPathExpression$Outbound & { type: "jp" })
|
|
160
|
+
| string;
|
|
161
|
+
|
|
162
|
+
/** @internal */
|
|
163
|
+
export const CallActionIf$outboundSchema: z.ZodType<
|
|
164
|
+
CallActionIf$Outbound,
|
|
165
|
+
z.ZodTypeDef,
|
|
166
|
+
CallActionIf
|
|
167
|
+
> = z.union([
|
|
168
|
+
CaseExpression$outboundSchema,
|
|
169
|
+
z.union([
|
|
170
|
+
CelExpression$outboundSchema.and(
|
|
171
|
+
z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
|
|
172
|
+
),
|
|
173
|
+
JMESPathExpression$outboundSchema.and(
|
|
174
|
+
z.object({ type: z.literal("jmespath") }).transform((v) => ({
|
|
175
|
+
type: v.type,
|
|
176
|
+
})),
|
|
177
|
+
),
|
|
178
|
+
JMESPathExpression$outboundSchema.and(
|
|
179
|
+
z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
|
|
180
|
+
),
|
|
181
|
+
]),
|
|
182
|
+
z.string(),
|
|
183
|
+
]);
|
|
184
|
+
|
|
185
|
+
export function callActionIfToJSON(callActionIf: CallActionIf): string {
|
|
186
|
+
return JSON.stringify(CallActionIf$outboundSchema.parse(callActionIf));
|
|
187
|
+
}
|
|
188
|
+
export function callActionIfFromJSON(
|
|
189
|
+
jsonString: string,
|
|
190
|
+
): SafeParseResult<CallActionIf, SDKValidationError> {
|
|
191
|
+
return safeParse(
|
|
192
|
+
jsonString,
|
|
193
|
+
(x) => CallActionIf$inboundSchema.parse(JSON.parse(x)),
|
|
194
|
+
`Failed to parse 'CallActionIf' from JSON`,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** @internal */
|
|
199
|
+
export const AutoPopulate$inboundSchema: z.ZodType<
|
|
200
|
+
AutoPopulate,
|
|
201
|
+
z.ZodTypeDef,
|
|
202
|
+
unknown
|
|
203
|
+
> = z.union([z.boolean(), z.string()]);
|
|
204
|
+
/** @internal */
|
|
205
|
+
export type AutoPopulate$Outbound = boolean | string;
|
|
206
|
+
|
|
207
|
+
/** @internal */
|
|
208
|
+
export const AutoPopulate$outboundSchema: z.ZodType<
|
|
209
|
+
AutoPopulate$Outbound,
|
|
210
|
+
z.ZodTypeDef,
|
|
211
|
+
AutoPopulate
|
|
212
|
+
> = z.union([z.boolean(), z.string()]);
|
|
213
|
+
|
|
214
|
+
export function autoPopulateToJSON(autoPopulate: AutoPopulate): string {
|
|
215
|
+
return JSON.stringify(AutoPopulate$outboundSchema.parse(autoPopulate));
|
|
216
|
+
}
|
|
217
|
+
export function autoPopulateFromJSON(
|
|
218
|
+
jsonString: string,
|
|
219
|
+
): SafeParseResult<AutoPopulate, SDKValidationError> {
|
|
220
|
+
return safeParse(
|
|
221
|
+
jsonString,
|
|
222
|
+
(x) => AutoPopulate$inboundSchema.parse(JSON.parse(x)),
|
|
223
|
+
`Failed to parse 'AutoPopulate' from JSON`,
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** @internal */
|
|
228
|
+
export const CallAction$inboundSchema: z.ZodType<
|
|
229
|
+
CallAction,
|
|
230
|
+
z.ZodTypeDef,
|
|
231
|
+
unknown
|
|
232
|
+
> = z.object({
|
|
233
|
+
if: z.nullable(
|
|
234
|
+
z.union([
|
|
235
|
+
CaseExpression$inboundSchema,
|
|
236
|
+
z.union([
|
|
237
|
+
CelExpression$inboundSchema.and(
|
|
238
|
+
z.object({ type: z.literal("cel") }).transform((v) => ({
|
|
239
|
+
type: v.type,
|
|
240
|
+
})),
|
|
241
|
+
),
|
|
242
|
+
JMESPathExpression$inboundSchema.and(
|
|
243
|
+
z.object({ type: z.literal("jmespath") }).transform((v) => ({
|
|
244
|
+
type: v.type,
|
|
245
|
+
})),
|
|
246
|
+
),
|
|
247
|
+
JMESPathExpression$inboundSchema.and(
|
|
248
|
+
z.object({ type: z.literal("jp") }).transform((v) => ({
|
|
249
|
+
type: v.type,
|
|
250
|
+
})),
|
|
251
|
+
),
|
|
252
|
+
]),
|
|
253
|
+
z.string(),
|
|
254
|
+
]),
|
|
255
|
+
).optional(),
|
|
256
|
+
action: z.literal("call").default("call"),
|
|
257
|
+
name: z.string(),
|
|
258
|
+
arguments: z.nullable(z.record(z.any())).optional(),
|
|
259
|
+
auto_populate: z.union([z.boolean(), z.string()]).optional(),
|
|
260
|
+
}).transform((v) => {
|
|
261
|
+
return remap$(v, {
|
|
262
|
+
"auto_populate": "autoPopulate",
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
/** @internal */
|
|
266
|
+
export type CallAction$Outbound = {
|
|
267
|
+
if?:
|
|
268
|
+
| CaseExpression$Outbound
|
|
269
|
+
| (CelExpression$Outbound & { type: "cel" })
|
|
270
|
+
| (JMESPathExpression$Outbound & { type: "jmespath" })
|
|
271
|
+
| (JMESPathExpression$Outbound & { type: "jp" })
|
|
272
|
+
| string
|
|
273
|
+
| null
|
|
274
|
+
| undefined;
|
|
275
|
+
action: "call";
|
|
276
|
+
name: string;
|
|
277
|
+
arguments?: { [k: string]: any } | null | undefined;
|
|
278
|
+
auto_populate?: boolean | string | undefined;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
/** @internal */
|
|
282
|
+
export const CallAction$outboundSchema: z.ZodType<
|
|
283
|
+
CallAction$Outbound,
|
|
284
|
+
z.ZodTypeDef,
|
|
285
|
+
CallAction
|
|
286
|
+
> = z.object({
|
|
287
|
+
if: z.nullable(
|
|
288
|
+
z.union([
|
|
289
|
+
CaseExpression$outboundSchema,
|
|
290
|
+
z.union([
|
|
291
|
+
CelExpression$outboundSchema.and(
|
|
292
|
+
z.object({ type: z.literal("cel") }).transform((v) => ({
|
|
293
|
+
type: v.type,
|
|
294
|
+
})),
|
|
295
|
+
),
|
|
296
|
+
JMESPathExpression$outboundSchema.and(
|
|
297
|
+
z.object({ type: z.literal("jmespath") }).transform((v) => ({
|
|
298
|
+
type: v.type,
|
|
299
|
+
})),
|
|
300
|
+
),
|
|
301
|
+
JMESPathExpression$outboundSchema.and(
|
|
302
|
+
z.object({ type: z.literal("jp") }).transform((v) => ({
|
|
303
|
+
type: v.type,
|
|
304
|
+
})),
|
|
305
|
+
),
|
|
306
|
+
]),
|
|
307
|
+
z.string(),
|
|
308
|
+
]),
|
|
309
|
+
).optional(),
|
|
310
|
+
action: z.literal("call").default("call" as const),
|
|
311
|
+
name: z.string(),
|
|
312
|
+
arguments: z.nullable(z.record(z.any())).optional(),
|
|
313
|
+
autoPopulate: z.union([z.boolean(), z.string()]).optional(),
|
|
314
|
+
}).transform((v) => {
|
|
315
|
+
return remap$(v, {
|
|
316
|
+
autoPopulate: "auto_populate",
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
export function callActionToJSON(callAction: CallAction): string {
|
|
321
|
+
return JSON.stringify(CallAction$outboundSchema.parse(callAction));
|
|
322
|
+
}
|
|
323
|
+
export function callActionFromJSON(
|
|
324
|
+
jsonString: string,
|
|
325
|
+
): SafeParseResult<CallAction, SDKValidationError> {
|
|
326
|
+
return safeParse(
|
|
327
|
+
jsonString,
|
|
328
|
+
(x) => CallAction$inboundSchema.parse(JSON.parse(x)),
|
|
329
|
+
`Failed to parse 'CallAction' from JSON`,
|
|
330
|
+
);
|
|
331
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
ConditionalValue,
|
|
11
|
+
ConditionalValue$inboundSchema,
|
|
12
|
+
ConditionalValue$Outbound,
|
|
13
|
+
ConditionalValue$outboundSchema,
|
|
14
|
+
} from "./conditionalvalue.js";
|
|
15
|
+
|
|
16
|
+
export type CaseExpression = {
|
|
17
|
+
case: Array<ConditionalValue>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const CaseExpression$inboundSchema: z.ZodType<
|
|
22
|
+
CaseExpression,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
case: z.array(z.lazy(() => ConditionalValue$inboundSchema)),
|
|
27
|
+
});
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type CaseExpression$Outbound = {
|
|
30
|
+
case: Array<ConditionalValue$Outbound>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const CaseExpression$outboundSchema: z.ZodType<
|
|
35
|
+
CaseExpression$Outbound,
|
|
36
|
+
z.ZodTypeDef,
|
|
37
|
+
CaseExpression
|
|
38
|
+
> = z.object({
|
|
39
|
+
case: z.array(z.lazy(() => ConditionalValue$outboundSchema)),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export function caseExpressionToJSON(caseExpression: CaseExpression): string {
|
|
43
|
+
return JSON.stringify(CaseExpression$outboundSchema.parse(caseExpression));
|
|
44
|
+
}
|
|
45
|
+
export function caseExpressionFromJSON(
|
|
46
|
+
jsonString: string,
|
|
47
|
+
): SafeParseResult<CaseExpression, SDKValidationError> {
|
|
48
|
+
return safeParse(
|
|
49
|
+
jsonString,
|
|
50
|
+
(x) => CaseExpression$inboundSchema.parse(JSON.parse(x)),
|
|
51
|
+
`Failed to parse 'CaseExpression' from JSON`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* See https://github.com/google/cel-spec/blob/master/doc/langdef.md
|
|
12
|
+
*/
|
|
13
|
+
export type CelExpression = {
|
|
14
|
+
/**
|
|
15
|
+
* The expression to evaluate.
|
|
16
|
+
*/
|
|
17
|
+
expression: string;
|
|
18
|
+
/**
|
|
19
|
+
* Google Common Expression Language.
|
|
20
|
+
*/
|
|
21
|
+
type?: "cel" | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const CelExpression$inboundSchema: z.ZodType<
|
|
26
|
+
CelExpression,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
expression: z.string(),
|
|
31
|
+
type: z.literal("cel").default("cel"),
|
|
32
|
+
});
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type CelExpression$Outbound = {
|
|
35
|
+
expression: string;
|
|
36
|
+
type: "cel";
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const CelExpression$outboundSchema: z.ZodType<
|
|
41
|
+
CelExpression$Outbound,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
CelExpression
|
|
44
|
+
> = z.object({
|
|
45
|
+
expression: z.string(),
|
|
46
|
+
type: z.literal("cel").default("cel" as const),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export function celExpressionToJSON(celExpression: CelExpression): string {
|
|
50
|
+
return JSON.stringify(CelExpression$outboundSchema.parse(celExpression));
|
|
51
|
+
}
|
|
52
|
+
export function celExpressionFromJSON(
|
|
53
|
+
jsonString: string,
|
|
54
|
+
): SafeParseResult<CelExpression, SDKValidationError> {
|
|
55
|
+
return safeParse(
|
|
56
|
+
jsonString,
|
|
57
|
+
(x) => CelExpression$inboundSchema.parse(JSON.parse(x)),
|
|
58
|
+
`Failed to parse 'CelExpression' from JSON`,
|
|
59
|
+
);
|
|
60
|
+
}
|