@transloadit/node 4.10.6 → 4.10.8

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 (49) hide show
  1. package/dist/alphalib/object.d.ts +3 -0
  2. package/dist/alphalib/object.d.ts.map +1 -1
  3. package/dist/alphalib/object.js +11 -0
  4. package/dist/alphalib/object.js.map +1 -1
  5. package/dist/alphalib/types/assemblyStatus.d.ts +8572 -4
  6. package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -1
  7. package/dist/alphalib/types/assemblyStatus.js +17 -0
  8. package/dist/alphalib/types/assemblyStatus.js.map +1 -1
  9. package/dist/alphalib/types/robots/_instructions-primitives.d.ts +14 -9
  10. package/dist/alphalib/types/robots/_instructions-primitives.d.ts.map +1 -1
  11. package/dist/alphalib/types/robots/_instructions-primitives.js +34 -36
  12. package/dist/alphalib/types/robots/_instructions-primitives.js.map +1 -1
  13. package/dist/alphalib/types/robots/assembly-savejson.d.ts +79 -0
  14. package/dist/alphalib/types/robots/assembly-savejson.d.ts.map +1 -1
  15. package/dist/alphalib/types/robots/assembly-savejson.js +7 -0
  16. package/dist/alphalib/types/robots/assembly-savejson.js.map +1 -1
  17. package/dist/alphalib/types/robots/file-filter.d.ts +2 -0
  18. package/dist/alphalib/types/robots/file-filter.d.ts.map +1 -1
  19. package/dist/alphalib/types/robots/file-filter.js +2 -1
  20. package/dist/alphalib/types/robots/file-filter.js.map +1 -1
  21. package/dist/alphalib/types/robots/http-import.d.ts +12 -0
  22. package/dist/alphalib/types/robots/http-import.d.ts.map +1 -1
  23. package/dist/alphalib/types/robots/http-import.js +8 -0
  24. package/dist/alphalib/types/robots/http-import.js.map +1 -1
  25. package/dist/alphalib/types/robots/image-facedetect.d.ts +28 -0
  26. package/dist/alphalib/types/robots/image-facedetect.d.ts.map +1 -1
  27. package/dist/alphalib/types/robots/image-facedetect.js +19 -1
  28. package/dist/alphalib/types/robots/image-facedetect.js.map +1 -1
  29. package/dist/alphalib/types/robots/speech-transcribe.d.ts +38 -8
  30. package/dist/alphalib/types/robots/speech-transcribe.d.ts.map +1 -1
  31. package/dist/alphalib/types/robots/speech-transcribe.js +60 -5
  32. package/dist/alphalib/types/robots/speech-transcribe.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/tus.d.ts.map +1 -1
  37. package/dist/tus.js +5 -0
  38. package/dist/tus.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/alphalib/object.ts +26 -0
  41. package/src/alphalib/types/assemblyStatus.ts +20 -0
  42. package/src/alphalib/types/robots/_instructions-primitives.ts +63 -56
  43. package/src/alphalib/types/robots/assembly-savejson.ts +21 -0
  44. package/src/alphalib/types/robots/file-filter.ts +12 -1
  45. package/src/alphalib/types/robots/http-import.ts +8 -0
  46. package/src/alphalib/types/robots/image-facedetect.ts +24 -1
  47. package/src/alphalib/types/robots/speech-transcribe.ts +60 -5
  48. package/src/alphalib/types/robots/video-encode.ts +2 -0
  49. package/src/tus.ts +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transloadit/node",
3
- "version": "4.10.6",
3
+ "version": "4.10.8",
4
4
  "description": "Node.js SDK for Transloadit",
5
5
  "homepage": "https://github.com/transloadit/node-sdk/tree/main/packages/node",
6
6
  "bugs": {
@@ -35,16 +35,42 @@ export function getRecordProperty(value: unknown, property: PropertyKey): unknow
35
35
  return value[property]
36
36
  }
37
37
 
