syllable-sdk 1.0.13-rc.3 → 1.0.13-rc.5

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.
Files changed (168) hide show
  1. package/bin/mcp-server.js +2809 -806
  2. package/bin/mcp-server.js.map +34 -9
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +3 -3
  6. package/lib/config.js +3 -3
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/server.js +1 -1
  9. package/models/components/bodyinsightsfolderuploadfile.d.ts +8 -8
  10. package/models/components/bodyinsightsfolderuploadfile.d.ts.map +1 -1
  11. package/models/components/bodyinsightsfolderuploadfile.js +11 -12
  12. package/models/components/bodyinsightsfolderuploadfile.js.map +1 -1
  13. package/models/components/callaction.d.ts +113 -0
  14. package/models/components/callaction.d.ts.map +1 -0
  15. package/models/components/callaction.js +174 -0
  16. package/models/components/callaction.js.map +1 -0
  17. package/models/components/caseexpression.d.ts +18 -0
  18. package/models/components/caseexpression.d.ts.map +1 -0
  19. package/models/components/caseexpression.js +59 -0
  20. package/models/components/caseexpression.js.map +1 -0
  21. package/models/components/celexpression.d.ts +28 -0
  22. package/models/components/celexpression.d.ts.map +1 -0
  23. package/models/components/celexpression.js +60 -0
  24. package/models/components/celexpression.js.map +1 -0
  25. package/models/components/conditionaltext.d.ts +85 -0
  26. package/models/components/conditionaltext.d.ts.map +1 -0
  27. package/models/components/conditionaltext.js +147 -0
  28. package/models/components/conditionaltext.js.map +1 -0
  29. package/models/components/conditionalvalue.d.ts +147 -0
  30. package/models/components/conditionalvalue.d.ts.map +1 -0
  31. package/models/components/conditionalvalue.js +248 -0
  32. package/models/components/conditionalvalue.js.map +1 -0
  33. package/models/components/context.d.ts +150 -0
  34. package/models/components/context.d.ts.map +1 -0
  35. package/models/components/context.js +265 -0
  36. package/models/components/context.js.map +1 -0
  37. package/models/components/contexttaskmetadata.d.ts +22 -0
  38. package/models/components/contexttaskmetadata.d.ts.map +1 -0
  39. package/models/components/contexttaskmetadata.js +69 -0
  40. package/models/components/contexttaskmetadata.js.map +1 -0
  41. package/models/components/contexttoolinfo.d.ts +25 -0
  42. package/models/components/contexttoolinfo.d.ts.map +1 -0
  43. package/models/components/contexttoolinfo.js +60 -0
  44. package/models/components/contexttoolinfo.js.map +1 -0
  45. package/models/components/eventtask.d.ts +42 -0
  46. package/models/components/eventtask.d.ts.map +1 -0
  47. package/models/components/eventtask.js +76 -0
  48. package/models/components/eventtask.js.map +1 -0
  49. package/models/components/eventtaskevents.d.ts +74 -0
  50. package/models/components/eventtaskevents.d.ts.map +1 -0
  51. package/models/components/eventtaskevents.js +139 -0
  52. package/models/components/eventtaskevents.js.map +1 -0
  53. package/models/components/expressiontask.d.ts +109 -0
  54. package/models/components/expressiontask.d.ts.map +1 -0
  55. package/models/components/expressiontask.js +170 -0
  56. package/models/components/expressiontask.js.map +1 -0
  57. package/models/components/expressiontaskevents.d.ts +131 -0
  58. package/models/components/expressiontaskevents.d.ts.map +1 -0
  59. package/models/components/expressiontaskevents.js +219 -0
  60. package/models/components/expressiontaskevents.js.map +1 -0
  61. package/models/components/incrementaction.d.ts +92 -0
  62. package/models/components/incrementaction.d.ts.map +1 -0
  63. package/models/components/incrementaction.js +151 -0
  64. package/models/components/incrementaction.js.map +1 -0
  65. package/models/components/index.d.ts +25 -0
  66. package/models/components/index.d.ts.map +1 -1
  67. package/models/components/index.js +25 -0
  68. package/models/components/index.js.map +1 -1
  69. package/models/components/inputparameter.d.ts +51 -0
  70. package/models/components/inputparameter.d.ts.map +1 -0
  71. package/models/components/inputparameter.js +87 -0
  72. package/models/components/inputparameter.js.map +1 -0
  73. package/models/components/jmespathexpression.d.ts +44 -0
  74. package/models/components/jmespathexpression.d.ts.map +1 -0
  75. package/models/components/jmespathexpression.js +71 -0
  76. package/models/components/jmespathexpression.js.map +1 -0
  77. package/models/components/loadtoolfromfiletask.d.ts +59 -0
  78. package/models/components/loadtoolfromfiletask.d.ts.map +1 -0
  79. package/models/components/loadtoolfromfiletask.js +88 -0
  80. package/models/components/loadtoolfromfiletask.js.map +1 -0
  81. package/models/components/nextstep.d.ts +93 -0
  82. package/models/components/nextstep.d.ts.map +1 -0
  83. package/models/components/nextstep.js +149 -0
  84. package/models/components/nextstep.js.map +1 -0
  85. package/models/components/saveaction.d.ts +92 -0
  86. package/models/components/saveaction.d.ts.map +1 -0
  87. package/models/components/saveaction.js +151 -0
  88. package/models/components/saveaction.js.map +1 -0
  89. package/models/components/sayaction.d.ts +108 -0
  90. package/models/components/sayaction.d.ts.map +1 -0
  91. package/models/components/sayaction.js +162 -0
  92. package/models/components/sayaction.js.map +1 -0
  93. package/models/components/setvalueaction.d.ts +154 -0
  94. package/models/components/setvalueaction.d.ts.map +1 -0
  95. package/models/components/setvalueaction.js +246 -0
  96. package/models/components/setvalueaction.js.map +1 -0
  97. package/models/components/step.d.ts +73 -0
  98. package/models/components/step.d.ts.map +1 -0
  99. package/models/components/step.js +103 -0
  100. package/models/components/step.js.map +1 -0
  101. package/models/components/stepeventactions.d.ts +185 -0
  102. package/models/components/stepeventactions.d.ts.map +1 -0
  103. package/models/components/stepeventactions.js +296 -0
  104. package/models/components/stepeventactions.js.map +1 -0
  105. package/models/components/stepstask.d.ts +42 -0
  106. package/models/components/stepstask.d.ts.map +1 -0
  107. package/models/components/stepstask.js +76 -0
  108. package/models/components/stepstask.js.map +1 -0
  109. package/models/components/steptools.d.ts +33 -0
  110. package/models/components/steptools.d.ts.map +1 -0
  111. package/models/components/steptools.js +71 -0
  112. package/models/components/steptools.js.map +1 -0
  113. package/models/components/tooldefinition.d.ts +6 -0
  114. package/models/components/tooldefinition.d.ts.map +1 -1
  115. package/models/components/tooldefinition.js +3 -0
  116. package/models/components/tooldefinition.js.map +1 -1
  117. package/models/components/variable.d.ts +119 -0
  118. package/models/components/variable.d.ts.map +1 -0
  119. package/models/components/variable.js +186 -0
  120. package/models/components/variable.js.map +1 -0
  121. package/openapi.json +2138 -291
  122. package/package.json +1 -1
  123. package/src/lib/config.ts +3 -3
  124. package/src/mcp-server/mcp-server.ts +1 -1
  125. package/src/mcp-server/server.ts +1 -1
  126. package/src/models/components/bodyinsightsfolderuploadfile.ts +36 -25
  127. package/src/models/components/callaction.ts +331 -0
  128. package/src/models/components/caseexpression.ts +53 -0
  129. package/src/models/components/celexpression.ts +60 -0
  130. package/src/models/components/conditionaltext.ts +280 -0
  131. package/src/models/components/conditionalvalue.ts +477 -0
  132. package/src/models/components/context.ts +485 -0
  133. package/src/models/components/contexttaskmetadata.ts +67 -0
  134. package/src/models/components/contexttoolinfo.ts +59 -0
  135. package/src/models/components/eventtask.ts +102 -0
  136. package/src/models/components/eventtaskevents.ts +257 -0
  137. package/src/models/components/expressiontask.ts +333 -0
  138. package/src/models/components/expressiontaskevents.ts +430 -0
  139. package/src/models/components/incrementaction.ts +291 -0
  140. package/src/models/components/index.ts +25 -0
  141. package/src/models/components/inputparameter.ts +103 -0
  142. package/src/models/components/jmespathexpression.ts +86 -0
  143. package/src/models/components/loadtoolfromfiletask.ts +137 -0
  144. package/src/models/components/nextstep.ts +280 -0
  145. package/src/models/components/saveaction.ts +281 -0
  146. package/src/models/components/sayaction.ts +302 -0
  147. package/src/models/components/setvalueaction.ts +508 -0
  148. package/src/models/components/step.ts +174 -0
  149. package/src/models/components/stepeventactions.ts +619 -0
  150. package/src/models/components/stepstask.ts +102 -0
  151. package/src/models/components/steptools.ts +76 -0
  152. package/src/models/components/tooldefinition.ts +13 -0
  153. package/src/models/components/variable.ts +332 -0
  154. package/src/types/enums.ts +1 -21
  155. package/src/types/index.ts +2 -1
  156. package/src/types/unrecognized.ts +27 -0
  157. package/types/enums.d.ts +1 -8
  158. package/types/enums.d.ts.map +1 -1
  159. package/types/enums.js +3 -21
  160. package/types/enums.js.map +1 -1
  161. package/types/index.d.ts +2 -1
  162. package/types/index.d.ts.map +1 -1
  163. package/types/index.js +15 -0
  164. package/types/index.js.map +1 -1
  165. package/types/unrecognized.d.ts +10 -0
  166. package/types/unrecognized.d.ts.map +1 -0
  167. package/types/unrecognized.js +26 -0
  168. package/types/unrecognized.js.map +1 -0
