Skip to content

Commit 5cc5080

Browse files
committed
Sync alphalib
1 parent 542ce00 commit 5cc5080

File tree

10 files changed

+9
-20
lines changed

10 files changed

+9
-20
lines changed

src/alphalib/types/robots/_instructions-primitives.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ export const ffmpegPresetSchema = z
287287

288288
export type FfmpegPreset = z.infer<typeof ffmpegPresetSchema>
289289

290-
export const ffmpegStackVersionSchema = z.enum(['v5.0.0', 'v6.0.0']).default('v5.0.0').describe(`
290+
export const ffmpegStackVersionSchema = z
291+
// Any semver in range is allowed and normalized. The enum is used for editor completions.
292+
.union([z.enum(['v5', 'v6']), z.string().regex(/^v?[56](\.\d+)?(\.\d+)?$/)])
293+
.default('v5.0.0').describe(`
291294
Selects the FFmpeg stack version to use for encoding. These versions reflect real FFmpeg versions. We currently recommend to use "v6.0.0".
292295
`)
293296

@@ -390,7 +393,10 @@ export const optimize_priority = z
390393
.enum(['compression-ratio', 'conversion-speed'])
391394
.default('conversion-speed')
392395

393-
export const imagemagickStackVersionSchema = z.enum(['v2.0.10', 'v3.0.1']).default('v2.0.10')
396+
export const imagemagickStackVersionSchema = z
397+
// Any semver in range is allowed and normalized. The enum is used for editor completions.
398+
.union([z.enum(['v2', 'v3']), z.string().regex(/^v?[23](\.\d+)?(\.\d+)?$/)])
399+
.default('v2')
394400
export type ImagemagickStackVersion = z.infer<typeof imagemagickStackVersionSchema>
395401

396402
export const colorspaceSchema = z.enum([

src/alphalib/types/robots/audio-artwork.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export const meta: RobotMeta = {
1313
artwork_extracted: {
1414
robot: '/audio/artwork',
1515
use: ':original',
16-
// @ts-expect-error Discuss and resolve interpolation.
1716
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
1817
},
1918
},

src/alphalib/types/robots/audio-concat.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export const meta: RobotMeta = {
2727
{ name: ':original', fields: 'third_audio_file', as: 'audio_3' },
2828
],
2929
},
30-
// @ts-expect-error Discuss and resolve interpolation.
3130
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
3231
},
3332
},

src/alphalib/types/robots/audio-encode.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const meta: RobotMeta = {
2323
use: ':original',
2424
preset: 'mp3',
2525
bitrate: 256000,
26-
// @ts-expect-error Discuss and resolve interpolation.
2726
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
2827
},
2928
},

src/alphalib/types/robots/audio-loop.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const meta: RobotMeta = {
2222
robot: '/audio/loop',
2323
use: ':original',
2424
duration: 300,
25-
// @ts-expect-error Discuss and resolve interpolation.
2625
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
2726
},
2827
},
@@ -53,7 +52,7 @@ export const robotAudioLoopInstructionsSchema = z
5352
robot: z.literal('/audio/loop'),
5453
use: useParamSchema.optional(),
5554
output_meta: outputMetaParamSchema,
56-
preset: preset.describe(`
55+
preset: preset.optional().describe(`
5756
Performs conversion using pre-configured settings.
5857
5958
If you specify your own FFmpeg parameters using the <dfn>Robot</dfn>'s \`ffmpeg\` parameter and you have not specified a preset, then the default \`mp3\` preset is not applied. This is to prevent you from having to override each of the \`mp3\` preset's values manually.

src/alphalib/types/robots/audio-merge.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export const meta: RobotMeta = {
2828
{ name: ':original', fields: 'third_audio_file', as: 'audio' },
2929
],
3030
},
31-
// @ts-expect-error Discuss and resolve interpolation.
3231
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
3332
},
3433
},

src/alphalib/types/robots/meta-write.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const meta: RobotMeta = {
2020
data_to_write: {
2121
copyright: '© Transloadit',
2222
},
23-
// @ts-expect-error Discuss and resolve interpolation.
2423
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
2524
},
2625
},

src/alphalib/types/robots/video-adaptive.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useParamSchema } from './_instructions-primitives.ts'
44
import type { RobotMeta } from './_instructions-primitives.ts'
55

66
export const meta: RobotMeta = {
7-
allowed_for_free_plans: true,
87
allowed_for_url_transform: false,
98
bytescount: Infinity,
109
discount_factor: 1,
@@ -18,21 +17,18 @@ export const meta: RobotMeta = {
1817
robot: '/video/encode',
1918
use: ':original',
2019
preset: 'hls/480p',
21-
// @ts-expect-error Discuss and resolve interpolation.
2220
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
2321
},
2422
encoded_720p: {
2523
robot: '/video/encode',
2624
use: ':original',
2725
preset: 'hls/720p',
28-
// @ts-expect-error Discuss and resolve interpolation.
2926
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
3027
},
3128
encoded_1080p: {
3229
robot: '/video/encode',
3330
use: ':original',
3431
preset: 'hls/1080p',
35-
// @ts-expect-error Discuss and resolve interpolation.
3632
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
3733
},
3834
hls_bundled: {
@@ -49,7 +45,6 @@ export const meta: RobotMeta = {
4945
example_code_description:
5046
'Implementing HTTP Live Streaming: encode the uploaded video into three versions, then cut them into several segments and generate playlist files containing all the segments:',
5147
minimum_charge: 0,
52-
old_title: 'The /video/adaptive Robot',
5348
output_factor: 1.2,
5449
override_lvl1: 'Video Encoding',
5550
purpose_sentence:

src/alphalib/types/robots/video-subtitle.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
import type { RobotMeta } from './_instructions-primitives.ts'
1414

1515
export const meta: RobotMeta = {
16-
allowed_for_free_plans: true,
1716
allowed_for_url_transform: false,
1817
bytescount: 1,
1918
discount_factor: 1,
@@ -28,15 +27,13 @@ export const meta: RobotMeta = {
2827
{ name: ':original', fields: 'input_srt', as: 'subtitles' },
2928
],
3029
},
31-
// @ts-expect-error Discuss and resolve interpolation.
3230
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
3331
},
3432
},
3533
},
3634
example_code_description:
3735
'If you have two file input fields in a form — one for a video and another for an SRT or VTT subtitle, named `input_video` and `input_srt` respectively (with the HTML `name` attribute), hereʼs how to embed the subtitles into the video with Transloadit:',
3836
minimum_charge: 0,
39-
old_title: 'The /video/subtitle Robot',
4037
output_factor: 0.6,
4138
override_lvl1: 'Video Encoding',
4239
purpose_sentence: 'adds subtitles and closed captions to videos',

src/alphalib/types/robots/video-thumbs.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
import type { RobotMeta } from './_instructions-primitives.ts'
1212

1313
export const meta: RobotMeta = {
14-
allowed_for_free_plans: true,
1514
allowed_for_url_transform: false,
1615
bytescount: 10,
1716
discount_factor: 0.1,
@@ -23,14 +22,12 @@ export const meta: RobotMeta = {
2322
robot: '/video/thumbs',
2423
use: ':original',
2524
count: 10,
26-
// @ts-expect-error Discuss and resolve interpolation.
2725
ffmpeg_stack: '{{ stacks.ffmpeg.recommended_version }}',
2826
},
2927
},
3028
},
3129
example_code_description: 'Extract 10 thumbnails from each uploaded video:',
3230
minimum_charge: 0,
33-
old_title: 'The /video/thumbs Robot',
3431
output_factor: 0.05,
3532
override_lvl1: 'Video Encoding',
3633
purpose_sentence: 'extracts any number of images from videos for use as previews',

0 commit comments

Comments
 (0)