38
+ export function getNestedRecordProperty(
39
+ value: unknown,
40
+ first: PropertyKey,
41
+ second: PropertyKey,
42
+ ): unknown {
43
+ return getRecordProperty(getRecordProperty(value, first), second)
44
+ }
45
+
38
46
  export function getStringProperty(value: unknown, property: PropertyKey): string | undefined {
39
47
  const propertyValue = getRecordProperty(value, property)
40
48
  return typeof propertyValue === 'string' ? propertyValue : undefined
41
49
  }
42
50
 
51
+ export function getNestedStringProperty(
52
+ value: unknown,
53
+ first: PropertyKey,
54
+ second: PropertyKey,
55
+ ): string | undefined {
56
+ const propertyValue = getNestedRecordProperty(value, first, second)
57
+ return typeof propertyValue === 'string' ? propertyValue : undefined
58
+ }
59
+
43
60
  export function getNumberProperty(value: unknown, property: PropertyKey): number | undefined {
44
61
  const propertyValue = getRecordProperty(value, property)
45
62
  return typeof propertyValue === 'number' ? propertyValue : undefined
46
63
  }
47
64
 
65
+ export function getNestedNumberProperty(
66
+ value: unknown,
67
+ first: PropertyKey,
68
+ second: PropertyKey,
69
+ ): number | undefined {
70
+ const propertyValue = getNestedRecordProperty(value, first, second)
71
+ return typeof propertyValue === 'number' ? propertyValue : undefined
72
+ }
73
+
48
74
  /**
49
75
  * Returns properly typed entries of an object
50
76
  */
@@ -7,6 +7,7 @@ export const assemblyBusyCodeSchema = z.enum([
7
7
  'ASSEMBLY_EXECUTING',
8
8
  'ASSEMBLY_REPLAYING',
9
9
  ])
10
+ export type AssemblyBusyCode = z.infer<typeof assemblyBusyCodeSchema>
10
11
 