@@ -0,0 +1,508 @@
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 SetValueActionValueFrom1 =
30
+ | (CelExpression & { type: "cel" })
31
+ | (JMESPathExpression & { type: "jmespath" })
32
+ | (JMESPathExpression & { type: "jp" });
33
+
34
+ /**
35
+ * Expression to compute initial value (mutually exclusive with value).
36
+ */
37
+ export type SetValueActionValueFrom =
38
+ | CaseExpression
39
+ | (CelExpression & { type: "cel" })
40
+ | (JMESPathExpression & { type: "jmespath" })
41
+ | (JMESPathExpression & { type: "jp" })
42
+ | string;
43
+
44
+ export type SetValueActionIf1 =
45
+ | (CelExpression & { type: "cel" })
46
+ | (JMESPathExpression & { type: "jmespath" })
47
+ | (JMESPathExpression & { type: "jp" });
48
+
49
+ /**
50
+ * An expression that must evaluate to true for the action to be applied.
51
+ */
52
+ export type SetValueActionIf =
53
+ | CaseExpression
54
+ | (CelExpression & { type: "cel" })
55
+ | (JMESPathExpression & { type: "jmespath" })
56
+ | (JMESPathExpression & { type: "jp" })
57
+ | string;
58
+
59
+ export type SetValueAction = {
60
+ /**
61
+ * Initial value of the variable.
62
+ */
63
+ value?: any | null | undefined;
64
+ /**
65
+ * Expression to compute initial value (mutually exclusive with value).
66
+ */
67
+ valueFrom?:
68
+ | CaseExpression
69
+ | (CelExpression & { type: "cel" })
70
+ | (JMESPathExpression & { type: "jmespath" })
71
+ | (JMESPathExpression & { type: "jp" })
72
+ | string
73
+ | null
74
+ | undefined;
75
+ /**
76
+ * An expression that must evaluate to true for the action to be applied.
77
+ */
78
+ if?:
79
+ | CaseExpression
80
+ | (CelExpression & { type: "cel" })
81
+ | (JMESPathExpression & { type: "jmespath" })
82
+ | (JMESPathExpression & { type: "jp" })
83
+ | string
84
+ | null
85
+ | undefined;
86
+ action?: "set" | undefined;
87
+ /**
88
+ * Destination path to mutate (e.g. output.foo).
89
+ */
90
+ name: string;
91
+ };
92
+
93
+ /** @internal */
94
+ export const SetValueActionValueFrom1$inboundSchema: z.ZodType<
95
+ SetValueActionValueFrom1,
96
+ z.ZodTypeDef,
97
+ unknown
98
+ > = z.union([
99
+ CelExpression$inboundSchema.and(
100
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
101
+ ),
102
+ JMESPathExpression$inboundSchema.and(
103
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
104
+ type: v.type,
105
+ })),
106
+ ),
107
+ JMESPathExpression$inboundSchema.and(
108
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
109
+ ),
110
+ ]);
111
+ /** @internal */
112
+ export type SetValueActionValueFrom1$Outbound =
113
+ | (CelExpression$Outbound & { type: "cel" })
114
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
115
+ | (JMESPathExpression$Outbound & { type: "jp" });
116
+
117
+ /** @internal */
118
+ export const SetValueActionValueFrom1$outboundSchema: z.ZodType<
119
+ SetValueActionValueFrom1$Outbound,
120
+ z.ZodTypeDef,
121
+ SetValueActionValueFrom1
122
+ > = z.union([
123
+ CelExpression$outboundSchema.and(
124
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
125
+ ),
126
+ JMESPathExpression$outboundSchema.and(
127
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
128
+ type: v.type,
129
+ })),
130
+ ),
131
+ JMESPathExpression$outboundSchema.and(
132
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
133
+ ),
134
+ ]);
135
+
136
+ export function setValueActionValueFrom1ToJSON(
137
+ setValueActionValueFrom1: SetValueActionValueFrom1,
138
+ ): string {
139
+ return JSON.stringify(
140
+ SetValueActionValueFrom1$outboundSchema.parse(setValueActionValueFrom1),
141
+ );
142
+ }
143
+ export function setValueActionValueFrom1FromJSON(
144
+ jsonString: string,
145
+ ): SafeParseResult<SetValueActionValueFrom1, SDKValidationError> {
146
+ return safeParse(
147
+ jsonString,
148
+ (x) => SetValueActionValueFrom1$inboundSchema.parse(JSON.parse(x)),
149
+ `Failed to parse 'SetValueActionValueFrom1' from JSON`,
150
+ );
151
+ }
152
+
153
+ /** @internal */
154
+ export const SetValueActionValueFrom$inboundSchema: z.ZodType<
155
+ SetValueActionValueFrom,
156
+ z.ZodTypeDef,
157
+ unknown
158
+ > = z.union([
159
+ CaseExpression$inboundSchema,
160
+ z.union([
161
+ CelExpression$inboundSchema.and(
162
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
163
+ ),
164
+ JMESPathExpression$inboundSchema.and(
165
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
166
+ type: v.type,
167
+ })),
168
+ ),
169
+ JMESPathExpression$inboundSchema.and(
170
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
171
+ ),
172
+ ]),
173
+ z.string(),
174
+ ]);
175
+ /** @internal */
176
+ export type SetValueActionValueFrom$Outbound =
177
+ | CaseExpression$Outbound
178
+ | (CelExpression$Outbound & { type: "cel" })
179
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
180
+ | (JMESPathExpression$Outbound & { type: "jp" })
181
+ | string;
182
+
183
+ /** @internal */
184
+ export const SetValueActionValueFrom$outboundSchema: z.ZodType<
185
+ SetValueActionValueFrom$Outbound,
186
+ z.ZodTypeDef,
187
+ SetValueActionValueFrom
188
+ > = z.union([
189
+ CaseExpression$outboundSchema,
190
+ z.union([
191
+ CelExpression$outboundSchema.and(
192
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
193
+ ),
194
+ JMESPathExpression$outboundSchema.and(
195
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
196
+ type: v.type,
197
+ })),
198
+ ),
199
+ JMESPathExpression$outboundSchema.and(
200
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
201
+ ),
202
+ ]),
203
+ z.string(),
204
+ ]);
205
+
206
+ export function setValueActionValueFromToJSON(
207
+ setValueActionValueFrom: SetValueActionValueFrom,
208
+ ): string {
209
+ return JSON.stringify(
210
+ SetValueActionValueFrom$outboundSchema.parse(setValueActionValueFrom),
211
+ );
212
+ }
213
+ export function setValueActionValueFromFromJSON(
214
+ jsonString: string,
215
+ ): SafeParseResult<SetValueActionValueFrom, SDKValidationError> {
216
+ return safeParse(
217
+ jsonString,
218
+ (x) => SetValueActionValueFrom$inboundSchema.parse(JSON.parse(x)),
219
+ `Failed to parse 'SetValueActionValueFrom' from JSON`,
220
+ );
221
+ }
222
+
223
+ /** @internal */
224
+ export const SetValueActionIf1$inboundSchema: z.ZodType<
225
+ SetValueActionIf1,
226
+ z.ZodTypeDef,
227
+ unknown
228
+ > = z.union([
229
+ CelExpression$inboundSchema.and(
230
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
231
+ ),
232
+ JMESPathExpression$inboundSchema.and(
233
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
234
+ type: v.type,
235
+ })),
236
+ ),
237
+ JMESPathExpression$inboundSchema.and(
238
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
239
+ ),
240
+ ]);
241
+ /** @internal */
242
+ export type SetValueActionIf1$Outbound =
243
+ | (CelExpression$Outbound & { type: "cel" })
244
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
245
+ | (JMESPathExpression$Outbound & { type: "jp" });
246
+
247
+ /** @internal */
248
+ export const SetValueActionIf1$outboundSchema: z.ZodType<
249
+ SetValueActionIf1$Outbound,
250
+ z.ZodTypeDef,
251
+ SetValueActionIf1
252
+ > = z.union([
253
+ CelExpression$outboundSchema.and(
254
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
255
+ ),
256
+ JMESPathExpression$outboundSchema.and(
257
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
258
+ type: v.type,
259
+ })),
260
+ ),
261
+ JMESPathExpression$outboundSchema.and(
262
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
263
+ ),
264
+ ]);
265
+
266
+ export function setValueActionIf1ToJSON(
267
+ setValueActionIf1: SetValueActionIf1,
268
+ ): string {
269
+ return JSON.stringify(
270
+ SetValueActionIf1$outboundSchema.parse(setValueActionIf1),
271
+ );
272
+ }
273
+ export function setValueActionIf1FromJSON(
274
+ jsonString: string,
275
+ ): SafeParseResult<SetValueActionIf1, SDKValidationError> {
276
+ return safeParse(
277
+ jsonString,
278
+ (x) => SetValueActionIf1$inboundSchema.parse(JSON.parse(x)),
279
+ `Failed to parse 'SetValueActionIf1' from JSON`,
280
+ );
281
+ }
282
+
283
+ /** @internal */
284
+ export const SetValueActionIf$inboundSchema: z.ZodType<
285
+ SetValueActionIf,
286
+ z.ZodTypeDef,
287
+ unknown
288
+ > = z.union([
289
+ CaseExpression$inboundSchema,
290
+ z.union([
291
+ CelExpression$inboundSchema.and(
292
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
293
+ ),
294
+ JMESPathExpression$inboundSchema.and(
295
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
296
+ type: v.type,
297
+ })),
298
+ ),
299
+ JMESPathExpression$inboundSchema.and(
300
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
301
+ ),
302
+ ]),
303
+ z.string(),
304
+ ]);
305
+ /** @internal */
306
+ export type SetValueActionIf$Outbound =
307
+ | CaseExpression$Outbound
308
+ | (CelExpression$Outbound & { type: "cel" })
309
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
310
+ | (JMESPathExpression$Outbound & { type: "jp" })
311
+ | string;
312
+
313
+ /** @internal */
314
+ export const SetValueActionIf$outboundSchema: z.ZodType<
315
+ SetValueActionIf$Outbound,
316
+ z.ZodTypeDef,
317
+ SetValueActionIf
318
+ > = z.union([
319
+ CaseExpression$outboundSchema,
320
+ z.union([
321
+ CelExpression$outboundSchema.and(
322
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
323
+ ),
324
+ JMESPathExpression$outboundSchema.and(
325
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
326
+ type: v.type,
327
+ })),
328
+ ),
329
+ JMESPathExpression$outboundSchema.and(
330
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
331
+ ),
332
+ ]),
333
+ z.string(),
334
+ ]);
335
+
336
+ export function setValueActionIfToJSON(
337
+ setValueActionIf: SetValueActionIf,
338
+ ): string {
339
+ return JSON.stringify(
340
+ SetValueActionIf$outboundSchema.parse(setValueActionIf),
341
+ );
342
+ }
343
+ export function setValueActionIfFromJSON(
344
+ jsonString: string,
345
+ ): SafeParseResult<SetValueActionIf, SDKValidationError> {
346
+ return safeParse(
347
+ jsonString,
348
+ (x) => SetValueActionIf$inboundSchema.parse(JSON.parse(x)),
349
+ `Failed to parse 'SetValueActionIf' from JSON`,
350
+ );
351
+ }
352
+
353
+ /** @internal */
354
+ export const SetValueAction$inboundSchema: z.ZodType<
355
+ SetValueAction,
356
+ z.ZodTypeDef,
357
+ unknown
358
+ > = z.object({
359
+ value: z.nullable(z.any()).optional(),
360
+ value_from: z.nullable(
361
+ z.union([
362
+ CaseExpression$inboundSchema,
363
+ z.union([
364
+ CelExpression$inboundSchema.and(
365
+ z.object({ type: z.literal("cel") }).transform((v) => ({
366
+ type: v.type,
367
+ })),
368
+ ),
369
+ JMESPathExpression$inboundSchema.and(
370
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
371
+ type: v.type,
372
+ })),
373
+ ),
374
+ JMESPathExpression$inboundSchema.and(
375
+ z.object({ type: z.literal("jp") }).transform((v) => ({
376
+ type: v.type,
377
+ })),
378
+ ),
379
+ ]),
380
+ z.string(),
381
+ ]),
382
+ ).optional(),
383
+ if: z.nullable(
384
+ z.union([
385
+ CaseExpression$inboundSchema,
386
+ z.union([
387
+ CelExpression$inboundSchema.and(
388
+ z.object({ type: z.literal("cel") }).transform((v) => ({
389
+ type: v.type,
390
+ })),
391
+ ),
392
+ JMESPathExpression$inboundSchema.and(
393
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
394
+ type: v.type,
395
+ })),
396
+ ),
397
+ JMESPathExpression$inboundSchema.and(
398
+ z.object({ type: z.literal("jp") }).transform((v) => ({
399
+ type: v.type,
400
+ })),
401
+ ),
402
+ ]),
403
+ z.string(),
404
+ ]),
405
+ ).optional(),
406
+ action: z.literal("set").default("set"),
407
+ name: z.string(),
408
+ }).transform((v) => {
409
+ return remap$(v, {
410
+ "value_from": "valueFrom",
411
+ });
412
+ });
413
+ /** @internal */
414
+ export type SetValueAction$Outbound = {
415
+ value?: any | null | undefined;
416
+ value_from?:
417
+ | CaseExpression$Outbound
418
+ | (CelExpression$Outbound & { type: "cel" })
419
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
420
+ | (JMESPathExpression$Outbound & { type: "jp" })
421
+ | string
422
+ | null
423
+ | undefined;
424
+ if?:
425
+ | CaseExpression$Outbound
426
+ | (CelExpression$Outbound & { type: "cel" })
427
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
428
+ | (JMESPathExpression$Outbound & { type: "jp" })
429
+ | string
430
+ | null
431
+ | undefined;
432
+ action: "set";
433
+ name: string;
434
+ };
435
+
436
+ /** @internal */
437
+ export const SetValueAction$outboundSchema: z.ZodType<
438
+ SetValueAction$Outbound,
439
+ z.ZodTypeDef,
440
+ SetValueAction
441
+ > = z.object({
442
+ value: z.nullable(z.any()).optional(),
443
+ valueFrom: z.nullable(
444
+ z.union([
445
+ CaseExpression$outboundSchema,
446
+ z.union([
447
+ CelExpression$outboundSchema.and(
448
+ z.object({ type: z.literal("cel") }).transform((v) => ({
449
+ type: v.type,
450
+ })),
451
+ ),
452
+ JMESPathExpression$outboundSchema.and(
453
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
454
+ type: v.type,
455
+ })),
456
+ ),
457
+ JMESPathExpression$outboundSchema.and(
458
+ z.object({ type: z.literal("jp") }).transform((v) => ({
459
+ type: v.type,
460
+ })),
461
+ ),
462
+ ]),
463
+ z.string(),
464
+ ]),
465
+ ).optional(),
466
+ if: z.nullable(
467
+ z.union([
468
+ CaseExpression$outboundSchema,
469
+ z.union([
470
+ CelExpression$outboundSchema.and(
471
+ z.object({ type: z.literal("cel") }).transform((v) => ({
472
+ type: v.type,
473
+ })),
474
+ ),
475
+ JMESPathExpression$outboundSchema.and(
476
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
477
+ type: v.type,
478
+ })),
479
+ ),
480
+ JMESPathExpression$outboundSchema.and(
481
+ z.object({ type: z.literal("jp") }).transform((v) => ({
482
+ type: v.type,
483
+ })),
484
+ ),
485
+ ]),
486
+ z.string(),
487
+ ]),
488
+ ).optional(),
489
+ action: z.literal("set").default("set" as const),
490
+ name: z.string(),
491
+ }).transform((v) => {
492
+ return remap$(v, {
493
+ valueFrom: "value_from",
494
+ });
495
+ });
496
+
497
+ export function setValueActionToJSON(setValueAction: SetValueAction): string {
498
+ return JSON.stringify(SetValueAction$outboundSchema.parse(setValueAction));
499
+ }
500
+ export function setValueActionFromJSON(
501
+ jsonString: string,
502
+ ): SafeParseResult<SetValueAction, SDKValidationError> {
503
+ return safeParse(
504
+ jsonString,
505
+ (x) => SetValueAction$inboundSchema.parse(JSON.parse(x)),
506
+ `Failed to parse 'SetValueAction' from JSON`,
507
+ );
508
+ }
@@ -0,0 +1,174 @@
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
+ ConditionalText,
11
+ ConditionalText$inboundSchema,
12
+ ConditionalText$Outbound,
13
+ ConditionalText$outboundSchema,
14
+ } from "./conditionaltext.js";
15
+ import {
16
+ InputParameter,
17
+ InputParameter$inboundSchema,
18
+ InputParameter$Outbound,
19
+ InputParameter$outboundSchema,
20
+ } from "./inputparameter.js";
21
+ import {
22
+ NextStep,
23
+ NextStep$inboundSchema,
24
+ NextStep$Outbound,
25
+ NextStep$outboundSchema,
26
+ } from "./nextstep.js";
27
+ import {
28
+ StepEventActions,
29
+ StepEventActions$inboundSchema,
30
+ StepEventActions$Outbound,
31
+ StepEventActions$outboundSchema,
32
+ } from "./stepeventactions.js";
33
+ import {
34
+ StepTools,
35
+ StepTools$inboundSchema,
36
+ StepTools$Outbound,
37
+ StepTools$outboundSchema,
38
+ } from "./steptools.js";
39
+
40
+ export type Instructions = ConditionalText | string;
41
+
42
+ export type Next = NextStep | string;
43
+
44
+ export type Step = {
45
+ /**
46
+ * The unique identifier of the step.
47
+ */
48
+ id: string;
49
+ /**
50
+ * The goal of the step.
51
+ */
52
+ goal: string;
53
+ /**
54
+ * The instructions for the step.
55
+ */
56
+ instructions?: Array<ConditionalText | string> | undefined;
57
+ /**
58
+ * Configuration for tools available in a step.
59
+ */
60
+ tools?: StepTools | undefined;
61
+ /**
62
+ * The inputs for the step.
63
+ */
64
+ inputs?: Array<InputParameter> | undefined;
65
+ /**
66
+ * Actions to perform when events occur (enter, submit).
67
+ */
68
+ on?: StepEventActions | undefined;
69
+ /**
70
+ * The next steps to execute.
71
+ */
72
+ next?: Array<NextStep | string> | undefined;
73
+ };
74
+
75
+ /** @internal */
76
+ export const Instructions$inboundSchema: z.ZodType<
77
+ Instructions,
78
+ z.ZodTypeDef,
79
+ unknown
80
+ > = z.union([ConditionalText$inboundSchema, z.string()]);
81
+ /** @internal */
82
+ export type Instructions$Outbound = ConditionalText$Outbound | string;
83
+
84
+ /** @internal */
85
+ export const Instructions$outboundSchema: z.ZodType<
86
+ Instructions$Outbound,
87
+ z.ZodTypeDef,
88
+ Instructions
89
+ > = z.union([ConditionalText$outboundSchema, z.string()]);
90
+
91
+ export function instructionsToJSON(instructions: Instructions): string {
92
+ return JSON.stringify(Instructions$outboundSchema.parse(instructions));
93
+ }
94
+ export function instructionsFromJSON(
95
+ jsonString: string,
96
+ ): SafeParseResult<Instructions, SDKValidationError> {
97
+ return safeParse(
98
+ jsonString,
99
+ (x) => Instructions$inboundSchema.parse(JSON.parse(x)),
100
+ `Failed to parse 'Instructions' from JSON`,
101
+ );
102
+ }
103
+
104
+ /** @internal */
105
+ export const Next$inboundSchema: z.ZodType<Next, z.ZodTypeDef, unknown> = z
106
+ .union([NextStep$inboundSchema, z.string()]);
107
+ /** @internal */
108
+ export type Next$Outbound = NextStep$Outbound | string;
109
+
110
+ /** @internal */
111
+ export const Next$outboundSchema: z.ZodType<Next$Outbound, z.ZodTypeDef, Next> =
112
+ z.union([NextStep$outboundSchema, z.string()]);
113
+
114
+ export function nextToJSON(next: Next): string {
115
+ return JSON.stringify(Next$outboundSchema.parse(next));
116
+ }
117
+ export function nextFromJSON(
118
+ jsonString: string,
119
+ ): SafeParseResult<Next, SDKValidationError> {
120
+ return safeParse(
121
+ jsonString,
122
+ (x) => Next$inboundSchema.parse(JSON.parse(x)),
123
+ `Failed to parse 'Next' from JSON`,
124
+ );
125
+ }
126
+
127
+ /** @internal */
128
+ export const Step$inboundSchema: z.ZodType<Step, z.ZodTypeDef, unknown> = z
129
+ .object({
130
+ id: z.string(),
131
+ goal: z.string(),
132
+ instructions: z.array(z.union([ConditionalText$inboundSchema, z.string()]))
133
+ .optional(),
134
+ tools: StepTools$inboundSchema.optional(),
135
+ inputs: z.array(InputParameter$inboundSchema).optional(),
136
+ on: StepEventActions$inboundSchema.optional(),
137
+ next: z.array(z.union([NextStep$inboundSchema, z.string()])).optional(),
138
+ });
139
+ /** @internal */
140
+ export type Step$Outbound = {
141
+ id: string;
142
+ goal: string;
143
+ instructions?: Array<ConditionalText$Outbound | string> | undefined;
144
+ tools?: StepTools$Outbound | undefined;
145
+ inputs?: Array<InputParameter$Outbound> | undefined;
146
+ on?: StepEventActions$Outbound | undefined;
147
+ next?: Array<NextStep$Outbound | string> | undefined;
148
+ };
149
+
150
+ /** @internal */
151
+ export const Step$outboundSchema: z.ZodType<Step$Outbound, z.ZodTypeDef, Step> =
152
+ z.object({
153
+ id: z.string(),
154
+ goal: z.string(),
155
+ instructions: z.array(z.union([ConditionalText$outboundSchema, z.string()]))
156
+ .optional(),
157
+ tools: StepTools$outboundSchema.optional(),
158
+ inputs: z.array(InputParameter$outboundSchema).optional(),
159
+ on: StepEventActions$outboundSchema.optional(),
160
+ next: z.array(z.union([NextStep$outboundSchema, z.string()])).optional(),
161
+ });
162
+
163
+ export function stepToJSON(step: Step): string {
164
+ return JSON.stringify(Step$outboundSchema.parse(step));
165
+ }
166
+ export function stepFromJSON(
167
+ jsonString: string,
168
+ ): SafeParseResult<Step, SDKValidationError> {
169
+ return safeParse(
170
+ jsonString,
171
+ (x) => Step$inboundSchema.parse(JSON.parse(x)),
172
+ `Failed to parse 'Step' from JSON`,
173
+ );
174
+ }