transloadit 4.0.2 → 4.0.4

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 (219) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +11 -0
  3. package/dist/Transloadit.d.ts +1 -1
  4. package/dist/Transloadit.d.ts.map +1 -1
  5. package/dist/Transloadit.js.map +1 -1
  6. package/dist/alphalib/types/assemblyReplay.d.ts +32 -28
  7. package/dist/alphalib/types/assemblyReplay.d.ts.map +1 -1
  8. package/dist/alphalib/types/assemblyReplayNotification.d.ts +32 -28
  9. package/dist/alphalib/types/assemblyReplayNotification.d.ts.map +1 -1
  10. package/dist/alphalib/types/assemblyStatus.d.ts +1 -0
  11. package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -1
  12. package/dist/alphalib/types/assemblyStatus.js +12 -0
  13. package/dist/alphalib/types/assemblyStatus.js.map +1 -1
  14. package/dist/alphalib/types/robots/_index.d.ts +312 -288
  15. package/dist/alphalib/types/robots/_index.d.ts.map +1 -1
  16. package/dist/alphalib/types/robots/_instructions-primitives.d.ts +22 -22
  17. package/dist/alphalib/types/robots/_instructions-primitives.d.ts.map +1 -1
  18. package/dist/alphalib/types/robots/_instructions-primitives.js +19 -10
  19. package/dist/alphalib/types/robots/_instructions-primitives.js.map +1 -1
  20. package/dist/alphalib/types/robots/assembly-savejson.d.ts +1 -1
  21. package/dist/alphalib/types/robots/assembly-savejson.d.ts.map +1 -1
  22. package/dist/alphalib/types/robots/assembly-savejson.js.map +1 -1
  23. package/dist/alphalib/types/robots/audio-artwork.d.ts +20 -20
  24. package/dist/alphalib/types/robots/audio-concat.d.ts +20 -20
  25. package/dist/alphalib/types/robots/audio-concat.d.ts.map +1 -1
  26. package/dist/alphalib/types/robots/audio-concat.js +2 -2
  27. package/dist/alphalib/types/robots/audio-concat.js.map +1 -1
  28. package/dist/alphalib/types/robots/audio-encode.d.ts +20 -20
  29. package/dist/alphalib/types/robots/audio-encode.js +1 -1
  30. package/dist/alphalib/types/robots/audio-loop.d.ts +20 -20
  31. package/dist/alphalib/types/robots/audio-merge.d.ts +20 -20
  32. package/dist/alphalib/types/robots/audio-merge.d.ts.map +1 -1
  33. package/dist/alphalib/types/robots/audio-merge.js +1 -1
  34. package/dist/alphalib/types/robots/audio-merge.js.map +1 -1
  35. package/dist/alphalib/types/robots/audio-waveform.d.ts +20 -20
  36. package/dist/alphalib/types/robots/audio-waveform.d.ts.map +1 -1
  37. package/dist/alphalib/types/robots/audio-waveform.js +1 -1
  38. package/dist/alphalib/types/robots/audio-waveform.js.map +1 -1
  39. package/dist/alphalib/types/robots/azure-import.d.ts.map +1 -1
  40. package/dist/alphalib/types/robots/azure-import.js +1 -1
  41. package/dist/alphalib/types/robots/azure-import.js.map +1 -1
  42. package/dist/alphalib/types/robots/azure-store.js +1 -1
  43. package/dist/alphalib/types/robots/azure-store.js.map +1 -1
  44. package/dist/alphalib/types/robots/backblaze-import.d.ts.map +1 -1
  45. package/dist/alphalib/types/robots/backblaze-import.js +1 -1
  46. package/dist/alphalib/types/robots/backblaze-import.js.map +1 -1
  47. package/dist/alphalib/types/robots/backblaze-store.js +1 -1
  48. package/dist/alphalib/types/robots/backblaze-store.js.map +1 -1
  49. package/dist/alphalib/types/robots/cloudfiles-import.d.ts.map +1 -1
  50. package/dist/alphalib/types/robots/cloudfiles-import.js +1 -1
  51. package/dist/alphalib/types/robots/cloudfiles-import.js.map +1 -1
  52. package/dist/alphalib/types/robots/cloudfiles-store.js +1 -1
  53. package/dist/alphalib/types/robots/cloudfiles-store.js.map +1 -1
  54. package/dist/alphalib/types/robots/cloudflare-import.d.ts.map +1 -1
  55. package/dist/alphalib/types/robots/cloudflare-import.js +1 -1
  56. package/dist/alphalib/types/robots/cloudflare-import.js.map +1 -1
  57. package/dist/alphalib/types/robots/cloudflare-store.js +1 -1
  58. package/dist/alphalib/types/robots/cloudflare-store.js.map +1 -1
  59. package/dist/alphalib/types/robots/digitalocean-import.d.ts.map +1 -1
  60. package/dist/alphalib/types/robots/digitalocean-import.js +1 -1
  61. package/dist/alphalib/types/robots/digitalocean-import.js.map +1 -1
  62. package/dist/alphalib/types/robots/digitalocean-store.js +1 -1
  63. package/dist/alphalib/types/robots/digitalocean-store.js.map +1 -1
  64. package/dist/alphalib/types/robots/document-thumbs.js +1 -1
  65. package/dist/alphalib/types/robots/dropbox-import.d.ts.map +1 -1
  66. package/dist/alphalib/types/robots/dropbox-import.js +1 -1
  67. package/dist/alphalib/types/robots/dropbox-import.js.map +1 -1
  68. package/dist/alphalib/types/robots/dropbox-store.js +1 -1
  69. package/dist/alphalib/types/robots/dropbox-store.js.map +1 -1
  70. package/dist/alphalib/types/robots/edgly-deliver.d.ts +1 -1
  71. package/dist/alphalib/types/robots/edgly-deliver.d.ts.map +1 -1
  72. package/dist/alphalib/types/robots/edgly-deliver.js.map +1 -1
  73. package/dist/alphalib/types/robots/file-decompress.d.ts +12 -0
  74. package/dist/alphalib/types/robots/file-decompress.d.ts.map +1 -1
  75. package/dist/alphalib/types/robots/file-decompress.js +9 -0
  76. package/dist/alphalib/types/robots/file-decompress.js.map +1 -1
  77. package/dist/alphalib/types/robots/file-serve.d.ts.map +1 -1
  78. package/dist/alphalib/types/robots/file-serve.js +33 -5
  79. package/dist/alphalib/types/robots/file-serve.js.map +1 -1
  80. package/dist/alphalib/types/robots/file-verify.d.ts.map +1 -1
  81. package/dist/alphalib/types/robots/file-verify.js +1 -1
  82. package/dist/alphalib/types/robots/file-verify.js.map +1 -1
  83. package/dist/alphalib/types/robots/ftp-import.d.ts.map +1 -1
  84. package/dist/alphalib/types/robots/ftp-import.js +1 -1
  85. package/dist/alphalib/types/robots/ftp-import.js.map +1 -1
  86. package/dist/alphalib/types/robots/ftp-store.js +1 -1
  87. package/dist/alphalib/types/robots/ftp-store.js.map +1 -1
  88. package/dist/alphalib/types/robots/google-import.d.ts.map +1 -1
  89. package/dist/alphalib/types/robots/google-import.js +1 -1
  90. package/dist/alphalib/types/robots/google-import.js.map +1 -1
  91. package/dist/alphalib/types/robots/google-store.js +2 -2
  92. package/dist/alphalib/types/robots/google-store.js.map +1 -1
  93. package/dist/alphalib/types/robots/meta-read.d.ts +1 -1
  94. package/dist/alphalib/types/robots/meta-read.d.ts.map +1 -1
  95. package/dist/alphalib/types/robots/meta-read.js +1 -1
  96. package/dist/alphalib/types/robots/meta-read.js.map +1 -1
  97. package/dist/alphalib/types/robots/meta-write.d.ts +20 -20
  98. package/dist/alphalib/types/robots/minio-import.d.ts.map +1 -1
  99. package/dist/alphalib/types/robots/minio-import.js +1 -1
  100. package/dist/alphalib/types/robots/minio-import.js.map +1 -1
  101. package/dist/alphalib/types/robots/minio-store.js +1 -1
  102. package/dist/alphalib/types/robots/minio-store.js.map +1 -1
  103. package/dist/alphalib/types/robots/s3-import.d.ts.map +1 -1
  104. package/dist/alphalib/types/robots/s3-import.js +1 -1
  105. package/dist/alphalib/types/robots/s3-import.js.map +1 -1
  106. package/dist/alphalib/types/robots/s3-store.d.ts +12 -0
  107. package/dist/alphalib/types/robots/s3-store.d.ts.map +1 -1
  108. package/dist/alphalib/types/robots/s3-store.js +7 -1
  109. package/dist/alphalib/types/robots/s3-store.js.map +1 -1
  110. package/dist/alphalib/types/robots/sftp-import.d.ts.map +1 -1
  111. package/dist/alphalib/types/robots/sftp-import.js +1 -1
  112. package/dist/alphalib/types/robots/sftp-import.js.map +1 -1
  113. package/dist/alphalib/types/robots/sftp-store.js +1 -1
  114. package/dist/alphalib/types/robots/sftp-store.js.map +1 -1
  115. package/dist/alphalib/types/robots/supabase-import.d.ts.map +1 -1
  116. package/dist/alphalib/types/robots/supabase-import.js +1 -1
  117. package/dist/alphalib/types/robots/supabase-import.js.map +1 -1
  118. package/dist/alphalib/types/robots/supabase-store.js +1 -1
  119. package/dist/alphalib/types/robots/supabase-store.js.map +1 -1
  120. package/dist/alphalib/types/robots/swift-import.d.ts.map +1 -1
  121. package/dist/alphalib/types/robots/swift-import.js +1 -1
  122. package/dist/alphalib/types/robots/swift-import.js.map +1 -1
  123. package/dist/alphalib/types/robots/swift-store.js +1 -1
  124. package/dist/alphalib/types/robots/swift-store.js.map +1 -1
  125. package/dist/alphalib/types/robots/tigris-import.d.ts.map +1 -1
  126. package/dist/alphalib/types/robots/tigris-import.js +2 -2
  127. package/dist/alphalib/types/robots/tigris-import.js.map +1 -1
  128. package/dist/alphalib/types/robots/tigris-store.js +2 -2
  129. package/dist/alphalib/types/robots/tigris-store.js.map +1 -1
  130. package/dist/alphalib/types/robots/tlcdn-deliver.d.ts +1 -1
  131. package/dist/alphalib/types/robots/tlcdn-deliver.d.ts.map +1 -1
  132. package/dist/alphalib/types/robots/tlcdn-deliver.js.map +1 -1
  133. package/dist/alphalib/types/robots/video-adaptive.d.ts +20 -20
  134. package/dist/alphalib/types/robots/video-concat.d.ts +20 -20
  135. package/dist/alphalib/types/robots/video-concat.d.ts.map +1 -1
  136. package/dist/alphalib/types/robots/video-concat.js +1 -1
  137. package/dist/alphalib/types/robots/video-concat.js.map +1 -1
  138. package/dist/alphalib/types/robots/video-encode.d.ts +20 -20
  139. package/dist/alphalib/types/robots/video-encode.d.ts.map +1 -1
  140. package/dist/alphalib/types/robots/video-encode.js +49 -1
  141. package/dist/alphalib/types/robots/video-encode.js.map +1 -1
  142. package/dist/alphalib/types/robots/video-merge.d.ts +20 -20
  143. package/dist/alphalib/types/robots/video-ondemand.d.ts +28 -28
  144. package/dist/alphalib/types/robots/video-subtitle.d.ts +20 -20
  145. package/dist/alphalib/types/robots/video-subtitle.d.ts.map +1 -1
  146. package/dist/alphalib/types/robots/video-subtitle.js +1 -1
  147. package/dist/alphalib/types/robots/video-subtitle.js.map +1 -1
  148. package/dist/alphalib/types/robots/video-thumbs.d.ts +20 -20
  149. package/dist/alphalib/types/robots/vimeo-import.js +1 -1
  150. package/dist/alphalib/types/robots/wasabi-import.d.ts.map +1 -1
  151. package/dist/alphalib/types/robots/wasabi-import.js +2 -2
  152. package/dist/alphalib/types/robots/wasabi-import.js.map +1 -1
  153. package/dist/alphalib/types/robots/wasabi-store.js +1 -1
  154. package/dist/alphalib/types/robots/wasabi-store.js.map +1 -1
  155. package/dist/alphalib/types/template.d.ts +564 -516
  156. package/dist/alphalib/types/template.d.ts.map +1 -1
  157. package/dist/alphalib/zodParseWithContext.d.ts.map +1 -1
  158. package/dist/alphalib/zodParseWithContext.js +14 -10
  159. package/dist/alphalib/zodParseWithContext.js.map +1 -1
  160. package/dist/apiTypes.d.ts +1 -1
  161. package/dist/apiTypes.d.ts.map +1 -1
  162. package/dist/apiTypes.js.map +1 -1
  163. package/dist/cli.d.ts +7 -0
  164. package/dist/cli.d.ts.map +1 -0
  165. package/dist/cli.js +130 -0
  166. package/dist/cli.js.map +1 -0
  167. package/package.json +4 -3
  168. package/src/Transloadit.ts +1 -8
  169. package/src/alphalib/types/assemblyStatus.ts +18 -0
  170. package/src/alphalib/types/robots/_instructions-primitives.ts +26 -10
  171. package/src/alphalib/types/robots/assembly-savejson.ts +2 -2
  172. package/src/alphalib/types/robots/audio-concat.ts +3 -2
  173. package/src/alphalib/types/robots/audio-encode.ts +1 -1
  174. package/src/alphalib/types/robots/audio-merge.ts +2 -1
  175. package/src/alphalib/types/robots/audio-waveform.ts +2 -1
  176. package/src/alphalib/types/robots/azure-import.ts +2 -1
  177. package/src/alphalib/types/robots/azure-store.ts +1 -1
  178. package/src/alphalib/types/robots/backblaze-import.ts +2 -1
  179. package/src/alphalib/types/robots/backblaze-store.ts +1 -1
  180. package/src/alphalib/types/robots/cloudfiles-import.ts +2 -1
  181. package/src/alphalib/types/robots/cloudfiles-store.ts +1 -1
  182. package/src/alphalib/types/robots/cloudflare-import.ts +2 -1
  183. package/src/alphalib/types/robots/cloudflare-store.ts +1 -1
  184. package/src/alphalib/types/robots/digitalocean-import.ts +2 -1
  185. package/src/alphalib/types/robots/digitalocean-store.ts +1 -1
  186. package/src/alphalib/types/robots/document-thumbs.ts +1 -1
  187. package/src/alphalib/types/robots/dropbox-import.ts +2 -1
  188. package/src/alphalib/types/robots/dropbox-store.ts +1 -1
  189. package/src/alphalib/types/robots/edgly-deliver.ts +2 -2
  190. package/src/alphalib/types/robots/file-decompress.ts +9 -0
  191. package/src/alphalib/types/robots/file-serve.ts +33 -5
  192. package/src/alphalib/types/robots/file-verify.ts +2 -1
  193. package/src/alphalib/types/robots/ftp-import.ts +2 -1
  194. package/src/alphalib/types/robots/ftp-store.ts +1 -1
  195. package/src/alphalib/types/robots/google-import.ts +2 -1
  196. package/src/alphalib/types/robots/google-store.ts +2 -2
  197. package/src/alphalib/types/robots/meta-read.ts +3 -3
  198. package/src/alphalib/types/robots/minio-import.ts +2 -1
  199. package/src/alphalib/types/robots/minio-store.ts +1 -1
  200. package/src/alphalib/types/robots/s3-import.ts +2 -1
  201. package/src/alphalib/types/robots/s3-store.ts +7 -1
  202. package/src/alphalib/types/robots/sftp-import.ts +2 -1
  203. package/src/alphalib/types/robots/sftp-store.ts +1 -1
  204. package/src/alphalib/types/robots/supabase-import.ts +2 -1
  205. package/src/alphalib/types/robots/supabase-store.ts +1 -1
  206. package/src/alphalib/types/robots/swift-import.ts +2 -1
  207. package/src/alphalib/types/robots/swift-store.ts +1 -1
  208. package/src/alphalib/types/robots/tigris-import.ts +3 -2
  209. package/src/alphalib/types/robots/tigris-store.ts +2 -2
  210. package/src/alphalib/types/robots/tlcdn-deliver.ts +2 -2
  211. package/src/alphalib/types/robots/video-concat.ts +2 -1
  212. package/src/alphalib/types/robots/video-encode.ts +49 -1
  213. package/src/alphalib/types/robots/video-subtitle.ts +2 -1
  214. package/src/alphalib/types/robots/vimeo-import.ts +1 -1
  215. package/src/alphalib/types/robots/wasabi-import.ts +3 -2
  216. package/src/alphalib/types/robots/wasabi-store.ts +1 -1
  217. package/src/alphalib/zodParseWithContext.ts +18 -14
  218. package/src/apiTypes.ts +0 -5
  219. package/src/cli.ts +158 -0
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on Dropbox:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on Dropbox:',
22
22
  has_small_icon: true,
