@transloadit/zod 7.0.0 → 7.1.1
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/README.md +12 -2
- package/dist/v3/builtinTemplates.d.ts +40 -0
- package/dist/v3/builtinTemplates.d.ts.map +1 -1
- package/dist/v3/builtinTemplates.js +29 -0
- package/dist/v3/responseErrors/DocumentConvertRobot.d.ts +17 -0
- package/dist/v3/responseErrors/DocumentConvertRobot.d.ts.map +1 -0
- package/dist/v3/responseErrors/DocumentConvertRobot.js +16 -0
- package/dist/v3/robots/document-convert.d.ts.map +1 -1
- package/dist/v3/robots/document-convert.js +19 -0
- package/dist/v3/robots/document-extract.d.ts +32 -20
- package/dist/v3/robots/document-extract.d.ts.map +1 -1
- package/dist/v3/robots/document-extract.js +51 -1
- package/dist/v3/robots/html-convert.d.ts.map +1 -1
- package/dist/v3/robots/html-convert.js +1 -0
- package/dist/v3/robots/speech-transcribe.d.ts +14 -0
- package/dist/v3/robots/speech-transcribe.d.ts.map +1 -1
- package/dist/v3/robots/speech-transcribe.js +42 -2
- package/dist/v3/robots/video-split.d.ts +11 -0
- package/dist/v3/robots/video-split.d.ts.map +1 -1
- package/dist/v3/robots/video-split.js +2 -1
- package/dist/v3/robots/video-subtitle.d.ts +24 -24
- package/dist/v3/robots/video-subtitle.d.ts.map +1 -1
- package/dist/v3/robots/video-subtitle.js +12 -11
- package/dist/v3/robots/video-thumbs.d.ts +36 -36
- package/dist/v3/robots/video-thumbs.d.ts.map +1 -1
- package/dist/v3/robots/video-thumbs.js +8 -3
- package/dist/v3/template.d.ts.map +1 -1
- package/dist/v3/template.js +5 -2
- package/dist/v4/assemblyStatus.d.ts +2 -2
- package/dist/v4/builtinTemplates.d.ts +22 -0
- package/dist/v4/builtinTemplates.d.ts.map +1 -1
- package/dist/v4/builtinTemplates.js +29 -0
- package/dist/v4/responseErrors/DocumentConvertRobot.d.ts +17 -0
- package/dist/v4/responseErrors/DocumentConvertRobot.d.ts.map +1 -0
- package/dist/v4/responseErrors/DocumentConvertRobot.js +16 -0
- package/dist/v4/robots/_instructions-primitives.d.ts.map +1 -1
- package/dist/v4/robots/_instructions-primitives.js +5 -0
- package/dist/v4/robots/document-convert.d.ts.map +1 -1
- package/dist/v4/robots/document-convert.js +19 -0
- package/dist/v4/robots/document-extract.d.ts +12 -0
- package/dist/v4/robots/document-extract.d.ts.map +1 -1
- package/dist/v4/robots/document-extract.js +51 -1
- package/dist/v4/robots/html-convert.d.ts.map +1 -1
- package/dist/v4/robots/html-convert.js +1 -0
- package/dist/v4/robots/speech-transcribe.d.ts +6 -0
- package/dist/v4/robots/speech-transcribe.d.ts.map +1 -1
- package/dist/v4/robots/speech-transcribe.js +42 -2
- package/dist/v4/robots/video-split.d.ts +5 -0
- package/dist/v4/robots/video-split.d.ts.map +1 -1
- package/dist/v4/robots/video-split.js +2 -1
- package/dist/v4/robots/video-subtitle.d.ts +12 -12
- package/dist/v4/robots/video-subtitle.d.ts.map +1 -1
- package/dist/v4/robots/video-subtitle.js +15 -17
- package/dist/v4/robots/video-thumbs.d.ts +12 -12
- package/dist/v4/robots/video-thumbs.d.ts.map +1 -1
- package/dist/v4/robots/video-thumbs.js +10 -5
- package/dist/v4/template.d.ts.map +1 -1
- package/dist/v4/template.js +5 -2
- package/package.json +2 -2
|
@@ -363,10 +363,10 @@ export declare const robotVideoSubtitleInstructionsSchema: z.ZodObject<{
|
|
|
363
363
|
shadow: "shadow";
|
|
364
364
|
}>>;
|
|
365
365
|
border_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
366
|
-
font: z.
|
|
366
|
+
font: z.ZodOptional<z.ZodString>;
|
|
367
367
|
font_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
368
|
-
font_size: z.
|
|
369
|
-
bold: z.
|
|
368
|
+
font_size: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
370
370
|
italic: z.ZodDefault<z.ZodBoolean>;
|
|
371
371
|
outline_width: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
372
372
|
position: z.ZodDefault<z.ZodEnum<{
|
|
@@ -739,10 +739,10 @@ export declare const robotVideoSubtitleInstructionsWithHiddenFieldsSchema: z.Zod
|
|
|
739
739
|
shadow: "shadow";
|
|
740
740
|
}>>;
|
|
741
741
|
border_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
742
|
-
font: z.
|
|
742
|
+
font: z.ZodOptional<z.ZodString>;
|
|
743
743
|
font_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
744
|
-
font_size: z.
|
|
745
|
-
bold: z.
|
|
744
|
+
font_size: z.ZodOptional<z.ZodNumber>;
|
|
745
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
746
746
|
italic: z.ZodDefault<z.ZodBoolean>;
|
|
747
747
|
outline_width: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
748
748
|
position: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1115,10 +1115,10 @@ export declare const robotVideoSubtitleInstructionsWithHiddenFieldsSchema: z.Zod
|
|
|
1115
1115
|
shadow: "shadow";
|
|
1116
1116
|
}>]>>;
|
|
1117
1117
|
border_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1118
|
-
font: z.
|
|
1118
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1119
1119
|
font_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1120
|
-
font_size: z.
|
|
1121
|
-
bold: z.
|
|
1120
|
+
font_size: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
1121
|
+
bold: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
1122
1122
|
italic: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
1123
1123
|
outline_width: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
|
|
1124
1124
|
position: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
@@ -1489,10 +1489,10 @@ export declare const robotVideoSubtitleInstructionsWithHiddenFieldsSchema: z.Zod
|
|
|
1489
1489
|
shadow: "shadow";
|
|
1490
1490
|
}>]>>;
|
|
1491
1491
|
border_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1492
|
-
font: z.
|
|
1492
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1493
1493
|
font_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1494
|
-
font_size: z.
|
|
1495
|
-
bold: z.
|
|
1494
|
+
font_size: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
1495
|
+
bold: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
1496
1496
|
italic: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
1497
1497
|
outline_width: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
|
|
1498
1498
|
position: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-subtitle.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/video-subtitle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAkB1B,oFAAoF;AACpF,eAAO,MAAM,wBAAwB;;;;;CAOpC,CAAA;AAED,eAAO,MAAM,IAAI,EAAE,cAmClB,CAAA;AAED,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBACnD,CAAA;AAEnB,KAAK,YAAY,GAAG,uBAAuB,CAAC,OAAO,eAAe,CAAC,CAAA;AAEnE,MAAM,MAAM,8BAA8B,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AACnE,MAAM,MAAM,8CAA8C,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA;AACzF,MAAM,MAAM,4CAA4C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AAC9F,MAAM,MAAM,iDAAiD,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AACnG,MAAM,MAAM,4DAA4D,GACtE,YAAY,CAAC,4BAA4B,CAAC,CAAA;AAC5C,MAAM,MAAM,iEAAiE,GAC3E,YAAY,CAAC,2BAA2B,CAAC,CAAA"}
|
|
@@ -40,7 +40,7 @@ export const meta = {
|
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
|
-
example_code_description: 'Transcribe an uploaded video into timestamped words, then burn in uppercase social captions with the spoken word highlighted. Captions normally contain up to three words, breaking at sentence endings and pauses longer than 0.4 seconds.
|
|
43
|
+
example_code_description: 'Transcribe an uploaded video into timestamped words, then burn in uppercase social captions with the spoken word highlighted. Captions normally contain up to three words, breaking at sentence endings and pauses longer than 0.4 seconds. Social phrasing can use one extra word to keep a short phrase together or avoid a sentence-final orphan:',
|
|
44
44
|
purpose_sentence: 'adds subtitles and closed captions to videos',
|
|
45
45
|
purpose_verb: 'subtitle',
|
|
46
46
|
purpose_word: 'subtitle',
|
|
@@ -66,7 +66,7 @@ Determines if subtitles are added as a separate stream to the video (value \`"ex
|
|
|
66
66
|
style: optionalWithV3Semantics(z
|
|
67
67
|
.enum(['social']))
|
|
68
68
|
.describe(`
|
|
69
|
-
Applies a ready-made appearance for burned subtitles: heavy Poppins text
|
|
69
|
+
Applies a ready-made appearance for burned subtitles: heavy Poppins text, a thick outline, and a soft black shadow. JSON captions render in uppercase in the lower third. By default, JSON font sizing uses the shorter side of the video and fits each caption within the safe width, preferring one line and using at most two. Words are never split. Each caption grows from 85% to full size over 120 milliseconds, then its words stay in place while the highlight changes color. The transcript file is preserved. Existing styling parameters override the preset; an explicit \`font_size\` disables automatic fitting. ASS files retain their own styles. With timestamped JSON from \`/speech/transcribe\`, the active word is highlighted until the next word or caption starts; other words use \`font_color\`. Trailing commas and periods are omitted from social JSON captions; question marks and exclamation marks are preserved. Word highlighting and grouping require JSON input.
|
|
70
70
|
`),
|
|
71
71
|
highlight_color: subtitleColorSchema.default('FFD60A').describe(`
|
|
72
72
|
The accent color of the active word in JSON subtitles. Only applies to burned JSON subtitles. With \`"style": "social"\`, the previous word stays highlighted through short gaps until the next word or caption starts. Without the social style, gaps use \`font_color\` for the entire caption.
|
|
@@ -79,7 +79,7 @@ ${subtitleColorDescription}
|
|
|
79
79
|
.min(1)
|
|
80
80
|
.default(3)
|
|
81
81
|
.describe(`
|
|
82
|
-
The target maximum number of timestamped JSON words shown in a caption. Captions break earlier at sentence-ending punctuation or pauses longer than 0.4 seconds. With \`"style": "social"\`, a trailing English function word such as “by,” “to,” or “the” moves to the next caption when possible,
|
|
82
|
+
The target maximum number of timestamped JSON words shown in a caption. Captions break earlier at sentence-ending punctuation or pauses longer than 0.4 seconds. With \`"style": "social"\`, a trailing English function word such as “by,” “to,” or “the” moves to the next caption when possible. Short phrases such as “line of code” can stay together, and a sentence-final single word can join the previous caption. These adjustments allow at most one extra word per caption, without crossing sentence endings or long pauses. Single-word captions are preserved when the limit is 1. A caption stays visible until the next caption starts when the pause is at most 0.4 seconds, and disappears at its last word’s end during longer pauses. Does not change SRT, VTT, or ASS cues.
|
|
83
83
|
`),
|
|
84
84
|
border_style: z
|
|
85
85
|
.enum(['box', 'outline', 'shadow'])
|
|
@@ -92,12 +92,12 @@ The color for the subtitle border. The default is opaque black. Only applies to
|
|
|
92
92
|
|
|
93
93
|
${subtitleColorDescription}
|
|
94
94
|
`),
|
|
95
|
+
// Preserve omitted appearance fields so parsing cannot override the selected style's defaults.
|
|
95
96
|
// TODO: Make font an enum
|
|
96
|
-
font: z
|
|
97
|
-
.string()
|
|
98
|
-
.default('Arial')
|
|
97
|
+
font: optionalWithV3Semantics(z
|
|
98
|
+
.string())
|
|
99
99
|
.describe(`
|
|
100
|
-
The font family to use. Also includes boldness and style of the font. With \`"style": "social"\`, the default is
|
|
100
|
+
The font family to use. Also includes boldness and style of the font. The default is Arial. With \`"style": "social"\`, the default is ${videoSubtitleSocialStyle.font}, using its ExtraBold weight for JSON captions. An explicit font overrides the style.
|
|
101
101
|
|
|
102
102
|
[Here](/docs/supported-formats/fonts/) is a list of all supported fonts.
|
|
103
103
|
`),
|
|
@@ -106,19 +106,17 @@ The color of the subtitle text. Only applies to burned subtitles.
|
|
|
106
106
|
|
|
107
107
|
${subtitleColorDescription}
|
|
108
108
|
`),
|
|
109
|
-
font_size: z
|
|
109
|
+
font_size: optionalWithV3Semantics(z
|
|
110
110
|
.number()
|
|
111
111
|
.int()
|
|
112
|
-
.min(1)
|
|
113
|
-
.default(16)
|
|
112
|
+
.min(1))
|
|
114
113
|
.describe(`
|
|
115
|
-
Specifies the size of the text in the 288-pixel subtitle coordinate space, scaled with the video height. With \`"style": "social"\`, the default is
|
|
114
|
+
Specifies the size of the text in the 288-pixel subtitle coordinate space, scaled with the video height. The default is 16. With \`"style": "social"\`, the default is ${videoSubtitleSocialStyle.font_size}. For social JSON captions, an omitted value scales this default with the shorter side of the video, increases it by 18% for portrait video, and shrinks captions as needed to fit at most two lines. Poppins capital letters are about 7.5% of the shorter side before fitting, or about 9% for portrait video. An explicit value keeps height-relative sizing and disables automatic fitting.
|
|
116
115
|
`),
|
|
117
|
-
bold: z
|
|
118
|
-
.boolean()
|
|
119
|
-
.default(false)
|
|
116
|
+
bold: optionalWithV3Semantics(z
|
|
117
|
+
.boolean())
|
|
120
118
|
.describe(`
|
|
121
|
-
Specifies whether the subtitle text should be bold. Only applies to burned subtitles. With \`"style": "social"\`, the default is
|
|
119
|
+
Specifies whether the subtitle text should be bold. Only applies to burned subtitles. The default is \`false\`. With \`"style": "social"\`, the default is \`${videoSubtitleSocialStyle.bold}\`; an explicit \`false\` overrides the style.
|
|
122
120
|
`),
|
|
123
121
|
italic: z
|
|
124
122
|
.boolean()
|
|
@@ -133,10 +131,10 @@ Specifies whether the subtitle text should be italic. Only applies to burned sub
|
|
|
133
131
|
.max(10))
|
|
134
132
|
.nullable()
|
|
135
133
|
.describe(`
|
|
136
|
-
Specifies the width of the text outline in the 288-pixel subtitle coordinate space, scaled with the video height. Numeric strings such as \`"4"\` are also accepted. Only applies to burned subtitles with \`"outline"\` or \`"box"\` border styles. If omitted or \`null\`, the default width is used (2 with \`"style": "social"\`,
|
|
134
|
+
Specifies the width of the text outline in the 288-pixel subtitle coordinate space, scaled with the video height. Numeric strings such as \`"4"\` are also accepted. Only applies to burned subtitles with \`"outline"\` or \`"box"\` border styles. If omitted or \`null\`, the default width is used (2 with \`"style": "social"\`, proportional to the final fitted font size for social JSON captions).
|
|
137
135
|
`),
|
|
138
136
|
position: positionSchema.default('bottom').describe(`
|
|
139
|
-
Specifies the position of the subtitles. With \`"style": "social"\`, the default bottom position places JSON captions in the lower third. An explicit value overrides the style.
|
|
137
|
+
Specifies the position of the subtitles. With \`"style": "social"\`, the default bottom position places JSON captions in the lower third, with extra bottom clearance on portrait video. An explicit value overrides the style.
|
|
140
138
|
`),
|
|
141
139
|
language: optionalWithV3Semantics(z
|
|
142
140
|
.string())
|
|
@@ -145,14 +145,14 @@ export declare const robotVideoThumbsInstructionsSchema: z.ZodObject<{
|
|
|
145
145
|
}>, z.ZodString]>>;
|
|
146
146
|
robot: z.ZodLiteral<"/video/thumbs">;
|
|
147
147
|
count: z.ZodDefault<z.ZodNumber>;
|
|
148
|
-
offsets: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]
|
|
148
|
+
offsets: z.ZodDefault<z.ZodNullable<z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>>>;
|
|
149
149
|
format: z.ZodDefault<z.ZodEnum<{
|
|
150
150
|
jpeg: "jpeg";
|
|
151
151
|
jpg: "jpg";
|
|
152
152
|
png: "png";
|
|
153
153
|
}>>;
|
|
154
|
-
width: z.ZodOptional<z.ZodNumber
|
|
155
|
-
height: z.ZodOptional<z.ZodNumber
|
|
154
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
155
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
156
156
|
resize_strategy: z.ZodDefault<z.ZodEnum<{
|
|
157
157
|
crop: "crop";
|
|
158
158
|
fit: "fit";
|
|
@@ -301,14 +301,14 @@ export declare const robotVideoThumbsInstructionsWithHiddenFieldsSchema: z.ZodOb
|
|
|
301
301
|
}>, z.ZodString]>>;
|
|
302
302
|
robot: z.ZodLiteral<"/video/thumbs">;
|
|
303
303
|
count: z.ZodDefault<z.ZodNumber>;
|
|
304
|
-
offsets: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]
|
|
304
|
+
offsets: z.ZodDefault<z.ZodNullable<z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodString>]>>>;
|
|
305
305
|
format: z.ZodDefault<z.ZodEnum<{
|
|
306
306
|
jpeg: "jpeg";
|
|
307
307
|
jpg: "jpg";
|
|
308
308
|
png: "png";
|
|
309
309
|
}>>;
|
|
310
|
-
width: z.ZodOptional<z.ZodNumber
|
|
311
|
-
height: z.ZodOptional<z.ZodNumber
|
|
310
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
311
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
312
312
|
resize_strategy: z.ZodDefault<z.ZodEnum<{
|
|
313
313
|
crop: "crop";
|
|
314
314
|
fit: "fit";
|
|
@@ -457,14 +457,14 @@ export declare const robotVideoThumbsInstructionsWithHiddenFieldsSchema: z.ZodOb
|
|
|
457
457
|
}>]>, z.ZodString]>>;
|
|
458
458
|
robot: z.ZodLiteral<"/video/thumbs">;
|
|
459
459
|
count: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
460
|
-
offsets: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>>]>, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>]
|
|
460
|
+
offsets: z.ZodPrefault<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>>]>, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>]>>>;
|
|
461
461
|
format: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
462
462
|
jpeg: "jpeg";
|
|
463
463
|
jpg: "jpg";
|
|
464
464
|
png: "png";
|
|
465
465
|
}>]>>;
|
|
466
|
-
width: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]
|
|
467
|
-
height: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]
|
|
466
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
|
|
467
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
|
|
468
468
|
resize_strategy: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
469
469
|
crop: "crop";
|
|
470
470
|
fit: "fit";
|
|
@@ -611,14 +611,14 @@ export declare const robotVideoThumbsInstructionsWithHiddenFieldsSchema: z.ZodOb
|
|
|
611
611
|
}>]>, z.ZodString]>>;
|
|
612
612
|
robot: z.ZodLiteral<"/video/thumbs">;
|
|
613
613
|
count: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
614
|
-
offsets: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>>]>, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>]
|
|
614
|
+
offsets: z.ZodPrefault<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>>]>, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>]>>>;
|
|
615
615
|
format: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
616
616
|
jpeg: "jpeg";
|
|
617
617
|
jpg: "jpg";
|
|
618
618
|
png: "png";
|
|
619
619
|
}>]>>;
|
|
620
|
-
width: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]
|
|
621
|
-
height: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]
|
|
620
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
|
|
621
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
|
|
622
622
|
resize_strategy: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
623
623
|
crop: "crop";
|
|
624
624
|
fit: "fit";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-thumbs.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/video-thum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AAM,MAAM,0CAA0C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AAC5F,MAAM,MAAM,+CAA+C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AACjG,MAAM,MAAM,0DAA0D,GACpE,YAAY,CAAC,4BAA4B,CAAC,CAAA;AAC5C,MAAM,MAAM,+DAA+D,GACzE,YAAY,CAAC,2BAA2B,CAAC,CAAA"}
|
|
@@ -68,7 +68,8 @@ The thumbnails are taken at regular intervals, determined by dividing the video
|
|
|
68
68
|
To extract thumbnails for specific timestamps, use the \`offsets\` parameter.
|
|
69
69
|
`),
|
|
70
70
|
offsets: z
|
|
71
|
-
.union([z.array(z.number()), z.array(percentageSchema)])
|
|
71
|
+
.union([z.array(z.number().finite()), z.array(percentageSchema)])
|
|
72
|
+
.nullable()
|
|
72
73
|
.default([])
|
|
73
74
|
.describe(`
|
|
74
75
|
An array of offsets representing seconds of the file duration, such as \`[ 2, 45, 120 ]\`. Millisecond durations of a file can also be used by using decimal place values. For example, an offset from 1250 milliseconds would be represented with \`1.25\`. Offsets can also be percentage values such as \`[ "2%", "50%", "75%" ]\`.
|
|
@@ -76,6 +77,8 @@ An array of offsets representing seconds of the file duration, such as \`[ 2, 45
|
|
|
76
77
|
This option cannot be used with the \`count\` parameter, and takes precedence if both are specified. Out-of-range offsets are silently ignored.
|
|
77
78
|
|
|
78
79
|
When \`smart\` is \`true\`, smart selection ignores \`offsets\` and uses \`count\` to select from its own candidate timestamps. If no smart candidates can be extracted, the Robot falls back to standard extraction, where \`offsets\` takes precedence. Use \`smart: false\` to consistently extract the specified timestamps.
|
|
80
|
+
|
|
81
|
+
Use \`null\` to leave timestamp selection to \`count\` and \`smart\`.
|
|
79
82
|
`),
|
|
80
83
|
format: z
|
|
81
84
|
.enum(['jpeg', 'jpg', 'png'])
|
|
@@ -87,17 +90,19 @@ The format of the extracted thumbnail. Supported values are \`"jpg"\`, \`"jpeg"\
|
|
|
87
90
|
.number()
|
|
88
91
|
.int()
|
|
89
92
|
.min(1)
|
|
90
|
-
.max(1920)
|
|
93
|
+
.max(1920)
|
|
94
|
+
.nullable())
|
|
91
95
|
.describe(`
|
|
92
|
-
The width of the thumbnail, in pixels.
|
|
96
|
+
The width of the thumbnail, in pixels. Omit or use \`null\` for the original width of the video.
|
|
93
97
|
`),
|
|
94
98
|
height: optionalWithV3Semantics(z
|
|
95
99
|
.number()
|
|
96
100
|
.int()
|
|
97
101
|
.min(1)
|
|
98
|
-
.max(1080)
|
|
102
|
+
.max(1080)
|
|
103
|
+
.nullable())
|
|
99
104
|
.describe(`
|
|
100
|
-
The height of the thumbnail, in pixels.
|
|
105
|
+
The height of the thumbnail, in pixels. Omit or use \`null\` for the original height of the video.
|
|
101
106
|
`),
|
|
102
107
|
resize_strategy: resize_strategy.describe(`
|
|
103
108
|
One of the [available resize strategies](/docs/topics/resize-strategies/).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/v4/template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAM1B,OAAO,KAAK,EACV,YAAY,EACZ,6BAA6B,EAC9B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/v4/template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAM1B,OAAO,KAAK,EACV,YAAY,EACZ,6BAA6B,EAC9B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAA;AAIpE,MAAM,MAAM,IAAI,GAAG,YAAY,CAAA;AAC/B,MAAM,MAAM,SAAS,GAAG,IAAI,CAAA;AAC5B,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAA;AACnD,M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AEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAClF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAC1F,MAAM,MAAM,oCAAoC,GAAG,OAAO,CACxD,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAC/C,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;kBA4BtB,CAAA;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;kBAIzB,CAAA;AAEX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkD1B,CAAA;AAQX,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;WACD,OAAO,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCxF,CAAA;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAA;AACjG,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,oCAAoC,CAC5C,CAAA"}
|
package/dist/v4/template.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { optionalWithV3Semantics } from "./lib/sdkZodOptional.js";
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import { robotsSchema, robotsWithHiddenBotsAndFieldsSchema, } from "./robots/_index.js";
|
|
4
|
+
import { refineDocumentExtractOcr } from "./robots/document-extract.js";
|
|
4
5
|
import { refineTransloaditImportSelector } from "./robots/transloadit-import.js";
|
|
5
6
|
export const stepSchema = z
|
|
6
7
|
.object({
|
|
@@ -10,7 +11,8 @@ export const stepSchema = z
|
|
|
10
11
|
.describe('Identifier of the [robot](https://transloadit.com/docs/robots/) to execute'),
|
|
11
12
|
})
|
|
12
13
|
.and(robotsSchema)
|
|
13
|
-
.superRefine(refineTransloaditImportSelector)
|
|
14
|
+
.superRefine(refineTransloaditImportSelector)
|
|
15
|
+
.superRefine(refineDocumentExtractOcr);
|
|
14
16
|
export const stepsSchema = z.record(z.string(), stepSchema)
|
|
15
17
|
.describe('Contains Assembly Instructions.');
|
|
16
18
|
export const optionalStepsSchema = optionalWithV3Semantics(stepsSchema);
|
|
@@ -22,7 +24,8 @@ export const stepSchemaWithHiddenFields = z
|
|
|
22
24
|
.describe('Identifier of the [robot](https://transloadit.com/docs/robots/) to execute'),
|
|
23
25
|
})
|
|
24
26
|
.and(robotsWithHiddenBotsAndFieldsSchema)
|
|
25
|
-
.superRefine(refineTransloaditImportSelector)
|
|
27
|
+
.superRefine(refineTransloaditImportSelector)
|
|
28
|
+
.superRefine(refineDocumentExtractOcr);
|
|
26
29
|
export const stepsSchemaWithHiddenFields = z.record(z.string(), stepSchemaWithHiddenFields)
|
|
27
30
|
.describe('Contains Assembly Instructions.');
|
|
28
31
|
const optionalStepsWithHiddenFieldsSchema = optionalWithV3Semantics(stepsSchemaWithHiddenFields);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transloadit/zod",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "Transloadit Zod schemas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@transloadit/types": "^6.
|
|
53
|
+
"@transloadit/types": "^6.1.1",
|
|
54
54
|
"@types/node": "^25.8.0"
|
|
55
55
|
}
|
|
56
56
|
}
|