@transloadit/zod 6.0.0 → 7.0.0
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/dist/v3/englishInteger.d.ts +3 -0
- package/dist/v3/englishInteger.d.ts.map +1 -0
- package/dist/v3/englishInteger.js +12 -0
- package/dist/v3/lib/zodInputSemantics.d.ts +3 -1
- package/dist/v3/lib/zodInputSemantics.d.ts.map +1 -1
- package/dist/v3/lib/zodInputSemantics.js +17 -0
- package/dist/v3/robots/_image-describe-output.d.ts +55 -0
- package/dist/v3/robots/_image-describe-output.d.ts.map +1 -0
- package/dist/v3/robots/_image-describe-output.js +15 -0
- package/dist/v3/robots/_image-facedetect-output.d.ts +30 -0
- package/dist/v3/robots/_image-facedetect-output.d.ts.map +1 -0
- package/dist/v3/robots/_image-facedetect-output.js +14 -0
- package/dist/v3/robots/_index.d.ts +582 -48
- package/dist/v3/robots/_index.d.ts.map +1 -1
- package/dist/v3/robots/_index.js +84 -80
- package/dist/v3/robots/_instructions-primitives.d.ts +82 -0
- package/dist/v3/robots/_instructions-primitives.d.ts.map +1 -1
- package/dist/v3/robots/_instructions-primitives.js +46 -2
- package/dist/v3/robots/_ocr-output.d.ts +75 -0
- package/dist/v3/robots/_ocr-output.d.ts.map +1 -0
- package/dist/v3/robots/_ocr-output.js +14 -0
- package/dist/v3/robots/ai-chat.d.ts +12 -12
- package/dist/v3/robots/audio-encode.d.ts.map +1 -1
- package/dist/v3/robots/audio-encode.js +8 -1
- package/dist/v3/robots/audio-split.d.ts.map +1 -1
- package/dist/v3/robots/audio-split.js +2 -0
- package/dist/v3/robots/digitalocean-store.d.ts +4 -4
- package/dist/v3/robots/digitalocean-store.js +1 -1
- package/dist/v3/robots/document-convert.d.ts +8 -6
- package/dist/v3/robots/document-convert.d.ts.map +1 -1
- package/dist/v3/robots/document-convert.js +5 -5
- package/dist/v3/robots/document-extract.d.ts +4 -4
- package/dist/v3/robots/document-ocr.d.ts +8 -8
- package/dist/v3/robots/google-store.d.ts +32 -8
- package/dist/v3/robots/google-store.d.ts.map +1 -1
- package/dist/v3/robots/google-store.js +10 -2
- package/dist/v3/robots/image-bgremove.d.ts +16 -16
- package/dist/v3/robots/image-describe.d.ts +17 -17
- package/dist/v3/robots/image-describe.d.ts.map +1 -1
- package/dist/v3/robots/image-describe.js +2 -1
- package/dist/v3/robots/image-facedetect.d.ts +9 -35
- package/dist/v3/robots/image-facedetect.d.ts.map +1 -1
- package/dist/v3/robots/image-facedetect.js +1 -11
- package/dist/v3/robots/image-generate.d.ts +20 -20
- package/dist/v3/robots/image-generate.js +1 -1
- package/dist/v3/robots/image-ocr.d.ts +8 -8
- package/dist/v3/robots/image-upscale.d.ts +17 -12
- package/dist/v3/robots/image-upscale.d.ts.map +1 -1
- package/dist/v3/robots/image-upscale.js +14 -2
- package/dist/v3/robots/mega-store.d.ts +4 -4
- package/dist/v3/robots/mega-store.js +1 -1
- package/dist/v3/robots/s3-store.d.ts +8 -8
- package/dist/v3/robots/s3-store.d.ts.map +1 -1
- package/dist/v3/robots/s3-store.js +14 -2
- package/dist/v3/robots/speech-transcribe.d.ts +12 -12
- package/dist/v3/robots/text-speak.d.ts +8 -8
- package/dist/v3/robots/text-translate.d.ts +8 -8
- package/dist/v3/robots/video-adaptive.d.ts +16 -19
- package/dist/v3/robots/video-adaptive.d.ts.map +1 -1
- package/dist/v3/robots/video-adaptive.js +37 -3
- package/dist/v3/robots/video-concat.d.ts.map +1 -1
- package/dist/v3/robots/video-concat.js +7 -3
- package/dist/v3/robots/video-encode.d.ts.map +1 -1
- package/dist/v3/robots/video-encode.js +6 -0
- package/dist/v3/robots/video-generate.d.ts +20 -20
- package/dist/v3/robots/video-generate.js +1 -1
- package/dist/v3/robots/video-merge.d.ts.map +1 -1
- package/dist/v3/robots/video-merge.js +15 -1
- package/dist/v3/robots/video-split.d.ts.map +1 -1
- package/dist/v3/robots/video-split.js +2 -0
- package/dist/v3/robots/video-subtitle.d.ts +47 -4
- package/dist/v3/robots/video-subtitle.d.ts.map +1 -1
- package/dist/v3/robots/video-subtitle.js +59 -46
- package/dist/v3/robots/vimeo-import.d.ts.map +1 -1
- package/dist/v3/robots/vimeo-import.js +1 -1
- package/dist/v3/robots/youtube-store.d.ts +37 -20
- package/dist/v3/robots/youtube-store.d.ts.map +1 -1
- package/dist/v3/robots/youtube-store.js +17 -29
- package/dist/v3/youtubeCategories.d.ts +20 -0
- package/dist/v3/youtubeCategories.d.ts.map +1 -0
- package/dist/v3/youtubeCategories.js +20 -0
- package/dist/v4/englishInteger.d.ts +3 -0
- package/dist/v4/englishInteger.d.ts.map +1 -0
- package/dist/v4/englishInteger.js +12 -0
- package/dist/v4/lib/zodInputSemantics.d.ts +3 -1
- package/dist/v4/lib/zodInputSemantics.d.ts.map +1 -1
- package/dist/v4/lib/zodInputSemantics.js +6 -0
- package/dist/v4/robots/_image-describe-output.d.ts +23 -0
- package/dist/v4/robots/_image-describe-output.d.ts.map +1 -0
- package/dist/v4/robots/_image-describe-output.js +15 -0
- package/dist/v4/robots/_image-facedetect-output.d.ts +14 -0
- package/dist/v4/robots/_image-facedetect-output.d.ts.map +1 -0
- package/dist/v4/robots/_image-facedetect-output.js +15 -0
- package/dist/v4/robots/_index.d.ts +582 -48
- package/dist/v4/robots/_index.d.ts.map +1 -1
- package/dist/v4/robots/_index.js +84 -80
- package/dist/v4/robots/_instructions-primitives.d.ts +16 -0
- package/dist/v4/robots/_instructions-primitives.d.ts.map +1 -1
- package/dist/v4/robots/_instructions-primitives.js +45 -2
- package/dist/v4/robots/_ocr-output.d.ts +29 -0
- package/dist/v4/robots/_ocr-output.d.ts.map +1 -0
- package/dist/v4/robots/_ocr-output.js +14 -0
- package/dist/v4/robots/audio-encode.d.ts.map +1 -1
- package/dist/v4/robots/audio-encode.js +8 -1
- package/dist/v4/robots/audio-split.d.ts.map +1 -1
- package/dist/v4/robots/audio-split.js +2 -0
- package/dist/v4/robots/digitalocean-store.d.ts +8 -8
- package/dist/v4/robots/digitalocean-store.js +1 -1
- package/dist/v4/robots/document-convert.d.ts +22 -8
- package/dist/v4/robots/document-convert.d.ts.map +1 -1
- package/dist/v4/robots/document-convert.js +5 -5
- package/dist/v4/robots/google-store.d.ts +16 -4
- package/dist/v4/robots/google-store.d.ts.map +1 -1
- package/dist/v4/robots/google-store.js +10 -2
- package/dist/v4/robots/image-describe.d.ts +1 -5
- package/dist/v4/robots/image-describe.d.ts.map +1 -1
- package/dist/v4/robots/image-describe.js +2 -1
- package/dist/v4/robots/image-facedetect.d.ts +1 -11
- package/dist/v4/robots/image-facedetect.d.ts.map +1 -1
- package/dist/v4/robots/image-facedetect.js +1 -12
- package/dist/v4/robots/image-generate.d.ts +0 -4
- package/dist/v4/robots/image-generate.d.ts.map +1 -1
- package/dist/v4/robots/image-generate.js +1 -1
- package/dist/v4/robots/image-upscale.d.ts +5 -0
- package/dist/v4/robots/image-upscale.d.ts.map +1 -1
- package/dist/v4/robots/image-upscale.js +14 -2
- package/dist/v4/robots/mega-store.d.ts +8 -8
- package/dist/v4/robots/mega-store.js +1 -1
- package/dist/v4/robots/s3-store.d.ts +20 -0
- package/dist/v4/robots/s3-store.d.ts.map +1 -1
- package/dist/v4/robots/s3-store.js +14 -2
- package/dist/v4/robots/video-adaptive.d.ts +16 -16
- package/dist/v4/robots/video-adaptive.d.ts.map +1 -1
- package/dist/v4/robots/video-adaptive.js +38 -5
- package/dist/v4/robots/video-concat.d.ts.map +1 -1
- package/dist/v4/robots/video-concat.js +7 -3
- package/dist/v4/robots/video-encode.d.ts.map +1 -1
- package/dist/v4/robots/video-encode.js +6 -0
- package/dist/v4/robots/video-generate.d.ts +0 -4
- package/dist/v4/robots/video-generate.d.ts.map +1 -1
- package/dist/v4/robots/video-generate.js +1 -1
- package/dist/v4/robots/video-merge.d.ts.map +1 -1
- package/dist/v4/robots/video-merge.js +15 -1
- package/dist/v4/robots/video-split.d.ts.map +1 -1
- package/dist/v4/robots/video-split.js +2 -0
- package/dist/v4/robots/video-subtitle.d.ts +31 -4
- package/dist/v4/robots/video-subtitle.d.ts.map +1 -1
- package/dist/v4/robots/video-subtitle.js +58 -46
- package/dist/v4/robots/vimeo-import.d.ts.map +1 -1
- package/dist/v4/robots/vimeo-import.js +1 -1
- package/dist/v4/robots/youtube-store.d.ts +25 -76
- package/dist/v4/robots/youtube-store.d.ts.map +1 -1
- package/dist/v4/robots/youtube-store.js +18 -29
- package/dist/v4/youtubeCategories.d.ts +20 -0
- package/dist/v4/youtubeCategories.d.ts.map +1 -0
- package/dist/v4/youtubeCategories.js +20 -0
- package/package.json +2 -2
|
@@ -7,6 +7,8 @@ export const meta = {
|
|
|
7
7
|
steps: {
|
|
8
8
|
merged: {
|
|
9
9
|
robot: '/video/merge',
|
|
10
|
+
preset: 'empty',
|
|
11
|
+
ffmpeg: { f: 'mp4' },
|
|
10
12
|
use: [
|
|
11
13
|
{ name: ':original', as: 'image' },
|
|
12
14
|
{ name: ':original', as: 'audio' },
|
|
@@ -32,7 +34,12 @@ export const robotVideoMergeInstructionsSchema = robotBase
|
|
|
32
34
|
.merge(robotUse)
|
|
33
35
|
.merge(robotFFmpegVideo)
|
|
34
36
|
.extend({
|
|
35
|
-
robot
|
|
37
|
+
// The robot literal's description supplies the Robot page introduction.
|
|
38
|
+
robot: z.literal('/video/merge').describe(`
|
|
39
|
+
When concatenating videos end-to-end, all inputs must have the same width and height, with or without a \`transition\`. For joining clips, use [🤖/video/concat](/docs/robots/video-concat/), which pre-transcodes inputs to matching specifications when needed.
|
|
40
|
+
|
|
41
|
+
When both \`preset\` and \`ffmpeg\` are omitted, this Robot uses the legacy \`"flash"\` preset and outputs FLV. Choose an output preset or set \`ffmpeg.f\` explicitly to select another format, such as \`"mp4"\`.
|
|
42
|
+
`),
|
|
36
43
|
resize_strategy: resize_strategy.describe(`
|
|
37
44
|
If the given width/height parameters are bigger than the input image's dimensions, then the \`resize_strategy\` determines how the image will be resized to match the provided width/height. See the [available resize strategies](/docs/topics/resize-strategies/).
|
|
38
45
|
`),
|
|
@@ -88,6 +95,7 @@ Stacks the input media vertically. All streams need to have the same pixel forma
|
|
|
88
95
|
The URL of an image to be merged with the audio or video. When this parameter is provided, the robot will download the image from the URL and merge it with the other media.
|
|
89
96
|
`),
|
|
90
97
|
sort_by: inputSortBySchema,
|
|
98
|
+
// Include join constraints in parameter help as well as the Robot introduction.
|
|
91
99
|
transition: z
|
|
92
100
|
.enum(['none', 'crossfade', 'fade_to_black'])
|
|
93
101
|
.default('none')
|
|
@@ -97,12 +105,18 @@ The type of transition effect to apply between concatenated video clips. Only ap
|
|
|
97
105
|
- \`"none"\` — No transition effect. Videos are joined end-to-end.
|
|
98
106
|
- \`"crossfade"\` — A gradual blend from one clip to the next (both video and audio).
|
|
99
107
|
- \`"fade_to_black"\` — The current clip fades out to black, then the next clip fades in from black.
|
|
108
|
+
|
|
109
|
+
Both \`"crossfade"\` and \`"fade_to_black"\` overlap adjacent clips and shorten the output by the applied \`transition_duration\` at each join. The applied duration is capped at half of the shorter clip in each pair.
|
|
110
|
+
|
|
111
|
+
All concatenated videos must have the same width and height, even when \`transition\` is \`"none"\`. For joining clips with different dimensions, use [🤖/video/concat](/docs/robots/video-concat/).
|
|
100
112
|
`),
|
|
101
113
|
transition_duration: z
|
|
102
114
|
.number()
|
|
103
115
|
.default(1)
|
|
104
116
|
.describe(`
|
|
105
117
|
The duration of the transition effect in seconds. Only applies when \`transition\` is not \`"none"\`. Supports float values (e.g., \`0.5\` for a 500ms transition) and must be greater than \`0\` whenever transitions are enabled. The applied transition is automatically capped at half of the shorter clip in each transition pair to prevent overlapping transitions.
|
|
118
|
+
|
|
119
|
+
For \`"crossfade"\`, this is the overlap duration where both clips are visible. For \`"fade_to_black"\`, the video fades out over approximately the first 20% of the transition and fades in over the remaining 80% (about 0.2 seconds out and 0.8 seconds in for a 1-second transition). Audio is crossfaded throughout the transition for both effects. Both effects shorten the output by the applied duration at each join.
|
|
106
120
|
`),
|
|
107
121
|
})
|
|
108
122
|
.strict();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-split.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/video-split.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAY1B,eAAO,MAAM,IAAI,EAAE,cAkBlB,CAAA;AAiBD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"video-split.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/video-split.ts"],"names":[],"mappings":"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"}
|
|
@@ -35,6 +35,8 @@ export const robotVideoSplitInstructionsSchema = robotBase
|
|
|
35
35
|
.extend({
|
|
36
36
|
robot: z.literal('/video/split').describe(`
|
|
37
37
|
Splits a video into multiple segments based on an array of from/to durations. Each segment produces a separate output file. This is useful for cutting a video into parts, for example to insert ads later via [🤖/video/concat](/docs/robots/video-concat/).
|
|
38
|
+
|
|
39
|
+
For iPhone videos with spatial audio, see [iPhone spatial audio in 🤖/video/encode](/docs/robots/video-encode/#iphone-spatial-audio).
|
|
38
40
|
`),
|
|
39
41
|
segments: z
|
|
40
42
|
.array(segmentSchema)
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { RobotDefinition, RobotMetaInput, RobotSchemaVariantTypes } from './_instructions-primitives.ts';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
|
+
/** Appearance defaults for the social caption preset, before customer overrides. */
|
|
4
|
+
export declare const videoSubtitleSocialStyle: {
|
|
5
|
+
font: string;
|
|
6
|
+
font_size: number;
|
|
7
|
+
bold: boolean;
|
|
8
|
+
outline_width: number;
|
|
9
|
+
};
|
|
3
10
|
export declare const meta: RobotMetaInput;
|
|
4
11
|
export declare const robotVideoSubtitleInstructionsSchema: z.ZodObject<{
|
|
5
12
|
interpolate: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
|
|
@@ -345,12 +352,17 @@ export declare const robotVideoSubtitleInstructionsSchema: z.ZodObject<{
|
|
|
345
352
|
external: "external";
|
|
346
353
|
burn: "burn";
|
|
347
354
|
}>, z.ZodTransform<"burned" | "external", "burned" | "external" | "burn">>>;
|
|
355
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
356
|
+
social: "social";
|
|
357
|
+
}>>;
|
|
358
|
+
highlight_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
359
|
+
max_words_per_caption: z.ZodDefault<z.ZodNumber>;
|
|
348
360
|
border_style: z.ZodDefault<z.ZodEnum<{
|
|
349
361
|
box: "box";
|
|
350
362
|
outline: "outline";
|
|
351
363
|
shadow: "shadow";
|
|
352
364
|
}>>;
|
|
353
|
-
border_color: z.ZodDefault<z.ZodString
|
|
365
|
+
border_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
354
366
|
font: z.ZodDefault<z.ZodString>;
|
|
355
367
|
font_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
356
368
|
font_size: z.ZodDefault<z.ZodNumber>;
|
|
@@ -716,12 +728,17 @@ export declare const robotVideoSubtitleInstructionsWithHiddenFieldsSchema: z.Zod
|
|
|
716
728
|
external: "external";
|
|
717
729
|
burn: "burn";
|
|
718
730
|
}>, z.ZodTransform<"burned" | "external", "burned" | "external" | "burn">>>;
|
|
731
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
732
|
+
social: "social";
|
|
733
|
+
}>>;
|
|
734
|
+
highlight_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
735
|
+
max_words_per_caption: z.ZodDefault<z.ZodNumber>;
|
|
719
736
|
border_style: z.ZodDefault<z.ZodEnum<{
|
|
720
737
|
box: "box";
|
|
721
738
|
outline: "outline";
|
|
722
739
|
shadow: "shadow";
|
|
723
740
|
}>>;
|
|
724
|
-
border_color: z.ZodDefault<z.ZodString
|
|
741
|
+
border_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
725
742
|
font: z.ZodDefault<z.ZodString>;
|
|
726
743
|
font_color: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
727
744
|
font_size: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1087,12 +1104,17 @@ export declare const robotVideoSubtitleInstructionsWithHiddenFieldsSchema: z.Zod
|
|
|
1087
1104
|
external: "external";
|
|
1088
1105
|
burn: "burn";
|
|
1089
1106
|
}>, z.ZodTransform<"burned" | "external", "burned" | "external" | "burn">>]>>;
|
|
1107
|
+
style: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
1108
|
+
social: "social";
|
|
1109
|
+
}>]>>;
|
|
1110
|
+
highlight_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1111
|
+
max_words_per_caption: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
1090
1112
|
border_style: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
1091
1113
|
box: "box";
|
|
1092
1114
|
outline: "outline";
|
|
1093
1115
|
shadow: "shadow";
|
|
1094
1116
|
}>]>>;
|
|
1095
|
-
border_color: z.ZodPrefault<z.ZodString
|
|
1117
|
+
border_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1096
1118
|
font: z.ZodPrefault<z.ZodString>;
|
|
1097
1119
|
font_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1098
1120
|
font_size: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
@@ -1456,12 +1478,17 @@ export declare const robotVideoSubtitleInstructionsWithHiddenFieldsSchema: z.Zod
|
|
|
1456
1478
|
external: "external";
|
|
1457
1479
|
burn: "burn";
|
|
1458
1480
|
}>, z.ZodTransform<"burned" | "external", "burned" | "external" | "burn">>]>>;
|
|
1481
|
+
style: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
1482
|
+
social: "social";
|
|
1483
|
+
}>]>>;
|
|
1484
|
+
highlight_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1485
|
+
max_words_per_caption: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
1459
1486
|
border_style: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
1460
1487
|
box: "box";
|
|
1461
1488
|
outline: "outline";
|
|
1462
1489
|
shadow: "shadow";
|
|
1463
1490
|
}>]>>;
|
|
1464
|
-
border_color: z.ZodPrefault<z.ZodString
|
|
1491
|
+
border_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1465
1492
|
font: z.ZodPrefault<z.ZodString>;
|
|
1466
1493
|
font_color: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
1467
1494
|
font_size: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"video-subtitle.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/video-subtitle.ts"],"names":[],"mappings":"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"}
|
|
@@ -3,53 +3,44 @@ import { z } from 'zod/v4';
|
|
|
3
3
|
import { zodInputPreservingTransform } from "../lib/zodInputSemantics.js";
|
|
4
4
|
import { stackVersions } from "../stackVersions.js";
|
|
5
5
|
import { color_with_alpha, color_without_alpha, defineRobot, positionSchema, robotBase, robotFFmpegVideo, robotUse, robotVideoEncodingMeta, } from "./_instructions-primitives.js";
|
|
6
|
+
const subtitleColorSchema = z.union([color_without_alpha, color_with_alpha]);
|
|
7
|
+
const subtitleColorDescription = `Use \`"rgb"\`, \`"rrggbb"\`, or \`"aarrggbb"\` format, optionally prefixed with \`#\`. Three-digit colors are expanded to six digits. Colors without alpha are fully opaque. For eight-digit colors, the first two digits specify transparency (\`"00"\` is fully opaque, \`"ff"\` is fully transparent).`;
|
|
8
|
+
/** Appearance defaults for the social caption preset, before customer overrides. */
|
|
9
|
+
export const videoSubtitleSocialStyle = {
|
|
10
|
+
// Static Poppins faces are included by API2's shared fontsConf google-fonts package.
|
|
11
|
+
font: 'Poppins',
|
|
12
|
+
// ASS includes the font's ascent and descent; Poppins capitals occupy about 40% of it.
|
|
13
|
+
font_size: 54,
|
|
14
|
+
bold: true,
|
|
15
|
+
outline_width: 2,
|
|
16
|
+
};
|
|
6
17
|
export const meta = {
|
|
7
18
|
...robotVideoEncodingMeta,
|
|
8
19
|
example_code: {
|
|
9
20
|
steps: {
|
|
10
|
-
|
|
11
|
-
robot: '/
|
|
12
|
-
use:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
fields: 'input_video',
|
|
17
|
-
as: 'video',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: ':original',
|
|
21
|
-
fields: 'input_srt_en',
|
|
22
|
-
as: 'subtitles',
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
language: 'eng',
|
|
27
|
-
name: 'English',
|
|
28
|
-
ffmpeg_stack: stackVersions.ffmpeg.recommendedVersion,
|
|
21
|
+
transcript: {
|
|
22
|
+
robot: '/speech/transcribe',
|
|
23
|
+
use: ':original',
|
|
24
|
+
provider: 'aws',
|
|
25
|
+
format: 'json',
|
|
26
|
+
source_language: 'en-US',
|
|
29
27
|
},
|
|
30
|
-
|
|
28
|
+
captioned: {
|
|
31
29
|
robot: '/video/subtitle',
|
|
32
30
|
use: {
|
|
33
31
|
steps: [
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
as: 'video',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: ':original',
|
|
40
|
-
fields: 'input_srt_de',
|
|
41
|
-
as: 'subtitles',
|
|
42
|
-
},
|
|
32
|
+
{ name: ':original', as: 'video' },
|
|
33
|
+
{ name: 'transcript', as: 'subtitles' },
|
|
43
34
|
],
|
|
44
35
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
subtitles_type: 'burned',
|
|
37
|
+
preset: 'empty',
|
|
38
|
+
style: 'social',
|
|
48
39
|
ffmpeg_stack: stackVersions.ffmpeg.recommendedVersion,
|
|
49
40
|
},
|
|
50
41
|
},
|
|
51
42
|
},
|
|
52
|
-
example_code_description: '
|
|
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. A trailing function word can move to the next caption, allowing one extra word there:',
|
|
53
44
|
purpose_sentence: 'adds subtitles and closed captions to videos',
|
|
54
45
|
purpose_verb: 'subtitle',
|
|
55
46
|
purpose_word: 'subtitle',
|
|
@@ -63,12 +54,32 @@ export const robotVideoSubtitleInstructionsSchema = robotBase
|
|
|
63
54
|
.merge(robotFFmpegVideo)
|
|
64
55
|
.extend({
|
|
65
56
|
robot: z.literal('/video/subtitle').describe(`
|
|
66
|
-
This <dfn>Robot</dfn> supports
|
|
57
|
+
This <dfn>Robot</dfn> supports SRT, VTT, ASS, and the timestamped JSON output of \`/speech/transcribe\` with \`"format": "json"\`. Pass the video as \`"video"\` and the transcript as \`"subtitles"\` in the \`use\` parameter. JSON words are grouped into captions and converted to ASS for burned word highlighting, or plain SRT cues for external subtitle streams. External JSON cues preserve casing and punctuation. Provider segments do not control caption breaks. SRT and VTT timing is preserved.
|
|
58
|
+
|
|
59
|
+
Without a \`preset\` or custom \`ffmpeg\` options, the legacy \`"flash"\` preset produces FLV output. With this default, burned subtitles use MP3 audio; external subtitles copy the input audio. Set \`"preset": "empty"\` to keep the input container, such as MP4 for an MP4 input.
|
|
67
60
|
`),
|
|
68
61
|
subtitles_type: zodInputPreservingTransform(z.enum(['burned', 'external', 'burn']), (val) => val === 'burn' ? 'burned' : val)
|
|
69
62
|
.default('external')
|
|
70
63
|
.describe(`
|
|
71
64
|
Determines if subtitles are added as a separate stream to the video (value \`"external"\`) that then can be switched on and off in your video player, or if they should be burned directly into the video (value \`"burned"\` or \`"burn"\`) so that they become part of the video stream.
|
|
65
|
+
`),
|
|
66
|
+
style: optionalWithV3Semantics(z
|
|
67
|
+
.enum(['social']))
|
|
68
|
+
.describe(`
|
|
69
|
+
Applies a ready-made appearance for burned subtitles: heavy Poppins text and a large font scaled with the video height. JSON captions render in uppercase in the lower third with a thick outline and a soft black shadow. 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. 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
|
+
`),
|
|
71
|
+
highlight_color: subtitleColorSchema.default('FFD60A').describe(`
|
|
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.
|
|
73
|
+
|
|
74
|
+
${subtitleColorDescription}
|
|
75
|
+
`),
|
|
76
|
+
max_words_per_caption: z
|
|
77
|
+
.number()
|
|
78
|
+
.int()
|
|
79
|
+
.min(1)
|
|
80
|
+
.default(3)
|
|
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, allowing at most one extra word in that caption. 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.
|
|
72
83
|
`),
|
|
73
84
|
border_style: z
|
|
74
85
|
.enum(['box', 'outline', 'shadow'])
|
|
@@ -76,23 +87,24 @@ Determines if subtitles are added as a separate stream to the video (value \`"ex
|
|
|
76
87
|
.describe(`
|
|
77
88
|
Specifies the style of the subtitle. Use the \`border_color\` parameter to specify the color of the border.
|
|
78
89
|
`),
|
|
79
|
-
border_color:
|
|
80
|
-
The color for the subtitle border. The
|
|
90
|
+
border_color: subtitleColorSchema.default('000000').describe(`
|
|
91
|
+
The color for the subtitle border. The default is opaque black. Only applies to burned subtitles.
|
|
92
|
+
|
|
93
|
+
${subtitleColorDescription}
|
|
81
94
|
`),
|
|
82
95
|
// TODO: Make font an enum
|
|
83
96
|
font: z
|
|
84
97
|
.string()
|
|
85
98
|
.default('Arial')
|
|
86
99
|
.describe(`
|
|
87
|
-
The font family to use. Also includes boldness and style of the font.
|
|
100
|
+
The font family to use. Also includes boldness and style of the font. With \`"style": "social"\`, the default is Poppins, using its ExtraBold weight for JSON captions. An explicit font overrides the style.
|
|
88
101
|
|
|
89
102
|
[Here](/docs/supported-formats/fonts/) is a list of all supported fonts.
|
|
90
103
|
`),
|
|
91
|
-
font_color:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
The color of the subtitle text in \`"rgb"\`, \`"rrggbb"\`, or \`"aarrggbb"\` format. If 8 hex digits are provided, the first two specify the alpha value of the color (\`"00"\` is fully opaque, \`"ff"\` is fully transparent).
|
|
104
|
+
font_color: subtitleColorSchema.default('FFFFFF').describe(`
|
|
105
|
+
The color of the subtitle text. Only applies to burned subtitles.
|
|
106
|
+
|
|
107
|
+
${subtitleColorDescription}
|
|
96
108
|
`),
|
|
97
109
|
font_size: z
|
|
98
110
|
.number()
|
|
@@ -100,13 +112,13 @@ The color of the subtitle text in \`"rgb"\`, \`"rrggbb"\`, or \`"aarrggbb"\` for
|
|
|
100
112
|
.min(1)
|
|
101
113
|
.default(16)
|
|
102
114
|
.describe(`
|
|
103
|
-
Specifies the size of the text.
|
|
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 54. Poppins capital letters are about 7.5% of the video height at this size. An explicit value overrides the style.
|
|
104
116
|
`),
|
|
105
117
|
bold: z
|
|
106
118
|
.boolean()
|
|
107
119
|
.default(false)
|
|
108
120
|
.describe(`
|
|
109
|
-
Specifies whether the subtitle text should be bold. Only applies to burned subtitles.
|
|
121
|
+
Specifies whether the subtitle text should be bold. Only applies to burned subtitles. With \`"style": "social"\`, the default is \`true\`; an explicit \`false\` overrides the style.
|
|
110
122
|
`),
|
|
111
123
|
italic: z
|
|
112
124
|
.boolean()
|
|
@@ -121,10 +133,10 @@ Specifies whether the subtitle text should be italic. Only applies to burned sub
|
|
|
121
133
|
.max(10))
|
|
122
134
|
.nullable()
|
|
123
135
|
.describe(`
|
|
124
|
-
Specifies the width of the text outline in
|
|
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"\`, about 3.7 pixels on a video 534 pixels high).
|
|
125
137
|
`),
|
|
126
138
|
position: positionSchema.default('bottom').describe(`
|
|
127
|
-
Specifies the position of the subtitles.
|
|
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.
|
|
128
140
|
`),
|
|
129
141
|
language: optionalWithV3Semantics(z
|
|
130
142
|
.string())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vimeo-import.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/vimeo-import.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpF,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAW1B,eAAO,MAAM,IAAI,EAAE,cAwBlB,CAAA;AAED,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"vimeo-import.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/vimeo-import.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpF,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAW1B,eAAO,MAAM,IAAI,EAAE,cAwBlB,CAAA;AAED,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqCpC,CAAA;AAEX,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC7F,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAElG,eAAO,MAAM,gDAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAE5D,CAAA;AACD,MAAM,MAAM,0CAA0C,GACpD,+CAA+C,CAAA;AAEjD,MAAM,MAAM,+CAA+C,GAAG,CAAC,CAAC,KAAK,CACnE,OAAO,gDAAgD,CACxD,CAAA;AAED,eAAO,MAAM,kDAAkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAU3D,CAAA;AAEJ,eAAO,MAAM,gEAAgE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAE5E,CAAA;AACD,MAAM,MAAM,0DAA0D,GAAG,CAAC,CAAC,KAAK,CAC9E,OAAO,gEAAgE,CACxE,CAAA;AACD,MAAM,MAAM,+DAA+D,GAAG,CAAC,CAAC,KAAK,CACnF,OAAO,gEAAgE,CACxE,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,OAAO,gDAAgD,EACvD,OAAO,gEAAgE,CAKxE,CAAA"}
|
|
@@ -59,7 +59,7 @@ You can also use an array of path strings here to import multiple paths in the s
|
|
|
59
59
|
rendition: z
|
|
60
60
|
.enum(['240p', '360p', '540p', '720p', '1080p', 'source'])
|
|
61
61
|
.default('720p')
|
|
62
|
-
.describe('The quality of the video to import.'),
|
|
62
|
+
.describe('The quality of the video to import. Use `source` for the original upload. Source availability depends on video permissions, your Vimeo account, the access token’s `video_files` scope, and whether Vimeo has retained the source file. The import fails with an error if the source file is unavailable.'),
|
|
63
63
|
})
|
|
64
64
|
.strict();
|
|
65
65
|
export const interpolatableRobotVimeoImportInstructionsSchema = interpolateRobot(robotVimeoImportInstructionsSchema);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RobotDefinitionWithHiddenFields, RobotMetaInput, RobotSchemaVariantTypes } from './_instructions-primitives.ts';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
export declare const meta: RobotMetaInput;
|
|
4
4
|
export declare const robotYoutubeStoreInstructionsSchema: z.ZodObject<{
|
|
@@ -38,30 +38,20 @@ export declare const robotYoutubeStoreInstructionsSchema: z.ZodObject<{
|
|
|
38
38
|
credentials: z.ZodString;
|
|
39
39
|
title: z.ZodString;
|
|
40
40
|
description: z.ZodString;
|
|
41
|
-
category: z.
|
|
42
|
-
"autos & vehicles": "autos & vehicles";
|
|
43
|
-
comedy: "comedy";
|
|
44
|
-
education: "education";
|
|
45
|
-
entertainment: "entertainment";
|
|
46
|
-
"film & animation": "film & animation";
|
|
47
|
-
gaming: "gaming";
|
|
48
|
-
"howto & style": "howto & style";
|
|
49
|
-
music: "music";
|
|
50
|
-
"news & politics": "news & politics";
|
|
51
|
-
"people & blogs": "people & blogs";
|
|
52
|
-
"pets & animals": "pets & animals";
|
|
53
|
-
"science & technology": "science & technology";
|
|
54
|
-
sports: "sports";
|
|
55
|
-
"travel & events": "travel & events";
|
|
56
|
-
}>>;
|
|
41
|
+
category: z.ZodType<"autos & vehicles" | "comedy" | "education" | "entertainment" | "film & animation" | "gaming" | "howto & style" | "music" | "news & politics" | "people & blogs" | "pets & animals" | "science & technology" | "sports" | "travel & events", unknown, z.core.$ZodTypeInternals<"autos & vehicles" | "comedy" | "education" | "entertainment" | "film & animation" | "gaming" | "howto & style" | "music" | "news & politics" | "people & blogs" | "pets & animals" | "science & technology" | "sports" | "travel & events", unknown>>;
|
|
57
42
|
keywords: z.ZodString;
|
|
58
|
-
visibility: z.ZodEnum<{
|
|
43
|
+
visibility: z.ZodDefault<z.ZodEnum<{
|
|
59
44
|
private: "private";
|
|
60
45
|
public: "public";
|
|
61
46
|
unlisted: "unlisted";
|
|
62
|
-
}
|
|
47
|
+
}>>;
|
|
63
48
|
}, z.core.$strict>;
|
|
64
|
-
|
|
49
|
+
declare const hiddenFields: {
|
|
50
|
+
access_token: z.ZodOptional<z.ZodString>;
|
|
51
|
+
credentials: z.ZodOptional<z.ZodString>;
|
|
52
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
53
|
+
};
|
|
54
|
+
export declare const robotDefinition: RobotDefinitionWithHiddenFields<typeof robotYoutubeStoreInstructionsSchema.shape, typeof hiddenFields>;
|
|
65
55
|
export declare const robotYoutubeStoreInstructionsWithHiddenFieldsSchema: z.ZodObject<{
|
|
66
56
|
interpolate: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
|
|
67
57
|
true: "true";
|
|
@@ -95,32 +85,19 @@ export declare const robotYoutubeStoreInstructionsWithHiddenFieldsSchema: z.ZodO
|
|
|
95
85
|
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
86
|
}, z.core.$strict>]>>;
|
|
97
87
|
robot: z.ZodLiteral<"/youtube/store">;
|
|
98
|
-
credentials: z.ZodString;
|
|
99
88
|
title: z.ZodString;
|
|
100
89
|
description: z.ZodString;
|
|
101
|
-
category: z.
|
|
102
|
-
"autos & vehicles": "autos & vehicles";
|
|
103
|
-
comedy: "comedy";
|
|
104
|
-
education: "education";
|
|
105
|
-
entertainment: "entertainment";
|
|
106
|
-
"film & animation": "film & animation";
|
|
107
|
-
gaming: "gaming";
|
|
108
|
-
"howto & style": "howto & style";
|
|
109
|
-
music: "music";
|
|
110
|
-
"news & politics": "news & politics";
|
|
111
|
-
"people & blogs": "people & blogs";
|
|
112
|
-
"pets & animals": "pets & animals";
|
|
113
|
-
"science & technology": "science & technology";
|
|
114
|
-
sports: "sports";
|
|
115
|
-
"travel & events": "travel & events";
|
|
116
|
-
}>>;
|
|
90
|
+
category: z.ZodType<"autos & vehicles" | "comedy" | "education" | "entertainment" | "film & animation" | "gaming" | "howto & style" | "music" | "news & politics" | "people & blogs" | "pets & animals" | "science & technology" | "sports" | "travel & events", unknown, z.core.$ZodTypeInternals<"autos & vehicles" | "comedy" | "education" | "entertainment" | "film & animation" | "gaming" | "howto & style" | "music" | "news & politics" | "people & blogs" | "pets & animals" | "science & technology" | "sports" | "travel & events", unknown>>;
|
|
117
91
|
keywords: z.ZodString;
|
|
118
|
-
visibility: z.ZodEnum<{
|
|
92
|
+
visibility: z.ZodDefault<z.ZodEnum<{
|
|
119
93
|
private: "private";
|
|
120
94
|
public: "public";
|
|
121
95
|
unlisted: "unlisted";
|
|
122
|
-
}
|
|
96
|
+
}>>;
|
|
123
97
|
result: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"debug">, z.ZodDefault<z.ZodBoolean>]>>;
|
|
98
|
+
access_token: z.ZodOptional<z.ZodString>;
|
|
99
|
+
credentials: z.ZodOptional<z.ZodString>;
|
|
100
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
124
101
|
}, z.core.$strict>, interpolatableRobotYoutubeStoreInstructionsSchema: z.ZodObject<{
|
|
125
102
|
interpolate: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
|
|
126
103
|
true: "true";
|
|
@@ -158,28 +135,13 @@ export declare const robotYoutubeStoreInstructionsWithHiddenFieldsSchema: z.ZodO
|
|
|
158
135
|
credentials: z.ZodString;
|
|
159
136
|
title: z.ZodString;
|
|
160
137
|
description: z.ZodString;
|
|
161
|
-
category: z.
|
|
162
|
-
"autos & vehicles": "autos & vehicles";
|
|
163
|
-
comedy: "comedy";
|
|
164
|
-
education: "education";
|
|
165
|
-
entertainment: "entertainment";
|
|
166
|
-
"film & animation": "film & animation";
|
|
167
|
-
gaming: "gaming";
|
|
168
|
-
"howto & style": "howto & style";
|
|
169
|
-
music: "music";
|
|
170
|
-
"news & politics": "news & politics";
|
|
171
|
-
"people & blogs": "people & blogs";
|
|
172
|
-
"pets & animals": "pets & animals";
|
|
173
|
-
"science & technology": "science & technology";
|
|
174
|
-
sports: "sports";
|
|
175
|
-
"travel & events": "travel & events";
|
|
176
|
-
}>>;
|
|
138
|
+
category: z.ZodType<"autos & vehicles" | "comedy" | "education" | "entertainment" | "film & animation" | "gaming" | "howto & style" | "music" | "news & politics" | "people & blogs" | "pets & animals" | "science & technology" | "sports" | "travel & events", unknown, z.core.$ZodTypeInternals<"autos & vehicles" | "comedy" | "education" | "entertainment" | "film & animation" | "gaming" | "howto & style" | "music" | "news & politics" | "people & blogs" | "pets & animals" | "science & technology" | "sports" | "travel & events", unknown>>;
|
|
177
139
|
keywords: z.ZodString;
|
|
178
|
-
visibility: z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
140
|
+
visibility: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
179
141
|
private: "private";
|
|
180
142
|
public: "public";
|
|
181
143
|
unlisted: "unlisted";
|
|
182
|
-
}>]
|
|
144
|
+
}>]>>;
|
|
183
145
|
}, z.core.$strict>, interpolatableRobotYoutubeStoreInstructionsWithHiddenFieldsSchema: z.ZodObject<{
|
|
184
146
|
interpolate: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
|
|
185
147
|
true: "true";
|
|
@@ -213,32 +175,19 @@ export declare const robotYoutubeStoreInstructionsWithHiddenFieldsSchema: z.ZodO
|
|
|
213
175
|
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
214
176
|
}, z.core.$strict>]>>;
|
|
215
177
|
robot: z.ZodLiteral<"/youtube/store">;
|
|
216
|
-
credentials: z.ZodString;
|
|
217
178
|
title: z.ZodString;
|
|
218
179
|
description: z.ZodString;
|
|
219
|
-
category: z.
|
|
220
|
-
"autos & vehicles": "autos & vehicles";
|
|
221
|
-
comedy: "comedy";
|
|
222
|
-
education: "education";
|
|
223
|
-
entertainment: "entertainment";
|
|
224
|
-
"film & animation": "film & animation";
|
|
225
|
-
gaming: "gaming";
|
|
226
|
-
"howto & style": "howto & style";
|
|
227
|
-
music: "music";
|
|
228
|
-
"news & politics": "news & politics";
|
|
229
|
-
"people & blogs": "people & blogs";
|
|
230
|
-
"pets & animals": "pets & animals";
|
|
231
|
-
"science & technology": "science & technology";
|
|
232
|
-
sports: "sports";
|
|
233
|
-
"travel & events": "travel & events";
|
|
234
|
-
}>>;
|
|
180
|
+
category: z.ZodType<"autos & vehicles" | "comedy" | "education" | "entertainment" | "film & animation" | "gaming" | "howto & style" | "music" | "news & politics" | "people & blogs" | "pets & animals" | "science & technology" | "sports" | "travel & events", unknown, z.core.$ZodTypeInternals<"autos & vehicles" | "comedy" | "education" | "entertainment" | "film & animation" | "gaming" | "howto & style" | "music" | "news & politics" | "people & blogs" | "pets & animals" | "science & technology" | "sports" | "travel & events", unknown>>;
|
|
235
181
|
keywords: z.ZodString;
|
|
236
|
-
visibility: z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
182
|
+
visibility: z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodEnum<{
|
|
237
183
|
private: "private";
|
|
238
184
|
public: "public";
|
|
239
185
|
unlisted: "unlisted";
|
|
240
|
-
}>]
|
|
186
|
+
}>]>>;
|
|
241
187
|
result: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodString, z.ZodLiteral<"debug">]>, z.ZodPrefault<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>]>>;
|
|
188
|
+
access_token: z.ZodOptional<z.ZodString>;
|
|
189
|
+
credentials: z.ZodOptional<z.ZodString>;
|
|
190
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
242
191
|
}, z.core.$strict>;
|
|
243
192
|
type Instructions = RobotSchemaVariantTypes<typeof robotDefinition>;
|
|
244
193
|
export type RobotYoutubeStoreInstructions = Instructions['output'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"youtube-store.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/youtube-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"youtube-store.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/youtube-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,+BAA+B,EAC/B,cAAc,EACd,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAgB1B,eAAO,MAAM,IAAI,EAAE,cAiBlB,CAAA;AAED,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoDrC,CAAA;AAIX,QAAA,MAAM,YAAY;;;;CAIjB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,+BAA+B,CAC3D,OAAO,mCAAmC,CAAC,KAAK,EAChD,OAAO,YAAY,CACmE,CAAA;AAExF,eAAO,MACa,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBACrD,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBACjC,iEAAiE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAChF,CAAA;AAEnB,KAAK,YAAY,GAAG,uBAAuB,CAAC,OAAO,eAAe,CAAC,CAAA;AAEnE,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AAClE,MAAM,MAAM,6CAA6C,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA;AACxF,MAAM,MAAM,2CAA2C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AAC7F,MAAM,MAAM,gDAAgD,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AAClG,MAAM,MAAM,2DAA2D,GACrE,YAAY,CAAC,4BAA4B,CAAC,CAAA;AAC5C,MAAM,MAAM,gEAAgE,GAC1E,YAAY,CAAC,2BAA2B,CAAC,CAAA"}
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
+
import { optionalWithV3Semantics } from "../lib/sdkZodOptional.js";
|
|
1
2
|
import { z } from 'zod/v4';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
'autos & vehicles',
|
|
6
|
-
'comedy',
|
|
7
|
-
'education',
|
|
8
|
-
'entertainment',
|
|
9
|
-
'film & animation',
|
|
10
|
-
'gaming',
|
|
11
|
-
'howto & style',
|
|
12
|
-
'music',
|
|
13
|
-
'news & politics',
|
|
14
|
-
'people & blogs',
|
|
15
|
-
'pets & animals',
|
|
16
|
-
'science & technology',
|
|
17
|
-
'sports',
|
|
18
|
-
'travel & events',
|
|
19
|
-
];
|
|
20
|
-
function asciiCaseInsensitiveLiteral(value) {
|
|
21
|
-
return [...value]
|
|
22
|
-
.map((character) => character >= 'a' && character <= 'z' ? `[${character}${character.toUpperCase()}]` : character)
|
|
23
|
-
.join('');
|
|
24
|
-
}
|
|
3
|
+
import { zodCaseInsensitiveEnum, zodCodePointLength } from "../lib/zodInputSemantics.js";
|
|
4
|
+
import { youtubeCategories } from "../youtubeCategories.js";
|
|
5
|
+
import { createProcessingExample, defineRobotWithHiddenFields, robotBase, robotStoreMeta, robotUse, } from "./_instructions-primitives.js";
|
|
25
6
|
const youtubeCategoryValueSchema = z.enum(youtubeCategories);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.regex(new RegExp(`^(?:${youtubeCategories.map(asciiCaseInsensitiveLiteral).join('|')})$`, 'u'));
|
|
29
|
-
const youtubeCategorySchema = zodWithJsonInputSchema(z.preprocess((value) => (typeof value === 'string' ? value.toLowerCase() : value), youtubeCategoryValueSchema), youtubeCategoryInputSchema);
|
|
7
|
+
// Preserve the existing SDK input type for this already-preprocessed field.
|
|
8
|
+
const youtubeCategorySchema = zodCaseInsensitiveEnum(youtubeCategoryValueSchema);
|
|
30
9
|
export const meta = {
|
|
31
10
|
...robotStoreMeta,
|
|
32
11
|
hideCredentialsWarning: true,
|
|
@@ -90,10 +69,20 @@ The category to which this video will be assigned.
|
|
|
90
69
|
keywords: z.string().describe(`
|
|
91
70
|
Tags used to describe the video, separated by commas. These tags will also be displayed on YouTube.
|
|
92
71
|
`),
|
|
93
|
-
visibility: z
|
|
72
|
+
visibility: z
|
|
73
|
+
.enum(['public', 'private', 'unlisted'])
|
|
74
|
+
.default('public')
|
|
75
|
+
.describe(`
|
|
94
76
|
Defines the visibility of the uploaded video.
|
|
95
77
|
`),
|
|
96
78
|
})
|
|
97
79
|
.strict();
|
|
98
|
-
|
|
80
|
+
// Credential alternatives stay optional while Templates and Assembly overrides are merged.
|
|
81
|
+
// YoutubeStoreRobot validates the resolved tokens after credential injection.
|
|
82
|
+
const hiddenFields = {
|
|
83
|
+
access_token: optionalWithV3Semantics(z.string()),
|
|
84
|
+
credentials: optionalWithV3Semantics(robotYoutubeStoreInstructionsSchema.shape.credentials),
|
|
85
|
+
refresh_token: optionalWithV3Semantics(z.string()),
|
|
86
|
+
};
|
|
87
|
+
export const robotDefinition = defineRobotWithHiddenFields(meta, robotYoutubeStoreInstructionsSchema, hiddenFields);
|
|
99
88
|
export const { withHiddenFields: robotYoutubeStoreInstructionsWithHiddenFieldsSchema, interpolatable: interpolatableRobotYoutubeStoreInstructionsSchema, interpolatableWithHiddenFields: interpolatableRobotYoutubeStoreInstructionsWithHiddenFieldsSchema, } = robotDefinition;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** YouTube upload categories shared by authored instructions and execution. */
|
|
2
|
+
export declare const youtubeCategoryIds: {
|
|
3
|
+
'autos & vehicles': string;
|
|
4
|
+
comedy: string;
|
|
5
|
+
education: string;
|
|
6
|
+
entertainment: string;
|
|
7
|
+
'film & animation': string;
|
|
8
|
+
gaming: string;
|
|
9
|
+
'howto & style': string;
|
|
10
|
+
music: string;
|
|
11
|
+
'news & politics': string;
|
|
12
|
+
'people & blogs': string;
|
|
13
|
+
'pets & animals': string;
|
|
14
|
+
'science & technology': string;
|
|
15
|
+
sports: string;
|
|
16
|
+
'travel & events': string;
|
|
17
|
+
};
|
|
18
|
+
/** Canonical category spellings; authoring and execution also accept case variants. */
|
|
19
|
+
export declare const youtubeCategories: [keyof typeof youtubeCategoryIds, ...(keyof typeof youtubeCategoryIds)[]];
|
|
20
|
+
//# sourceMappingURL=youtubeCategories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"youtubeCategories.d.ts","sourceRoot":"","sources":["../../src/v4/youtubeCategories.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;CAeG,CAAA;AAElC,uFAAuF;AAEvF,eAAO,MAAM,iBAAiB,EAAsC,CAClE,MAAM,OAAO,kBAAkB,EAC/B,GAAG,CAAC,MAAM,OAAO,kBAAkB,CAAC,EAAE,CACvC,CAAA"}
|