23
23
  minimum_charge: 0,
24
24
  output_factor: 1,
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod'
2
-
3
- import { interpolateRobot, type RobotMetaInput, robotBase } from './_instructions-primitives.ts'
2
+ import type { RobotMetaInput } from './_instructions-primitives.ts'
3
+ import { interpolateRobot, robotBase } from './_instructions-primitives.ts'
4
4
 
5
5
  export const meta: RobotMetaInput = {
6
6
  allowed_for_url_transform: false,
@@ -87,6 +87,15 @@ A possible array member is only \`"meta"\`.
87
87
  You might see an error when trying to extract metadata from the files inside your archive. This happens, for example, for files with a size of zero bytes. Setting this to \`true\` will cause the <dfn>Robot</dfn> to not stop the file decompression (and the entire <dfn>Assembly</dfn>) when that happens.
88
88
 
89
89
  To keep backwards compatibility, setting this parameter to \`true\` will set it to \`["meta"]\` internally.
90
+ `),
91
+ stack: z
92
+ .enum(['v1', 'v2'])
93
+ .default('v1')
94
+ .describe(`
95
+ Temporary parameter for backwards compatibility while we roll out new underlying tooling for the robot.
96
+
97
+ - \`v1\` uses the old decompression.
98
+ - \`v2\` uses the new decompression with better support for unicode and nested archives.
90
99
  `),
