@transloadit/node 6.2.2 → 6.4.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.
Files changed (63) hide show
  1. package/dist/alphalib/types/builtinTemplates.d.ts +7 -0
  2. package/dist/alphalib/types/builtinTemplates.d.ts.map +1 -1
  3. package/dist/alphalib/types/builtinTemplates.js +16 -0
  4. package/dist/alphalib/types/builtinTemplates.js.map +1 -1
  5. package/dist/alphalib/types/robots/_html-pdf.d.ts +3 -0
  6. package/dist/alphalib/types/robots/_html-pdf.d.ts.map +1 -0
  7. package/dist/alphalib/types/robots/_html-pdf.js +3 -0
  8. package/dist/alphalib/types/robots/_html-pdf.js.map +1 -0
  9. package/dist/alphalib/types/robots/_video-generate-description.d.ts +3 -0
  10. package/dist/alphalib/types/robots/_video-generate-description.d.ts.map +1 -0
  11. package/dist/alphalib/types/robots/_video-generate-description.js +3 -0
  12. package/dist/alphalib/types/robots/_video-generate-description.js.map +1 -0
  13. package/dist/alphalib/types/robots/cloudflare-store.d.ts +12 -0
  14. package/dist/alphalib/types/robots/cloudflare-store.d.ts.map +1 -1
  15. package/dist/alphalib/types/robots/cloudflare-store.js +20 -0
  16. package/dist/alphalib/types/robots/cloudflare-store.js.map +1 -1
  17. package/dist/alphalib/types/robots/document-convert.d.ts.map +1 -1
  18. package/dist/alphalib/types/robots/document-convert.js +3 -0
  19. package/dist/alphalib/types/robots/document-convert.js.map +1 -1
  20. package/dist/alphalib/types/robots/html-convert.d.ts.map +1 -1
  21. package/dist/alphalib/types/robots/html-convert.js +3 -0
  22. package/dist/alphalib/types/robots/html-convert.js.map +1 -1
  23. package/dist/alphalib/types/robots/s3-store.d.ts +8 -8
  24. package/dist/alphalib/types/robots/s3-store.d.ts.map +1 -1
  25. package/dist/alphalib/types/robots/s3-store.js +27 -1
  26. package/dist/alphalib/types/robots/s3-store.js.map +1 -1
  27. package/dist/alphalib/types/robots/text-speak.d.ts.map +1 -1
  28. package/dist/alphalib/types/robots/text-speak.js +0 -24
  29. package/dist/alphalib/types/robots/text-speak.js.map +1 -1
  30. package/dist/alphalib/types/robots/text-translate.d.ts.map +1 -1
  31. package/dist/alphalib/types/robots/text-translate.js +0 -13
  32. package/dist/alphalib/types/robots/text-translate.js.map +1 -1
  33. package/dist/alphalib/types/robots/video-encode.d.ts.map +1 -1
  34. package/dist/alphalib/types/robots/video-encode.js +2 -0
  35. package/dist/alphalib/types/robots/video-encode.js.map +1 -1
  36. package/dist/alphalib/types/robots/video-generate.d.ts.map +1 -1
  37. package/dist/alphalib/types/robots/video-generate.js +15 -25
  38. package/dist/alphalib/types/robots/video-generate.js.map +1 -1
  39. package/dist/alphalib/types/robots/video-subtitle.d.ts.map +1 -1
  40. package/dist/alphalib/types/robots/video-subtitle.js +2 -0
  41. package/dist/alphalib/types/robots/video-subtitle.js.map +1 -1
  42. package/dist/alphalib/types/robots/video-thumbs.d.ts.map +1 -1
  43. package/dist/alphalib/types/robots/video-thumbs.js +2 -0
  44. package/dist/alphalib/types/robots/video-thumbs.js.map +1 -1
  45. package/dist/alphalib/types/template.d.ts +18 -0
  46. package/dist/alphalib/types/template.d.ts.map +1 -1
  47. package/dist/alphalib/types/template.js +19 -0
  48. package/dist/alphalib/types/template.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/alphalib/types/builtinTemplates.ts +17 -0
  51. package/src/alphalib/types/robots/_html-pdf.ts +3 -0
  52. package/src/alphalib/types/robots/_video-generate-description.ts +2 -0
  53. package/src/alphalib/types/robots/cloudflare-store.ts +20 -0
  54. package/src/alphalib/types/robots/document-convert.ts +3 -0
  55. package/src/alphalib/types/robots/html-convert.ts +3 -0
  56. package/src/alphalib/types/robots/s3-store.ts +27 -1
  57. package/src/alphalib/types/robots/text-speak.ts +0 -24
  58. package/src/alphalib/types/robots/text-translate.ts +0 -13
  59. package/src/alphalib/types/robots/video-encode.ts +2 -0
  60. package/src/alphalib/types/robots/video-generate.ts +15 -27
  61. package/src/alphalib/types/robots/video-subtitle.ts +2 -0
  62. package/src/alphalib/types/robots/video-thumbs.ts +2 -0
  63. package/src/alphalib/types/template.ts +30 -0
