@transloadit/node 4.10.2 → 4.10.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 (251) hide show
  1. package/dist/alphalib/errors.d.ts +8 -0
  2. package/dist/alphalib/errors.d.ts.map +1 -0
  3. package/dist/alphalib/errors.js +27 -0
  4. package/dist/alphalib/errors.js.map +1 -0
  5. package/dist/alphalib/object.d.ts +8 -0
  6. package/dist/alphalib/object.d.ts.map +1 -1
  7. package/dist/alphalib/object.js +29 -0
  8. package/dist/alphalib/object.js.map +1 -1
  9. package/dist/alphalib/types/assemblyStatus.d.ts +128 -110
  10. package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -1
  11. package/dist/alphalib/types/assemblyStatus.js +182 -23
  12. package/dist/alphalib/types/assemblyStatus.js.map +1 -1
  13. package/dist/alphalib/types/robots/_index.d.ts +3 -1
  14. package/dist/alphalib/types/robots/_index.d.ts.map +1 -1
  15. package/dist/alphalib/types/robots/_instructions-primitives.d.ts +5 -1
  16. package/dist/alphalib/types/robots/_instructions-primitives.d.ts.map +1 -1
  17. package/dist/alphalib/types/robots/_instructions-primitives.js +63 -29
  18. package/dist/alphalib/types/robots/_instructions-primitives.js.map +1 -1
  19. package/dist/alphalib/types/robots/ai-chat.d.ts +12 -0
  20. package/dist/alphalib/types/robots/ai-chat.d.ts.map +1 -1
  21. package/dist/alphalib/types/robots/ai-chat.js +1 -1
  22. package/dist/alphalib/types/robots/ai-chat.js.map +1 -1
  23. package/dist/alphalib/types/robots/assembly-savejson.d.ts +6 -0
  24. package/dist/alphalib/types/robots/assembly-savejson.d.ts.map +1 -1
  25. package/dist/alphalib/types/robots/assembly-savejson.js +16 -2
  26. package/dist/alphalib/types/robots/assembly-savejson.js.map +1 -1
  27. package/dist/alphalib/types/robots/audio-artwork.d.ts +12 -0
  28. package/dist/alphalib/types/robots/audio-artwork.d.ts.map +1 -1
  29. package/dist/alphalib/types/robots/audio-concat.d.ts +12 -0
  30. package/dist/alphalib/types/robots/audio-concat.d.ts.map +1 -1
  31. package/dist/alphalib/types/robots/audio-encode.d.ts +12 -0
  32. package/dist/alphalib/types/robots/audio-encode.d.ts.map +1 -1
  33. package/dist/alphalib/types/robots/audio-loop.d.ts +12 -0
  34. package/dist/alphalib/types/robots/audio-loop.d.ts.map +1 -1
  35. package/dist/alphalib/types/robots/audio-merge.d.ts +12 -0
  36. package/dist/alphalib/types/robots/audio-merge.d.ts.map +1 -1
  37. package/dist/alphalib/types/robots/audio-split.d.ts +12 -0
  38. package/dist/alphalib/types/robots/audio-split.d.ts.map +1 -1
  39. package/dist/alphalib/types/robots/audio-waveform.d.ts +12 -0
  40. package/dist/alphalib/types/robots/audio-waveform.d.ts.map +1 -1
  41. package/dist/alphalib/types/robots/azure-import.d.ts +12 -0
  42. package/dist/alphalib/types/robots/azure-import.d.ts.map +1 -1
  43. package/dist/alphalib/types/robots/azure-store.d.ts +12 -0
  44. package/dist/alphalib/types/robots/azure-store.d.ts.map +1 -1
  45. package/dist/alphalib/types/robots/backblaze-import.d.ts +12 -0
  46. package/dist/alphalib/types/robots/backblaze-import.d.ts.map +1 -1
  47. package/dist/alphalib/types/robots/backblaze-store.d.ts +12 -0
  48. package/dist/alphalib/types/robots/backblaze-store.d.ts.map +1 -1
  49. package/dist/alphalib/types/robots/box-import.d.ts +12 -0
  50. package/dist/alphalib/types/robots/box-import.d.ts.map +1 -1
  51. package/dist/alphalib/types/robots/box-store.d.ts +12 -0
  52. package/dist/alphalib/types/robots/box-store.d.ts.map +1 -1
  53. package/dist/alphalib/types/robots/cloudfiles-import.d.ts +12 -0
  54. package/dist/alphalib/types/robots/cloudfiles-import.d.ts.map +1 -1
  55. package/dist/alphalib/types/robots/cloudfiles-store.d.ts +12 -0
  56. package/dist/alphalib/types/robots/cloudfiles-store.d.ts.map +1 -1
  57. package/dist/alphalib/types/robots/cloudflare-import.d.ts +12 -0
  58. package/dist/alphalib/types/robots/cloudflare-import.d.ts.map +1 -1
  59. package/dist/alphalib/types/robots/cloudflare-store.d.ts +12 -0
  60. package/dist/alphalib/types/robots/cloudflare-store.d.ts.map +1 -1
  61. package/dist/alphalib/types/robots/digitalocean-import.d.ts +12 -0
  62. package/dist/alphalib/types/robots/digitalocean-import.d.ts.map +1 -1
  63. package/dist/alphalib/types/robots/digitalocean-store.d.ts +12 -0
  64. package/dist/alphalib/types/robots/digitalocean-store.d.ts.map +1 -1
  65. package/dist/alphalib/types/robots/document-autorotate.d.ts +12 -0
  66. package/dist/alphalib/types/robots/document-autorotate.d.ts.map +1 -1
  67. package/dist/alphalib/types/robots/document-convert.d.ts +12 -0
  68. package/dist/alphalib/types/robots/document-convert.d.ts.map +1 -1
  69. package/dist/alphalib/types/robots/document-merge.d.ts +12 -0
  70. package/dist/alphalib/types/robots/document-merge.d.ts.map +1 -1
  71. package/dist/alphalib/types/robots/document-ocr.d.ts +12 -0
  72. package/dist/alphalib/types/robots/document-ocr.d.ts.map +1 -1
  73. package/dist/alphalib/types/robots/document-optimize.d.ts +12 -0
  74. package/dist/alphalib/types/robots/document-optimize.d.ts.map +1 -1
  75. package/dist/alphalib/types/robots/document-split.d.ts +12 -0
  76. package/dist/alphalib/types/robots/document-split.d.ts.map +1 -1
  77. package/dist/alphalib/types/robots/document-thumbs.d.ts +24 -6
  78. package/dist/alphalib/types/robots/document-thumbs.d.ts.map +1 -1
  79. package/dist/alphalib/types/robots/document-thumbs.js +16 -2
  80. package/dist/alphalib/types/robots/document-thumbs.js.map +1 -1
  81. package/dist/alphalib/types/robots/dropbox-import.d.ts +12 -0
  82. package/dist/alphalib/types/robots/dropbox-import.d.ts.map +1 -1
  83. package/dist/alphalib/types/robots/dropbox-store.d.ts +12 -0
  84. package/dist/alphalib/types/robots/dropbox-store.d.ts.map +1 -1
  85. package/dist/alphalib/types/robots/edgly-deliver.d.ts +12 -0
  86. package/dist/alphalib/types/robots/edgly-deliver.d.ts.map +1 -1
  87. package/dist/alphalib/types/robots/file-compress.d.ts +12 -0
  88. package/dist/alphalib/types/robots/file-compress.d.ts.map +1 -1
  89. package/dist/alphalib/types/robots/file-decompress.d.ts +12 -0
  90. package/dist/alphalib/types/robots/file-decompress.d.ts.map +1 -1
  91. package/dist/alphalib/types/robots/file-filter.d.ts +12 -0
  92. package/dist/alphalib/types/robots/file-filter.d.ts.map +1 -1
  93. package/dist/alphalib/types/robots/file-filter.js +5 -1
  94. package/dist/alphalib/types/robots/file-filter.js.map +1 -1
  95. package/dist/alphalib/types/robots/file-hash.d.ts +12 -0
  96. package/dist/alphalib/types/robots/file-hash.d.ts.map +1 -1
  97. package/dist/alphalib/types/robots/file-preview.d.ts +12 -0
  98. package/dist/alphalib/types/robots/file-preview.d.ts.map +1 -1
  99. package/dist/alphalib/types/robots/file-read.d.ts +12 -0
  100. package/dist/alphalib/types/robots/file-read.d.ts.map +1 -1
  101. package/dist/alphalib/types/robots/file-serve.d.ts +12 -0
  102. package/dist/alphalib/types/robots/file-serve.d.ts.map +1 -1
  103. package/dist/alphalib/types/robots/file-verify.d.ts +12 -0
  104. package/dist/alphalib/types/robots/file-verify.d.ts.map +1 -1
  105. package/dist/alphalib/types/robots/file-virusscan.d.ts +12 -0
  106. package/dist/alphalib/types/robots/file-virusscan.d.ts.map +1 -1
  107. package/dist/alphalib/types/robots/file-watermark.d.ts +12 -0
  108. package/dist/alphalib/types/robots/file-watermark.d.ts.map +1 -1
  109. package/dist/alphalib/types/robots/file-watermark.js +16 -2
  110. package/dist/alphalib/types/robots/file-watermark.js.map +1 -1
  111. package/dist/alphalib/types/robots/ftp-import.d.ts +12 -0
  112. package/dist/alphalib/types/robots/ftp-import.d.ts.map +1 -1
  113. package/dist/alphalib/types/robots/ftp-store.d.ts +12 -0
  114. package/dist/alphalib/types/robots/ftp-store.d.ts.map +1 -1
  115. package/dist/alphalib/types/robots/google-import.d.ts +12 -0
  116. package/dist/alphalib/types/robots/google-import.d.ts.map +1 -1
  117. package/dist/alphalib/types/robots/google-store.d.ts +12 -0
  118. package/dist/alphalib/types/robots/google-store.d.ts.map +1 -1
  119. package/dist/alphalib/types/robots/html-convert.d.ts +12 -0
  120. package/dist/alphalib/types/robots/html-convert.d.ts.map +1 -1
  121. package/dist/alphalib/types/robots/http-import.d.ts +192 -0
  122. package/dist/alphalib/types/robots/http-import.d.ts.map +1 -1
  123. package/dist/alphalib/types/robots/http-import.js +8 -2
  124. package/dist/alphalib/types/robots/http-import.js.map +1 -1
  125. package/dist/alphalib/types/robots/image-bgremove.d.ts +12 -0
  126. package/dist/alphalib/types/robots/image-bgremove.d.ts.map +1 -1
  127. package/dist/alphalib/types/robots/image-copyrightdetect.d.ts +12 -0
  128. package/dist/alphalib/types/robots/image-copyrightdetect.d.ts.map +1 -1
  129. package/dist/alphalib/types/robots/image-describe.d.ts +12 -0
  130. package/dist/alphalib/types/robots/image-describe.d.ts.map +1 -1
  131. package/dist/alphalib/types/robots/image-enhance.d.ts +12 -0
  132. package/dist/alphalib/types/robots/image-enhance.d.ts.map +1 -1
  133. package/dist/alphalib/types/robots/image-facedetect.d.ts +12 -0
  134. package/dist/alphalib/types/robots/image-facedetect.d.ts.map +1 -1
  135. package/dist/alphalib/types/robots/image-generate.d.ts +12 -0
  136. package/dist/alphalib/types/robots/image-generate.d.ts.map +1 -1
  137. package/dist/alphalib/types/robots/image-merge.d.ts +12 -0
  138. package/dist/alphalib/types/robots/image-merge.d.ts.map +1 -1
  139. package/dist/alphalib/types/robots/image-ocr.d.ts +12 -0
  140. package/dist/alphalib/types/robots/image-ocr.d.ts.map +1 -1
  141. package/dist/alphalib/types/robots/image-optimize.d.ts +12 -0
  142. package/dist/alphalib/types/robots/image-optimize.d.ts.map +1 -1
  143. package/dist/alphalib/types/robots/image-optimize.js +1 -1
  144. package/dist/alphalib/types/robots/image-resize.d.ts +16 -4
  145. package/dist/alphalib/types/robots/image-resize.d.ts.map +1 -1
  146. package/dist/alphalib/types/robots/image-resize.js +1 -1
  147. package/dist/alphalib/types/robots/image-upscale.d.ts +12 -0
  148. package/dist/alphalib/types/robots/image-upscale.d.ts.map +1 -1
  149. package/dist/alphalib/types/robots/mega-import.d.ts +12 -0
  150. package/dist/alphalib/types/robots/mega-import.d.ts.map +1 -1
  151. package/dist/alphalib/types/robots/mega-store.d.ts +12 -0
  152. package/dist/alphalib/types/robots/mega-store.d.ts.map +1 -1
  153. package/dist/alphalib/types/robots/meta-read.d.ts +12 -0
  154. package/dist/alphalib/types/robots/meta-read.d.ts.map +1 -1
  155. package/dist/alphalib/types/robots/meta-read.js +17 -2
  156. package/dist/alphalib/types/robots/meta-read.js.map +1 -1
  157. package/dist/alphalib/types/robots/meta-write.d.ts +12 -0
  158. package/dist/alphalib/types/robots/meta-write.d.ts.map +1 -1
  159. package/dist/alphalib/types/robots/minio-import.d.ts +12 -0
  160. package/dist/alphalib/types/robots/minio-import.d.ts.map +1 -1
  161. package/dist/alphalib/types/robots/minio-store.d.ts +12 -0
  162. package/dist/alphalib/types/robots/minio-store.d.ts.map +1 -1
  163. package/dist/alphalib/types/robots/progress-simulate.d.ts +6 -0
  164. package/dist/alphalib/types/robots/progress-simulate.d.ts.map +1 -1
  165. package/dist/alphalib/types/robots/progress-simulate.js +16 -2
  166. package/dist/alphalib/types/robots/progress-simulate.js.map +1 -1
  167. package/dist/alphalib/types/robots/s3-import.d.ts +12 -0
  168. package/dist/alphalib/types/robots/s3-import.d.ts.map +1 -1
  169. package/dist/alphalib/types/robots/s3-store.d.ts +12 -0
  170. package/dist/alphalib/types/robots/s3-store.d.ts.map +1 -1
  171. package/dist/alphalib/types/robots/script-run.d.ts +12 -0
  172. package/dist/alphalib/types/robots/script-run.d.ts.map +1 -1
  173. package/dist/alphalib/types/robots/sftp-import.d.ts +12 -0
  174. package/dist/alphalib/types/robots/sftp-import.d.ts.map +1 -1
  175. package/dist/alphalib/types/robots/sftp-store.d.ts +12 -0
  176. package/dist/alphalib/types/robots/sftp-store.d.ts.map +1 -1
  177. package/dist/alphalib/types/robots/speech-transcribe.d.ts +12 -0
  178. package/dist/alphalib/types/robots/speech-transcribe.d.ts.map +1 -1
  179. package/dist/alphalib/types/robots/supabase-import.d.ts +12 -0
  180. package/dist/alphalib/types/robots/supabase-import.d.ts.map +1 -1
  181. package/dist/alphalib/types/robots/supabase-store.d.ts +12 -0
  182. package/dist/alphalib/types/robots/supabase-store.d.ts.map +1 -1
  183. package/dist/alphalib/types/robots/swift-import.d.ts +12 -0
  184. package/dist/alphalib/types/robots/swift-import.d.ts.map +1 -1
  185. package/dist/alphalib/types/robots/swift-store.d.ts +12 -0
  186. package/dist/alphalib/types/robots/swift-store.d.ts.map +1 -1
  187. package/dist/alphalib/types/robots/text-speak.d.ts +12 -0
  188. package/dist/alphalib/types/robots/text-speak.d.ts.map +1 -1
  189. package/dist/alphalib/types/robots/text-translate.d.ts +12 -0
  190. package/dist/alphalib/types/robots/text-translate.d.ts.map +1 -1
  191. package/dist/alphalib/types/robots/tigris-import.d.ts +12 -0
  192. package/dist/alphalib/types/robots/tigris-import.d.ts.map +1 -1
  193. package/dist/alphalib/types/robots/tigris-store.d.ts +12 -0
  194. package/dist/alphalib/types/robots/tigris-store.d.ts.map +1 -1
  195. package/dist/alphalib/types/robots/tlcdn-deliver.d.ts +24 -0
  196. package/dist/alphalib/types/robots/tlcdn-deliver.d.ts.map +1 -1
  197. package/dist/alphalib/types/robots/tlcdn-deliver.js +11 -5
  198. package/dist/alphalib/types/robots/tlcdn-deliver.js.map +1 -1
  199. package/dist/alphalib/types/robots/tus-store.d.ts +12 -0
  200. package/dist/alphalib/types/robots/tus-store.d.ts.map +1 -1
  201. package/dist/alphalib/types/robots/upload-handle.d.ts +12 -0
  202. package/dist/alphalib/types/robots/upload-handle.d.ts.map +1 -1
  203. package/dist/alphalib/types/robots/video-adaptive.d.ts +12 -0
  204. package/dist/alphalib/types/robots/video-adaptive.d.ts.map +1 -1
  205. package/dist/alphalib/types/robots/video-artwork.d.ts +12 -0
  206. package/dist/alphalib/types/robots/video-artwork.d.ts.map +1 -1
  207. package/dist/alphalib/types/robots/video-concat.d.ts +12 -0
  208. package/dist/alphalib/types/robots/video-concat.d.ts.map +1 -1
  209. package/dist/alphalib/types/robots/video-encode.d.ts +12 -0
  210. package/dist/alphalib/types/robots/video-encode.d.ts.map +1 -1
  211. package/dist/alphalib/types/robots/video-generate.d.ts +12 -0
  212. package/dist/alphalib/types/robots/video-generate.d.ts.map +1 -1
  213. package/dist/alphalib/types/robots/video-merge.d.ts +12 -0
  214. package/dist/alphalib/types/robots/video-merge.d.ts.map +1 -1
  215. package/dist/alphalib/types/robots/video-ondemand.d.ts +12 -0
  216. package/dist/alphalib/types/robots/video-ondemand.d.ts.map +1 -1
  217. package/dist/alphalib/types/robots/video-split.d.ts +12 -0
  218. package/dist/alphalib/types/robots/video-split.d.ts.map +1 -1
  219. package/dist/alphalib/types/robots/video-subtitle.d.ts +12 -0
  220. package/dist/alphalib/types/robots/video-subtitle.d.ts.map +1 -1
  221. package/dist/alphalib/types/robots/video-thumbs.d.ts +12 -0
  222. package/dist/alphalib/types/robots/video-thumbs.d.ts.map +1 -1
  223. package/dist/alphalib/types/robots/vimeo-import.d.ts +12 -0
  224. package/dist/alphalib/types/robots/vimeo-import.d.ts.map +1 -1
  225. package/dist/alphalib/types/robots/vimeo-store.d.ts +12 -0
  226. package/dist/alphalib/types/robots/vimeo-store.d.ts.map +1 -1
  227. package/dist/alphalib/types/robots/wasabi-import.d.ts +12 -0
  228. package/dist/alphalib/types/robots/wasabi-import.d.ts.map +1 -1
  229. package/dist/alphalib/types/robots/wasabi-store.d.ts +12 -0
  230. package/dist/alphalib/types/robots/wasabi-store.d.ts.map +1 -1
  231. package/dist/alphalib/types/robots/youtube-store.d.ts +12 -0
  232. package/dist/alphalib/types/robots/youtube-store.d.ts.map +1 -1
  233. package/dist/alphalib/types/template.js +4 -4
  234. package/package.json +5 -7
  235. package/src/alphalib/errors.ts +34 -0
  236. package/src/alphalib/object.ts +40 -0
  237. package/src/alphalib/types/assemblyStatus.ts +182 -23
  238. package/src/alphalib/types/robots/_index.ts +1 -1
  239. package/src/alphalib/types/robots/_instructions-primitives.ts +124 -67
  240. package/src/alphalib/types/robots/ai-chat.ts +3 -1
  241. package/src/alphalib/types/robots/assembly-savejson.ts +16 -2
  242. package/src/alphalib/types/robots/document-thumbs.ts +16 -2
  243. package/src/alphalib/types/robots/file-filter.ts +5 -1
  244. package/src/alphalib/types/robots/file-watermark.ts +16 -2
  245. package/src/alphalib/types/robots/http-import.ts +8 -2
  246. package/src/alphalib/types/robots/image-optimize.ts +1 -1
  247. package/src/alphalib/types/robots/image-resize.ts +1 -1
  248. package/src/alphalib/types/robots/meta-read.ts +17 -2
  249. package/src/alphalib/types/robots/progress-simulate.ts +16 -2
  250. package/src/alphalib/types/robots/tlcdn-deliver.ts +13 -5
  251. package/src/alphalib/types/template.ts +4 -4