91
100
  })
92
101
  .strict()
@@ -42,12 +42,40 @@ While theoretically possible, you could use [🤖/file/serve](/docs/robots/file-
42
42
 
43
43
  Also consider configuring caching headers and cache-control directives to control how content is cached and invalidated on the CDN edge servers, balancing between freshness and efficiency.
44
44
 
45
- More information on:
45
+ ## Smart CDN Security with Signature Authentication
46
46
 
47
- - [Content Delivery](/services/content-delivery/).
48
- - [🤖/file/serve](/docs/robots/file-serve/) pricing.
49
- - [🤖/tlcdn/deliver](/docs/robots/tlcdn-deliver/) pricing.
50
- - [File Preview Feature](/blog/2024/06/file-preview-with-smart-cdn/) blog post.
47
+ You can leverage [Signature Authentication](/docs/api/authentication/#smart-cdn) to avoid abuse of our encoding platform. Below is a quick Node.js example using our Node SDK, but there are [examples for other languages and SDKs](/docs/api/authentication/#example-code) as well.
48
+
49
+ \`\`\`javascript
50
+ // yarn add transloadit
51
+ // or
52
+ // npm install --save transloadit
53
+
54
+ import { Transloadit } from 'transloadit'
55
+
56
+ const transloadit = new Transloadit({
57
+ authKey: 'YOUR_TRANSLOADIT_KEY',
58
+ authSecret: 'YOUR_TRANSLOADIT_SECRET',
59
+ })
60
+
61
+ const url = transloadit.getSignedSmartCDNUrl({
62
+ workspace: 'YOUR_WORKSPACE',
63
+ template: 'YOUR_TEMPLATE',
64
+ input: 'image.png',
65
+ urlParams: { height: 100, width: 100 },
66
+ })
67
+
68
+ console.log(url)
69
+ \`\`\`
70
+
71
+ This will generate a signed Smart CDN URL that includes authentication parameters, preventing unauthorized access to your transformation endpoints.
72
+
73
+ ## More information
74
+
75
+ - [Content Delivery](/services/content-delivery/)
76
+ - [🤖/file/serve](/docs/robots/file-serve/) pricing
77
+ - [🤖/tlcdn/deliver](/docs/robots/tlcdn-deliver/) pricing
78
+ - [File Preview Feature](/blog/2024/06/file-preview-with-smart-cdn/) blog post
51
79
  `),
52
80
  headers: z
53
81
  .record(z.string())
@@ -6,7 +6,8 @@ import { interpolateRobot, robotBase, robotUse } from './_instructions-primitive
6
6
  export const meta: RobotMetaInput = {
7
7
  allowed_for_url_transform: true,
8
8
  bytescount: 4,
9
- description: `/file/verify is a simple Robot that helps ensure that the files you upload are of the type you initially intended. This is especially useful when handling user-generated content, where you may not want to run certain Steps in your Template if the user hasn’t uploaded a file of the correct type. Another use case for /file/verify is when a user uploads a ZIP file, but we find that it has a few damaged files inside when we extract it. Perhaps you don’t want to error out, but only send the good files to a next processing step. With /file/verify, you can do exactly that (assuming the default of \`error_on_decline\`: \`true\`).`,
9
+ description:
10
+ '/file/verify is a simple Robot that helps ensure that the files you upload are of the type you initially intended. This is especially useful when handling user-generated content, where you may not want to run certain Steps in your Template if the user hasn’t uploaded a file of the correct type. Another use case for /file/verify is when a user uploads a ZIP file, but we find that it has a few damaged files inside when we extract it. Perhaps you don’t want to error out, but only send the good files to a next processing step. With /file/verify, you can do exactly that (assuming the default of `error_on_decline`: `true`).',
10
11
  discount_factor: 0.25,
11
12
  discount_pct: 75,
12
13
  example_code: {
@@ -23,7 +23,8 @@ export const meta: RobotMetaInput = {
23
23
  },
24
24
  },
25
25
  },
26
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
26
+ example_code_description:
27
+ 'Import files from the `path/to/files` directory and its subdirectories:',
27
28
  minimum_charge: 0,
28
29
  output_factor: 1,
29
30
  override_lvl1: 'File Importing',
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on an FTP server:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on an FTP server:',
22
22
  minimum_charge: 0,
23
23
  output_factor: 1,
24
24
  override_lvl1: 'File Exporting',
@@ -27,7 +27,8 @@ export const meta: RobotMetaInput = {
27
27
  },
28
28
  },
