transloadit 3.0.2 → 4.0.0-2

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 (477) hide show
  1. package/CHANGELOG.md +9 -12
  2. package/README.md +175 -129
  3. package/dist/ApiError.d.ts +20 -0
  4. package/dist/ApiError.d.ts.map +1 -0
  5. package/dist/ApiError.js +35 -0
  6. package/dist/ApiError.js.map +1 -0
  7. package/dist/InconsistentResponseError.d.ts +4 -0
  8. package/dist/InconsistentResponseError.d.ts.map +1 -0
  9. package/dist/InconsistentResponseError.js +7 -0
  10. package/dist/InconsistentResponseError.js.map +1 -0
  11. package/dist/PaginationStream.d.ts +14 -0
  12. package/dist/PaginationStream.d.ts.map +1 -0
  13. package/dist/PaginationStream.js +39 -0
  14. package/dist/PaginationStream.js.map +1 -0
  15. package/dist/PollingTimeoutError.d.ts +5 -0
  16. package/dist/PollingTimeoutError.d.ts.map +1 -0
  17. package/dist/PollingTimeoutError.js +8 -0
  18. package/dist/PollingTimeoutError.js.map +1 -0
  19. package/dist/Transloadit.d.ts +227 -0
  20. package/dist/Transloadit.d.ts.map +1 -0
  21. package/dist/Transloadit.js +628 -0
  22. package/dist/Transloadit.js.map +1 -0
  23. package/dist/alphalib/types/assemblyStatus.d.ts +6208 -0
  24. package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -0
  25. package/dist/alphalib/types/assemblyStatus.js +285 -0
  26. package/dist/alphalib/types/assemblyStatus.js.map +1 -0
  27. package/dist/alphalib/types/robots/_index.d.ts +56966 -0
  28. package/dist/alphalib/types/robots/_index.d.ts.map +1 -0
  29. package/dist/alphalib/types/robots/_index.js +347 -0
  30. package/dist/alphalib/types/robots/_index.js.map +1 -0
  31. package/dist/alphalib/types/robots/_instructions-primitives.d.ts +2157 -0
  32. package/dist/alphalib/types/robots/_instructions-primitives.d.ts.map +1 -0
  33. package/dist/alphalib/types/robots/_instructions-primitives.js +655 -0
  34. package/dist/alphalib/types/robots/_instructions-primitives.js.map +1 -0
  35. package/dist/alphalib/types/robots/audio-artwork.d.ts +628 -0
  36. package/dist/alphalib/types/robots/audio-artwork.d.ts.map +1 -0
  37. package/dist/alphalib/types/robots/audio-artwork.js +55 -0
  38. package/dist/alphalib/types/robots/audio-artwork.js.map +1 -0
  39. package/dist/alphalib/types/robots/audio-concat.d.ts +632 -0
  40. package/dist/alphalib/types/robots/audio-concat.d.ts.map +1 -0
  41. package/dist/alphalib/types/robots/audio-concat.js +66 -0
  42. package/dist/alphalib/types/robots/audio-concat.js.map +1 -0
  43. package/dist/alphalib/types/robots/audio-encode.d.ts +629 -0
  44. package/dist/alphalib/types/robots/audio-encode.d.ts.map +1 -0
  45. package/dist/alphalib/types/robots/audio-encode.js +55 -0
  46. package/dist/alphalib/types/robots/audio-encode.js.map +1 -0
  47. package/dist/alphalib/types/robots/audio-loop.d.ts +631 -0
  48. package/dist/alphalib/types/robots/audio-loop.d.ts.map +1 -0
  49. package/dist/alphalib/types/robots/audio-loop.js +54 -0
  50. package/dist/alphalib/types/robots/audio-loop.js.map +1 -0
  51. package/dist/alphalib/types/robots/audio-merge.d.ts +637 -0
  52. package/dist/alphalib/types/robots/audio-merge.d.ts.map +1 -0
  53. package/dist/alphalib/types/robots/audio-merge.js +65 -0
  54. package/dist/alphalib/types/robots/audio-merge.js.map +1 -0
  55. package/dist/alphalib/types/robots/audio-waveform.d.ts +642 -0
  56. package/dist/alphalib/types/robots/audio-waveform.d.ts.map +1 -0
  57. package/dist/alphalib/types/robots/audio-waveform.js +80 -0
  58. package/dist/alphalib/types/robots/audio-waveform.js.map +1 -0
  59. package/dist/alphalib/types/robots/azure-import.d.ts +46 -0
  60. package/dist/alphalib/types/robots/azure-import.d.ts.map +1 -0
  61. package/dist/alphalib/types/robots/azure-import.js +58 -0
  62. package/dist/alphalib/types/robots/azure-import.js.map +1 -0
  63. package/dist/alphalib/types/robots/azure-store.d.ts +129 -0
  64. package/dist/alphalib/types/robots/azure-store.d.ts.map +1 -0
  65. package/dist/alphalib/types/robots/azure-store.js +73 -0
  66. package/dist/alphalib/types/robots/azure-store.js.map +1 -0
  67. package/dist/alphalib/types/robots/backblaze-import.d.ts +49 -0
  68. package/dist/alphalib/types/robots/backblaze-import.d.ts.map +1 -0
  69. package/dist/alphalib/types/robots/backblaze-import.js +66 -0
  70. package/dist/alphalib/types/robots/backblaze-import.js.map +1 -0
  71. package/dist/alphalib/types/robots/backblaze-store.d.ts +111 -0
  72. package/dist/alphalib/types/robots/backblaze-store.d.ts.map +1 -0
  73. package/dist/alphalib/types/robots/backblaze-store.js +58 -0
  74. package/dist/alphalib/types/robots/backblaze-store.js.map +1 -0
  75. package/dist/alphalib/types/robots/cloudfiles-import.d.ts +55 -0
  76. package/dist/alphalib/types/robots/cloudfiles-import.d.ts.map +1 -0
  77. package/dist/alphalib/types/robots/cloudfiles-import.js +65 -0
  78. package/dist/alphalib/types/robots/cloudfiles-import.js.map +1 -0
  79. package/dist/alphalib/types/robots/cloudfiles-store.d.ts +114 -0
  80. package/dist/alphalib/types/robots/cloudfiles-store.d.ts.map +1 -0
  81. package/dist/alphalib/types/robots/cloudfiles-store.js +56 -0
  82. package/dist/alphalib/types/robots/cloudfiles-store.js.map +1 -0
  83. package/dist/alphalib/types/robots/cloudflare-import.d.ts +52 -0
  84. package/dist/alphalib/types/robots/cloudflare-import.d.ts.map +1 -0
  85. package/dist/alphalib/types/robots/cloudflare-import.js +68 -0
  86. package/dist/alphalib/types/robots/cloudflare-import.js.map +1 -0
  87. package/dist/alphalib/types/robots/cloudflare-store.d.ts +117 -0
  88. package/dist/alphalib/types/robots/cloudflare-store.d.ts.map +1 -0
  89. package/dist/alphalib/types/robots/cloudflare-store.js +57 -0
  90. package/dist/alphalib/types/robots/cloudflare-store.js.map +1 -0
  91. package/dist/alphalib/types/robots/digitalocean-import.d.ts +52 -0
  92. package/dist/alphalib/types/robots/digitalocean-import.d.ts.map +1 -0
  93. package/dist/alphalib/types/robots/digitalocean-import.js +65 -0
  94. package/dist/alphalib/types/robots/digitalocean-import.js.map +1 -0
  95. package/dist/alphalib/types/robots/digitalocean-store.d.ts +123 -0
  96. package/dist/alphalib/types/robots/digitalocean-store.d.ts.map +1 -0
  97. package/dist/alphalib/types/robots/digitalocean-store.js +62 -0
  98. package/dist/alphalib/types/robots/digitalocean-store.js.map +1 -0
  99. package/dist/alphalib/types/robots/document-autorotate.d.ts +91 -0
  100. package/dist/alphalib/types/robots/document-autorotate.d.ts.map +1 -0
  101. package/dist/alphalib/types/robots/document-autorotate.js +31 -0
  102. package/dist/alphalib/types/robots/document-autorotate.js.map +1 -0
  103. package/dist/alphalib/types/robots/document-convert.d.ts +118 -0
  104. package/dist/alphalib/types/robots/document-convert.d.ts.map +1 -0
  105. package/dist/alphalib/types/robots/document-convert.js +182 -0
  106. package/dist/alphalib/types/robots/document-convert.js.map +1 -0
  107. package/dist/alphalib/types/robots/document-merge.d.ts +97 -0
  108. package/dist/alphalib/types/robots/document-merge.d.ts.map +1 -0
  109. package/dist/alphalib/types/robots/document-merge.js +66 -0
  110. package/dist/alphalib/types/robots/document-merge.js.map +1 -0
  111. package/dist/alphalib/types/robots/document-ocr.d.ts +100 -0
  112. package/dist/alphalib/types/robots/document-ocr.d.ts.map +1 -0
  113. package/dist/alphalib/types/robots/document-ocr.js +65 -0
  114. package/dist/alphalib/types/robots/document-ocr.js.map +1 -0
  115. package/dist/alphalib/types/robots/document-split.d.ts +94 -0
  116. package/dist/alphalib/types/robots/document-split.d.ts.map +1 -0
  117. package/dist/alphalib/types/robots/document-split.js +34 -0
  118. package/dist/alphalib/types/robots/document-split.js.map +1 -0
  119. package/dist/alphalib/types/robots/document-thumbs.d.ts +134 -0
  120. package/dist/alphalib/types/robots/document-thumbs.d.ts.map +1 -0
  121. package/dist/alphalib/types/robots/document-thumbs.js +111 -0
  122. package/dist/alphalib/types/robots/document-thumbs.js.map +1 -0
  123. package/dist/alphalib/types/robots/dropbox-import.d.ts +43 -0
  124. package/dist/alphalib/types/robots/dropbox-import.d.ts.map +1 -0
  125. package/dist/alphalib/types/robots/dropbox-import.js +52 -0
  126. package/dist/alphalib/types/robots/dropbox-import.js.map +1 -0
  127. package/dist/alphalib/types/robots/dropbox-store.d.ts +114 -0
  128. package/dist/alphalib/types/robots/dropbox-store.d.ts.map +1 -0
  129. package/dist/alphalib/types/robots/dropbox-store.js +49 -0
  130. package/dist/alphalib/types/robots/dropbox-store.js.map +1 -0
  131. package/dist/alphalib/types/robots/edgly-deliver.d.ts +19 -0
  132. package/dist/alphalib/types/robots/edgly-deliver.d.ts.map +1 -0
  133. package/dist/alphalib/types/robots/edgly-deliver.js +31 -0
  134. package/dist/alphalib/types/robots/edgly-deliver.js.map +1 -0
  135. package/dist/alphalib/types/robots/file-compress.d.ts +106 -0
  136. package/dist/alphalib/types/robots/file-compress.d.ts.map +1 -0
  137. package/dist/alphalib/types/robots/file-compress.js +102 -0
  138. package/dist/alphalib/types/robots/file-compress.js.map +1 -0
  139. package/dist/alphalib/types/robots/file-decompress.d.ts +94 -0
  140. package/dist/alphalib/types/robots/file-decompress.d.ts.map +1 -0
  141. package/dist/alphalib/types/robots/file-decompress.js +81 -0
  142. package/dist/alphalib/types/robots/file-decompress.js.map +1 -0
  143. package/dist/alphalib/types/robots/file-filter.d.ts +107 -0
  144. package/dist/alphalib/types/robots/file-filter.d.ts.map +1 -0
  145. package/dist/alphalib/types/robots/file-filter.js +108 -0
  146. package/dist/alphalib/types/robots/file-filter.js.map +1 -0
  147. package/dist/alphalib/types/robots/file-hash.d.ts +94 -0
  148. package/dist/alphalib/types/robots/file-hash.d.ts.map +1 -0
  149. package/dist/alphalib/types/robots/file-hash.js +49 -0
  150. package/dist/alphalib/types/robots/file-hash.js.map +1 -0
  151. package/dist/alphalib/types/robots/file-preview.d.ts +393 -0
  152. package/dist/alphalib/types/robots/file-preview.d.ts.map +1 -0
  153. package/dist/alphalib/types/robots/file-preview.js +155 -0
  154. package/dist/alphalib/types/robots/file-preview.js.map +1 -0
  155. package/dist/alphalib/types/robots/file-read.d.ts +91 -0
  156. package/dist/alphalib/types/robots/file-read.d.ts.map +1 -0
  157. package/dist/alphalib/types/robots/file-read.js +34 -0
  158. package/dist/alphalib/types/robots/file-read.js.map +1 -0
  159. package/dist/alphalib/types/robots/file-serve.d.ts +95 -0
  160. package/dist/alphalib/types/robots/file-serve.d.ts.map +1 -0
  161. package/dist/alphalib/types/robots/file-serve.js +56 -0
  162. package/dist/alphalib/types/robots/file-serve.js.map +1 -0
  163. package/dist/alphalib/types/robots/file-verify.d.ts +100 -0
  164. package/dist/alphalib/types/robots/file-verify.d.ts.map +1 -0
  165. package/dist/alphalib/types/robots/file-verify.js +52 -0
  166. package/dist/alphalib/types/robots/file-verify.js.map +1 -0
  167. package/dist/alphalib/types/robots/file-virusscan.d.ts +97 -0
  168. package/dist/alphalib/types/robots/file-virusscan.d.ts.map +1 -0
  169. package/dist/alphalib/types/robots/file-virusscan.js +55 -0
  170. package/dist/alphalib/types/robots/file-virusscan.js.map +1 -0
  171. package/dist/alphalib/types/robots/file-watermark.d.ts +92 -0
  172. package/dist/alphalib/types/robots/file-watermark.d.ts.map +1 -0
  173. package/dist/alphalib/types/robots/file-watermark.js +13 -0
  174. package/dist/alphalib/types/robots/file-watermark.js.map +1 -0
  175. package/dist/alphalib/types/robots/ftp-import.d.ts +46 -0
  176. package/dist/alphalib/types/robots/ftp-import.d.ts.map +1 -0
  177. package/dist/alphalib/types/robots/ftp-import.js +47 -0
  178. package/dist/alphalib/types/robots/ftp-import.js.map +1 -0
  179. package/dist/alphalib/types/robots/ftp-store.d.ts +120 -0
  180. package/dist/alphalib/types/robots/ftp-store.d.ts.map +1 -0
  181. package/dist/alphalib/types/robots/ftp-store.js +57 -0
  182. package/dist/alphalib/types/robots/ftp-store.js.map +1 -0
  183. package/dist/alphalib/types/robots/google-import.d.ts +40 -0
  184. package/dist/alphalib/types/robots/google-import.d.ts.map +1 -0
  185. package/dist/alphalib/types/robots/google-import.js +65 -0
  186. package/dist/alphalib/types/robots/google-import.js.map +1 -0
  187. package/dist/alphalib/types/robots/google-store.d.ts +113 -0
  188. package/dist/alphalib/types/robots/google-store.d.ts.map +1 -0
  189. package/dist/alphalib/types/robots/google-store.js +86 -0
  190. package/dist/alphalib/types/robots/google-store.js.map +1 -0
  191. package/dist/alphalib/types/robots/html-convert.d.ts +115 -0
  192. package/dist/alphalib/types/robots/html-convert.d.ts.map +1 -0
  193. package/dist/alphalib/types/robots/html-convert.js +81 -0
  194. package/dist/alphalib/types/robots/html-convert.js.map +1 -0
  195. package/dist/alphalib/types/robots/http-import.d.ts +42 -0
  196. package/dist/alphalib/types/robots/http-import.d.ts.map +1 -0
  197. package/dist/alphalib/types/robots/http-import.js +76 -0
  198. package/dist/alphalib/types/robots/http-import.js.map +1 -0
  199. package/dist/alphalib/types/robots/image-describe.d.ts +103 -0
  200. package/dist/alphalib/types/robots/image-describe.d.ts.map +1 -0
  201. package/dist/alphalib/types/robots/image-describe.js +66 -0
  202. package/dist/alphalib/types/robots/image-describe.js.map +1 -0
  203. package/dist/alphalib/types/robots/image-facedetect.d.ts +109 -0
  204. package/dist/alphalib/types/robots/image-facedetect.d.ts.map +1 -0
  205. package/dist/alphalib/types/robots/image-facedetect.js +125 -0
  206. package/dist/alphalib/types/robots/image-facedetect.js.map +1 -0
  207. package/dist/alphalib/types/robots/image-generate.d.ts +229 -0
  208. package/dist/alphalib/types/robots/image-generate.d.ts.map +1 -0
  209. package/dist/alphalib/types/robots/image-generate.js +27 -0
  210. package/dist/alphalib/types/robots/image-generate.js.map +1 -0
  211. package/dist/alphalib/types/robots/image-merge.d.ts +109 -0
  212. package/dist/alphalib/types/robots/image-merge.d.ts.map +1 -0
  213. package/dist/alphalib/types/robots/image-merge.js +74 -0
  214. package/dist/alphalib/types/robots/image-merge.js.map +1 -0
  215. package/dist/alphalib/types/robots/image-ocr.d.ts +100 -0
  216. package/dist/alphalib/types/robots/image-ocr.d.ts.map +1 -0
  217. package/dist/alphalib/types/robots/image-ocr.js +64 -0
  218. package/dist/alphalib/types/robots/image-ocr.js.map +1 -0
  219. package/dist/alphalib/types/robots/image-optimize.d.ts +103 -0
  220. package/dist/alphalib/types/robots/image-optimize.d.ts.map +1 -0
  221. package/dist/alphalib/types/robots/image-optimize.js +60 -0
  222. package/dist/alphalib/types/robots/image-optimize.js.map +1 -0
  223. package/dist/alphalib/types/robots/image-remove-background.d.ts +98 -0
  224. package/dist/alphalib/types/robots/image-remove-background.d.ts.map +1 -0
  225. package/dist/alphalib/types/robots/image-remove-background.js +21 -0
  226. package/dist/alphalib/types/robots/image-remove-background.js.map +1 -0
  227. package/dist/alphalib/types/robots/image-resize.d.ts +696 -0
  228. package/dist/alphalib/types/robots/image-resize.d.ts.map +1 -0
  229. package/dist/alphalib/types/robots/image-resize.js +364 -0
  230. package/dist/alphalib/types/robots/image-resize.js.map +1 -0
  231. package/dist/alphalib/types/robots/media-playlist.d.ts +115 -0
  232. package/dist/alphalib/types/robots/media-playlist.d.ts.map +1 -0
  233. package/dist/alphalib/types/robots/media-playlist.js +56 -0
  234. package/dist/alphalib/types/robots/media-playlist.js.map +1 -0
  235. package/dist/alphalib/types/robots/meta-write.d.ts +623 -0
  236. package/dist/alphalib/types/robots/meta-write.d.ts.map +1 -0
  237. package/dist/alphalib/types/robots/meta-write.js +53 -0
  238. package/dist/alphalib/types/robots/meta-write.js.map +1 -0
  239. package/dist/alphalib/types/robots/minio-import.d.ts +52 -0
  240. package/dist/alphalib/types/robots/minio-import.d.ts.map +1 -0
  241. package/dist/alphalib/types/robots/minio-import.js +68 -0
  242. package/dist/alphalib/types/robots/minio-import.js.map +1 -0
  243. package/dist/alphalib/types/robots/minio-store.d.ts +120 -0
  244. package/dist/alphalib/types/robots/minio-store.d.ts.map +1 -0
  245. package/dist/alphalib/types/robots/minio-store.js +61 -0
  246. package/dist/alphalib/types/robots/minio-store.js.map +1 -0
  247. package/dist/alphalib/types/robots/progress-simulate.d.ts +29 -0
  248. package/dist/alphalib/types/robots/progress-simulate.d.ts.map +1 -0
  249. package/dist/alphalib/types/robots/progress-simulate.js +15 -0
  250. package/dist/alphalib/types/robots/progress-simulate.js.map +1 -0
  251. package/dist/alphalib/types/robots/s3-import.d.ts +52 -0
  252. package/dist/alphalib/types/robots/s3-import.d.ts.map +1 -0
  253. package/dist/alphalib/types/robots/s3-import.js +104 -0
  254. package/dist/alphalib/types/robots/s3-import.js.map +1 -0
  255. package/dist/alphalib/types/robots/s3-store.d.ts +135 -0
  256. package/dist/alphalib/types/robots/s3-store.d.ts.map +1 -0
  257. package/dist/alphalib/types/robots/s3-store.js +118 -0
  258. package/dist/alphalib/types/robots/s3-store.js.map +1 -0
  259. package/dist/alphalib/types/robots/script-run.d.ts +94 -0
  260. package/dist/alphalib/types/robots/script-run.d.ts.map +1 -0
  261. package/dist/alphalib/types/robots/script-run.js +79 -0
  262. package/dist/alphalib/types/robots/script-run.js.map +1 -0
  263. package/dist/alphalib/types/robots/sftp-import.d.ts +43 -0
  264. package/dist/alphalib/types/robots/sftp-import.d.ts.map +1 -0
  265. package/dist/alphalib/types/robots/sftp-import.js +45 -0
  266. package/dist/alphalib/types/robots/sftp-import.js.map +1 -0
  267. package/dist/alphalib/types/robots/sftp-store.d.ts +120 -0
  268. package/dist/alphalib/types/robots/sftp-store.d.ts.map +1 -0
  269. package/dist/alphalib/types/robots/sftp-store.js +58 -0
  270. package/dist/alphalib/types/robots/sftp-store.js.map +1 -0
  271. package/dist/alphalib/types/robots/speech-transcribe.d.ts +210 -0
  272. package/dist/alphalib/types/robots/speech-transcribe.d.ts.map +1 -0
  273. package/dist/alphalib/types/robots/speech-transcribe.js +80 -0
  274. package/dist/alphalib/types/robots/speech-transcribe.js.map +1 -0
  275. package/dist/alphalib/types/robots/supabase-import.d.ts +52 -0
  276. package/dist/alphalib/types/robots/supabase-import.d.ts.map +1 -0
  277. package/dist/alphalib/types/robots/supabase-import.js +70 -0
  278. package/dist/alphalib/types/robots/supabase-import.js.map +1 -0
  279. package/dist/alphalib/types/robots/supabase-store.d.ts +117 -0
  280. package/dist/alphalib/types/robots/supabase-store.d.ts.map +1 -0
  281. package/dist/alphalib/types/robots/supabase-store.js +54 -0
  282. package/dist/alphalib/types/robots/supabase-store.js.map +1 -0
  283. package/dist/alphalib/types/robots/swift-import.d.ts +52 -0
  284. package/dist/alphalib/types/robots/swift-import.d.ts.map +1 -0
  285. package/dist/alphalib/types/robots/swift-import.js +68 -0
  286. package/dist/alphalib/types/robots/swift-import.js.map +1 -0
  287. package/dist/alphalib/types/robots/swift-store.d.ts +120 -0
  288. package/dist/alphalib/types/robots/swift-store.d.ts.map +1 -0
  289. package/dist/alphalib/types/robots/swift-store.js +58 -0
  290. package/dist/alphalib/types/robots/swift-store.js.map +1 -0
  291. package/dist/alphalib/types/robots/text-speak.d.ts +106 -0
  292. package/dist/alphalib/types/robots/text-speak.d.ts.map +1 -0
  293. package/dist/alphalib/types/robots/text-speak.js +97 -0
  294. package/dist/alphalib/types/robots/text-speak.js.map +1 -0
  295. package/dist/alphalib/types/robots/text-translate.d.ts +100 -0
  296. package/dist/alphalib/types/robots/text-translate.d.ts.map +1 -0
  297. package/dist/alphalib/types/robots/text-translate.js +196 -0
  298. package/dist/alphalib/types/robots/text-translate.js.map +1 -0
  299. package/dist/alphalib/types/robots/tigris-import.d.ts +52 -0
  300. package/dist/alphalib/types/robots/tigris-import.d.ts.map +1 -0
  301. package/dist/alphalib/types/robots/tigris-import.js +68 -0
  302. package/dist/alphalib/types/robots/tigris-import.js.map +1 -0
  303. package/dist/alphalib/types/robots/tigris-store.d.ts +120 -0
  304. package/dist/alphalib/types/robots/tigris-store.d.ts.map +1 -0
  305. package/dist/alphalib/types/robots/tigris-store.js +61 -0
  306. package/dist/alphalib/types/robots/tigris-store.js.map +1 -0
  307. package/dist/alphalib/types/robots/tlcdn-deliver.d.ts +19 -0
  308. package/dist/alphalib/types/robots/tlcdn-deliver.d.ts.map +1 -0
  309. package/dist/alphalib/types/robots/tlcdn-deliver.js +31 -0
  310. package/dist/alphalib/types/robots/tlcdn-deliver.js.map +1 -0
  311. package/dist/alphalib/types/robots/tus-store.d.ts +110 -0
  312. package/dist/alphalib/types/robots/tus-store.d.ts.map +1 -0
  313. package/dist/alphalib/types/robots/tus-store.js +74 -0
  314. package/dist/alphalib/types/robots/tus-store.js.map +1 -0
  315. package/dist/alphalib/types/robots/upload-handle.d.ts +92 -0
  316. package/dist/alphalib/types/robots/upload-handle.d.ts.map +1 -0
  317. package/dist/alphalib/types/robots/upload-handle.js +54 -0
  318. package/dist/alphalib/types/robots/upload-handle.js.map +1 -0
  319. package/dist/alphalib/types/robots/video-adaptive.d.ts +640 -0
  320. package/dist/alphalib/types/robots/video-adaptive.d.ts.map +1 -0
  321. package/dist/alphalib/types/robots/video-adaptive.js +119 -0
  322. package/dist/alphalib/types/robots/video-adaptive.js.map +1 -0
  323. package/dist/alphalib/types/robots/video-concat.d.ts +634 -0
  324. package/dist/alphalib/types/robots/video-concat.d.ts.map +1 -0
  325. package/dist/alphalib/types/robots/video-concat.js +65 -0
  326. package/dist/alphalib/types/robots/video-concat.js.map +1 -0
  327. package/dist/alphalib/types/robots/video-encode.d.ts +1439 -0
  328. package/dist/alphalib/types/robots/video-encode.d.ts.map +1 -0
  329. package/dist/alphalib/types/robots/video-encode.js +157 -0
  330. package/dist/alphalib/types/robots/video-encode.js.map +1 -0
  331. package/dist/alphalib/types/robots/video-merge.d.ts +655 -0
  332. package/dist/alphalib/types/robots/video-merge.d.ts.map +1 -0
  333. package/dist/alphalib/types/robots/video-merge.js +64 -0
  334. package/dist/alphalib/types/robots/video-merge.js.map +1 -0
  335. package/dist/alphalib/types/robots/video-subtitle.d.ts +649 -0
  336. package/dist/alphalib/types/robots/video-subtitle.d.ts.map +1 -0
  337. package/dist/alphalib/types/robots/video-subtitle.js +77 -0
  338. package/dist/alphalib/types/robots/video-subtitle.js.map +1 -0
  339. package/dist/alphalib/types/robots/video-thumbs.d.ts +642 -0
  340. package/dist/alphalib/types/robots/video-thumbs.d.ts.map +1 -0
  341. package/dist/alphalib/types/robots/video-thumbs.js +79 -0
  342. package/dist/alphalib/types/robots/video-thumbs.js.map +1 -0
  343. package/dist/alphalib/types/robots/vimeo-store.d.ts +116 -0
  344. package/dist/alphalib/types/robots/vimeo-store.d.ts.map +1 -0
  345. package/dist/alphalib/types/robots/vimeo-store.js +81 -0
  346. package/dist/alphalib/types/robots/vimeo-store.js.map +1 -0
  347. package/dist/alphalib/types/robots/wasabi-import.d.ts +53 -0
  348. package/dist/alphalib/types/robots/wasabi-import.d.ts.map +1 -0
  349. package/dist/alphalib/types/robots/wasabi-import.js +72 -0
  350. package/dist/alphalib/types/robots/wasabi-import.js.map +1 -0
  351. package/dist/alphalib/types/robots/wasabi-store.d.ts +120 -0
  352. package/dist/alphalib/types/robots/wasabi-store.d.ts.map +1 -0
  353. package/dist/alphalib/types/robots/wasabi-store.js +59 -0
  354. package/dist/alphalib/types/robots/wasabi-store.js.map +1 -0
  355. package/dist/alphalib/types/robots/youtube-store.d.ts +110 -0
  356. package/dist/alphalib/types/robots/youtube-store.d.ts.map +1 -0
  357. package/dist/alphalib/types/robots/youtube-store.js +105 -0
  358. package/dist/alphalib/types/robots/youtube-store.js.map +1 -0
  359. package/dist/alphalib/types/stackVersions.d.ts +13 -0
  360. package/dist/alphalib/types/stackVersions.d.ts.map +1 -0
  361. package/dist/alphalib/types/stackVersions.js +16 -0
  362. package/dist/alphalib/types/stackVersions.js.map +1 -0
  363. package/dist/alphalib/types/template.d.ts +77150 -0
  364. package/dist/alphalib/types/template.d.ts.map +1 -0
  365. package/dist/alphalib/types/template.js +49 -0
  366. package/dist/alphalib/types/template.js.map +1 -0
  367. package/dist/alphalib/zodParseWithContext.d.ts +18 -0
  368. package/dist/alphalib/zodParseWithContext.d.ts.map +1 -0
  369. package/dist/alphalib/zodParseWithContext.js +123 -0
  370. package/dist/alphalib/zodParseWithContext.js.map +1 -0
  371. package/dist/apiTypes.d.ts +127 -0
  372. package/dist/apiTypes.d.ts.map +1 -0
  373. package/dist/apiTypes.js +3 -0
  374. package/dist/apiTypes.js.map +1 -0
  375. package/dist/tus.d.ts +17 -0
  376. package/dist/tus.d.ts.map +1 -0
  377. package/dist/tus.js +88 -0
  378. package/dist/tus.js.map +1 -0
  379. package/package.json +58 -39
  380. package/src/ApiError.ts +44 -0
  381. package/src/InconsistentResponseError.ts +3 -0
  382. package/src/PaginationStream.ts +55 -0
  383. package/src/PollingTimeoutError.ts +5 -0
  384. package/src/Transloadit.ts +826 -0
  385. package/src/alphalib/types/assemblyStatus.ts +300 -0
  386. package/src/alphalib/types/robots/_index.ts +437 -0
  387. package/src/alphalib/types/robots/_instructions-primitives.ts +835 -0
  388. package/src/alphalib/types/robots/audio-artwork.ts +57 -0
  389. package/src/alphalib/types/robots/audio-concat.ts +74 -0
  390. package/src/alphalib/types/robots/audio-encode.ts +63 -0
  391. package/src/alphalib/types/robots/audio-loop.ts +62 -0
  392. package/src/alphalib/types/robots/audio-merge.ts +73 -0
  393. package/src/alphalib/types/robots/audio-waveform.ts +83 -0
  394. package/src/alphalib/types/robots/azure-import.ts +69 -0
  395. package/src/alphalib/types/robots/azure-store.ts +76 -0
  396. package/src/alphalib/types/robots/backblaze-import.ts +81 -0
  397. package/src/alphalib/types/robots/backblaze-store.ts +63 -0
  398. package/src/alphalib/types/robots/cloudfiles-import.ts +80 -0
  399. package/src/alphalib/types/robots/cloudfiles-store.ts +63 -0
  400. package/src/alphalib/types/robots/cloudflare-import.ts +84 -0
  401. package/src/alphalib/types/robots/cloudflare-store.ts +64 -0
  402. package/src/alphalib/types/robots/digitalocean-import.ts +81 -0
  403. package/src/alphalib/types/robots/digitalocean-store.ts +69 -0
  404. package/src/alphalib/types/robots/document-autorotate.ts +36 -0
  405. package/src/alphalib/types/robots/document-convert.ts +186 -0
  406. package/src/alphalib/types/robots/document-merge.ts +68 -0
  407. package/src/alphalib/types/robots/document-ocr.ts +72 -0
  408. package/src/alphalib/types/robots/document-split.ts +38 -0
  409. package/src/alphalib/types/robots/document-thumbs.ts +119 -0
  410. package/src/alphalib/types/robots/dropbox-import.ts +58 -0
  411. package/src/alphalib/types/robots/dropbox-store.ts +52 -0
  412. package/src/alphalib/types/robots/edgly-deliver.ts +32 -0
  413. package/src/alphalib/types/robots/file-compress.ts +104 -0
  414. package/src/alphalib/types/robots/file-decompress.ts +86 -0
  415. package/src/alphalib/types/robots/file-filter.ts +115 -0
  416. package/src/alphalib/types/robots/file-hash.ts +51 -0
  417. package/src/alphalib/types/robots/file-preview.ts +174 -0
  418. package/src/alphalib/types/robots/file-read.ts +36 -0
  419. package/src/alphalib/types/robots/file-serve.ts +60 -0
  420. package/src/alphalib/types/robots/file-verify.ts +55 -0
  421. package/src/alphalib/types/robots/file-virusscan.ts +60 -0
  422. package/src/alphalib/types/robots/file-watermark.ts +13 -0
  423. package/src/alphalib/types/robots/ftp-import.ts +52 -0
  424. package/src/alphalib/types/robots/ftp-store.ts +61 -0
  425. package/src/alphalib/types/robots/google-import.ts +77 -0
  426. package/src/alphalib/types/robots/google-store.ts +89 -0
  427. package/src/alphalib/types/robots/html-convert.ts +83 -0
  428. package/src/alphalib/types/robots/http-import.ts +79 -0
  429. package/src/alphalib/types/robots/image-describe.ts +74 -0
  430. package/src/alphalib/types/robots/image-facedetect.ts +131 -0
  431. package/src/alphalib/types/robots/image-generate.ts +32 -0
  432. package/src/alphalib/types/robots/image-merge.ts +81 -0
  433. package/src/alphalib/types/robots/image-ocr.ts +71 -0
  434. package/src/alphalib/types/robots/image-optimize.ts +61 -0
  435. package/src/alphalib/types/robots/image-remove-background.ts +23 -0
  436. package/src/alphalib/types/robots/image-resize.ts +401 -0
  437. package/src/alphalib/types/robots/media-playlist.ts +58 -0
  438. package/src/alphalib/types/robots/meta-write.ts +55 -0
  439. package/src/alphalib/types/robots/minio-import.ts +80 -0
  440. package/src/alphalib/types/robots/minio-store.ts +64 -0
  441. package/src/alphalib/types/robots/progress-simulate.ts +16 -0
  442. package/src/alphalib/types/robots/s3-import.ts +116 -0
  443. package/src/alphalib/types/robots/s3-store.ts +121 -0
  444. package/src/alphalib/types/robots/script-run.ts +81 -0
  445. package/src/alphalib/types/robots/sftp-import.ts +50 -0
  446. package/src/alphalib/types/robots/sftp-store.ts +61 -0
  447. package/src/alphalib/types/robots/speech-transcribe.ts +96 -0
  448. package/src/alphalib/types/robots/supabase-import.ts +84 -0
  449. package/src/alphalib/types/robots/supabase-store.ts +59 -0
  450. package/src/alphalib/types/robots/swift-import.ts +80 -0
  451. package/src/alphalib/types/robots/swift-store.ts +61 -0
  452. package/src/alphalib/types/robots/text-speak.ts +100 -0
  453. package/src/alphalib/types/robots/text-translate.ts +199 -0
  454. package/src/alphalib/types/robots/tigris-import.ts +80 -0
  455. package/src/alphalib/types/robots/tigris-store.ts +64 -0
  456. package/src/alphalib/types/robots/tlcdn-deliver.ts +32 -0
  457. package/src/alphalib/types/robots/tus-store.ts +77 -0
  458. package/src/alphalib/types/robots/upload-handle.ts +58 -0
  459. package/src/alphalib/types/robots/video-adaptive.ts +123 -0
  460. package/src/alphalib/types/robots/video-concat.ts +68 -0
  461. package/src/alphalib/types/robots/video-encode.ts +182 -0
  462. package/src/alphalib/types/robots/video-merge.ts +72 -0
  463. package/src/alphalib/types/robots/video-subtitle.ts +86 -0
  464. package/src/alphalib/types/robots/video-thumbs.ts +88 -0
  465. package/src/alphalib/types/robots/vimeo-store.ts +84 -0
  466. package/src/alphalib/types/robots/wasabi-import.ts +84 -0
  467. package/src/alphalib/types/robots/wasabi-store.ts +62 -0
  468. package/src/alphalib/types/robots/youtube-store.ts +108 -0
  469. package/src/alphalib/types/stackVersions.ts +12 -0
  470. package/src/alphalib/types/template.ts +71 -0
  471. package/src/alphalib/zodParseWithContext.ts +151 -0
  472. package/src/apiTypes.ts +165 -0
  473. package/src/tus.ts +123 -0
  474. package/index.js +0 -1
  475. package/src/PaginationStream.js +0 -39
  476. package/src/Transloadit.js +0 -701
  477. package/types/index.d.ts +0 -217