@@ -300,6 +300,38 @@ type InterpolatableSchema<Schema extends z.ZodTypeAny> = Schema extends z.ZodStr
300
300
  ? z.ZodUnion<[z.ZodString, ...InterpolatableTuple<T>]>
301
301
  : Schema
302
302
 
303
+ function isZodTypeAny(schema: unknown): schema is z.ZodTypeAny {
304
+ return schema instanceof z.ZodType
305
+ }
306
+
307
+ function toFirstPartySchema(schema: unknown): z.ZodFirstPartySchemaTypes {
308
+ if (!isZodTypeAny(schema)) {
309
+ throw new Error('Expected a Zod schema')
310
+ }
311
+ return schema as z.ZodFirstPartySchemaTypes
312
+ }
313
+
314
+ function toInterpolatableSchema<Schema extends z.ZodFirstPartySchemaTypes>(
315
+ schema: z.ZodTypeAny,
316
+ ): InterpolatableSchema<Schema> {
317
+ return schema as InterpolatableSchema<Schema>
318
+ }
319
+
320
+ function toInterpolatableRobot<Schema extends z.ZodObject<z.ZodRawShape>>(
321
+ schema: z.ZodTypeAny,
322
+ ): InterpolatableRobot<Schema> {
323
+ return schema as InterpolatableRobot<Schema>
324
+ }
325
+
326
+ function toInterpolatableUnionOptions(options: z.ZodTypeAny[]): z.ZodUnionOptions {
327
+ if (options.length === 0) {
328
+ throw new Error('Union options must not be empty')
329
+ }
330
+
331
+ const [head, ...tail] = options
332
+ return [head, ...tail]
333
+ }
334
+
303
335
  export function interpolateRecursive<Schema extends z.ZodFirstPartySchemaTypes>(
304
336
  schema: Schema,
305
337
  ): InterpolatableSchema<Schema> {
@@ -307,12 +339,14 @@ export function interpolateRecursive<Schema extends z.ZodFirstPartySchemaTypes>(
307
339
 
308
340
  switch (def.typeName) {
309
341
  case z.ZodFirstPartyTypeKind.ZodBoolean:
310
- return z.union([
311
- interpolationSchemaFull,
312
- z
313
- .union([schema, booleanStringSchema])
314
- .transform((value) => value === true || value === false),
315
- ]) as InterpolatableSchema<Schema>
342
+ return toInterpolatableSchema(
343
+ z.union([
344
+ interpolationSchemaFull,
345
+ z
346
+ .union([schema, booleanStringSchema])
347
+ .transform((value) => value === true || value === false),
348
+ ]),
349
+ )
316
350
  case z.ZodFirstPartyTypeKind.ZodArray: {
317
351
  let replacement = z.array(interpolateRecursive(def.type), def)
318
352
 
@@ -328,88 +362,93 @@ export function interpolateRecursive<Schema extends z.ZodFirstPartySchemaTypes>(
328
362
  replacement = replacement.min(def.minLength.value, def.minLength.message)
329
363
  }
330
364
 
331
- return z.union([interpolationSchemaFull, replacement]) as InterpolatableSchema<Schema>
365
+ return toInterpolatableSchema(z.union([interpolationSchemaFull, replacement]))
332
366
  }
333
367
  case z.ZodFirstPartyTypeKind.ZodDefault: {
334
- const replacement = (
335
- interpolateRecursive(def.innerType) as InterpolatableSchema<Schema>
368
+ const replacement = toInterpolatableSchema<Schema>(
369
+ interpolateRecursive(def.innerType),
336
370
  ).default(def.defaultValue())
337
371
 
338
- return (
339
- def.description ? replacement.describe(def.description) : replacement
340
- ) as InterpolatableSchema<Schema>
372
+ return toInterpolatableSchema(
373
+ def.description ? replacement.describe(def.description) : replacement,
374
+ )
341
375
  }
342
376
  case z.ZodFirstPartyTypeKind.ZodEffects:
343
377
  case z.ZodFirstPartyTypeKind.ZodEnum:
344
378
  case z.ZodFirstPartyTypeKind.ZodLiteral:
345
- return z.union([interpolationSchemaFull, schema], def) as InterpolatableSchema<Schema>
379
+ return toInterpolatableSchema(z.union([interpolationSchemaFull, schema], def))
346
380
  case z.ZodFirstPartyTypeKind.ZodNumber:
347
- return z.union(
348
- [
349
- z
350
- .string()
351
- .regex(/^\d+(\.\d+)?$/)
352
- .transform((value) => Number(value)),
353
- interpolationSchemaFull,
354
- schema,
355
- ],
356
- def,
357
- ) as InterpolatableSchema<Schema>
381
+ return toInterpolatableSchema(
382
+ z.union(
383
+ [
384
+ z
385
+ .string()
386
+ .regex(/^\d+(\.\d+)?$/)
387
+ .transform((value) => Number(value)),
388
+ interpolationSchemaFull,
389
+ schema,
390
+ ],
391
+ def,
392
+ ),
393
+ )
358
394
  case z.ZodFirstPartyTypeKind.ZodNullable:
359
- return interpolateRecursive(def.innerType)
360
- .nullable()
361
- .describe(def.description) as InterpolatableSchema<Schema>
395
+ return toInterpolatableSchema(
396
+ interpolateRecursive(def.innerType).nullable().describe(def.description),
397
+ )
362
398
  case z.ZodFirstPartyTypeKind.ZodObject: {
363
399
  const replacement = z.object(
364
400
  Object.fromEntries(
365
401
  Object.entries(def.shape()).map(([key, nested]) => [
366
402
  key,
367
- interpolateRecursive(nested as z.ZodFirstPartySchemaTypes),
403
+ interpolateRecursive(toFirstPartySchema(nested)),
368
404
  ]),
369
405
  ),
370
406
  def,
371
407
  )
372
- return z.union([
373
- interpolationSchemaFull,
374
- def.unknownKeys === 'strict'
375
- ? replacement.strict()
376
- : def.unknownKeys === 'passthrough'
377
- ? replacement.passthrough()
378
- : replacement,
379
- ]) as InterpolatableSchema<Schema>
408
+ return toInterpolatableSchema(
409
+ z.union([
410
+ interpolationSchemaFull,
411
+ def.unknownKeys === 'strict'
412
+ ? replacement.strict()
413
+ : def.unknownKeys === 'passthrough'
414
+ ? replacement.passthrough()
415
+ : replacement,
416
+ ]),
417
+ )
380
418
  }
381
419
  case z.ZodFirstPartyTypeKind.ZodOptional:
382
- return z.optional(interpolateRecursive(def.innerType), def) as InterpolatableSchema<Schema>
420
+ return toInterpolatableSchema(z.optional(interpolateRecursive(def.innerType), def))
383
421
  case z.ZodFirstPartyTypeKind.ZodRecord:
384
- return z.record(
385
- def.keyType,
386
- interpolateRecursive(def.valueType),
387
- def,
388
- ) as InterpolatableSchema<Schema>
422
+ return toInterpolatableSchema(z.record(def.keyType, interpolateRecursive(def.valueType), def))
389
423
  case z.ZodFirstPartyTypeKind.ZodString:
390
- return z.union([interpolationSchemaPartial, schema], def) as InterpolatableSchema<Schema>
424
+ return toInterpolatableSchema(z.union([interpolationSchemaPartial, schema], def))
391
425
  case z.ZodFirstPartyTypeKind.ZodTuple: {
392
426
  const tuple = z.tuple(def.items.map(interpolateRecursive), def)
393
427
 
394
- return z.union([
395
- interpolationSchemaFull,
396
- def.rest ? tuple.rest(def.rest) : tuple,
397
- ]) as InterpolatableSchema<Schema>
428
+ return toInterpolatableSchema(
429
+ z.union([interpolationSchemaFull, def.rest ? tuple.rest(def.rest) : tuple]),
430
+ )
398
431
  }
399
432
  case z.ZodFirstPartyTypeKind.ZodUnion:
400
- return z.union(
401
- [interpolationSchemaFull, ...(def.options.map(interpolateRecursive) as z.ZodUnionOptions)],
402
- def,
403
- ) as InterpolatableSchema<Schema>
433
+ return toInterpolatableSchema(
434
+ z.union(
435
+ [
436
+ interpolationSchemaFull,
437
+ ...toInterpolatableUnionOptions(def.options.map(interpolateRecursive)),
438
+ ],
439
+ def,
440
+ ),
441
+ )
404
442
  default:
405
- return schema as InterpolatableSchema<Schema>
443
+ return toInterpolatableSchema(schema)
406
444
  }
407
445
  }
408
446
 
409
447
  /**
410
448
  * The robot keys specified in this array can’t be interpolated.
411
449
  */
412
- const uninterpolatableKeys = ['robot', 'use'] as const
450
+ const uninterpolatableKeys = ['interpolate', 'robot', 'use'] as const
451
+ const uninterpolatableKeySet = new Set<string>(uninterpolatableKeys)
413
452
 
414
453
  type InterpolatableRobot<Schema extends z.ZodObject<z.ZodRawShape>> =
415
454
  Schema extends z.ZodObject<infer T, infer UnknownKeys, infer Catchall>
@@ -428,27 +467,45 @@ export function interpolateRobot<Schema extends z.ZodObject<z.ZodRawShape>>(
428
467
  schema: Schema,
429
468
  ): InterpolatableRobot<Schema> {
430
469
  const def = schema._def
431
- return z
432
- .object(
433
- Object.fromEntries(
434
- Object.entries(def.shape()).map(([key, nested]) => [
435
- key,
436
- (uninterpolatableKeys as readonly string[]).includes(key)
437
- ? nested
438
- : interpolateRecursive(nested as z.ZodFirstPartySchemaTypes),
439
- ]),
440
- ),
441
- def,
442
- )
443
- .strict() as InterpolatableRobot<Schema>
470
+ return toInterpolatableRobot(
471
+ z
472
+ .object(
473
+ Object.fromEntries(
474
+ Object.entries(def.shape()).map(([key, nested]) => [
475
+ key,
476
+ uninterpolatableKeySet.has(key)
477
+ ? nested
478
+ : interpolateRecursive(toFirstPartySchema(nested)),
479
+ ]),
480
+ ),
481
+ def,
482
+ )
483
+ .strict(),
484
+ )
444
485
  }
445
486
 
487
+ const robotInterpolateBooleanSchema = z
488
+ .union([z.boolean(), booleanStringSchema])
489
+ .transform((value) => value === true || value === 'true')
490
+
491
+ export const robotInterpolateSchema = z
492
+ .union([robotInterpolateBooleanSchema, z.record(robotInterpolateBooleanSchema)])
493
+ .describe(`
494
+ Controls whether Assembly Variables are interpolated for individual instruction fields.
495
+
496
+ By default, most Robot instruction fields interpolate Assembly Variables. Set this to \`false\` to treat every instruction field as literal text, or set an individual field path to \`false\` to treat only that field as literal text. For Robot-specific fields that are literal by default, set this to \`true\` or set that field path to \`true\` to opt back into interpolation.
497
+
498
+ Use field names such as \`path\`, or dotted paths such as \`ffmpeg.vf\` for nested objects.
499
+ `)
500
+
446
501
  /**
447
502
  * Fields that are shared by all Transloadit robots.
448
503
  */
449
504
  export type RobotBase = z.infer<typeof robotBase>
450
505
  export const robotBase = z
451
506
  .object({
507
+ interpolate: robotInterpolateSchema.optional(),
508
+
452
509
  output_meta: z
453
510
  .union([z.record(z.boolean()), z.boolean(), z.array(z.string())])
454
511
  .optional()
@@ -805,7 +862,7 @@ A parameter object to be passed to FFmpeg. If a preset is used, the options spec
805
862
  ffmpeg_stack: z
806
863
  // Any semver in range is allowed and normalized. The enum is used for editor completions.
807
864
  .union([z.enum(['v5', 'v6', 'v7']), z.string().regex(/^v?[567](\.\d+)?(\.\d+)?$/)])
808
- .default('v5.0.0')
865
+ .default('v6.0.0')
809
866
  .describe(`
810
867
  Selects the FFmpeg stack version to use for encoding. These versions reflect real FFmpeg versions. We currently recommend to use "v6.0.0".
811
868
  `),
@@ -214,7 +214,9 @@ export const robotAiChatInstructionsSchema = robotBase
214
214
  system_message: z
215
215
  .string()
216
216
  .optional()
217
- .describe('Set the system/developer prompt, if the model allows it'),
217
+ .describe(
218
+ 'Set the system/developer prompt, if the model allows it. If this prompt contains literal documentation or code examples with `${...}` syntax, set `interpolate.system_message` to `false`.',
219
+ ),
218
220
  reasoning_effort: z
219
221
  .enum(['xhigh', 'high', 'medium', 'low'])
220
222
  .optional()
@@ -2,9 +2,10 @@ import { z } from 'zod'
2
2
  import type { RobotMetaInput } from './_instructions-primitives.ts'
3
3
  import { interpolateRobot, robotBase } from './_instructions-primitives.ts'
4
4
 
5
- // @ts-expect-error - AssemblySavejsonRobot is not ready yet @TODO please supply missing keys
6
5
  export const meta: RobotMetaInput = {
7
- name: 'AssemblySavejsonRobot',
6
+ bytescount: 0,
7
+ discount_factor: 0,
8
+ discount_pct: 100,
8
9
  example_code: {
9
10
  steps: {
10
11
  save_json: {
@@ -13,6 +14,19 @@ export const meta: RobotMetaInput = {
13
14
  },
14
15
  },
15
16
  example_code_description: 'Save Assembly result data as JSON:',
17
+ minimum_charge: 0,
18
+ output_factor: 1,
19
+ override_lvl1: 'File Exporting',
20
+ purpose_sentence: 'exports Assembly status data as JSON',
21
+ purpose_verb: 'export',
22
+ purpose_word: 'Assembly status',
23
+ purpose_words: 'Export Assembly status JSON',
24
+ service_slug: 'file-exporting',
25
+ slot_count: 5,
26
+ title: 'Export Assembly status JSON',
27
+ typical_file_size_mb: 0.1,
28
+ typical_file_type: 'file',
29
+ name: 'AssemblySavejsonRobot',
16
30
  priceFactor: 0,
17
31
  queueSlotCount: 5,
18
32
  isAllowedForUrlTransform: true,
@@ -102,6 +102,20 @@ If you specify the value \`"gif"\`, then an animated gif cycling through all pag
102
102
  If your output format is \`"gif"\` then this parameter sets the number of 100th seconds to pass before the next frame is shown in the animation. Set this to \`100\` for example to allow 1 second to pass between the frames of the animated gif.
103
103
 
104
104
  If your output format is not \`"gif"\`, then this parameter does not have any effect.
105
+ `),
106
+ stack: z
107
+ .enum(['ghostscript', 'vips', 'pdfium'])
108
+ .optional()
109
+ .describe(`
110
+ Selects the PDF rendering stack. Defaults to Ghostscript.
111
+
112
+ Use \`"pdfium"\` for page-specific or single-page high-DPI PDF rasterization when Ghostscript is too slow or exhausts scratch space, for example with high-resolution CAD, blueprint, or layered real-estate PDFs. This stack uses PDFium via the Python \`pypdfium2\` bindings and Pillow for final image encoding.
113
+
114
+ Use \`"vips"\` only when you explicitly want libvips PDF loading. It is lower-overhead, but PDFium was faster in high-DPI floorplan tests while producing comparable output quality.
115
+
116
+ The \`"pdfium"\` stack currently supports JPG/PNG output, \`resize_strategy: "fit"\`, a specific \`page\` or single-page PDFs, opaque hexadecimal backgrounds, \`antialiasing\`, and \`pdf_use_cropbox\`.
117
+
118
+ The \`"vips"\` stack currently supports JPG/PNG output, \`resize_strategy: "fit"\`, a specific \`page\` or single-page PDFs, and hexadecimal or transparent backgrounds.
105
119
  `),
106
120
  width: z
107
121
  .number()
@@ -206,10 +220,10 @@ export const robotDocumentThumbsInstructionsWithHiddenFieldsSchema =
206
220
  .union([z.literal('debug'), robotDocumentThumbsInstructionsSchema.shape.result])
207
221
  .optional(),
208
222
  stack: z
209
- .string()
223
+ .enum(['ghostscript', 'vips', 'pdfium', 'imagemagick'])
210
224
  .optional()
211
225
  .describe(`
212
- The image processing stack to use. Defaults to the robot's preferred stack (ImageMagick).
226
+ Selects the PDF rendering stack. Use \`"ghostscript"\` for the default renderer, \`"pdfium"\` for high-end CAD, blueprint, floorplan, or other complex high-DPI PDFs where Ghostscript is too slow or exhausts scratch space, and \`"vips"\` only when libvips PDF loading is explicitly needed. The \`"imagemagick"\` value is kept for internal/backwards-compatible use and should not be used in new public templates.
213
227
  `),
214
228
  // Override to support lowercase for BC:
215
229
  alpha: z
@@ -59,6 +59,10 @@ The <dfn>Robot</dfn> has two modes of operation:
59
59
  - Constructing conditions out of arrays with 3 members each. For example, \`["\${file.size}", "<=", "720"]\`
60
60
  - Writing conditions in JavaScript. For example, \`\${file.size <= 720}\`. See also [Dynamic Evaluation](/docs/topics/dynamic-evaluation/).
61
61
 
62
+ If you want a \`/file/filter\` Step to pass every input file through unchanged, leave \`accepts\` and
63
+ \`declines\` unset, or set them to \`null\`. Do not use \`"accepts": "true"\` for this: plain strings
64
+ are treated as JavaScript expressions only when they use the \`\${...}\` form, such as \`"\${true}"\`.
65
+
62
66
  Passing JavaScript allows you to implement logic as complex as you wish, however it’s slower than combining arrays of conditions, and will be charged for per invocation via [🤖/script/run](/docs/robots/script-run/).
63
67
 
64
68
  ### Conditions as arrays
@@ -109,7 +113,7 @@ As indicated, we charge for this via [🤖/script/run](/docs/robots/script-run/)
109
113
  accepts: filterCondition
110
114
  .describe(
111
115
  `
112
- Files that match at least one requirement will be accepted, or declined otherwise. If the value is \`null\`, all files will be accepted. If the array is empty, no files will be accepted. Examples:
116
+ Files that match at least one requirement will be accepted, or declined otherwise. If the value is \`null\`, all files will be accepted. If the array is empty, no files will be accepted. Omit this parameter or set it to \`null\` when you want the Step to pass every file through. Examples:
113
117
 
114
118
  \`[["\${file.mime}", "==", "image/gif"]]\`
115
119
  \`[["\${file.size}", "<", "5kb"]]\`
@@ -3,9 +3,10 @@ import { z } from 'zod'
3
3
  import type { RobotMetaInput } from './_instructions-primitives.ts'
4
4
  import { interpolateRobot, robotBase, robotUse } from './_instructions-primitives.ts'
5
5
 
6
- // @ts-expect-error - FileWatermarkRobot is not ready yet @TODO please supply missing keys
7
6
  export const meta: RobotMetaInput = {
8
- name: 'FileWatermarkRobot',
7
+ bytescount: 4,
8
+ discount_factor: 0.25,
9
+ discount_pct: 75,
9
10
  example_code: {
10
11
  steps: {
11
12
  watermarked: {
@@ -16,6 +17,19 @@ export const meta: RobotMetaInput = {
16
17
  },
17
18
  },
18
19
  example_code_description: 'Apply randomized watermarking to uploaded files:',
20
+ minimum_charge: 0,
21
+ output_factor: 1,
22
+ override_lvl1: 'Image Manipulation',
23
+ purpose_sentence: 'applies randomized watermarks to uploaded media',
24
+ purpose_verb: 'write',
25
+ purpose_word: 'watermark files',
26
+ purpose_words: 'Watermark files',
27
+ service_slug: 'image-manipulation',
28
+ slot_count: 20,
29
+ title: 'Apply watermarks to files',
30
+ typical_file_size_mb: 1.2,
31
+ typical_file_type: 'file',
32
+ name: 'FileWatermarkRobot',
19
33
  priceFactor: 4,
20
34
  queueSlotCount: 20,
21
35
  isAllowedForUrlTransform: true,
@@ -6,6 +6,7 @@ import {
6
6
  return_file_stubs,
7
7
  robotBase,
8
8
  robotImport,
9
+ robotUseWithHiddenFields,
9
10
  } from './_instructions-primitives.ts'
10
11
 
11
12
  export const meta: RobotMetaInput = {
@@ -85,6 +86,10 @@ Headers can be specified as:
85
86
  - An array of strings in the format "Header-Name: value"
86
87
  - An array of objects with header names as keys and values as values
87
88
  - A JSON string that will be parsed into an object
89
+
90
+ The same \`headers\` value is sent with every URL in this \`/http/import\` Step. If \`url\` is an
91
+ array, \`headers\` is not matched to the URLs by array index. Use separate \`/http/import\` Steps
92
+ when different URLs need different headers.
88
93
  `),
89
94
  import_on_errors: z
90
95
  .array(z.string())
@@ -123,8 +128,9 @@ Allows you to specify one or more byte ranges to import from the file. The serve
123
128
  })
124
129
  .strict()
125
130
 
126
- export const robotHttpImportInstructionsWithHiddenFieldsSchema =
127
- robotHttpImportInstructionsSchema.extend({
131
+ export const robotHttpImportInstructionsWithHiddenFieldsSchema = robotHttpImportInstructionsSchema
132
+ .merge(robotUseWithHiddenFields)
133
+ .extend({
128
134
  force_original_id: z.string().optional(),
129
135
  force_name: z
130
136
  .union([z.string(), z.record(z.string())])
@@ -54,7 +54,7 @@ This <dfn>Robot</dfn> enables you to lower your storage and bandwidth costs, and
54
54
  It works well together with [🤖/image/resize](/docs/robots/image-resize/) to bring the full power of resized and optimized images to your website or app.
55
55
 
56
56
  > [!Note]
57
- > This <dfn>Robot</dfn> accepts all image types and will just pass on unsupported image types unoptimized. Hence, there is no need to set up [🤖/file/filter](/docs/robots/file-filter/) workflows for this.
57
+ > This <dfn>Robot</dfn> accepts all image types and will just pass on unsupported image types unoptimized, including JPEG XL (\`.jxl\`) images when no smaller optimized result can be produced. Hence, there is no need to set up [🤖/file/filter](/docs/robots/file-filter/) workflows for this.
58
58
 
59
59
  > [!Note]
60
60
  > PNG optimization uses only lossless (optipng) compressors by default. To also enable lossy compression (pngquant), set \`lossy: true\`. When enabled, both lossy and lossless compressors compete and the smallest result wins, which may cause color shifts in some images.
@@ -162,7 +162,7 @@ export const robotImageResizeInstructionsSchema = robotBase
162
162
  .describe(`
163
163
  The output format for the modified image.
164
164
 
165
- Some of the most important available formats are \`"jpg"\`, \`"png"\`, \`"gif"\`, and \`"tiff"\`. For a complete lists of all formats that we can write to please check [our supported image formats list](/docs/supported-formats/image-formats/).
165
+ Some of the most important available formats are \`"jpg"\`, \`"png"\`, \`"gif"\`, \`"tiff"\`, and \`"jxl"\` for JPEG XL. For a complete list of all formats that we can write to, please check [our supported image formats list](/docs/supported-formats/image-formats/).
166
166
 
167
167
  If \`null\` (default), then the input image's format will be used as the output format.
168
168
 
@@ -2,9 +2,11 @@ import { z } from 'zod'
2
2
  import type { RobotMetaInput } from './_instructions-primitives.ts'
3
3
  import { interpolateRobot, robotBase } from './_instructions-primitives.ts'
4
4
 
5
- // @ts-expect-error - MetaReadRobot is not ready yet @TODO please supply missing keys
6
5
  export const meta: RobotMetaInput = {
7
- name: 'MetaReadRobot',
6
+ // api2 tracks /meta/read as a special 1% metadata fee while keeping runtime priceFactor at 0.
7
+ bytescount: 100,
8
+ discount_factor: 0.01,
9
+ discount_pct: 99,
8
10
  example_code: {
9
11
  steps: {
10
12
  metadata: {
@@ -13,6 +15,19 @@ export const meta: RobotMetaInput = {
13
15
  },
14
16
  },
15
17
  example_code_description: 'Read metadata from uploaded files:',
18
+ minimum_charge: 0,
19
+ output_factor: 1,
20
+ override_lvl1: 'Media Cataloging',
21
+ purpose_sentence: 'reads metadata from uploaded files',
22
+ purpose_verb: 'read',
23
+ purpose_word: 'metadata',
24
+ purpose_words: 'Read file metadata',
25
+ service_slug: 'media-cataloging',
26
+ slot_count: 15,
27
+ title: 'Read file metadata',
28
+ typical_file_size_mb: 1.2,
29
+ typical_file_type: 'file',
30
+ name: 'MetaReadRobot',
16
31
  priceFactor: 0,
17
32
  queueSlotCount: 15,
18
33
  isAllowedForUrlTransform: true,
@@ -3,9 +3,10 @@ import { z } from 'zod'
3
3
  import type { RobotMetaInput } from './_instructions-primitives.ts'
4
4
  import { interpolateRobot, robotBase, robotUse } from './_instructions-primitives.ts'
5
5
 
6
- // @ts-expect-error - ProgressSimulateRobot is not ready yet @TODO please supply missing keys
7
6
  export const meta: RobotMetaInput = {
8
- name: 'ProgressSimulateRobot',
7
+ bytescount: 1,
8
+ discount_factor: 1,
9
+ discount_pct: 0,
9
10
  example_code: {
10
11
  steps: {
11
12
  simulate: {
@@ -19,6 +20,19 @@ export const meta: RobotMetaInput = {
19
20
  },
20
21
  },
21
22
  example_code_description: 'Simulate Step progress and output generation for testing:',
23
+ minimum_charge: 0,
24
+ output_factor: 1,
25
+ override_lvl1: 'Code Evaluation',
26
+ purpose_sentence: 'simulates Step progress and output generation for tests',
27
+ purpose_verb: 'run',
28
+ purpose_word: 'progress simulation',
29
+ purpose_words: 'Simulate Step progress',
30
+ service_slug: 'code-evaluation',
31
+ slot_count: 20,
32
+ title: 'Simulate Step progress',
33
+ typical_file_size_mb: 1.2,
34
+ typical_file_type: 'file',
35
+ name: 'ProgressSimulateRobot',
22
36
  priceFactor: 1,
23
37
  queueSlotCount: 20,
24
38
  isAllowedForUrlTransform: false,
@@ -3,9 +3,9 @@ import type { RobotMetaInput } from './_instructions-primitives.ts'
3
3
  import { interpolateRobot, robotBase } from './_instructions-primitives.ts'
4
4
 
5
5
  export const meta: RobotMetaInput = {
6
- bytescount: 20,
7
- discount_factor: 0.05,
8
- discount_pct: 95,
6
+ bytescount: 25,
7
+ discount_factor: 0.04,
8
+ discount_pct: 96,
9
9
  example_code: {
10
10
  steps: {
11
11
  deliver: {
@@ -27,7 +27,8 @@ export const meta: RobotMetaInput = {
27
27
  typical_file_size_mb: 1.2,
28
28
  typical_file_type: 'file',
29
29
  name: 'TlcdnDeliverRobot',
30
- priceFactor: 20,
30
+ // Baseline factor for non-HIPAA delivery; HIPAA delivery uses a 20% lower factor.
31
+ priceFactor: 25,
31
32
  queueSlotCount: 0,
32
33
  minimumCharge: 102400,
33
34
  downloadInputFiles: false,
@@ -42,8 +43,15 @@ export const meta: RobotMetaInput = {
42
43
  export const robotTlcdnDeliverInstructionsSchema = robotBase
43
44
  .extend({
44
45
  robot: z.literal('/tlcdn/deliver').describe(`
45
- When you want Transloadit to tranform files on the fly, this <dfn>Robot</dfn> can cache and deliver the results close to your end-user, saving on latency and encoding volume. The use of this <dfn>Robot</dfn> is implicit when you use the <code>tlcdn.com</code> domain.
46
+ When you want Transloadit to transform files on the fly, this <dfn>Robot</dfn> can cache and deliver the results close to your end-user, saving on latency and encoding volume. The use of this <dfn>Robot</dfn> is implicit when you use the <code>tlcdn.com</code> domain.
46
47
  `),
48
+ enable_hipaa_compliance: z
49
+ .boolean()
50
+ .optional()
51
+ .default(false)
52
+ .describe(
53
+ 'When enabled, use the HIPAA-compliant Smart CDN pricing profile for this delivery step (20% lower price factor). When disabled, the non-HIPAA baseline price factor applies.',
54
+ ),
47
55
  })
48
56
  .strict()
49
57
 
@@ -137,12 +137,12 @@ The \`referer\` property is a regular expression to match against the HTTP refer
137
137
  Uploads without a referer will always pass (as they are turned off for some browsers) making this useful in just a handful of use cases. For details about regular expressions, see [Mozilla's RegExp documentation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp).
138
138
 
139
139
  The \`max_size\` property can be used to set a maximum size that an upload can have in bytes, such as \`1048576\` (1 MB). Specify this to prevent users from uploading excessively large files.
140
-
141
- This can be set as part of the Assembly request or as part of the Template.
142
-
143
140
  The file size is checked as soon as the upload is started and if it exceeds the maximum size, the entire upload process is canceled and the Assembly will error out, even if it contains files that do not exceed the \`max_size\` limitation.
144
-
145
141
  If you want to just ignore the files that exceed a certain size, but process all others, then please use [🤖/file/filter](https://transloadit.com/docs/robots/file-filter/).
142
+
143
+ The \`max_number_of_files\` property can be used to set a maximum number of files that an upload can have, such as \`100\`. Specify this to prevent users from uploading excessively many files, both via file uploads and via import Robots.
144
+
145
+ These properties can be set as part of the Assembly request or as part of the Template.
146
146
  `)
147
147
 
148
148
  const assemblyInstructionsSharedShape = {