29
29
  },
30
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
30
+ example_code_description:
31
+ 'Import files from the `path/to/files` directory and its subdirectories:',
31
32
  has_small_icon: true,
32
33
  minimum_charge: 0,
33
34
  output_factor: 1,
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on Google Storage:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on Google Storage:',
22
22
  has_small_icon: true,
23
23
  minimum_charge: 0,
24
24
  output_factor: 1,
@@ -51,7 +51,7 @@ The URL to the exported file in your Google bucket will be presented in the Tran
51
51
  result: z
52
52
  .boolean()
53
53
  .optional()
54
- .describe(`Whether the results of this Step should be present in the Assembly Status JSON`),
54
+ .describe('Whether the results of this Step should be present in the Assembly Status JSON'),
55
55
  credentials: z.string().describe(`
56
56
  Create a new [Google service account](https://cloud.google.com/storage/docs/authentication). Set its role to "Storage Object Creator". Choose "JSON" for the key file format and download it to your computer. You will need to upload this file when creating your <dfn>Template Credentials</dfn>.
57
57
 
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod'
2
-
3
- import { interpolateRobot, type RobotMetaInput, robotBase } from './_instructions-primitives.ts'
2
+ import type { RobotMetaInput } from './_instructions-primitives.ts'
3
+ import { interpolateRobot, robotBase } from './_instructions-primitives.ts'
4
4
 
5
5
  // @ts-expect-error - MetaReadRobot is not ready yet @TODO please supply missing keys
6
6
  export const meta: RobotMetaInput = {
@@ -15,7 +15,7 @@ export const meta: RobotMetaInput = {
15
15
 
16
16
  export const robotMetaReadInstructionsSchema = robotBase
17
17
  .extend({
18
- robot: z.literal('/meta/read').describe(`Reads metadata from a file.`),
18
+ robot: z.literal('/meta/read').describe('Reads metadata from a file.'),
19
19
  })
20
20
  .strict()
21
21
 
@@ -28,7 +28,8 @@ export const meta: RobotMetaInput = {
28
28
  },
29
29
  },
30
30
  },
31
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
31
+ example_code_description:
32
+ 'Import files from the `path/to/files` directory and its subdirectories:',
32
33
  has_small_icon: true,
33
34
  minimum_charge: 0,
34
35
  output_factor: 1,
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on MinIO:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on MinIO:',
22
22
  has_small_icon: true,
23
23
  minimum_charge: 0,
24
24
  output_factor: 1,
@@ -28,7 +28,8 @@ export const meta: RobotMetaInput = {
28
28
  },
29
29
  },
30
30
  },
31
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
31
+ example_code_description:
32
+ 'Import files from the `path/to/files` directory and its subdirectories:',
32
33
  has_small_icon: true,
33
34
  minimum_charge: 0,
34
35
  output_factor: 1,
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` in an S3 bucket:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` in an S3 bucket:',
22
22
  has_small_icon: true,
23
23
  minimum_charge: 0,
24
24
  output_factor: 1,
@@ -149,6 +149,12 @@ Set to \`true\` if you use a custom host and run into access denied errors.
149
149
  .optional()
150
150
  .describe(`
151
151
  This parameter provides signed URLs in the result JSON (in the \`signed_url\` and \`signed_ssl_url\` properties). The number that you set this parameter to is the URL expiry time in seconds. If this parameter is not used, no URL signing is done.
152
+ `),
153
+ session_token: z
154
+ .string()
155
+ .optional()
156
+ .describe(`
157
+ The session token to use for the S3 store. This is only used if the credentials are from an IAM user with the \`sts:AssumeRole\` permission.
152
158
  `),
153
159
  })