11
12
  export const assemblyStatusOkCodeSchema = z.enum([
12
13
  'ASSEMBLY_CANCELED',
@@ -19,6 +20,7 @@ export const assemblyStatusOkCodeSchema = z.enum([
19
20
  // 'ASSEMBLY_FILE_ACCEPTED',
20
21
  // 'ASSEMBLY_FILE_RESERVED',
21
22
  ])
23
+ export type AssemblyStatusOkCode = z.infer<typeof assemblyStatusOkCodeSchema>
22
24
 
23
25
  export const assemblyStatusErrCodeSchema = z.enum([
24
26
  'ADMIN_PERMISSIONS_REQUIRED',
@@ -351,6 +353,7 @@ export const assemblyStatusErrCodeSchema = z.enum([
351
353
  'YOUTUBE_STORE_PROBLEM_SENDING_FILE',
352
354
  'YOUTUBE_STORE_VALIDATION',
353
355
  ])
356
+ export type AssemblyStatusErrCode = z.infer<typeof assemblyStatusErrCodeSchema>
354
357
 
355
358
  const assemblyStatusMetaSchema = z
356
359
  .object({
@@ -455,6 +458,22 @@ const assemblyStatusMetaSchema = z
455
458
  num_subtitles: z.union([z.number(), z.null()]).optional(),
456
459
  bit_depth: z.union([z.number(), z.null()]).optional(),
457
460
  seekable: z.union([z.boolean(), z.null()]).optional(),
461
+ interlaced: z.boolean().nullable().optional(),
462
+ field_order: z.string().nullable().optional(),
463
+ interlace_detection: z
464
+ .object({
465
+ sampled_frames: z.number().optional(),
466
+ tff: z.number().optional(),
467
+ bff: z.number().optional(),
468
+ progressive: z.number().optional(),
469
+ undetermined: z.number().optional(),
470
+ confidence: z.number().optional(),
471
+ method: z.string().optional(),
472
+ ffprobe_field_order: z.string().nullable().optional(),
473
+ })
474
+ .passthrough()
475
+ .nullable()
476
+ .optional(),
458
477
  pixel_format: z.union([z.string(), z.null()]).optional(),
459
478
  reference_count: z.union([z.number(), z.null()]).optional(),
460
479
  time_base: z.union([z.string(), z.null()]).optional(),
@@ -740,6 +759,7 @@ export const assemblyStatusBaseSchema = z.object({
740
759
  notify_status: z.string().nullable().optional(),
741
760
  notify_response_code: z.number().nullable().optional(),
742
761
  notify_response_data: z.string().nullable().optional(),
762
+ notify_error: z.string().nullable().optional(),
743
763
  notify_duration: z.number().nullable().optional(),
744
764
  last_job_completed: z.string().nullable().optional(),
745
765
  fields: z.record(z.unknown()).optional(),
@@ -1682,59 +1682,59 @@ export const filterExpression = z.union([
1682
1682
  z.array(z.union([z.string(), z.number(), z.null()])),
1683
1683
  ])
1684
1684
 
1685
- export type FilterCondition = z.infer<typeof filterCondition>
1686
- export const filterCondition = z.union([
1687
- z.null(),
1688
- z.string(),
1689
- z.array(
1690
- z.tuple([
1691
- filterExpression,
1692
- z.union([
1693
- z.literal('=').describe('Equals without type check'),
1694
- z.literal('==').describe('Equals without type check'),
1695
- z.literal('===').describe('Strict equals with type check'),
1696
- z.literal('<').describe('Less than'),
1697
- z.literal('>').describe('Greater than'),
1698
- z.literal('<=').describe('Less or equal'),
1699
- z.literal('>=').describe('Greater or equal'),
1700
- z.literal('!=').describe('Simple inequality check without type check'),
1701
- z.literal('!==').describe('Strict inequality check with type check'),
1702
- z
1703
- .literal('regex')
1704
- .describe(
1705
- 'Case-insensitive regular expression based on [RE2](https://github.com/google/re2) `.match()`',
1706
- ),
1707
- z
1708
- .literal('!regex')
1709
- .describe(
1710
- 'Case-insensitive regular expression based on [RE2](https://github.com/google/re2) `!.match()`',
1711
- ),
1712
- z
1713
- .literal('includes')
1714
- .describe(
1715
- 'Check if the right element is included in the array, which is represented by the left element',
1716
- ),
1717
- z
1718
- .literal('!includes')
1719
- .describe(
1720
- 'Check if the right element is not included in the array, which is represented by the left element',
1721
- ),
1722
- z
1723
- .literal('empty')
1724
- .describe(
1725
- 'Check if the left element is an empty array, an object without properties, an empty string, the number zero or the boolean false. Leave the third element of the array to be an empty string. It won’t be evaluated.',
1726
- ),
1727
- z
1728
- .literal('!empty')
1729
- .describe(
1730
- 'Check if the left element is an array with members, an object with at least one property, a non-empty string, a number that does not equal zero or the boolean true. Leave the third element of the array to be an empty string. It won’t be evaluated.',
1731
- ),
1732
- ]),
1733
- filterExpression,
1734
- ]),
1735
- ),
1685
+ export type FilterConditionOperator = z.infer<typeof filterConditionOperatorSchema>
1686
+ export const filterConditionOperatorSchema = z.union([
1687
+ z.literal('=').describe('Equals without type check'),
1688
+ z.literal('==').describe('Equals without type check'),
1689
+ z.literal('===').describe('Strict equals with type check'),
1690
+ z.literal('<').describe('Less than'),
1691
+ z.literal('>').describe('Greater than'),
1692
+ z.literal('<=').describe('Less or equal'),
1693
+ z.literal('>=').describe('Greater or equal'),
1694
+ z.literal('!=').describe('Simple inequality check without type check'),
1695
+ z.literal('!==').describe('Strict inequality check with type check'),
1696
+ z
1697
+ .literal('regex')
1698
+ .describe(
1699
+ 'Case-insensitive regular expression based on [RE2](https://github.com/google/re2) `.match()`',
1700
+ ),
1701
+ z
1702
+ .literal('!regex')
1703
+ .describe(
1704
+ 'Case-insensitive regular expression based on [RE2](https://github.com/google/re2) `!.match()`',
1705
+ ),
1706
+ z
1707
+ .literal('includes')
1708
+ .describe(
1709
+ 'Check if the right element is included in the array, which is represented by the left element',
1710
+ ),
1711
+ z
1712
+ .literal('!includes')
1713
+ .describe(
1714
+ 'Check if the right element is not included in the array, which is represented by the left element',
1715
+ ),
1716
+ z
1717
+ .literal('empty')
1718
+ .describe(
1719
+ 'Check if the left element is an empty array, an object without properties, an empty string, the number zero or the boolean false. Leave the third element of the array to be an empty string. It won’t be evaluated.',
1720
+ ),
1721
+ z
1722
+ .literal('!empty')
1723
+ .describe(
1724
+ 'Check if the left element is an array with members, an object with at least one property, a non-empty string, a number that does not equal zero or the boolean true. Leave the third element of the array to be an empty string. It won’t be evaluated.',
1725
+ ),
1736
1726
  ])
1737
1727
 
1728
+ export type FilterConditionPart = z.infer<typeof filterConditionPartSchema>
1729
+ export const filterConditionPartSchema = z.tuple([
1730
+ filterExpression,
1731
+ filterConditionOperatorSchema,
1732
+ filterExpression,
1733
+ ])
1734
+
1735
+ export type FilterCondition = z.infer<typeof filterCondition>
1736
+ export const filterCondition = z.union([z.null(), z.string(), z.array(filterConditionPartSchema)])
1737
+
1738
1738
  /**
1739
1739
  * Parameters specific to the /video/encode robot. Useful for typing robots that pass files to /video/encode.
1740
1740
  */
@@ -1913,10 +1913,17 @@ Delta to apply to segment duration. This is optional and allows fine-tuning of s
1913
1913
  })
1914
1914
  .strict()
1915
1915
 
1916
- /**
1917
- * Type for the normalized use parameter from AssemblyNormalizer
1918
- * The steps array can contain either strings or objects with name property
1919
- */
1916
+ export type NormalizedUseStepName = string | undefined
1917
+
1918
+ export interface NormalizedUseStep {
1919
+ as?: unknown[]
1920
+ fields?: unknown[]
1921
+ name: NormalizedUseStepName
1922
+ }
1923
+
1920
1924
  export interface NormalizedUse {
1921
- steps: Array<{ name: string; as?: string; fields?: string }>
1925
+ bundle_steps: boolean
1926
+ fields: true | unknown[]
1927
+ group_by_original: boolean
1928
+ steps: NormalizedUseStep[]
1922
1929
  }
@@ -46,9 +46,20 @@ TODO: Add robot description here
46
46
  })
47
47
  .strict()
48
48
 
49
+ export const robotAssemblySavejsonInstructionsWithHiddenFieldsSchema =
50
+ robotAssemblySavejsonInstructionsSchema.extend({
51
+ assembly_id: z.string().optional(),
52
+ expiry: z.string().optional(),
53
+ instance: z.string().optional(),
54
+ status: z.unknown().optional(),
55
+ })
56
+
49
57
  export type RobotAssemblySavejsonInstructions = z.infer<
50
58
  typeof robotAssemblySavejsonInstructionsSchema
51
59
  >
60
+ export type RobotAssemblySavejsonInstructionsWithHiddenFields = z.infer<
61
+ typeof robotAssemblySavejsonInstructionsWithHiddenFieldsSchema
62
+ >
52
63
 
53
64
  export const interpolatableRobotAssemblySavejsonInstructionsSchema = interpolateRobot(
54
65
  robotAssemblySavejsonInstructionsSchema,
@@ -59,3 +70,13 @@ export type InterpolatableRobotAssemblySavejsonInstructions =
59
70
  export type InterpolatableRobotAssemblySavejsonInstructionsInput = z.input<
60
71
  typeof interpolatableRobotAssemblySavejsonInstructionsSchema
61
72
  >
73
+
74
+ export const interpolatableRobotAssemblySavejsonInstructionsWithHiddenFieldsSchema =
75
+ interpolateRobot(robotAssemblySavejsonInstructionsWithHiddenFieldsSchema)
76
+ export type InterpolatableRobotAssemblySavejsonInstructionsWithHiddenFields = z.infer<
77
+ typeof interpolatableRobotAssemblySavejsonInstructionsWithHiddenFieldsSchema
78
+ >
79
+
80
+ export type InterpolatableRobotAssemblySavejsonInstructionsWithHiddenFieldsInput = z.input<
81
+ typeof interpolatableRobotAssemblySavejsonInstructionsWithHiddenFieldsSchema
82
+ >
@@ -9,6 +9,17 @@ import {
9
9
  robotUse,
10
10
  } from './_instructions-primitives.ts'
11
11
 
12
+ export type {
13
+ FilterCondition,
14
+ FilterConditionOperator,
15
+ FilterConditionPart,
16
+ } from './_instructions-primitives.ts'
17
+
18
+ export {
19
+ filterConditionOperatorSchema,
20
+ filterConditionPartSchema,
21
+ } from './_instructions-primitives.ts'
22
+
12
23
  export const meta: RobotMetaInput = {
13
24
  bytescount: 0,
14
25
  discount_factor: 0,
@@ -71,7 +82,7 @@ Passing JavaScript allows you to implement logic as complex as you wish, however
71
82
  The \`accepts\` and \`declines\` parameters can each be set to an array of arrays with three members:
72
83
 
73
84
  1. A value or job variable, such as \`\${file.mime}\`
74
- 2. One of the following operators: \`==\`, \`===\`, \`<\`, \`>\`, \`<=\`, \`>=\`, \`!=\`, \`!==\`, \`regex\`, \`!regex\`, \`includes\`, \`!includes\`
85
+ 2. One of the following operators: \`=\`, \`==\`, \`===\`, \`<\`, \`>\`, \`<=\`, \`>=\`, \`!=\`, \`!==\`, \`regex\`, \`!regex\`, \`includes\`, \`!includes\`, \`empty\`, \`!empty\`
75
86
  3. A value or job variable, such as \`50\` or \`"foo"\`
76
87
 
77
88
  Examples:
@@ -103,6 +103,14 @@ Setting this to \`"meta"\` will still import the file on metadata extraction err
103
103
  .default(false)
104
104
  .describe(`
105
105
  Disable the internal retry mechanism, and fail immediately if a resource can't be imported. This can be useful for performance critical applications.
106
+ `),
107
+ max_file_size: z
108
+ .number()
109
+ .int()
110
+ .positive()
111
+ .optional()
112
+ .describe(`
113
+ Maximum allowed size in bytes for each imported file. If the remote server reports a larger file size, the import is rejected before the download starts. If the remote server does not report a size upfront, the download is aborted once this limit is exceeded.
106
114
  `),
107
115
  return_file_stubs,
108
116
  range: z
@@ -9,6 +9,29 @@ import {
9
9
  robotUse,
10
10
  } from './_instructions-primitives.ts'
11
11
 
12
+ export const imageFacedetectFaceSelectionModes = [
13
+ 'each',
14
+ 'group',
15
+ 'max-confidence',
16
+ 'max-size',
17
+ ] as const
18
+
19
+ export const imageFacedetectFaceSelectionModeSchema = z.enum(imageFacedetectFaceSelectionModes)
20
+
21
+ export const imageFacedetectFaceCoordinatesSchema = z
22
+ .object({
23
+ confidence: z.number().optional(),
24
+ height: z.number(),
25
+ width: z.number(),
26
+ x1: z.number(),
27
+ x2: z.number().optional(),
28
+ y1: z.number(),
29
+ y2: z.number().optional(),
30
+ })
31
+ .passthrough()
32
+
33
+ export type ImageFacedetectFaceCoordinates = z.infer<typeof imageFacedetectFaceCoordinatesSchema>
34
+
12
35
  export const meta: RobotMetaInput = {
13
36
  bytescount: 1,
14
37
  discount_factor: 1,
@@ -104,7 +127,7 @@ The default value \`"preserve"\` means that the input image format is re-used.
104
127
  Specifies the minimum confidence that a detected face must have. Only faces which have a higher confidence value than this threshold will be included in the result.
105
128
  `),
106
129
  faces: z
107
- .union([z.enum(['each', 'group', 'max-confidence', 'max-size']), z.number().int()])
130
+ .union([imageFacedetectFaceSelectionModeSchema, z.number().int()])
108
131
  .default('each')
109
132
  .describe(`
110
133
  Determines which of the detected faces should be returned. Valid values are:
@@ -9,10 +9,10 @@ import {
9
9
  robotUse,
10
10
  } from './_instructions-primitives.ts'
11
11
 
12
- const speechTranscribeProviderSchema = z.enum(['aws', 'gcp', 'replicate']).default('replicate')
12
+ const speechTranscribeProviderSchema = z.enum(['aws', 'gcp', 'replicate']).optional()
13
13
  const speechTranscribeProviderWithHiddenFieldsSchema = z
14
14
  .enum(['aws', 'gcp', 'replicate', 'transloadit'])
15
- .default('replicate')
15
+ .optional()
16
16
 
17
17
  export const meta: RobotMetaInput = {
18
18
  bytescount: 1,
@@ -68,11 +68,48 @@ export const robotSpeechTranscribeInstructionsSchema = robotBase
68
68
  You can use the text that we return in your application, or you can pass the text down to other <dfn>Robots</dfn> to filter audio or video files that contain (or do not contain) certain content, or burn the text into images or video for example.
69
69
 
70
70
  Another common use case is automatically subtitling videos, or making audio searchable.
71
+
72
+ Set \`speaker_labels\` to \`true\` when you want JSON or meta transcription output to distinguish
73
+ recurring speakers:
74
+
75
+ \`\`\`json
76
+ {
77
+ "steps": {
78
+ "transcribed": {
79
+ "use": ":original",
80
+ "robot": "/speech/transcribe",
81
+ "provider": "aws",
82
+ "format": "json",
83
+ "speaker_labels": true,
84
+ "max_speakers": 3
85
+ }
86
+ }
87
+ }
88
+ \`\`\`
89
+
90
+ Speaker labels are currently supported by the \`aws\` and \`gcp\` providers. If you enable
91
+ \`speaker_labels\` without setting \`provider\`, Transloadit uses \`aws\` for that <dfn>Step</dfn>. Labels
92
+ are normalized as \`speaker_1\`, \`speaker_2\`, and so on:
93
+
94
+ \`\`\`json
95
+ {
96
+ "text": "Hello there. Hi!",
97
+ "words": [
98
+ { "text": "Hello", "startTime": 0, "endTime": 0.5, "speaker": "speaker_1" },
99
+ { "text": "there", "startTime": 0.6, "endTime": 1, "speaker": "speaker_1" },
100
+ { "text": "Hi!", "startTime": 1.2, "endTime": 1.8, "speaker": "speaker_2" }
101
+ ],
102
+ "segments": [
103
+ { "text": "Hello there", "startTime": 0, "endTime": 1, "speaker": "speaker_1" },
104
+ { "text": "Hi!", "startTime": 1.2, "endTime": 1.8, "speaker": "speaker_2" }
105
+ ]
106
+ }
107
+ \`\`\`
71
108
  `),
72
109
  provider: speechTranscribeProviderSchema.describe(`
73
110
  Which AI provider to leverage.
74
111
 
75
- Defaults to \`"replicate"\`, which currently uses our highest-quality deployed transcription path while ElevenLabs Scribe support is being prepared.
112
+ Defaults to \`"replicate"\`, which currently uses our highest-quality deployed transcription path while ElevenLabs Scribe support is being prepared. When \`speaker_labels\` is \`true\` and \`provider\` is omitted, Transloadit defaults to \`"aws"\`, because speaker labels are currently supported by the \`aws\` and \`gcp\` providers.
76
113
 
77
114
  Transloadit abstracts the interface so you can expect the same data structures, but different latencies and information being returned. Different cloud vendors have different areas they shine in, and we recommend to try out and see what yields the best results for your use case.
78
115
  `),
@@ -86,9 +123,26 @@ Whether to return a full response (\`"full"\`), or a flat list of descriptions (
86
123
  Output format for the transcription.
87
124
 
88
125
  - \`"text"\` outputs a plain text file that you can store and process.
89
- - \`"json"\` outputs a JSON file containing timestamped words.
126
+ - \`"json"\` outputs a JSON file containing timestamped words. When \`speaker_labels\` is enabled, words can include \`speaker\` labels and the JSON can also include grouped \`segments\` by speaker.
90
127
  - \`"srt"\` and \`"webvtt"\` output subtitle files of those respective file types, which can be stored separately or used in other encoding <dfn>Steps</dfn>.
91
- - \`"meta"\` does not return a file, but stores the data inside Transloadit's file object (under \`\${file.meta.transcription.text}\`) that's passed around between encoding <dfn>Steps</dfn>, so that you can use the values to burn the data into videos, filter on them, etc.
128
+ - \`"meta"\` does not return a file, but stores the data inside Transloadit's file object (under \`\${file.meta.transcription.text}\`, \`\${file.meta.transcription.words}\`, and, when speaker labels are available, \`\${file.meta.transcription.segments}\`) that's passed around between encoding <dfn>Steps</dfn>, so that you can use the values to burn the data into videos, filter on them, etc.
129
+ `),
130
+ speaker_labels: z
131
+ .boolean()
132
+ .default(false)
133
+ .describe(`
134
+ When enabled, Transloadit asks the transcription provider to distinguish different speakers. JSON and meta output can then include \`speaker\` labels such as \`"speaker_1"\` on individual words, plus grouped \`segments\` by speaker. Text, SRT, and WebVTT output behavior is unchanged.
135
+
136
+ Speaker labels identify recurring voices, not real person names. Accuracy depends on audio quality, background noise, overlapping speech, and the number of speakers.
137
+ `),
138
+ max_speakers: z
139
+ .number()
140
+ .int()
141
+ .min(1)
142
+ .max(10)
143
+ .default(10)
144
+ .describe(`
145
+ The maximum number of speakers to detect when \`speaker_labels\` is enabled.
92
146
  `),
93
147
  // TODO determine the list of languages
94
148
  source_language: z
@@ -113,6 +167,7 @@ The language should be specified in the [BCP-47](https://www.rfc-editor.org/rfc/
113
167
 
114
168
  export const robotSpeechTranscribeInstructionsWithHiddenFieldsSchema =
115
169
  robotSpeechTranscribeInstructionsSchema.extend({
170
+ model: z.enum(['whisper-large-v3']).optional(),
116
171
  provider: speechTranscribeProviderWithHiddenFieldsSchema,
117
172
  result: z
118
173
  .union([z.literal('debug'), robotSpeechTranscribeInstructionsSchema.shape.result])
@@ -95,6 +95,8 @@ You can add text overlays to videos using FFmpeg's \`drawtext\` filter through t
95
95
  - Use the \`font\` attribute to reference a font by family name with FFmpeg's \`drawtext\`
96
96
  - FFmpeg font family names typically do not contain dashes (e.g. \`Times New Roman\`), while
97
97
  ImageMagick uses dashed names (e.g. \`Times-New-Roman\`).
98
+ - File-loading \`drawtext\` options such as \`textfile\` and \`fontfile\` are not supported. Use
99
+ inline \`text\` and a font family name instead.
98
100
  - Preserve the source audio by setting \`"codec:a": "copy"\`.
99
101
  - Position text with the \`x\` and \`y\` expressions. The example above centers the text.
100
102
 
package/src/tus.ts CHANGED
@@ -153,6 +153,12 @@ export async function sendTusRequest({
153
153
  rejectCompletion = reject
154
154
  })
155
155
 
156
+ // If startPromise rejects first, pMap aborts before sendTusRequest reaches the aggregate awaits
157
+ // below. These bookkeeping promises still need handlers so the startPromise rejection remains
158
+ // the single error surface.
159
+ uploadUrlPromise.catch(() => {})
160
+ completionPromise.catch(() => {})
161
+
156
162
  uploadUrlPromises.push(uploadUrlPromise)
157
163
  completionPromises.push(completionPromise)
158
164