@@ -26,19 +26,6 @@ export const meta: RobotMetaInput = {
26
26
  extended_description: `
27
27
  > [!Warning]
28
28
  > This <dfn>Robot</dfn> uses third-party AI services. They may tweak their models over time, giving different responses for the same input media. Avoid relying on exact responses in your tests and application.
29
-
30
- ## Supported languages
31
-
32
- {%- for provider in text_translate_languages %}
33
-
34
- ### {{provider[0] | upcase }}
35
-
36
- <!-- prettier-ignore -->
37
- {%- for language in provider[1] %}
38
- {{ language }}{% unless forloop.last %},{% endunless %}
39
- {%- endfor %}
40
-
41
- {%- endfor %}
42
29
  `,
43
30
  override_lvl1: 'Artificial Intelligence',
44
31
  purpose_sentence: 'translates text in documents',
@@ -45,6 +45,8 @@ Videos recorded with iPhone spatial audio can contain a stereo AAC track alongsi
45
45
 
46
46
  Files containing only unsupported audio still fail. Individual audio track selections and stream-copy requests keep the tracks you select; the output format must support copied tracks.
47
47
 
48
+ When adding watermarks or drawing with simple FFmpeg video filters such as \`drawtext\` to HLG or PQ HDR video, the video is tone-mapped to SDR BT.709 before drawing, so overlay colors retain their intended RGB values. SDR inputs keep their existing processing. A custom \`ffmpeg.pre:filter:v\` that supplies tone mapping controls its own color conversion. Custom multi-input \`filter_complex\` graphs must handle each input’s color space explicitly.
49
+
48
50
  ## Adding text overlays with FFmpeg
49
51
 
50
52
  You can add text overlays to videos using FFmpeg's \`drawtext\` filter through this <dfn>Robot</dfn>'s \`ffmpeg\` parameter. Here are two examples — one with the default font and one with a custom font family name:
@@ -11,6 +11,7 @@ import {
11
11
  robotParameterDocs,
12
12
  robotUse,
13
13
  } from './_instructions-primitives.ts'
14
+ import { videoGenerationParameterEnforcementDate } from './_video-generate-description.ts'
14
15
 
15
16
  export const meta: RobotMetaInput = {
16
17
  ...robotArtificialIntelligenceMeta,
@@ -19,8 +20,6 @@ export const meta: RobotMetaInput = {
19
20
  generated_video: {
20
21
  robot: '/video/generate',
21
22
  prompt: 'A slow cinematic drone shot of ocean cliffs at sunrise, realistic lighting.',
22
- duration: 5,
23
- aspect_ratio: '16:9',
24
23
  format: 'mp4',
25
24
  },
26
25
  },
@@ -46,15 +45,18 @@ export const robotVideoGenerateInstructionsSchema = robotBase
46
45
  .string()
47
46
  .optional()
48
47
  .describe(
49
- `The AI model to use for video generation. Defaults to ${videoGenerateDefaultModelIdentifier}.`,
48
+ `Video model; defaults to ${videoGenerateDefaultModelIdentifier}. Unsupported settings warn until ${videoGenerationParameterEnforcementDate}. MiniMax outputs are about six seconds.`,
50
49
  ),
51
50
  prompt: z.string().describe('The prompt describing the desired video content.'),
52
51
  format: z.enum(['mp4']).optional().describe('Format of the generated video.'),
53
52
  seed: z.number().optional().describe(robotParameterDocs.seed.description),
54
- aspect_ratio: z.string().optional().describe('Aspect ratio of the generated video.'),
55
- height: z.number().optional().describe('Height of the generated video.'),
56
- width: z.number().optional().describe('Width of the generated video.'),
57
- style: z.string().optional().describe('Style of the generated video.'),
53
+ aspect_ratio: z
54
+ .string()
55
+ .optional()
56
+ .describe('Aspect ratio for lightricks/ltx-video without an input image.'),
57
+ height: z.number().optional().describe('Pixel height for tencent/hunyuan-video.'),
58
+ width: z.number().optional().describe('Pixel width for tencent/hunyuan-video.'),
59
+ style: z.string().optional().describe('Unsupported by current models; omit it.'),
58
60
  num_outputs: z
59
61
  .number()
60
62
  .int()
@@ -62,26 +64,12 @@ export const robotVideoGenerateInstructionsSchema = robotBase
62
64
  .max(10)
63
65
  .optional()
64
66
  .describe('Number of video variants to generate.'),
65
- duration: z.number().optional().describe('Duration of the generated video in seconds.'),
66
- fps: z.number().optional().describe('Frames per second of the output video.'),
67
- motion_amount: z
68
- .number()
69
- .optional()
70
- .describe('Controls the intensity of motion in the generated video.'),
71
- camera_motion: z
72
- .string()
73
- .optional()
74
- .describe(
75
- 'Camera movement type (e.g., pan-left, pan-right, zoom-in, zoom-out, orbit, static, dolly, crane).',
76
- ),
77
- negative_prompt: z
78
- .string()
79
- .optional()
80
- .describe('Describes what should be avoided in the generated video.'),
81
- reference_strength: z
82
- .number()
83
- .optional()
84
- .describe('How closely the output should follow the reference input (0.0 - 1.0).'),
67
+ duration: z.number().optional().describe('Unsupported by current models; omit it.'),
68
+ fps: z.number().optional().describe('Frames per second for tencent/hunyuan-video.'),
69
+ motion_amount: z.number().optional().describe('Unsupported by current models; omit it.'),
70
+ camera_motion: z.string().optional().describe('Unsupported by current models; omit it.'),
71
+ negative_prompt: z.string().optional().describe('Content to avoid (lightricks/ltx-video).'),
72
+ reference_strength: z.number().optional().describe('Unsupported by current models; omit it.'),
85
73
  })
86
74
  .strict()
87
75
 
@@ -77,6 +77,8 @@ export const robotVideoSubtitleInstructionsSchema = robotBase
77
77
  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.
78
78
 
79
79
  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.
80
+
81
+ When burning subtitles into HLG or PQ HDR video, the video is tone-mapped to SDR BT.709 before captions are drawn. Caption colors retain their intended RGB values, and the output is tagged as SDR. External subtitles preserve the source video’s HDR colors. SDR inputs keep their existing processing. If \`ffmpeg.pre:filter:v\` supplies its own tone mapping, that filter controls color conversion.
80
82
  `),