154
160
  .strict()
@@ -17,7 +17,8 @@ export const meta: RobotMetaInput = {
17
17
  },
18
18
  },
19
19
  },
20
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
20
+ example_code_description:
21
+ 'Import files from the `path/to/files` directory and its subdirectories:',
21
22
  minimum_charge: 0,
22
23
  output_factor: 1,
23
24
  override_lvl1: 'File Importing',
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on an SFTP server:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on an SFTP server:',
22
22
  minimum_charge: 0,
23
23
  output_factor: 1,
24
24
  override_lvl1: 'File Exporting',
@@ -28,7 +28,8 @@ export const meta: RobotMetaInput = {
28
28
  },
29
29
  },
30
30
  },
31
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
31
+ example_code_description:
32
+ 'Import files from the `path/to/files` directory and its subdirectories:',
32
33
  has_small_icon: true,
33
34
  minimum_charge: 0,
34
35
  output_factor: 1,
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on supabase R2:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on supabase R2:',
22
22
  has_small_icon: true,
23
23
  minimum_charge: 0,
24
24
  output_factor: 1,
@@ -28,7 +28,8 @@ export const meta: RobotMetaInput = {
28
28
  },
29
29
  },
30
30
  },
31
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
31
+ example_code_description:
32
+ 'Import files from the `path/to/files` directory and its subdirectories:',
32
33
  has_small_icon: true,