@@ -0,0 +1,104 @@
1
+ import { z } from 'zod'
2
+
3
+ import { robotBase, robotUse } from './_instructions-primitives.ts'
4
+ import type { RobotMeta } from './_instructions-primitives.ts'
5
+
6
+ export const meta: RobotMeta = {
7
+ allowed_for_url_transform: false,
8
+ bytescount: 1,
9
+ discount_factor: 1,
10
+ discount_pct: 0,
11
+ example_code: {
12
+ steps: {
13
+ compressed: {
14
+ robot: '/file/compress',
15
+ use: {
16
+ steps: [':original'],
17
+ bundle_steps: true,
18
+ },
19
+ format: 'zip',
20
+ },
21
+ },
22
+ },
23
+ example_code_description: 'Compress uploaded files into a ZIP archive:',
24
+ extended_description: `
25
+ ### Archive structure for the \`"advanced"\` file layout.
26
+
27
+ There are a few things that we kept in mind when designing the \`"advanced"\` archive structure:
28
+
29
+ - There could be naming collisions.
30
+ - You want to know which <dfn>Step</dfn> a result file belongs to.
31
+ - You want to know from which originally uploaded file a result file was generated.
32
+ - Ideally, you want subfolders for a better structure of files.
33
+
34
+ To achieve all this, we have created the following archive file structure.
35
+
36
+ - There is a subfolder for each <dfn>Step</dfn> name that has result files in the archive.
37
+ - Files are named according to the first two letters of the unique original prefix + "_" + the first two letters of the unique prefix + "_" + the original file name. If you do not know what the original prefixes are, please check [our available Assembly variables](/docs/topics/assembly-instructions/#assembly-variables) and look for \`\${unique_original_prefix}\` and \`\${unique_prefix}\`.
38
+ - Files that belong to the \`:original\` <dfn>Step</dfn> (originally uploaded files) do **not** include the first two letters of the \`unique_original_prefix\`.
39
+ - If you are dealing with thumbnails from [🤖/video/thumbs](/docs/transcoding/video-encoding/video-thumbs/), there is an additional digit representing the order in the file name.
40
+
41
+ Here is an example:
42
+
43
+ \`\`\`yaml
44
+ ":original":
45
+ - gh_a.mov # "gh" are the first 2 letters of the unique prefix.
46
+ # "a.mov" was the file name of the uploaded file.
47
+ - ff_b.mov
48
+ "thumbed":
49
+ - gh_e8_thumb_1.jpg # "gh" is the unique original prefix, meaning it's a result of a.mov.
50
+ # "e8" is the file's unique prefix.
51
+ # The "1" shows the thumbnail order.
52
+ - gh_cv_thumb_2.jpg
53
+ - ff_9b_thumb_3.jpg
54
+ "resized":
55
+ - gh_ll_thumb.jpg
56
+ - gh_df_thumb.jpg
57
+ - ff_jk_thumb.jpg # is a child of b.mov, as it starts with "ff"
58
+ \`\`\`
59
+ `,
60
+ minimum_charge: 0,
61
+ output_factor: 1,
62
+ override_lvl1: 'File Compressing',
63
+ purpose_sentence: 'creates archives of files or file conversion results',
64
+ purpose_verb: 'compress',
65
+ purpose_word: 'compress',
66
+ purpose_words: 'Compress files',
67
+ service_slug: 'file-compressing',
68
+ slot_count: 15,
69
+ title: 'Compress files',
70
+ typical_file_size_mb: 1.2,
71
+ typical_file_type: 'file',
72
+ }
73
+
74
+ export const robotFileCompressInstructionsSchema = robotBase
75
+ .merge(robotUse)
76
+ .extend({
77
+ robot: z.literal('/file/compress'),
78
+ format: z.enum(['tar', 'zip']).default('tar').describe(`
79
+ The format of the archive to be created. Supported values are \`"tar"\` and \`"zip"\`.
80
+
81
+ Note that \`"tar"\` without setting \`gzip\` to \`true\` results in an archive that's not compressed in any way.
82
+ `),
83
+ gzip: z.boolean().default(false).describe(`
84
+ Determines if the result archive should also be gzipped. Gzip compression is only applied if you use the \`"tar"\` format.
85
+ `),
86
+ password: z.string().nullable().default(null).describe(`
87
+ This allows you to encrypt all archive contents with a password and thereby protect it against unauthorized use. To unzip the archive, the user will need to provide the password in a text input field prompt.
88
+
89
+ This parameter has no effect if the format parameter is anything other than \`"zip"\`.
90
+ `),
91
+ compression_level: z.number().int().min(-9).max(0).default(-6).describe(`
92
+ Determines how fiercely to try to compress the archive. \`-0\` is compressionless, which is suitable for media that is already compressed. \`-1\` is fastest with lowest compression. \`-9\` is slowest with the highest compression.
93
+
94
+ If you are using \`-0\` in combination with the \`tar\` format with \`gzip\` enabled, consider setting \`gzip: false\` instead. This results in a plain Tar archive, meaning it already has no compression.
95
+ `),
96
+ file_layout: z.enum(['advanced', 'simple']).default('advanced').describe(`
97
+ Determines if the result archive should contain all files in one directory (value for this is \`"simple"\`) or in subfolders according to the explanation below (value for this is \`"advanced"\`).
98
+
99
+ Files with same names are numbered in the \`"simple"\` file layout to avoid naming collisions.
100
+ `),
101
+ })
102
+ .strict()
103
+
104
+ export type RobotFileCompressInstructions = z.infer<typeof robotFileCompressInstructionsSchema>
@@ -0,0 +1,86 @@
1
+ import { z } from 'zod'
2
+
3
+ import { robotBase, robotUse } from './_instructions-primitives.ts'
4
+ import type { RobotMeta } from './_instructions-primitives.ts'
5
+
6
+ export const meta: RobotMeta = {
7
+ allowed_for_url_transform: true,
8
+ bytescount: 1,
9
+ discount_factor: 0.8,
10
+ discount_pct: 20,
11
+ example_code: {
12
+ steps: {
13
+ decompressed: {
14
+ robot: '/file/decompress',
15
+ use: ':original',
16
+ },
17
+ },
18
+ },
19
+ example_code_description: 'Decompress an uploaded archive:',
20
+ minimum_charge: 0,
21
+ output_factor: 1,
22
+ override_lvl1: 'File Compressing',
23
+ purpose_sentence:
24
+ 'extracts entire archives of files to be consumed by other Robots or exported as individual files',
25
+ purpose_verb: 'decompress',
26
+ purpose_word: 'decompress',
27
+ purpose_words: 'Decompress archives',
28
+ service_slug: 'file-compressing',
29
+ slot_count: 10,
30
+ title: 'Decompress archives',
31
+ typical_file_size_mb: 1.2,
32
+ typical_file_type: 'file',
33
+ }
34
+
35
+ export const robotFileDecompressInstructionsSchema = robotBase
36
+ .merge(robotUse)
37
+ .extend({
38
+ robot: z.literal('/file/decompress').describe(`
39
+ This Robot supports the following archive formats:
40
+
41
+ - ZIP archives (with uncompressed or "deflate"-compressed entries)
42
+ - 7-Zip archives
43
+ - RAR archives
44
+ - GNU tar format (including GNU long filenames, long link names, and sparse files)
45
+ - Solaris 9 extended tar format (including ACLs)
46
+ - Old V7 tar archives
47
+ - POSIX ustar
48
+ - POSIX pax interchange format
49
+ - POSIX octet-oriented cpio
50
+ - SVR4 ASCII cpio
51
+ - POSIX octet-oriented cpio
52
+ - Binary cpio (big-endian or little-endian)
53
+ - ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
54
+ - GNU and BSD "ar" archives
55
+ - "mtree" format
56
+ - Microsoft CAB format
57
+ - LHA and LZH archives
58
+ - XAR archives
59
+
60
+ This <dfn>Robot</dfn> also detects and handles any of the following before evaluating the archive file:
61
+
62
+ - uuencoded files
63
+ - Files with RPM wrapper
64
+ - gzip compression
65
+ - bzip2 compression
66
+ - compress/LZW compression
67
+ - lzma, lzip, and xz compression
68
+
69
+ For security reasons, archives that contain symlinks to outside the archived dir, will error out the <dfn>Assembly</dfn>. Decompressing password-protected archives (encrypted archives) is currently not fully supported but will not cause an <dfn>Assembly</dfn> to fail.
70
+ `),
71
+ ignore_errors: z
72
+ .union([z.boolean(), z.array(z.enum(['meta']))])
73
+ .transform((ignoreErrors): 'meta'[] =>
74
+ ignoreErrors === true ? ['meta'] : ignoreErrors === false ? [] : ignoreErrors,
75
+ )
76
+ .default([]).describe(`
77
+ A possible array member is only \`"meta"\`.
78
+
79
+ 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.
80
+
81
+ To keep backwards compatibility, setting this parameter to \`true\` will set it to \`["meta"]\` internally.
82
+ `),
83
+ })
84
+ .strict()
85
+
86
+ export type RobotFileDecompressInstructions = z.infer<typeof robotFileDecompressInstructionsSchema>
@@ -0,0 +1,115 @@
1
+ import { z } from 'zod'
2
+
3
+ import { robotBase, robotUse } from './_instructions-primitives.ts'
4
+ import type { RobotMeta } from './_instructions-primitives.ts'
5
+
6
+ export const meta: RobotMeta = {
7
+ allowed_for_url_transform: true,
8
+ bytescount: 0,
9
+ discount_factor: 0,
10
+ discount_pct: 100,
11
+ example_code: {
12
+ steps: {
13
+ filtered: {
14
+ robot: '/file/filter',
15
+ use: ':original',
16
+ declines: [['${file.size}', '&gt;', '20971520']],
17
+ error_on_decline: true,
18
+ error_msg: 'File size must not exceed 20 MB',
19
+ },
20
+ },
21
+ },
22
+ example_code_description: 'Reject files that are larger than 20 MB:',
23
+ minimum_charge: 0,
24
+ output_factor: 1,
25
+ override_lvl1: 'File Filtering',
26
+ purpose_sentence: 'directs files to different encoding Steps based on your conditions',
27
+ purpose_verb: 'filter',
28
+ purpose_word: 'filter',
29
+ purpose_words: 'Filter files',
30
+ service_slug: 'file-filtering',
31
+ slot_count: 0,
32
+ title: 'Filter files',
33
+ typical_file_size_mb: 1.2,
34
+ typical_file_type: 'file',
35
+ }
36
+
37
+ export const robotFileFilterInstructionsSchema = robotBase
38
+ .merge(robotUse)
39
+ .extend({
40
+ robot: z.literal('/file/filter').describe(`
41
+ Think of this <dfn>Robot</dfn> as an \`if/else\` condition for building advanced file conversion workflows. With it, you can filter and direct certain uploaded files depending on their metadata.
42
+
43
+ The <dfn>Robot</dfn> has two modes of operation:
44
+
45
+ - Constructing conditions out of arrays with 3 members each. For example, \`["\${file.size}", "<=", "720"]\`
46
+ - Writing conditions in JavaScript. For example, \`\${file.size <= 720}\`. See also [Dynamic Evaluation](/docs/topics/dynamic-evaluation/).
47
+
48
+ 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/transcoding/code-evaluation/script-run/).
49
+
50
+ ### Conditions as arrays
51
+
52
+ The \`accepts\` and \`declines\` parameters can each be set to an array of arrays with three members:
53
+
54
+ 1. A value or job variable, such as \`\${file.mime}\`
55
+ 2. One of the following operators: \`==\`, \`===\`, \`<\`, \`>\`, \`<=\`, \`>=\`, \`!=\`, \`!==\`, \`regex\`, \`!regex\`
56
+ 3. A value or job variable, such as \`50\` or \`"foo"\`
57
+
58
+ Examples:
59
+
60
+ - \`[["\${file.meta.width}", ">", "\${file.meta.height}"]]\`
61
+ - \`[["\${file.size}", "<=", "720"]]\`
62
+ - \`[["720", ">=", "\${file.size}"]]\`
63
+ - \`[["\${file.mime}", "regex", "image"]]\`
64
+
65
+ **Warning:** If you would like to match against a \`null\` value or a value that is not present (like an audio file does not have a \`video_codec\` property in its metadata), match against \`""\` (an empty string) instead. We’ll support proper matching against \`null\` in the future, but we cannot easily do so right now without breaking backwards compatibility. [{.alert .alert-warning}]
66
+
67
+ ### Conditions as JavaScript
68
+
69
+ The \`accepts\` and \`declines\` parameters can each be set to strings of JavaScript, which return a boolean value.
70
+
71
+ Examples:
72
+
73
+ - \`\${file.meta.width > file.meta.height}\`
74
+ - \`\${file.size <= 720}\`
75
+ - \`\${/image/.test(file.mime)}\`
76
+ - \`\${Math.max(file.meta.width, file.meta.height) > 100}\`
77
+
78
+ As indicated, we charge for this via [🤖/script/run](/docs/transcoding/code-evaluation/script-run/). See also [Dynamic Evaluation](/docs/topics/dynamic-evaluation/) for more details on allowed syntax and behavior.
79
+ `),
80
+ accepts: z
81
+ .array(
82
+ z.union([z.string(), z.tuple([z.string(), z.string(), z.union([z.string(), z.number()])])]),
83
+ )
84
+ .default([]).describe(`
85
+ Files that match at least one requirement will be accepted, or declined otherwise. If the array is empty, all files will be accepted. Example:
86
+
87
+ \`[["\${file.mime}", "==", "image/gif"]]\`.
88
+
89
+ If the \`condition_type\` parameter is set to \`"and"\`, then all requirements must match for the file to be accepted.
90
+ `),
91
+ declines: z
92
+ .array(
93
+ z.union([z.string(), z.tuple([z.string(), z.string(), z.union([z.string(), z.number()])])]),
94
+ )
95
+ .default([]).describe(`
96
+ Files that match at least one requirement will be declined, or accepted otherwise. Example:
97
+
98
+ \`[["\${file.size}",">","1024"]]\`.
99
+
100
+ If the \`condition_type\` parameter is set to \`"and"\`, then all requirements must match for the file to be declined.
101
+ `),
102
+ condition_type: z.enum(['and', 'or']).default('or').describe(`
103
+ Specifies the condition type according to which the members of the \`accepts\` or \`declines\` arrays should be evaluated. Can be \`"or"\` or \`"and"\`.
104
+ `),
105
+ error_on_decline: z.boolean().default(false).describe(`
106
+ If this is set to \`true\` and one or more files are declined, the Assembly will be stopped and marked with an error.
107
+ `),
108
+ error_msg: z.string().default('One of your files was declined').describe(`
109
+ The error message shown to your users (such as by Uppy) when a file is declined and \`error_on_decline\` is set to \`true\`.
110
+ `),
111
+ })
112
+ .strict()
113
+
114
+ export type RobotFileFilterInstructions = z.infer<typeof robotFileFilterInstructionsSchema>
115
+ export type RobotFileFilterInstructionsInput = z.input<typeof robotFileFilterInstructionsSchema>
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod'
2
+
3
+ import { robotBase, robotUse } from './_instructions-primitives.ts'
4
+ import type { RobotMeta } from './_instructions-primitives.ts'
5
+
6
+ export const meta: RobotMeta = {
7
+ allowed_for_url_transform: false,
8
+ bytescount: 5,
9
+ discount_factor: 0.2,
10
+ discount_pct: 80,
11
+ example_code: {
12
+ steps: {
13
+ hashed: {
14
+ robot: '/file/hash',
15
+ use: ':original',
16
+ algorithm: 'sha1',
17
+ },
18
+ },
19
+ },
20
+ example_code_description: 'Hash each uploaded file using the SHA-1 algorithm:',
21
+ minimum_charge: 0,
22
+ output_factor: 1,
23
+ override_lvl1: 'Media Cataloging',
24
+ purpose_sentence: 'hashes files in Assemblies',
25
+ purpose_verb: 'hash',
26
+ purpose_word: 'file',
27
+ purpose_words: 'Hash files',
28
+ service_slug: 'media-cataloging',
29
+ slot_count: 60,
30
+ title: 'Hash Files',
31
+ typical_file_size_mb: 1.2,
32
+ typical_file_type: 'file',
33
+ }
34
+
35
+ export const robotFileHashInstructionsSchema = robotBase
36
+ .merge(robotUse)
37
+ .extend({
38
+ robot: z.literal('/file/hash').describe(`
39
+ This <dfn>Robot</dfn> allows you to hash any file as part of the <dfn>Assembly</dfn> execution process. This can be useful for verifying the integrity of a file for example.
40
+ `),
41
+ algorithm: z
42
+ .enum(['b2', 'md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'])
43
+ .default('sha256').describe(`
44
+ The hashing algorithm to use.
45
+
46
+ The file hash is exported as \`file.meta.hash\`.
47
+ `),
48
+ })
49
+ .strict()
50
+
51
+ export type RobotFileHashInstructions = z.infer<typeof robotFileHashInstructionsSchema>
@@ -0,0 +1,174 @@
1
+ import { z } from 'zod'
2
+
3
+ import {
4
+ color_with_optional_alpha,
5
+ complexHeightSchema,
6
+ complexWidthSchema,
7
+ interpolationSchemaToYieldNumber,
8
+ optimize_priority,
9
+ resize_strategy,
10
+ robotBase,
11
+ robotUse,
12
+ } from './_instructions-primitives.ts'
13
+ import type { RobotMeta } from './_instructions-primitives.ts'
14
+
15
+ export const meta: RobotMeta = {
16
+ allowed_for_url_transform: true,
17
+ bytescount: 1,
18
+ discount_factor: 1,
19
+ discount_pct: 0,
20
+ docs_redirect_from: ['/docs/media-preview/', '/docs/transcoding/media-cataloging/media-preview/'],
21
+ example_code: {
22
+ steps: {
23
+ previewed: {
24
+ robot: '/file/preview',
25
+ use: ':original',
26
+ height: 400,
27
+ width: 300,
28
+ format: 'png',
29
+ },
30
+ },
31
+ },
32
+ example_code_description: 'Generate a preview thumbnail for any uploaded file:',
33
+ minimum_charge: 1048576,
34
+ output_factor: 1,
35
+ override_lvl1: 'Media Cataloging',
36
+ purpose_sentence:
37
+ 'generates a thumbnail for any uploaded file to preview its content, similar to the thumbnails in desktop file managers',
38
+ purpose_verb: 'generate',
39
+ purpose_word: 'generate',
40
+ purpose_words: 'Generate a preview thumbnail',
41
+ service_slug: 'media-cataloging',
42
+ slot_count: 15,
43
+ title: 'Generate a preview thumbnail',
44
+ typical_file_size_mb: 1.2,
45
+ typical_file_type: 'file',
46
+ }
47
+
48
+ export const robotFilePreviewInstructionsInterpolatedSchema = robotBase
49
+ .merge(robotUse)
50
+ .extend({
51
+ robot: z.literal('/file/preview').describe(`
52
+ This <dfn>Robot</dfn>'s purpose is to generate a meaningful preview image for any file, in such a way that the resulting thumbnail highlights the file's content. The goal is not to losslessly present the original media in a smaller way. Instead, it is to maximize the chance of a person recognizing the media at a glance, while being visually pleasing and consistent with other previews. The generation process depends on the file type. For example, the <dfn>Robot</dfn> can extract artwork from media files, frames from videos, generate a waveform for audio files, and preview the content of documents and images. The details of all available strategies are provided in the next section.
53
+
54
+ If no file-specific thumbnail can be generated because the file type is not supported, a generic icon containing the file extension will be generated.
55
+
56
+ The default parameters ensure that the <dfn>Robot</dfn> always generates a preview image with the predefined dimensions and formats, to allow an easy integration into your application's UI. In addition, the generated preview images are optimized by default to reduce their file size while keeping their quality.
57
+ `),
58
+ format: z.enum(['gif', 'jpg', 'png']).default('png').describe(`
59
+ The output format for the generated thumbnail image. If a short video clip is generated using the \`clip\` strategy, its format is defined by \`clip_format\`.
60
+ `),
61
+ width: complexWidthSchema.default(300).describe(`
62
+ Width of the thumbnail, in pixels.
63
+ `),
64
+ height: complexHeightSchema.default(200).describe(`
65
+ Height of the thumbnail, in pixels.
66
+ `),
67
+ resize_strategy: resize_strategy.describe(`
68
+ To achieve the desired dimensions of the preview thumbnail, the <dfn>Robot</dfn> might have to resize the generated image. This happens, for example, when the dimensions of a frame extracted from a video do not match the chosen \`width\` and \`height\` parameters.
69
+
70
+ See the list of available [resize strategies](/docs/transcoding/image-manipulation/image-resize/#resize-strategies) for more details.
71
+ `),
72
+ background: color_with_optional_alpha.default('#ffffffff').describe(`
73
+ The hexadecimal code of the color used to fill the background (only used for the pad resize strategy). The format is \`#rrggbb[aa]\` (red, green, blue, alpha). Use \`#00000000\` for a transparent padding.
74
+ `),
75
+ strategy: z
76
+ .object({
77
+ archive: z.array(z.string()).default(['icon']),
78
+ audio: z.array(z.string()).default(['artwork', 'waveform', 'icon']),
79
+ document: z.array(z.string()).default(['page', 'icon']),
80
+ image: z.array(z.string()).default(['image', 'icon']),
81
+ unknown: z.array(z.string()).default(['icon']),
82
+ video: z.array(z.string()).default(['artwork', 'frame', 'icon']),
83
+ webpage: z.array(z.string()).default(['render', 'icon']),
84
+ })
85
+ .optional().describe(`
86
+ Definition of the thumbnail generation process per file category. The parameter must be an object whose keys can be one of the file categories: \`audio\`, \`video\`, \`image\`, \`document\`, \`archive\`, \`webpage\`, and \`unknown\`. The corresponding value is an array of strategies for the specific file category. See the above section for a list of all available strategies.
87
+
88
+ For each file, the <dfn>Robot</dfn> will attempt to use the first strategy to generate the thumbnail. If this process fails (e.g., because no artwork is available in a video file), the next strategy is attempted. This is repeated until either a thumbnail is generated or the list is exhausted. Selecting the \`icon\` strategy as the last entry provides a fallback mechanism to ensure that an appropriate strategy is always available.
89
+
90
+ The parameter defaults to the following definition:
91
+
92
+ \`\`\`json
93
+ {
94
+ "audio": ["artwork", "waveform", "icon"],
95
+ "video": ["artwork", "frame", "icon"],
96
+ "document": ["page", "icon"],
97
+ "image": ["image", "icon"],
98
+ "webpage": ["render", "icon"],
99
+ "archive": ["icon"],
100
+ "unknown": ["icon"]
101
+ }
102
+ \`\`\`
103
+ `),
104
+ waveform_center_color: color_with_optional_alpha.default('#000000ff').describe(`
105
+ The color used in the center of the waveform's gradient. The format is \`#rrggbb[aa]\` (red, green, blue, alpha). Only used if the \`waveform\` strategy for audio files is applied.
106
+ `),
107
+ waveform_outer_color: color_with_optional_alpha.default('#000000ff').describe(`
108
+ The color used in the outer parts of the waveform's gradient. The format is \`#rrggbb[aa]\` (red, green, blue, alpha). Only used if the \`waveform\` strategy for audio files is applied.
109
+ `),
110
+ waveform_height: z.number().int().min(1).max(5000).default(100).describe(`
111
+ Height of the waveform, in pixels. Only used if the \`waveform\` strategy for audio files is applied. It can be utilized to ensure that the waveform only takes up a section of the preview thumbnail.
112
+ `),
113
+ waveform_width: z.number().int().min(1).max(5000).default(300).describe(`
114
+ Width of the waveform, in pixels. Only used if the \`waveform\` strategy for audio files is applied. It can be utilized to ensure that the waveform only takes up a section of the preview thumbnail.
115
+ `),
116
+ icon_style: z.enum(['square', 'with-text']).default('with-text').describe(`
117
+ The style of the icon generated if the \`icon\` strategy is applied. The default style, \`with-text\`, includes an icon showing the file type and a text box below it, whose content can be controlled by the \`icon_text_content\` parameter and defaults to the file extension (e.g. MP4, JPEG). The \`square\` style only includes a square variant of the icon showing the file type. Below are exemplary previews generated for a text file utilizing the different styles:
118
+
119
+ <br><br> <strong>\`with-text\` style:</strong> <br>
120
+ ![Image with text style]({{site.asset_cdn}}/assets/images/file-preview/icon-with-text.png)
121
+ <br><br> <strong>\`square\` style:</strong> <br>
122
+ ![Image with square style]({{site.asset_cdn}}/assets/images/file-preview/icon-square.png)
123
+ `),
124
+ icon_text_color: color_with_optional_alpha.default('#a2a2a2').describe(`
125
+ The color of the text used in the icon. The format is \`#rrggbb[aa]\`. Only used if the \`icon\` strategy is applied.
126
+ `),
127
+ // TODO: Determine the font enum.
128
+ icon_text_font: z.string().default('Roboto').describe(`
129
+ The font family of the text used in the icon. Only used if the \`icon\` strategy is applied. [Here](/docs/supported-formats/fonts/) is a list of all supported fonts.
130
+ `),
131
+ icon_text_content: z.enum(['extension', 'none']).default('extension').describe(`
132
+ The content of the text box in generated icons. Only used if the \`icon_style\` parameter is set to \`with-text\`. The default value, \`extension\`, adds the file extension (e.g. MP4, JPEG) to the icon. The value \`none\` can be used to render an empty text box, which is useful if no text should not be included in the raster image, but some place should be reserved in the image for later overlaying custom text over the image using HTML etc.
133
+ `),
134
+ optimize: z.boolean().default(true).describe(`
135
+ Specifies whether the generated preview image should be optimized to reduce the image's file size while keeping their quaility. If enabled, the images will be optimized using [🤖/image/optimize](/docs/transcoding/image-manipulation/image-optimize/).
136
+ `),
137
+ optimize_priority: optimize_priority.describe(`
138
+ Specifies whether conversion speed or compression ratio is prioritized when optimizing images. Only used if \`optimize\` is enabled. Please see the [🤖/image/optimize documentation](/docs/transcoding/image-manipulation/image-optimize/#param-priority) for more details.
139
+ `),
140
+ optimize_progressive: z.boolean().default(false).describe(`
141
+ Specifies whether images should be interlaced, which makes the result image load progressively in browsers. Only used if \`optimize\` is enabled. Please see the [🤖/image/optimize documentation](/docs/transcoding/image-manipulation/image-optimize/#param-progressive) for more details.
142
+ `),
143
+ clip_format: z.enum(['apng', 'avif', 'gif', 'webp']).default('webp').describe(`
144
+ The animated image format for the generated video clip. Only used if the \`clip\` strategy for video files is applied.
145
+
146
+ Please consult the [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types) for detailed information about the image formats and their characteristics. GIF enjoys the broadest support in software, but only supports a limit color palette. APNG supports a variety of color depths, but its lossless compression produces large images for videos. AVIF is a modern image format that offers great compression, but proper support for animations is still lacking in some browsers. WebP on the other hand, enjoys broad support while offering a great balance between small file sizes and good visual quality, making it the default clip format.
147
+ `),
148
+ clip_offset: z.number().min(0).default(1).describe(`
149
+ The start position in seconds of where the clip is cut. Only used if the \`clip\` strategy for video files is applied. Be aware that for larger video only the first few MBs of the file may be imported to improve speed. Larger offsets may seek to a position outside of the imported part and thus fail to generate a clip.
150
+ `),
151
+ clip_duration: z.number().min(0).default(5).describe(`
152
+ The duration in seconds of the generated video clip. Only used if the \`clip\` strategy for video files is applied. Be aware that a longer clip duration also results in a larger file size, which might be undesirable for previews.
153
+ `),
154
+ clip_framerate: z.number().int().min(1).max(60).default(5).describe(`
155
+ The framerate of the generated video clip. Only used if the \`clip\` strategy for video files is applied. Be aware that a higher framerate appears smoother but also results in a larger file size, which might be undesirable for previews.
156
+ `),
157
+ clip_loop: z.boolean().default(true).describe(`
158
+ Specifies whether the generated animated image should loop forever (\`true\`) or stop after playing the animation once (\`false\`). Only used if the \`clip\` strategy for video files is applied.
159
+ `),
160
+ })
161
+ .strict()
162
+
163
+ export const robotFilePreviewInstructionsSchema =
164
+ robotFilePreviewInstructionsInterpolatedSchema.extend({
165
+ width: robotFilePreviewInstructionsInterpolatedSchema.shape.width.or(
166
+ interpolationSchemaToYieldNumber,
167
+ ),
168
+ height: robotFilePreviewInstructionsInterpolatedSchema.shape.height.or(
169
+ interpolationSchemaToYieldNumber,
170
+ ),
171
+ })
172
+
173
+ export type RobotFilePreviewInstructions = z.infer<typeof robotFilePreviewInstructionsSchema>
174
+ export type RobotFilePreviewInstructionsInput = z.input<typeof robotFilePreviewInstructionsSchema>
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod'
2
+
3
+ import { robotBase, robotUse } from './_instructions-primitives.ts'
4
+ import type { RobotMeta } from './_instructions-primitives.ts'
5
+
6
+ export const meta: RobotMeta = {
7
+ allowed_for_url_transform: true,
8
+ bytescount: 5,
9
+ discount_factor: 0.2,
10
+ discount_pct: 80,
11
+ minimum_charge: 512000,
12
+ output_factor: 1,
13
+ override_lvl1: 'Document Processing',
14
+ purpose_sentence: 'reads file contents from supported file-types',
15
+ purpose_verb: 'read',
16
+ purpose_word: 'read files',
17
+ purpose_words: 'Read file contents',
18
+ service_slug: 'document-processing',
19
+ slot_count: 5,
20
+ title: 'Read file contents',
21
+ typical_file_size_mb: 1.2,
22
+ typical_file_type: 'file',
23
+ }
24
+
25
+ export const robotFileReadInstructionsSchema = robotBase
26
+ .merge(robotUse)
27
+ .extend({
28
+ robot: z.literal('/file/read').describe(`
29
+ This <dfn>Robot</dfn> accepts any file, and will read the file using UTF-8 encoding. The result is outputted to \`file.meta.content\` to be accessed in later <dfn>Steps</dfn>.
30
+
31
+ The <dfn>Robot</dfn> currently only accepts files under 500KB.
32
+ `),
33
+ })
34
+ .strict()
35
+
36
+ export type RobotFileReadInstructions = z.infer<typeof robotFileReadInstructionsSchema>
@@ -0,0 +1,60 @@
1
+ import { z } from 'zod'
2
+
3
+ import { robotBase, robotUse } from './_instructions-primitives.ts'
4
+ import type { RobotMeta } from './_instructions-primitives.ts'
5
+
6
+ export const meta: RobotMeta = {
7
+ allowed_for_url_transform: true,
8
+ bytescount: 4,
9
+ discount_factor: 0.25,
10
+ discount_pct: 75,
11
+ minimum_charge: 0,
12
+ output_factor: 1,
13
+ purpose_sentence: 'serves files to web browsers',
14
+ purpose_verb: 'serve',
15
+ purpose_word: 'Serve files',
16
+ purpose_words: 'Serve files to web browsers',
17
+ service_slug: 'content-delivery',
18
+ slot_count: 0,
19
+ title: 'Serve files to web browsers',
20
+ typical_file_size_mb: 1.2,
21
+ typical_file_type: 'file',
22
+ }
23
+
24
+ export const robotFileServeInstructionsSchema = robotBase
25
+ .merge(robotUse)
26
+ .extend({
27
+ robot: z.literal('/file/serve').describe(`
28
+ When you want Transloadit to tranform files on the fly, you can use this <dfn>Robot</dfn> to determine which <dfn>Step</dfn> of a <dfn>Template</dfn> should be served to the end-user (via a CDN), as well as set extra information on the served files, such as headers. This way you can for instance suggest the CDN for how long to keep cached copies of the result around. By default, as you can see in the \`headers\` parameter, we instruct browsers to cache the result for 72h (\`259200\` seconds) and CDNs to cache the content for 24h (\`86400\` seconds). These values should be adjusted to suit your use case.
29
+
30
+ 🤖/file/serve merely acts as the glue layer between our <dfn>Assembly</dfn> engine and serving files over HTTP. It let's you pick the proper result of a series of <dfn>Steps</dfn> via the \`use\` parameter and configure headers on the original content. That is where its responsibilies end, and 🤖/tlcdn/deliver, then takes over to globally distribute this original content across the globe, and make sure that is cached close to your end-users, when they make requests such as <https://my-app.tlcdn.com/resize-img/canoe.jpg?w=500>, another. 🤖/tlcdn/deliver is not a part of your <dfn>Assembly Instructions</dfn>, but it may appear on your invoices as bandwidth charges incur when distributing the cached copies. 🤖/file/serve only charges when the CDN does not have a cached copy and requests to regenerate the original content, which depending on your caching settings could be just once a month, or year, per file/transformation.
31
+
32
+ While theoretically possible, you could use [🤖/file/serve](/docs/transcoding/content-delivery/file-serve/) directly in HTML files, but we strongly recommend against this, because if your site gets popular and the media URL that /file/serve is handling gets hit one million times, that is one million new image resizes. Wrapping it with a CDN (and thanks to the caching that comes with it) makes sure encoding charges stay low, as well as latencies.
33
+
34
+ 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.
35
+
36
+ More information on:
37
+
38
+ - [Content Delivery](/services/content-delivery/).
39
+ - [🤖/file/serve](/docs/transcoding/content-delivery/file-serve/) pricing.
40
+ - [🤖/tlcdn/deliver](/docs/transcoding/content-delivery/tlcdn-deliver/) pricing.
41
+ - [File Preview Feature](/blog/2024/06/file-preview-with-smart-cdn/) blog post.
42
+ `),
43
+ headers: z.record(z.string()).default({
44
+ 'Access-Control-Allow-Headers':
45
+ 'X-Requested-With, Content-Type, Cache-Control, Accept, Content-Length, Transloadit-Client, Authorization',
46
+ 'Access-Control-Allow-Methods': 'POST, GET, PUT, DELETE, OPTIONS',
47
+ 'Access-Control-Allow-Origin': '*',
48
+ 'Cache-Control': 'public, max-age=259200, s-max-age=86400',
49
+ 'Content-Type': '${file.mime}; charset=utf-8',
50
+ 'Transfer-Encoding': 'chunked',
51
+ 'Transloadit-Assembly': '…',
52
+ 'Transloadit-RequestID': '…',
53
+ }).describe(`
54
+ An object containing a list of headers to be set for a file as we serve it to a CDN/web browser, such as \`{ FileURL: "\${file.url_name}" }\` which will be merged over the defaults, and can include any available [Assembly Variable](/docs/topics/assembly-instructions/#assembly-variables).
55
+ `),
56
+ })
57
+ .strict()
58
+
59
+ export type RobotFileServeInstructions = z.infer<typeof robotFileServeInstructionsSchema>
60
+ export type RobotFileServeInstructionsInput = z.input<typeof robotFileServeInstructionsSchema>