81
83
  subtitles_type: zodInputPreservingTransform(z.enum(['burned', 'external', 'burn']), (val) =>
82
84
  val === 'burn' ? 'burned' : val,
@@ -70,6 +70,8 @@ export const robotVideoThumbsInstructionsSchema = robotBase
70
70
  robot: z.literal('/video/thumbs').describe(`
71
71
  Set \`smart: true\` to select strong preview images with AI instead of taking frames only at regular intervals. The Robot scores candidate frames for clarity, brightness, composition, faces, expressions, action, and visual interest, then returns the best \`count\` frames in chronological order. Smart results include \`file.meta.smart_score\` and \`file.meta.smart_reasons\`. If AI scoring is unavailable, the Assembly continues with the candidate frames in fallback order and includes a warning. No AI credentials are required.
72
72
 
73
+ HLG and PQ HDR video frames are tone-mapped to SDR sRGB before image encoding, including smart-thumbnail candidates. This preserves the intended appearance in browsers that display thumbnails as sRGB images. SDR inputs keep their existing processing.
74
+
73
75
  ## AI pricing
74
76
 
75
77
  Regular \`/video/thumbs\` processing charges still apply. AI frame analysis is billed separately at the underlying provider cost plus a ${smartThumbnailMarkupPercent}% Transloadit markup. Smart selection uses the dedicated \`${smartThumbnailModel}\` vision model with \`${smartThumbnailReasoningEffort}\` reasoning, independently of the \`/ai/chat\` default. The exact AI charge varies with the number of candidate frames and provider pricing.
@@ -172,14 +172,44 @@ const assemblyInstructionsSharedShape = {
172
172
  template_id: templateIdSchema,
173
173
  } as const
174
174
 
175
+ /** Most URLs one Assembly may import through `input_url`. */
176
+ export const assemblyInputUrlMaxCount = 10
177
+ /** Longest URL `input_url` accepts, in Unicode code points. */
178
+ export const assemblyInputUrlMaxLength = 4096
179
+
180
+ /** One `input_url` entry; API2 additionally requires a literal absolute HTTP(S) URL. */
181
+ export const assemblyInputUrlValueSchema = z
182
+ .string()
183
+ .min(1)
184
+ .refine(
185
+ (value) => [...value].length <= assemblyInputUrlMaxLength,
186
+ `Must be at most ${assemblyInputUrlMaxLength} characters`,
187
+ )
188
+
189
+ // Request-only: Template content cannot declare it, so it stays out of the shared shape.
190
+ const assemblyInputUrlSchema = z
191
+ .union([
192
+ assemblyInputUrlValueSchema,
193
+ z.array(assemblyInputUrlValueSchema).min(1).max(assemblyInputUrlMaxCount),
194
+ ])
195
+ .optional()
196
+ .describe(
197
+ `One HTTP(S) URL, or a list of up to ${assemblyInputUrlMaxCount}, that Transloadit downloads as the input files of the Builtin Template selected with \`template_id\`, instead of your client uploading them. Only Builtin Templates that accept an input file support it, and the request must be signed or Bearer-authenticated. It cannot be combined with \`steps\` or with uploads. URLs are used literally: they must be absolute, at most ${assemblyInputUrlMaxLength} characters, and must not contain whitespace, \`|\` or Assembly variables such as \`\${fields.url}\`. Private-network addresses are refused.`,
198
+ )
199
+
200
+ /** URLs a request imports as a Builtin Template's input files. */
201
+ export type AssemblyInputUrl = z.input<typeof assemblyInputUrlSchema>
202
+
175
203
  export const assemblyInstructionsSchema = z.object({
176
204
  auth: assemblyAuthInstructionsSchema.optional(),
177
205
  ...assemblyInstructionsSharedShape,
206
+ input_url: assemblyInputUrlSchema,
178
207
  })
179
208
 
180
209
  export const assemblyInstructionsSchemaWithRequiredAuth = z.object({
181
210
  auth: assemblyAuthInstructionsSchema,
182
211
  ...assemblyInstructionsSharedShape,
212
+ input_url: assemblyInputUrlSchema,
183
213
  })
184
214
 
185
215
  export type AssemblyInstructions = z.infer<typeof assemblyInstructionsSchema>