33
34
  minimum_charge: 0,
34
35
  output_factor: 1,
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on Swift:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on Swift:',
22
22
  has_small_icon: true,
23
23
  minimum_charge: 0,
24
24
  output_factor: 1,
@@ -28,7 +28,8 @@ export const meta: RobotMetaInput = {
28
28
  },
29
29
  },
30
30
  },
31
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
31
+ example_code_description:
32
+ 'Import files from the `path/to/files` directory and its subdirectories:',
32
33
  has_small_icon: true,
33
34
  minimum_charge: 0,
34
35
  output_factor: 1,
@@ -85,7 +86,7 @@ The pagination page size. This only works when recursive is \`true\` for now, in
85
86
  bucket_region: z
86
87
  .string()
87
88
  .optional()
88
- .describe(`The region of your Tigris bucket. This is optional as it can often be derived.`),
89
+ .describe('The region of your Tigris bucket. This is optional as it can often be derived.'),
89
90
  })
90
91
  .strict()
91
92
 
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on Tigris:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on Tigris:',
22
22
  has_small_icon: true,
23
23
  minimum_charge: 0,
24
24
  output_factor: 1,
@@ -81,7 +81,7 @@ If this parameter is not used, no URL signing is done.
81
81
  bucket_region: z
82
82
  .string()
83
83
  .optional()
84
- .describe(`The region of your Tigris bucket. This is optional as it can often be derived.`),
84
+ .describe('The region of your Tigris bucket. This is optional as it can often be derived.'),
85
85
  })
86
86
  .strict()
87
87
 
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod'
2
-
3
- import { interpolateRobot, type RobotMetaInput, robotBase } from './_instructions-primitives.ts'
2
+ import type { RobotMetaInput } from './_instructions-primitives.ts'
3
+ import { interpolateRobot, robotBase } from './_instructions-primitives.ts'
4
4
 
5
5
  export const meta: RobotMetaInput = {
6
6
  allowed_for_url_transform: false,
@@ -39,7 +39,8 @@ export const meta: RobotMetaInput = {
39
39
  },
40
40
  },
41
41
  },
42
- example_code_description: `If you have a form with 3 file input fields and want to concatenate the uploaded videos in a specific order, instruct Transloadit using the \`name\` attribute of each input field. Use this attribute as the value for the \`fields\` key in the JSON, and set \`as\` to \`video_[[index]]\`. Transloadit will concatenate the files based on the ascending index order:`,
42
+ example_code_description:
43
+ 'If you have a form with 3 file input fields and want to concatenate the uploaded videos in a specific order, instruct Transloadit using the `name` attribute of each input field. Use this attribute as the value for the `fields` key in the JSON, and set `as` to `video_[[index]]`. Transloadit will concatenate the files based on the ascending index order:',
43
44
  minimum_charge: 0,
44
45
  output_factor: 0.6,
45
46
  override_lvl1: 'Video Encoding',
@@ -50,7 +50,55 @@ export const robotVideoEncodeInstructionsSchema = robotBase
50
50
  .merge(robotUse)
51
51
  .merge(videoEncodeSpecificInstructionsSchema)
52
52
  .extend({
53
- robot: z.literal('/video/encode'),
53
+ robot: z.literal('/video/encode').describe(`
54
+ The /video/encode Robot is a versatile tool for video processing that handles transcoding, resizing, and watermarking. It supports various formats including modern standards like HEVC (H.265), and provides features such as presets for common devices, custom FFmpeg parameters for powerusers, watermark positioning, and more.
55
+
56
+ ## Adding text overlays with FFmpeg
57
+
58
+ You can add text overlays to videos using FFmpeg's \`drawtext\` filter through this <Definition term="Robot">Robot</Definition>'s \`ffmpeg\` parameter. Here are two examples — one with the default font and one with a custom font family name:
59
+
60
+ \`\`\`json
61
+ {
62
+ "steps": {
63
+ ":original": {
64
+ "robot": "/upload/handle"
65
+ },
66
+ "text_overlay_default": {
67
+ "use": ":original",
68
+ "robot": "/video/encode",
69
+ "preset": "empty",
70
+ "ffmpeg_stack": "{{stacks.ffmpeg.recommended_version}}",
71
+ "ffmpeg": {
72
+ "codec:a": "copy",
73
+ "vf": "drawtext=text='My text overlay':fontcolor=white:fontsize=24:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2"
74
+ },
75
+ "result": true
76
+ },
77
+ "text_overlay_custom": {
78
+ "use": ":original",
79
+ "robot": "/video/encode",
80
+ "preset": "empty",
81
+ "ffmpeg_stack": "{{stacks.ffmpeg.recommended_version}}",
82
+ "ffmpeg": {
83
+ "codec:a": "copy",
84
+ "vf": "drawtext=font='Times New Roman':text='My text overlay':fontcolor=white:fontsize=24:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2"
85
+ },
86
+ "result": true
87
+ }
88
+ }
89
+ }
90
+ \`\`\`
91
+
92
+ **Notes:**
93
+
94
+ - Use the \`font\` attribute to reference a font by family name with FFmpeg's \`drawtext\`
95
+ - FFmpeg font family names typically do not contain dashes (e.g. \`Times New Roman\`), while
96
+ ImageMagick uses dashed names (e.g. \`Times-New-Roman\`).
97
+ - Preserve the source audio by setting \`"codec:a": "copy"\`.
98
+ - Position text with the \`x\` and \`y\` expressions. The example above centers the text.
99
+
100
+ See the live demo [here](/demos/video-encoding/add-text-overlay/).
101
+ `),
54
102
  font_size: z.number().optional(),
55
103
  font_color: z.string().optional(),
56
104
  text_background_color: z.string().optional(),
@@ -39,7 +39,8 @@ export const meta: RobotMetaInput = {
39
39
  },
40
40
  },
41
41
  },
42
- example_code_description: `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:`,
42
+ example_code_description:
43
+ '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:',
43
44
  minimum_charge: 0,
44
45
  output_factor: 0.6,
45
46
  override_lvl1: 'Video Encoding',
@@ -83,7 +83,7 @@ You can also use an array of path strings here to import multiple paths in the s
83
83
  rendition: z
84
84
  .enum(['240p', '360p', '540p', '720p', '1080p', 'source'])
85
85
  .default('720p')
86
- .describe(`The quality of the video to import.`),
86
+ .describe('The quality of the video to import.'),
87
87
  })
88
88
  .strict()
89
89
 
@@ -28,7 +28,8 @@ export const meta: RobotMetaInput = {
28
28
  },
29
29
  },
30
30
  },
31
- example_code_description: `Import files from the \`path/to/files\` directory and its subdirectories:`,
31
+ example_code_description:
32
+ 'Import files from the `path/to/files` directory and its subdirectories:',
32
33
  has_small_icon: true,
33
34
  minimum_charge: 0,
34
35
  output_factor: 1,
@@ -59,7 +60,7 @@ export const robotWasabiImportInstructionsSchema = robotBase
59
60
  result: z
60
61
  .boolean()
61
62
  .optional()
62
- .describe(`Whether the results of this Step should be present in the Assembly Status JSON`),
63
+ .describe('Whether the results of this Step should be present in the Assembly Status JSON'),
63
64
  robot: z.literal('/wasabi/import'),
64
65
  path: path.describe(`
65
66
  The path in your bucket to the specific file or directory. If the path points to a file, only this file will be imported. For example: \`images/avatar.jpg\`.
@@ -18,7 +18,7 @@ export const meta: RobotMetaInput = {
18
18
  },
19
19
  },
20
20
  },
21
- example_code_description: `Export uploaded files to \`my_target_folder\` on Wasabi:`,
21
+ example_code_description: 'Export uploaded files to `my_target_folder` on Wasabi:',
22
22
  has_small_icon: true,
23
23
  minimum_charge: 0,
24
24
  output_factor: 1,
@@ -113,7 +113,7 @@ export function zodParseWithContext<T extends z.ZodType>(
113
113
  else if ('unionErrors' in zodIssue && zodIssue.unionErrors) {
114
114
  // --- Moved initialization out of the loop ---
115
115
  const collectedLiterals: Record<string, (string | number | boolean)[]> = {}
116
- const collectedMessages: Record<string, string[]> = {}
116
+ const collectedMessages: Record<string, Set<string>> = {}
117
117
 
118
118
  // Process nested issues within the union
119
119
  for (const unionError of zodIssue.unionErrors) {
@@ -123,8 +123,11 @@ export function zodParseWithContext<T extends z.ZodType>(
123
123
 
124
124
  // Ensure paths exist in collection maps
125
125
  if (!collectedLiterals[nestedPath]) collectedLiterals[nestedPath] = []
126
- if (!collectedMessages[nestedPath]) collectedMessages[nestedPath] = []
126
+ if (!collectedMessages[nestedPath]) collectedMessages[nestedPath] = new Set()
127
127
 
128
+ if (issue.code === 'custom' && issue.message.includes('interpolation string')) {
129
+ continue
130
+ }
128
131
  if (issue.code === 'invalid_literal') {
129
132
  const { expected } = issue
130
133
  if (
@@ -137,7 +140,7 @@ export function zodParseWithContext<T extends z.ZodType>(
137
140
  collectedLiterals[nestedPath].push(expected)
138
141
  }
139
142
  // Still add the raw message for fallback
140
- collectedMessages[nestedPath].push(issue.message)
143
+ collectedMessages[nestedPath].add(issue.message)
141
144
  }
142
145
  // Keep existing enum handling if needed, but literal should cover most cases
143
146
  else if (issue.code === 'invalid_enum_value') {
@@ -145,7 +148,7 @@ export function zodParseWithContext<T extends z.ZodType>(
145
148
  if (options && options.length > 0) {
146
149
  collectedLiterals[nestedPath].push(...options.map(String)) // Assuming options are compatible
147
150
  }
148
- collectedMessages[nestedPath].push(issue.message)
151
+ collectedMessages[nestedPath].add(issue.message)
149
152
  }
150
153
  // Keep existing unrecognized keys handling
151
154
  else if (issue.code === 'unrecognized_keys') {
@@ -153,7 +156,7 @@ export function zodParseWithContext<T extends z.ZodType>(
153
156
  const { keys } = issue
154
157
  const truncatedKeys = keys.slice(0, maxKeysToShow)
155
158
  const ellipsis = keys.length > maxKeysToShow ? '...' : ''
156
- collectedMessages[nestedPath].push(
159
+ collectedMessages[nestedPath].add(
157
160
  `has unrecognized keys: ${truncatedKeys.map((k) => `\`${k}\``).join(', ')}${ellipsis}`,
158
161
  )
159
162
  }
@@ -177,13 +180,13 @@ export function zodParseWithContext<T extends z.ZodType>(
177
180
  }
178
181
  }
179
182
 
180
- collectedMessages[nestedPath].push(
183
+ collectedMessages[nestedPath].add(
181
184
  `got invalid type: ${received} (value: \`${actualValueStr}\`, expected: ${expectedOutput})`,
182
185
  )
183
186
  }
184
187
  // <-- End added handling -->
185
188
  else {
186
- collectedMessages[nestedPath].push(issue.message) // Handle other nested codes
189
+ collectedMessages[nestedPath].add(issue.message) // Handle other nested codes
187
190
  }
188
191
  }
189
192
  }
@@ -194,13 +197,17 @@ export function zodParseWithContext<T extends z.ZodType>(
194
197
  if (!badPaths.has(nestedPath)) {
195
198
  badPaths.set(nestedPath, [])
196
199
  }
197
- const targetMessages = badPaths.get(nestedPath)!
200
+
201
+ const targetMessages = badPaths.get(nestedPath)
202
+ if (!targetMessages) {
203
+ continue
204
+ }
198
205
 
199
206
  // Prioritize more specific messages (like invalid type with details)
200
- const invalidTypeMessages = collectedMessages[nestedPath].filter((m) =>
207
+ const invalidTypeMessages = Array.from(collectedMessages[nestedPath]).filter((m) =>
201
208
  m.startsWith('got invalid type:'),
202
209
  )
203
- const unrecognizedKeyMessages = collectedMessages[nestedPath].filter((m) =>
210
+ const unrecognizedKeyMessages = Array.from(collectedMessages[nestedPath]).filter((m) =>
204
211
  m.startsWith('has unrecognized keys:'),
205
212
  )
206
213
  const literalMessages = collectedLiterals[nestedPath] ?? []
@@ -217,9 +224,6 @@ export function zodParseWithContext<T extends z.ZodType>(
217
224
  targetMessages.push(...collectedMessages[nestedPath])
218
225
  }
219
226
  }
220
-
221
- // Prevent the main `messages` array from being populated further for this union issue
222
- continue // Skip adding messages directly from the top-level union issue itself
223
227
  }
224
228
  // Handle other specific error codes (only if not handled above)
225
229
  else {
@@ -231,7 +235,7 @@ export function zodParseWithContext<T extends z.ZodType>(
231
235
  switch (zodIssue.code) {
232
236
  case 'invalid_type': {
233
237
  received = zodIssue.received === 'undefined' ? 'missing' : zodIssue.received
234
- const actualValue = getByPath(obj, path) as any
238
+ const actualValue = getByPath(obj, path)
235
239
  const actualValueStr =
236
240
  typeof actualValue === 'object' && actualValue !== null
237
241
  ? JSON.stringify(actualValue)
package/src/apiTypes.ts CHANGED
@@ -2,11 +2,6 @@ import type { AssemblyInstructions, AssemblyInstructionsInput } from './alphalib
2
2
 
3
3
  export {
4
4
  type AssemblyIndexItem,
5
- type AssemblyStatusMeta,
6
- type AssemblyStatusResult,
7
- type AssemblyStatusResults,
8
- type AssemblyStatusUpload,
9
- type AssemblyStatusUploads,
10
5
  assemblyIndexItemSchema,
11
6
  assemblyStatusSchema,
12
7
  } from './alphalib/types/assemblyStatus.ts'