@transloadit/node 4.1.3

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 (593) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +701 -0
  3. package/dist/ApiError.d.ts +22 -0
  4. package/dist/ApiError.d.ts.map +1 -0
  5. package/dist/ApiError.js +33 -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 +4 -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 +36 -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 +5 -0
  18. package/dist/PollingTimeoutError.js.map +1 -0
  19. package/dist/Transloadit.d.ts +250 -0
  20. package/dist/Transloadit.d.ts.map +1 -0
  21. package/dist/Transloadit.js +661 -0
  22. package/dist/Transloadit.js.map +1 -0
  23. package/dist/alphalib/lib/nativeGlobby.d.ts +14 -0
  24. package/dist/alphalib/lib/nativeGlobby.d.ts.map +1 -0
  25. package/dist/alphalib/lib/nativeGlobby.js +181 -0
  26. package/dist/alphalib/lib/nativeGlobby.js.map +1 -0
  27. package/dist/alphalib/mcache.d.ts +65 -0
  28. package/dist/alphalib/mcache.d.ts.map +1 -0
  29. package/dist/alphalib/mcache.js +135 -0
  30. package/dist/alphalib/mcache.js.map +1 -0
  31. package/dist/alphalib/tryCatch.d.ts +21 -0
  32. package/dist/alphalib/tryCatch.d.ts.map +1 -0
  33. package/dist/alphalib/tryCatch.js +17 -0
  34. package/dist/alphalib/tryCatch.js.map +1 -0
  35. package/dist/alphalib/types/assembliesGet.d.ts +62 -0
  36. package/dist/alphalib/types/assembliesGet.d.ts.map +1 -0
  37. package/dist/alphalib/types/assembliesGet.js +33 -0
  38. package/dist/alphalib/types/assembliesGet.js.map +1 -0
  39. package/dist/alphalib/types/assemblyReplay.d.ts +7858 -0
  40. package/dist/alphalib/types/assemblyReplay.d.ts.map +1 -0
  41. package/dist/alphalib/types/assemblyReplay.js +15 -0
  42. package/dist/alphalib/types/assemblyReplay.js.map +1 -0
  43. package/dist/alphalib/types/assemblyReplayNotification.d.ts +7849 -0
  44. package/dist/alphalib/types/assemblyReplayNotification.d.ts.map +1 -0
  45. package/dist/alphalib/types/assemblyReplayNotification.js +13 -0
  46. package/dist/alphalib/types/assemblyReplayNotification.js.map +1 -0
  47. package/dist/alphalib/types/assemblyStatus.d.ts +71084 -0
  48. package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -0
  49. package/dist/alphalib/types/assemblyStatus.js +710 -0
  50. package/dist/alphalib/types/assemblyStatus.js.map +1 -0
  51. package/dist/alphalib/types/bill.d.ts +44 -0
  52. package/dist/alphalib/types/bill.d.ts.map +1 -0
  53. package/dist/alphalib/types/bill.js +8 -0
  54. package/dist/alphalib/types/bill.js.map +1 -0
  55. package/dist/alphalib/types/robots/_index.d.ts +76306 -0
  56. package/dist/alphalib/types/robots/_index.d.ts.map +1 -0
  57. package/dist/alphalib/types/robots/_index.js +354 -0
  58. package/dist/alphalib/types/robots/_index.js.map +1 -0
  59. package/dist/alphalib/types/robots/_instructions-primitives.d.ts +3533 -0
  60. package/dist/alphalib/types/robots/_instructions-primitives.d.ts.map +1 -0
  61. package/dist/alphalib/types/robots/_instructions-primitives.js +1491 -0
  62. package/dist/alphalib/types/robots/_instructions-primitives.js.map +1 -0
  63. package/dist/alphalib/types/robots/ai-chat.d.ts +2096 -0
  64. package/dist/alphalib/types/robots/ai-chat.d.ts.map +1 -0
  65. package/dist/alphalib/types/robots/ai-chat.js +223 -0
  66. package/dist/alphalib/types/robots/ai-chat.js.map +1 -0
  67. package/dist/alphalib/types/robots/assembly-savejson.d.ts +52 -0
  68. package/dist/alphalib/types/robots/assembly-savejson.d.ts.map +1 -0
  69. package/dist/alphalib/types/robots/assembly-savejson.js +22 -0
  70. package/dist/alphalib/types/robots/assembly-savejson.js.map +1 -0
  71. package/dist/alphalib/types/robots/audio-artwork.d.ts +2867 -0
  72. package/dist/alphalib/types/robots/audio-artwork.d.ts.map +1 -0
  73. package/dist/alphalib/types/robots/audio-artwork.js +73 -0
  74. package/dist/alphalib/types/robots/audio-artwork.js.map +1 -0
  75. package/dist/alphalib/types/robots/audio-concat.d.ts +2916 -0
  76. package/dist/alphalib/types/robots/audio-concat.d.ts.map +1 -0
  77. package/dist/alphalib/types/robots/audio-concat.js +106 -0
  78. package/dist/alphalib/types/robots/audio-concat.js.map +1 -0
  79. package/dist/alphalib/types/robots/audio-encode.d.ts +2864 -0
  80. package/dist/alphalib/types/robots/audio-encode.d.ts.map +1 -0
  81. package/dist/alphalib/types/robots/audio-encode.js +67 -0
  82. package/dist/alphalib/types/robots/audio-encode.js.map +1 -0
  83. package/dist/alphalib/types/robots/audio-loop.d.ts +2879 -0
  84. package/dist/alphalib/types/robots/audio-loop.d.ts.map +1 -0
  85. package/dist/alphalib/types/robots/audio-loop.js +67 -0
  86. package/dist/alphalib/types/robots/audio-loop.js.map +1 -0
  87. package/dist/alphalib/types/robots/audio-merge.d.ts +2931 -0
  88. package/dist/alphalib/types/robots/audio-merge.d.ts.map +1 -0
  89. package/dist/alphalib/types/robots/audio-merge.js +101 -0
  90. package/dist/alphalib/types/robots/audio-merge.js.map +1 -0
  91. package/dist/alphalib/types/robots/audio-waveform.d.ts +3131 -0
  92. package/dist/alphalib/types/robots/audio-waveform.d.ts.map +1 -0
  93. package/dist/alphalib/types/robots/audio-waveform.js +238 -0
  94. package/dist/alphalib/types/robots/audio-waveform.js.map +1 -0
  95. package/dist/alphalib/types/robots/azure-import.d.ts +210 -0
  96. package/dist/alphalib/types/robots/azure-import.d.ts.map +1 -0
  97. package/dist/alphalib/types/robots/azure-import.js +73 -0
  98. package/dist/alphalib/types/robots/azure-import.js.map +1 -0
  99. package/dist/alphalib/types/robots/azure-store.d.ts +562 -0
  100. package/dist/alphalib/types/robots/azure-store.d.ts.map +1 -0
  101. package/dist/alphalib/types/robots/azure-store.js +115 -0
  102. package/dist/alphalib/types/robots/azure-store.js.map +1 -0
  103. package/dist/alphalib/types/robots/backblaze-import.d.ts +210 -0
  104. package/dist/alphalib/types/robots/backblaze-import.d.ts.map +1 -0
  105. package/dist/alphalib/types/robots/backblaze-import.js +81 -0
  106. package/dist/alphalib/types/robots/backblaze-import.js.map +1 -0
  107. package/dist/alphalib/types/robots/backblaze-store.d.ts +478 -0
  108. package/dist/alphalib/types/robots/backblaze-store.d.ts.map +1 -0
  109. package/dist/alphalib/types/robots/backblaze-store.js +76 -0
  110. package/dist/alphalib/types/robots/backblaze-store.js.map +1 -0
  111. package/dist/alphalib/types/robots/cloudfiles-import.d.ts +234 -0
  112. package/dist/alphalib/types/robots/cloudfiles-import.d.ts.map +1 -0
  113. package/dist/alphalib/types/robots/cloudfiles-import.js +80 -0
  114. package/dist/alphalib/types/robots/cloudfiles-import.js.map +1 -0
  115. package/dist/alphalib/types/robots/cloudfiles-store.d.ts +490 -0
  116. package/dist/alphalib/types/robots/cloudfiles-store.d.ts.map +1 -0
  117. package/dist/alphalib/types/robots/cloudfiles-store.js +70 -0
  118. package/dist/alphalib/types/robots/cloudfiles-store.js.map +1 -0
  119. package/dist/alphalib/types/robots/cloudflare-import.d.ts +234 -0
  120. package/dist/alphalib/types/robots/cloudflare-import.d.ts.map +1 -0
  121. package/dist/alphalib/types/robots/cloudflare-import.js +81 -0
  122. package/dist/alphalib/types/robots/cloudflare-import.js.map +1 -0
  123. package/dist/alphalib/types/robots/cloudflare-store.d.ts +514 -0
  124. package/dist/alphalib/types/robots/cloudflare-store.d.ts.map +1 -0
  125. package/dist/alphalib/types/robots/cloudflare-store.js +86 -0
  126. package/dist/alphalib/types/robots/cloudflare-store.js.map +1 -0
  127. package/dist/alphalib/types/robots/digitalocean-import.d.ts +234 -0
  128. package/dist/alphalib/types/robots/digitalocean-import.d.ts.map +1 -0
  129. package/dist/alphalib/types/robots/digitalocean-import.js +78 -0
  130. package/dist/alphalib/types/robots/digitalocean-import.js.map +1 -0
  131. package/dist/alphalib/types/robots/digitalocean-store.d.ts +526 -0
  132. package/dist/alphalib/types/robots/digitalocean-store.d.ts.map +1 -0
  133. package/dist/alphalib/types/robots/digitalocean-store.js +91 -0
  134. package/dist/alphalib/types/robots/digitalocean-store.js.map +1 -0
  135. package/dist/alphalib/types/robots/document-autorotate.d.ts +405 -0
  136. package/dist/alphalib/types/robots/document-autorotate.d.ts.map +1 -0
  137. package/dist/alphalib/types/robots/document-autorotate.js +44 -0
  138. package/dist/alphalib/types/robots/document-autorotate.js.map +1 -0
  139. package/dist/alphalib/types/robots/document-convert.d.ts +513 -0
  140. package/dist/alphalib/types/robots/document-convert.d.ts.map +1 -0
  141. package/dist/alphalib/types/robots/document-convert.js +273 -0
  142. package/dist/alphalib/types/robots/document-convert.js.map +1 -0
  143. package/dist/alphalib/types/robots/document-merge.d.ts +429 -0
  144. package/dist/alphalib/types/robots/document-merge.d.ts.map +1 -0
  145. package/dist/alphalib/types/robots/document-merge.js +86 -0
  146. package/dist/alphalib/types/robots/document-merge.js.map +1 -0
  147. package/dist/alphalib/types/robots/document-ocr.d.ts +441 -0
  148. package/dist/alphalib/types/robots/document-ocr.d.ts.map +1 -0
  149. package/dist/alphalib/types/robots/document-ocr.js +86 -0
  150. package/dist/alphalib/types/robots/document-ocr.js.map +1 -0
  151. package/dist/alphalib/types/robots/document-split.d.ts +417 -0
  152. package/dist/alphalib/types/robots/document-split.d.ts.map +1 -0
  153. package/dist/alphalib/types/robots/document-split.js +48 -0
  154. package/dist/alphalib/types/robots/document-split.js.map +1 -0
  155. package/dist/alphalib/types/robots/document-thumbs.d.ts +592 -0
  156. package/dist/alphalib/types/robots/document-thumbs.d.ts.map +1 -0
  157. package/dist/alphalib/types/robots/document-thumbs.js +196 -0
  158. package/dist/alphalib/types/robots/document-thumbs.js.map +1 -0
  159. package/dist/alphalib/types/robots/dropbox-import.d.ts +144 -0
  160. package/dist/alphalib/types/robots/dropbox-import.d.ts.map +1 -0
  161. package/dist/alphalib/types/robots/dropbox-import.js +65 -0
  162. package/dist/alphalib/types/robots/dropbox-import.js.map +1 -0
  163. package/dist/alphalib/types/robots/dropbox-store.d.ts +449 -0
  164. package/dist/alphalib/types/robots/dropbox-store.d.ts.map +1 -0
  165. package/dist/alphalib/types/robots/dropbox-store.js +68 -0
  166. package/dist/alphalib/types/robots/dropbox-store.js.map +1 -0
  167. package/dist/alphalib/types/robots/edgly-deliver.d.ts +100 -0
  168. package/dist/alphalib/types/robots/edgly-deliver.d.ts.map +1 -0
  169. package/dist/alphalib/types/robots/edgly-deliver.js +46 -0
  170. package/dist/alphalib/types/robots/edgly-deliver.js.map +1 -0
  171. package/dist/alphalib/types/robots/file-compress.d.ts +477 -0
  172. package/dist/alphalib/types/robots/file-compress.d.ts.map +1 -0
  173. package/dist/alphalib/types/robots/file-compress.js +139 -0
  174. package/dist/alphalib/types/robots/file-compress.js.map +1 -0
  175. package/dist/alphalib/types/robots/file-decompress.d.ts +404 -0
  176. package/dist/alphalib/types/robots/file-decompress.d.ts.map +1 -0
  177. package/dist/alphalib/types/robots/file-decompress.js +94 -0
  178. package/dist/alphalib/types/robots/file-decompress.js.map +1 -0
  179. package/dist/alphalib/types/robots/file-filter.d.ts +465 -0
  180. package/dist/alphalib/types/robots/file-filter.d.ts.map +1 -0
  181. package/dist/alphalib/types/robots/file-filter.js +136 -0
  182. package/dist/alphalib/types/robots/file-filter.js.map +1 -0
  183. package/dist/alphalib/types/robots/file-hash.d.ts +417 -0
  184. package/dist/alphalib/types/robots/file-hash.d.ts.map +1 -0
  185. package/dist/alphalib/types/robots/file-hash.js +59 -0
  186. package/dist/alphalib/types/robots/file-hash.js.map +1 -0
  187. package/dist/alphalib/types/robots/file-preview.d.ts +854 -0
  188. package/dist/alphalib/types/robots/file-preview.d.ts.map +1 -0
  189. package/dist/alphalib/types/robots/file-preview.js +221 -0
  190. package/dist/alphalib/types/robots/file-preview.js.map +1 -0
  191. package/dist/alphalib/types/robots/file-read.d.ts +405 -0
  192. package/dist/alphalib/types/robots/file-read.d.ts.map +1 -0
  193. package/dist/alphalib/types/robots/file-read.js +44 -0
  194. package/dist/alphalib/types/robots/file-read.js.map +1 -0
  195. package/dist/alphalib/types/robots/file-serve.d.ts +418 -0
  196. package/dist/alphalib/types/robots/file-serve.d.ts.map +1 -0
  197. package/dist/alphalib/types/robots/file-serve.js +99 -0
  198. package/dist/alphalib/types/robots/file-serve.js.map +1 -0
  199. package/dist/alphalib/types/robots/file-verify.d.ts +441 -0
  200. package/dist/alphalib/types/robots/file-verify.d.ts.map +1 -0
  201. package/dist/alphalib/types/robots/file-verify.js +73 -0
  202. package/dist/alphalib/types/robots/file-verify.js.map +1 -0
  203. package/dist/alphalib/types/robots/file-virusscan.d.ts +435 -0
  204. package/dist/alphalib/types/robots/file-virusscan.d.ts.map +1 -0
  205. package/dist/alphalib/types/robots/file-virusscan.js +82 -0
  206. package/dist/alphalib/types/robots/file-virusscan.js.map +1 -0
  207. package/dist/alphalib/types/robots/file-watermark.d.ts +417 -0
  208. package/dist/alphalib/types/robots/file-watermark.d.ts.map +1 -0
  209. package/dist/alphalib/types/robots/file-watermark.js +28 -0
  210. package/dist/alphalib/types/robots/file-watermark.js.map +1 -0
  211. package/dist/alphalib/types/robots/ftp-import.d.ts +198 -0
  212. package/dist/alphalib/types/robots/ftp-import.d.ts.map +1 -0
  213. package/dist/alphalib/types/robots/ftp-import.js +60 -0
  214. package/dist/alphalib/types/robots/ftp-import.js.map +1 -0
  215. package/dist/alphalib/types/robots/ftp-store.d.ts +532 -0
  216. package/dist/alphalib/types/robots/ftp-store.d.ts.map +1 -0
  217. package/dist/alphalib/types/robots/ftp-store.js +91 -0
  218. package/dist/alphalib/types/robots/ftp-store.js.map +1 -0
  219. package/dist/alphalib/types/robots/google-import.d.ts +174 -0
  220. package/dist/alphalib/types/robots/google-import.d.ts.map +1 -0
  221. package/dist/alphalib/types/robots/google-import.js +77 -0
  222. package/dist/alphalib/types/robots/google-import.js.map +1 -0
  223. package/dist/alphalib/types/robots/google-store.d.ts +476 -0
  224. package/dist/alphalib/types/robots/google-store.d.ts.map +1 -0
  225. package/dist/alphalib/types/robots/google-store.js +111 -0
  226. package/dist/alphalib/types/robots/google-store.js.map +1 -0
  227. package/dist/alphalib/types/robots/html-convert.d.ts +531 -0
  228. package/dist/alphalib/types/robots/html-convert.d.ts.map +1 -0
  229. package/dist/alphalib/types/robots/html-convert.js +137 -0
  230. package/dist/alphalib/types/robots/html-convert.js.map +1 -0
  231. package/dist/alphalib/types/robots/http-import.d.ts +215 -0
  232. package/dist/alphalib/types/robots/http-import.d.ts.map +1 -0
  233. package/dist/alphalib/types/robots/http-import.js +135 -0
  234. package/dist/alphalib/types/robots/http-import.js.map +1 -0
  235. package/dist/alphalib/types/robots/image-bgremove.d.ts +453 -0
  236. package/dist/alphalib/types/robots/image-bgremove.d.ts.map +1 -0
  237. package/dist/alphalib/types/robots/image-bgremove.js +65 -0
  238. package/dist/alphalib/types/robots/image-bgremove.js.map +1 -0
  239. package/dist/alphalib/types/robots/image-describe.d.ts +453 -0
  240. package/dist/alphalib/types/robots/image-describe.d.ts.map +1 -0
  241. package/dist/alphalib/types/robots/image-describe.js +86 -0
  242. package/dist/alphalib/types/robots/image-describe.js.map +1 -0
  243. package/dist/alphalib/types/robots/image-facedetect.d.ts +477 -0
  244. package/dist/alphalib/types/robots/image-facedetect.d.ts.map +1 -0
  245. package/dist/alphalib/types/robots/image-facedetect.js +151 -0
  246. package/dist/alphalib/types/robots/image-facedetect.js.map +1 -0
  247. package/dist/alphalib/types/robots/image-generate.d.ts +522 -0
  248. package/dist/alphalib/types/robots/image-generate.d.ts.map +1 -0
  249. package/dist/alphalib/types/robots/image-generate.js +64 -0
  250. package/dist/alphalib/types/robots/image-generate.js.map +1 -0
  251. package/dist/alphalib/types/robots/image-merge.d.ts +477 -0
  252. package/dist/alphalib/types/robots/image-merge.d.ts.map +1 -0
  253. package/dist/alphalib/types/robots/image-merge.js +92 -0
  254. package/dist/alphalib/types/robots/image-merge.js.map +1 -0
  255. package/dist/alphalib/types/robots/image-ocr.d.ts +441 -0
  256. package/dist/alphalib/types/robots/image-ocr.d.ts.map +1 -0
  257. package/dist/alphalib/types/robots/image-ocr.js +79 -0
  258. package/dist/alphalib/types/robots/image-ocr.js.map +1 -0
  259. package/dist/alphalib/types/robots/image-optimize.d.ts +453 -0
  260. package/dist/alphalib/types/robots/image-optimize.d.ts.map +1 -0
  261. package/dist/alphalib/types/robots/image-optimize.js +81 -0
  262. package/dist/alphalib/types/robots/image-optimize.js.map +1 -0
  263. package/dist/alphalib/types/robots/image-resize.d.ts +1758 -0
  264. package/dist/alphalib/types/robots/image-resize.d.ts.map +1 -0
  265. package/dist/alphalib/types/robots/image-resize.js +602 -0
  266. package/dist/alphalib/types/robots/image-resize.js.map +1 -0
  267. package/dist/alphalib/types/robots/meta-read.d.ts +98 -0
  268. package/dist/alphalib/types/robots/meta-read.d.ts.map +1 -0
  269. package/dist/alphalib/types/robots/meta-read.js +24 -0
  270. package/dist/alphalib/types/robots/meta-read.js.map +1 -0
  271. package/dist/alphalib/types/robots/meta-write.d.ts +2842 -0
  272. package/dist/alphalib/types/robots/meta-write.d.ts.map +1 -0
  273. package/dist/alphalib/types/robots/meta-write.js +66 -0
  274. package/dist/alphalib/types/robots/meta-write.js.map +1 -0
  275. package/dist/alphalib/types/robots/minio-import.d.ts +234 -0
  276. package/dist/alphalib/types/robots/minio-import.d.ts.map +1 -0
  277. package/dist/alphalib/types/robots/minio-import.js +81 -0
  278. package/dist/alphalib/types/robots/minio-import.js.map +1 -0
  279. package/dist/alphalib/types/robots/minio-store.d.ts +514 -0
  280. package/dist/alphalib/types/robots/minio-store.d.ts.map +1 -0
  281. package/dist/alphalib/types/robots/minio-store.js +87 -0
  282. package/dist/alphalib/types/robots/minio-store.js.map +1 -0
  283. package/dist/alphalib/types/robots/progress-simulate.d.ts +229 -0
  284. package/dist/alphalib/types/robots/progress-simulate.d.ts.map +1 -0
  285. package/dist/alphalib/types/robots/progress-simulate.js +25 -0
  286. package/dist/alphalib/types/robots/progress-simulate.js.map +1 -0
  287. package/dist/alphalib/types/robots/s3-import.d.ts +246 -0
  288. package/dist/alphalib/types/robots/s3-import.d.ts.map +1 -0
  289. package/dist/alphalib/types/robots/s3-import.js +137 -0
  290. package/dist/alphalib/types/robots/s3-import.js.map +1 -0
  291. package/dist/alphalib/types/robots/s3-store.d.ts +593 -0
  292. package/dist/alphalib/types/robots/s3-store.d.ts.map +1 -0
  293. package/dist/alphalib/types/robots/s3-store.js +169 -0
  294. package/dist/alphalib/types/robots/s3-store.js.map +1 -0
  295. package/dist/alphalib/types/robots/script-run.d.ts +423 -0
  296. package/dist/alphalib/types/robots/script-run.d.ts.map +1 -0
  297. package/dist/alphalib/types/robots/script-run.js +95 -0
  298. package/dist/alphalib/types/robots/script-run.js.map +1 -0
  299. package/dist/alphalib/types/robots/sftp-import.d.ts +192 -0
  300. package/dist/alphalib/types/robots/sftp-import.d.ts.map +1 -0
  301. package/dist/alphalib/types/robots/sftp-import.js +62 -0
  302. package/dist/alphalib/types/robots/sftp-import.js.map +1 -0
  303. package/dist/alphalib/types/robots/sftp-store.d.ts +520 -0
  304. package/dist/alphalib/types/robots/sftp-store.d.ts.map +1 -0
  305. package/dist/alphalib/types/robots/sftp-store.js +83 -0
  306. package/dist/alphalib/types/robots/sftp-store.js.map +1 -0
  307. package/dist/alphalib/types/robots/speech-transcribe.d.ts +465 -0
  308. package/dist/alphalib/types/robots/speech-transcribe.d.ts.map +1 -0
  309. package/dist/alphalib/types/robots/speech-transcribe.js +103 -0
  310. package/dist/alphalib/types/robots/speech-transcribe.js.map +1 -0
  311. package/dist/alphalib/types/robots/supabase-import.d.ts +246 -0
  312. package/dist/alphalib/types/robots/supabase-import.d.ts.map +1 -0
  313. package/dist/alphalib/types/robots/supabase-import.js +83 -0
  314. package/dist/alphalib/types/robots/supabase-import.js.map +1 -0
  315. package/dist/alphalib/types/robots/supabase-store.d.ts +514 -0
  316. package/dist/alphalib/types/robots/supabase-store.d.ts.map +1 -0
  317. package/dist/alphalib/types/robots/supabase-store.js +77 -0
  318. package/dist/alphalib/types/robots/supabase-store.js.map +1 -0
  319. package/dist/alphalib/types/robots/swift-import.d.ts +246 -0
  320. package/dist/alphalib/types/robots/swift-import.d.ts.map +1 -0
  321. package/dist/alphalib/types/robots/swift-import.js +81 -0
  322. package/dist/alphalib/types/robots/swift-import.js.map +1 -0
  323. package/dist/alphalib/types/robots/swift-store.d.ts +526 -0
  324. package/dist/alphalib/types/robots/swift-store.d.ts.map +1 -0
  325. package/dist/alphalib/types/robots/swift-store.js +84 -0
  326. package/dist/alphalib/types/robots/swift-store.js.map +1 -0
  327. package/dist/alphalib/types/robots/text-speak.d.ts +465 -0
  328. package/dist/alphalib/types/robots/text-speak.d.ts.map +1 -0
  329. package/dist/alphalib/types/robots/text-speak.js +119 -0
  330. package/dist/alphalib/types/robots/text-speak.js.map +1 -0
  331. package/dist/alphalib/types/robots/text-translate.d.ts +441 -0
  332. package/dist/alphalib/types/robots/text-translate.d.ts.map +1 -0
  333. package/dist/alphalib/types/robots/text-translate.js +211 -0
  334. package/dist/alphalib/types/robots/text-translate.js.map +1 -0
  335. package/dist/alphalib/types/robots/tigris-import.d.ts +244 -0
  336. package/dist/alphalib/types/robots/tigris-import.d.ts.map +1 -0
  337. package/dist/alphalib/types/robots/tigris-import.js +85 -0
  338. package/dist/alphalib/types/robots/tigris-import.js.map +1 -0
  339. package/dist/alphalib/types/robots/tigris-store.d.ts +524 -0
  340. package/dist/alphalib/types/robots/tigris-store.d.ts.map +1 -0
  341. package/dist/alphalib/types/robots/tigris-store.js +91 -0
  342. package/dist/alphalib/types/robots/tigris-store.js.map +1 -0
  343. package/dist/alphalib/types/robots/tlcdn-deliver.d.ts +100 -0
  344. package/dist/alphalib/types/robots/tlcdn-deliver.d.ts.map +1 -0
  345. package/dist/alphalib/types/robots/tlcdn-deliver.js +46 -0
  346. package/dist/alphalib/types/robots/tlcdn-deliver.js.map +1 -0
  347. package/dist/alphalib/types/robots/tus-store.d.ts +477 -0
  348. package/dist/alphalib/types/robots/tus-store.d.ts.map +1 -0
  349. package/dist/alphalib/types/robots/tus-store.js +102 -0
  350. package/dist/alphalib/types/robots/tus-store.js.map +1 -0
  351. package/dist/alphalib/types/robots/upload-handle.d.ts +100 -0
  352. package/dist/alphalib/types/robots/upload-handle.d.ts.map +1 -0
  353. package/dist/alphalib/types/robots/upload-handle.js +66 -0
  354. package/dist/alphalib/types/robots/upload-handle.js.map +1 -0
  355. package/dist/alphalib/types/robots/video-adaptive.d.ts +2915 -0
  356. package/dist/alphalib/types/robots/video-adaptive.d.ts.map +1 -0
  357. package/dist/alphalib/types/robots/video-adaptive.js +144 -0
  358. package/dist/alphalib/types/robots/video-adaptive.js.map +1 -0
  359. package/dist/alphalib/types/robots/video-concat.d.ts +2891 -0
  360. package/dist/alphalib/types/robots/video-concat.d.ts.map +1 -0
  361. package/dist/alphalib/types/robots/video-concat.js +96 -0
  362. package/dist/alphalib/types/robots/video-concat.js.map +1 -0
  363. package/dist/alphalib/types/robots/video-encode.d.ts +3280 -0
  364. package/dist/alphalib/types/robots/video-encode.d.ts.map +1 -0
  365. package/dist/alphalib/types/robots/video-encode.js +107 -0
  366. package/dist/alphalib/types/robots/video-encode.js.map +1 -0
  367. package/dist/alphalib/types/robots/video-merge.d.ts +2987 -0
  368. package/dist/alphalib/types/robots/video-merge.d.ts.map +1 -0
  369. package/dist/alphalib/types/robots/video-merge.js +102 -0
  370. package/dist/alphalib/types/robots/video-merge.js.map +1 -0
  371. package/dist/alphalib/types/robots/video-ondemand.d.ts +4553 -0
  372. package/dist/alphalib/types/robots/video-ondemand.d.ts.map +1 -0
  373. package/dist/alphalib/types/robots/video-ondemand.js +112 -0
  374. package/dist/alphalib/types/robots/video-ondemand.js.map +1 -0
  375. package/dist/alphalib/types/robots/video-subtitle.d.ts +2975 -0
  376. package/dist/alphalib/types/robots/video-subtitle.d.ts.map +1 -0
  377. package/dist/alphalib/types/robots/video-subtitle.js +122 -0
  378. package/dist/alphalib/types/robots/video-subtitle.js.map +1 -0
  379. package/dist/alphalib/types/robots/video-thumbs.d.ts +2938 -0
  380. package/dist/alphalib/types/robots/video-thumbs.d.ts.map +1 -0
  381. package/dist/alphalib/types/robots/video-thumbs.js +122 -0
  382. package/dist/alphalib/types/robots/video-thumbs.js.map +1 -0
  383. package/dist/alphalib/types/robots/vimeo-import.d.ts +189 -0
  384. package/dist/alphalib/types/robots/vimeo-import.d.ts.map +1 -0
  385. package/dist/alphalib/types/robots/vimeo-import.js +92 -0
  386. package/dist/alphalib/types/robots/vimeo-import.js.map +1 -0
  387. package/dist/alphalib/types/robots/vimeo-store.d.ts +520 -0
  388. package/dist/alphalib/types/robots/vimeo-store.d.ts.map +1 -0
  389. package/dist/alphalib/types/robots/vimeo-store.js +115 -0
  390. package/dist/alphalib/types/robots/vimeo-store.js.map +1 -0
  391. package/dist/alphalib/types/robots/wasabi-import.d.ts +244 -0
  392. package/dist/alphalib/types/robots/wasabi-import.d.ts.map +1 -0
  393. package/dist/alphalib/types/robots/wasabi-import.js +85 -0
  394. package/dist/alphalib/types/robots/wasabi-import.js.map +1 -0
  395. package/dist/alphalib/types/robots/wasabi-store.d.ts +526 -0
  396. package/dist/alphalib/types/robots/wasabi-store.d.ts.map +1 -0
  397. package/dist/alphalib/types/robots/wasabi-store.js +85 -0
  398. package/dist/alphalib/types/robots/wasabi-store.js.map +1 -0
  399. package/dist/alphalib/types/robots/youtube-store.d.ts +477 -0
  400. package/dist/alphalib/types/robots/youtube-store.d.ts.map +1 -0
  401. package/dist/alphalib/types/robots/youtube-store.js +122 -0
  402. package/dist/alphalib/types/robots/youtube-store.js.map +1 -0
  403. package/dist/alphalib/types/stackVersions.d.ts +13 -0
  404. package/dist/alphalib/types/stackVersions.d.ts.map +1 -0
  405. package/dist/alphalib/types/stackVersions.js +13 -0
  406. package/dist/alphalib/types/stackVersions.js.map +1 -0
  407. package/dist/alphalib/types/template.d.ts +131710 -0
  408. package/dist/alphalib/types/template.d.ts.map +1 -0
  409. package/dist/alphalib/types/template.js +218 -0
  410. package/dist/alphalib/types/template.js.map +1 -0
  411. package/dist/alphalib/types/templateCredential.d.ts +95 -0
  412. package/dist/alphalib/types/templateCredential.d.ts.map +1 -0
  413. package/dist/alphalib/types/templateCredential.js +57 -0
  414. package/dist/alphalib/types/templateCredential.js.map +1 -0
  415. package/dist/alphalib/zodParseWithContext.d.ts +17 -0
  416. package/dist/alphalib/zodParseWithContext.d.ts.map +1 -0
  417. package/dist/alphalib/zodParseWithContext.js +248 -0
  418. package/dist/alphalib/zodParseWithContext.js.map +1 -0
  419. package/dist/apiTypes.d.ts +112 -0
  420. package/dist/apiTypes.d.ts.map +1 -0
  421. package/dist/apiTypes.js +3 -0
  422. package/dist/apiTypes.js.map +1 -0
  423. package/dist/cli/OutputCtl.d.ts +47 -0
  424. package/dist/cli/OutputCtl.d.ts.map +1 -0
  425. package/dist/cli/OutputCtl.js +85 -0
  426. package/dist/cli/OutputCtl.js.map +1 -0
  427. package/dist/cli/commands/BaseCommand.d.ts +24 -0
  428. package/dist/cli/commands/BaseCommand.d.ts.map +1 -0
  429. package/dist/cli/commands/BaseCommand.js +52 -0
  430. package/dist/cli/commands/BaseCommand.js.map +1 -0
  431. package/dist/cli/commands/assemblies.d.ts +93 -0
  432. package/dist/cli/commands/assemblies.d.ts.map +1 -0
  433. package/dist/cli/commands/assemblies.js +1021 -0
  434. package/dist/cli/commands/assemblies.js.map +1 -0
  435. package/dist/cli/commands/auth.d.ts +28 -0
  436. package/dist/cli/commands/auth.d.ts.map +1 -0
  437. package/dist/cli/commands/auth.js +280 -0
  438. package/dist/cli/commands/auth.js.map +1 -0
  439. package/dist/cli/commands/bills.d.ts +14 -0
  440. package/dist/cli/commands/bills.d.ts.map +1 -0
  441. package/dist/cli/commands/bills.js +69 -0
  442. package/dist/cli/commands/bills.js.map +1 -0
  443. package/dist/cli/commands/index.d.ts +3 -0
  444. package/dist/cli/commands/index.d.ts.map +1 -0
  445. package/dist/cli/commands/index.js +39 -0
  446. package/dist/cli/commands/index.js.map +1 -0
  447. package/dist/cli/commands/notifications.d.ts +9 -0
  448. package/dist/cli/commands/notifications.d.ts.map +1 -0
  449. package/dist/cli/commands/notifications.js +44 -0
  450. package/dist/cli/commands/notifications.js.map +1 -0
  451. package/dist/cli/commands/templates.d.ts +73 -0
  452. package/dist/cli/commands/templates.d.ts.map +1 -0
  453. package/dist/cli/commands/templates.js +428 -0
  454. package/dist/cli/commands/templates.js.map +1 -0
  455. package/dist/cli/helpers.d.ts +13 -0
  456. package/dist/cli/helpers.d.ts.map +1 -0
  457. package/dist/cli/helpers.js +39 -0
  458. package/dist/cli/helpers.js.map +1 -0
  459. package/dist/cli/template-last-modified.d.ts +10 -0
  460. package/dist/cli/template-last-modified.d.ts.map +1 -0
  461. package/dist/cli/template-last-modified.js +134 -0
  462. package/dist/cli/template-last-modified.js.map +1 -0
  463. package/dist/cli/types.d.ts +78 -0
  464. package/dist/cli/types.d.ts.map +1 -0
  465. package/dist/cli/types.js +49 -0
  466. package/dist/cli/types.js.map +1 -0
  467. package/dist/cli.d.ts +6 -0
  468. package/dist/cli.d.ts.map +1 -0
  469. package/dist/cli.js +41 -0
  470. package/dist/cli.js.map +1 -0
  471. package/dist/tus.d.ts +18 -0
  472. package/dist/tus.d.ts.map +1 -0
  473. package/dist/tus.js +122 -0
  474. package/dist/tus.js.map +1 -0
  475. package/package.json +92 -0
  476. package/src/ApiError.ts +49 -0
  477. package/src/InconsistentResponseError.ts +3 -0
  478. package/src/PaginationStream.ts +54 -0
  479. package/src/PollingTimeoutError.ts +5 -0
  480. package/src/Transloadit.ts +980 -0
  481. package/src/alphalib/lib/nativeGlobby.ts +244 -0
  482. package/src/alphalib/mcache.ts +184 -0
  483. package/src/alphalib/tryCatch.ts +30 -0
  484. package/src/alphalib/types/assembliesGet.ts +42 -0
  485. package/src/alphalib/types/assemblyReplay.ts +24 -0
  486. package/src/alphalib/types/assemblyReplayNotification.ts +16 -0
  487. package/src/alphalib/types/assemblyStatus.ts +794 -0
  488. package/src/alphalib/types/bill.ts +9 -0
  489. package/src/alphalib/types/robots/_index.ts +1201 -0
  490. package/src/alphalib/types/robots/_instructions-primitives.ts +1770 -0
  491. package/src/alphalib/types/robots/ai-chat.ts +278 -0
  492. package/src/alphalib/types/robots/assembly-savejson.ts +37 -0
  493. package/src/alphalib/types/robots/audio-artwork.ts +107 -0
  494. package/src/alphalib/types/robots/audio-concat.ts +142 -0
  495. package/src/alphalib/types/robots/audio-encode.ts +103 -0
  496. package/src/alphalib/types/robots/audio-loop.ts +102 -0
  497. package/src/alphalib/types/robots/audio-merge.ts +137 -0
  498. package/src/alphalib/types/robots/audio-waveform.ts +280 -0
  499. package/src/alphalib/types/robots/azure-import.ts +111 -0
  500. package/src/alphalib/types/robots/azure-store.ts +143 -0
  501. package/src/alphalib/types/robots/backblaze-import.ts +119 -0
  502. package/src/alphalib/types/robots/backblaze-store.ts +104 -0
  503. package/src/alphalib/types/robots/cloudfiles-import.ts +118 -0
  504. package/src/alphalib/types/robots/cloudfiles-store.ts +104 -0
  505. package/src/alphalib/types/robots/cloudflare-import.ts +121 -0
  506. package/src/alphalib/types/robots/cloudflare-store.ts +120 -0
  507. package/src/alphalib/types/robots/digitalocean-import.ts +118 -0
  508. package/src/alphalib/types/robots/digitalocean-store.ts +125 -0
  509. package/src/alphalib/types/robots/document-autorotate.ts +74 -0
  510. package/src/alphalib/types/robots/document-convert.ts +302 -0
  511. package/src/alphalib/types/robots/document-merge.ts +114 -0
  512. package/src/alphalib/types/robots/document-ocr.ts +120 -0
  513. package/src/alphalib/types/robots/document-split.ts +78 -0
  514. package/src/alphalib/types/robots/document-thumbs.ts +231 -0
  515. package/src/alphalib/types/robots/dropbox-import.ts +100 -0
  516. package/src/alphalib/types/robots/dropbox-store.ts +97 -0
  517. package/src/alphalib/types/robots/edgly-deliver.ts +73 -0
  518. package/src/alphalib/types/robots/file-compress.ts +167 -0
  519. package/src/alphalib/types/robots/file-decompress.ts +125 -0
  520. package/src/alphalib/types/robots/file-filter.ts +173 -0
  521. package/src/alphalib/types/robots/file-hash.ts +86 -0
  522. package/src/alphalib/types/robots/file-preview.ts +260 -0
  523. package/src/alphalib/types/robots/file-read.ts +71 -0
  524. package/src/alphalib/types/robots/file-serve.ts +128 -0
  525. package/src/alphalib/types/robots/file-verify.ts +102 -0
  526. package/src/alphalib/types/robots/file-virusscan.ts +113 -0
  527. package/src/alphalib/types/robots/file-watermark.ts +56 -0
  528. package/src/alphalib/types/robots/ftp-import.ts +95 -0
  529. package/src/alphalib/types/robots/ftp-store.ts +119 -0
  530. package/src/alphalib/types/robots/google-import.ts +115 -0
  531. package/src/alphalib/types/robots/google-store.ts +139 -0
  532. package/src/alphalib/types/robots/html-convert.ts +165 -0
  533. package/src/alphalib/types/robots/http-import.ts +168 -0
  534. package/src/alphalib/types/robots/image-bgremove.ts +95 -0
  535. package/src/alphalib/types/robots/image-describe.ts +121 -0
  536. package/src/alphalib/types/robots/image-facedetect.ts +187 -0
  537. package/src/alphalib/types/robots/image-generate.ts +92 -0
  538. package/src/alphalib/types/robots/image-merge.ts +127 -0
  539. package/src/alphalib/types/robots/image-ocr.ts +112 -0
  540. package/src/alphalib/types/robots/image-optimize.ts +114 -0
  541. package/src/alphalib/types/robots/image-resize.ts +653 -0
  542. package/src/alphalib/types/robots/meta-read.ts +44 -0
  543. package/src/alphalib/types/robots/meta-write.ts +93 -0
  544. package/src/alphalib/types/robots/minio-import.ts +120 -0
  545. package/src/alphalib/types/robots/minio-store.ts +115 -0
  546. package/src/alphalib/types/robots/progress-simulate.ts +40 -0
  547. package/src/alphalib/types/robots/s3-import.ts +175 -0
  548. package/src/alphalib/types/robots/s3-store.ts +198 -0
  549. package/src/alphalib/types/robots/script-run.ts +122 -0
  550. package/src/alphalib/types/robots/sftp-import.ts +92 -0
  551. package/src/alphalib/types/robots/sftp-store.ts +110 -0
  552. package/src/alphalib/types/robots/speech-transcribe.ts +139 -0
  553. package/src/alphalib/types/robots/supabase-import.ts +122 -0
  554. package/src/alphalib/types/robots/supabase-store.ts +105 -0
  555. package/src/alphalib/types/robots/swift-import.ts +120 -0
  556. package/src/alphalib/types/robots/swift-store.ts +112 -0
  557. package/src/alphalib/types/robots/text-speak.ts +152 -0
  558. package/src/alphalib/types/robots/text-translate.ts +245 -0
  559. package/src/alphalib/types/robots/tigris-import.ts +124 -0
  560. package/src/alphalib/types/robots/tigris-store.ts +119 -0
  561. package/src/alphalib/types/robots/tlcdn-deliver.ts +73 -0
  562. package/src/alphalib/types/robots/tus-store.ts +129 -0
  563. package/src/alphalib/types/robots/upload-handle.ts +95 -0
  564. package/src/alphalib/types/robots/video-adaptive.ts +179 -0
  565. package/src/alphalib/types/robots/video-concat.ts +130 -0
  566. package/src/alphalib/types/robots/video-encode.ts +141 -0
  567. package/src/alphalib/types/robots/video-merge.ts +138 -0
  568. package/src/alphalib/types/robots/video-ondemand.ts +161 -0
  569. package/src/alphalib/types/robots/video-subtitle.ts +159 -0
  570. package/src/alphalib/types/robots/video-thumbs.ts +158 -0
  571. package/src/alphalib/types/robots/vimeo-import.ts +126 -0
  572. package/src/alphalib/types/robots/vimeo-store.ts +143 -0
  573. package/src/alphalib/types/robots/wasabi-import.ts +124 -0
  574. package/src/alphalib/types/robots/wasabi-store.ts +113 -0
  575. package/src/alphalib/types/robots/youtube-store.ts +153 -0
  576. package/src/alphalib/types/stackVersions.ts +12 -0
  577. package/src/alphalib/types/template.ts +277 -0
  578. package/src/alphalib/types/templateCredential.ts +61 -0
  579. package/src/alphalib/zodParseWithContext.ts +306 -0
  580. package/src/apiTypes.ts +154 -0
  581. package/src/cli/OutputCtl.ts +115 -0
  582. package/src/cli/commands/BaseCommand.ts +71 -0
  583. package/src/cli/commands/assemblies.ts +1373 -0
  584. package/src/cli/commands/auth.ts +354 -0
  585. package/src/cli/commands/bills.ts +91 -0
  586. package/src/cli/commands/index.ts +65 -0
  587. package/src/cli/commands/notifications.ts +63 -0
  588. package/src/cli/commands/templates.ts +556 -0
  589. package/src/cli/helpers.ts +50 -0
  590. package/src/cli/template-last-modified.ts +156 -0
  591. package/src/cli/types.ts +70 -0
  592. package/src/cli.ts +44 -0
  593. package/src/tus.ts +168 -0
package/README.md ADDED
@@ -0,0 +1,701 @@
1
+ [![Build Status](https://github.com/transloadit/node-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/transloadit/node-sdk/actions/workflows/ci.yml)
2
+ [![Coverage](https://codecov.io/gh/transloadit/node-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/transloadit/node-sdk)
3
+
4
+ > **Stability: Experimental.** This scoped package is new and may change without notice.
5
+ > For the stable SDK, use the unscoped `transloadit` package.
6
+
7
+ <a href="https://transloadit.com/?utm_source=github&utm_medium=referral&utm_campaign=sdks&utm_content=node_sdk">
8
+ <picture>
9
+ <source media="(prefers-color-scheme: dark)" srcset="https://assets.transloadit.com/assets/images/sponsorships/logo-dark.svg">
10
+ <source media="(prefers-color-scheme: light)" srcset="https://assets.transloadit.com/assets/images/sponsorships/logo-default.svg">
11
+ <img src="https://assets.transloadit.com/assets/images/sponsorships/logo-default.svg" alt="Transloadit Logo">
12
+ </picture>
13
+ </a>
14
+
15
+ This is the official **Node.js** SDK for [Transloadit](https://transloadit.com)'s file uploading and encoding service.
16
+
17
+ ## Intro
18
+
19
+ [Transloadit](https://transloadit.com) is a service that helps you handle file
20
+ uploads, resize, crop and watermark your images, make GIFs, transcode your
21
+ videos, extract thumbnails, generate audio waveforms, [and so much more](https://transloadit.com/demos/). In
22
+ short, [Transloadit](https://transloadit.com) is the Swiss Army Knife for your
23
+ files.
24
+
25
+ This is a **Node.js** SDK to make it easy to talk to the
26
+ [Transloadit](https://transloadit.com) REST API.
27
+
28
+ ## Requirements
29
+
30
+ - [Node.js](https://nodejs.org/en/) version 20 or newer
31
+ - [A Transloadit account](https://transloadit.com/signup/) ([free signup](https://transloadit.com/pricing/))
32
+ - [Your API credentials](https://transloadit.com/c/template-credentials) (`authKey`, `authSecret`)
33
+
34
+ ## Install
35
+
36
+ Inside your project, type:
37
+
38
+ ```bash
39
+ yarn add transloadit
40
+ ```
41
+
42
+ or
43
+
44
+ ```bash
45
+ npm install --save transloadit
46
+ ```
47
+
48
+ ## Command Line Interface (CLI)
49
+
50
+ This package includes a full-featured CLI for interacting with Transloadit from your terminal.
51
+
52
+ ### Quick Start
53
+
54
+ ```bash
55
+ # Set your credentials
56
+ export TRANSLOADIT_KEY="YOUR_TRANSLOADIT_KEY"
57
+ export TRANSLOADIT_SECRET="YOUR_TRANSLOADIT_SECRET"
58
+
59
+ # See all available commands
60
+ npx transloadit --help
61
+ ```
62
+
63
+ ### Processing Media
64
+
65
+ Create Assemblies to process files using Assembly Instructions (steps) or Templates:
66
+
67
+ ```bash
68
+ # Process a file using a steps file
69
+ npx transloadit assemblies create --steps steps.json --input image.jpg --output result.jpg
70
+
71
+ # Process using a Template
72
+ npx transloadit assemblies create --template YOUR_TEMPLATE_ID --input image.jpg --output result.jpg
73
+
74
+ # Process with custom fields
75
+ npx transloadit assemblies create --template YOUR_TEMPLATE_ID --field size=100 --input image.jpg --output thumb.jpg
76
+
77
+ # Process a directory of files
78
+ npx transloadit assemblies create --template YOUR_TEMPLATE_ID --input images/ --output thumbs/
79
+
80
+ # Process recursively with file watching
81
+ npx transloadit assemblies create --template YOUR_TEMPLATE_ID --input images/ --output thumbs/ --recursive --watch
82
+
83
+ # Process multiple files in a single assembly
84
+ npx transloadit assemblies create --template YOUR_TEMPLATE_ID --input file1.jpg --input file2.jpg --output results/ --single-assembly
85
+
86
+ # Limit concurrent processing (default: 5)
87
+ npx transloadit assemblies create --template YOUR_TEMPLATE_ID --input images/ --output thumbs/ --concurrency 2
88
+ ```
89
+
90
+ ### Managing Assemblies
91
+
92
+ ```bash
93
+ # List recent assemblies
94
+ npx transloadit assemblies list
95
+
96
+ # List assemblies with filters
97
+ npx transloadit assemblies list --after 2024-01-01 --before 2024-12-31
98
+
99
+ # Get assembly status
100
+ npx transloadit assemblies get ASSEMBLY_ID
101
+
102
+ # Cancel an assembly
103
+ npx transloadit assemblies delete ASSEMBLY_ID
104
+
105
+ # Replay an assembly (re-run with original instructions)
106
+ npx transloadit assemblies replay ASSEMBLY_ID
107
+
108
+ # Replay with different steps
109
+ npx transloadit assemblies replay --steps new-steps.json ASSEMBLY_ID
110
+
111
+ # Replay using latest template version
112
+ npx transloadit assemblies replay --reparse-template ASSEMBLY_ID
113
+ ```
114
+
115
+ ### Managing Templates
116
+
117
+ ```bash
118
+ # List all templates
119
+ npx transloadit templates list
120
+
121
+ # Get template content
122
+ npx transloadit templates get TEMPLATE_ID
123
+
124
+ # Create a template from a JSON file
125
+ npx transloadit templates create my-template template.json
126
+
127
+ # Modify a template
128
+ npx transloadit templates modify TEMPLATE_ID template.json
129
+
130
+ # Rename a template
131
+ npx transloadit templates modify TEMPLATE_ID --name new-name
132
+
133
+ # Delete a template
134
+ npx transloadit templates delete TEMPLATE_ID
135
+
136
+ # Sync local template files with Transloadit (bidirectional)
137
+ npx transloadit templates sync templates/*.json
138
+ npx transloadit templates sync --recursive templates/
139
+ ```
140
+
141
+ ### Billing
142
+
143
+ ```bash
144
+ # Get bill for a month
145
+ npx transloadit bills get 2024-01
146
+
147
+ # Get detailed bill as JSON
148
+ npx transloadit bills get 2024-01 --json
149
+ ```
150
+
151
+ ### Assembly Notifications
152
+
153
+ ```bash
154
+ # Replay a notification
155
+ npx transloadit assembly-notifications replay ASSEMBLY_ID
156
+
157
+ # Replay to a different URL
158
+ npx transloadit assembly-notifications replay --notify-url https://example.com/hook ASSEMBLY_ID
159
+ ```
160
+
161
+ ### Signature Generation
162
+
163
+ ```bash
164
+ # Generate a signature for assembly params
165
+ echo '{"steps":{}}' | npx transloadit auth signature
166
+
167
+ # Generate with specific algorithm
168
+ echo '{"steps":{}}' | npx transloadit auth signature --algorithm sha256
169
+
170
+ # Generate a signed Smart CDN URL
171
+ echo '{"workspace":"my-workspace","template":"my-template","input":"image.jpg"}' | npx transloadit auth smart-cdn
172
+ ```
173
+
174
+ ### CLI Options
175
+
176
+ All commands support these common options:
177
+
178
+ - `--json, -j` - Output results as JSON (useful for scripting)
179
+ - `--log-level, -l` - Set log verbosity level by name or number (default: notice)
180
+ - `--endpoint` - Custom API endpoint URL (or set `TRANSLOADIT_ENDPOINT` env var)
181
+ - `--help, -h` - Show help for a command
182
+
183
+ The `assemblies create` command additionally supports:
184
+
185
+ - `--single-assembly` - Pass all input files to a single assembly instead of one assembly per file
186
+
187
+ #### Log Levels
188
+
189
+ The CLI uses [syslog severity levels](https://en.wikipedia.org/wiki/Syslog#Severity_level). Lower = more severe, higher = more verbose:
190
+
191
+ | Level | Value | Description |
192
+ | -------- | ----- | ------------------------------------- |
193
+ | `err` | 3 | Error conditions |
194
+ | `warn` | 4 | Warning conditions |
195
+ | `notice` | 5 | Normal but significant **(default)** |
196
+ | `info` | 6 | Informational messages |
197
+ | `debug` | 7 | Debug-level messages |
198
+ | `trace` | 8 | Most verbose/detailed |
199
+
200
+ You can use either the level name or its numeric value:
201
+
202
+ ```bash
203
+ # Show only errors and warnings
204
+ npx transloadit assemblies list -l warn
205
+ npx transloadit assemblies list -l 4
206
+
207
+ # Show debug output
208
+ npx transloadit assemblies list -l debug
209
+ npx transloadit assemblies list -l 7
210
+ ```
211
+
212
+ ## SDK Usage
213
+
214
+ The following code will upload an image and resize it to a thumbnail:
215
+
216
+ ```javascript
217
+ import { Transloadit } from 'transloadit'
218
+
219
+ const transloadit = new Transloadit({
220
+ authKey: 'YOUR_TRANSLOADIT_KEY',
221
+ authSecret: 'YOUR_TRANSLOADIT_SECRET',
222
+ })
223
+
224
+ try {
225
+ const options = {
226
+ files: {
227
+ file1: '/PATH/TO/FILE.jpg',
228
+ },
229
+ params: {
230
+ steps: {
231
+ // You can have many Steps. In this case we will just resize any inputs (:original)
232
+ resize: {
233
+ use: ':original',
234
+ robot: '/image/resize',
235
+ result: true,
236
+ width: 75,
237
+ height: 75,
238
+ },
239
+ },
240
+ // OR if you already created a template, you can use it instead of "steps":
241
+ // template_id: 'YOUR_TEMPLATE_ID',
242
+ },
243
+ waitForCompletion: true, // Wait for the Assembly (job) to finish executing before returning
244
+ }
245
+
246
+ const status = await transloadit.createAssembly(options)
247
+
248
+ if (status.results.resize) {
249
+ console.log('✅ Success - Your resized image:', status.results.resize[0].ssl_url)
250
+ } else {
251
+ console.log("❌ The Assembly didn't produce any output. Make sure you used a valid image file")
252
+ }
253
+ } catch (err) {
254
+ console.error('❌ Unable to process Assembly.', err)
255
+ if (err instanceof ApiError && err.assemblyId) {
256
+ console.error(`💡 More info: https://transloadit.com/assemblies/${err.assemblyId}`)
257
+ }
258
+ }
259
+ ```
260
+
261
+ You can find [details about your executed Assemblies here](https://transloadit.com/assemblies).
262
+
263
+ ## Examples
264
+
265
+ - [Upload and resize image](https://github.com/transloadit/node-sdk/blob/main/examples/resize_an_image.ts)
266
+ - [Upload image and convert to WebP](https://github.com/transloadit/node-sdk/blob/main/examples/convert_to_webp.ts)
267
+ - [Rasterize SVG to PNG](https://github.com/transloadit/node-sdk/blob/main/examples/rasterize_svg_to_png.ts)
268
+ - [Crop a face out of an image and download the result](https://github.com/transloadit/node-sdk/blob/main/examples/face_detect_download.ts)
269
+ - [Retry example](https://github.com/transloadit/node-sdk/blob/main/examples/retry.ts)
270
+ - [Calculate total costs (GB usage)](https://github.com/transloadit/node-sdk/blob/main/examples/fetch_costs_of_all_assemblies_in_timeframe.ts)
271
+ - [Templates CRUD](https://github.com/transloadit/node-sdk/blob/main/examples/template_api.ts)
272
+ - [Template Credentials CRUD](https://github.com/transloadit/node-sdk/blob/main/examples/credentials.ts)
273
+
274
+ For more fully working examples take a look at [`examples/`](https://github.com/transloadit/node-sdk/blob/main/examples/).
275
+
276
+ For more example use cases and information about the available robots and their parameters, check out the [Transloadit website](https://transloadit.com/).
277
+
278
+ ## API
279
+
280
+ These are the public methods on the `Transloadit` object and their descriptions. The methods are based on the [Transloadit API](https://transloadit.com/docs/api/).
281
+
282
+ Table of contents:
283
+
284
+ - [Main](#main)
285
+ - [Assemblies](#assemblies)
286
+ - [Assembly notifications](#assembly-notifications)
287
+ - [Templates](#templates)
288
+ - [Template Credentials](#template-credentials)
289
+ - [Errors](#errors)
290
+ - [Rate limiting & auto retry](#rate-limiting--auto-retry)
291
+
292
+ ### Main
293
+
294
+ #### constructor(options)
295
+
296
+ Returns a new instance of the client.
297
+
298
+ The `options` object can contain the following keys:
299
+
300
+ - `authKey` **(required)** - see [requirements](#requirements)
301
+ - `authSecret` **(required)** - see [requirements](#requirements)
302
+ - `endpoint` (default `'https://api2.transloadit.com'`)
303
+ - `maxRetries` (default `5`) - see [Rate limiting & auto retry](#rate-limiting--auto-retry)
304
+ - `gotRetry` (default `0`) - see [Rate limiting & auto retry](#rate-limiting--auto-retry)
305
+ - `timeout` (default `60000`: 1 minute) - the timeout (in milliseconds) for all requests (except `createAssembly`)
306
+ - `validateResponses` (default `false`)
307
+
308
+ ### Assemblies
309
+
310
+ #### async createAssembly(options)
311
+
312
+ Creates a new Assembly on Transloadit and optionally upload the specified `files` and `uploads`.
313
+
314
+ You can provide the following keys inside the `options` object:
315
+
316
+ - `params` **(required)** - An object containing keys defining the Assembly's behavior with the following keys: (See also [API doc](https://transloadit.com/docs/api/assemblies-post/) and [examples](#examples))
317
+ - `steps` - Assembly instructions - See [Transloadit docs](https://transloadit.com/docs/topics/assembly-instructions/) and [demos](https://transloadit.com/demos/) for inspiration.
318
+ - `template_id` - The ID of the Template that contains your Assembly Instructions. **One of either `steps` or `template_id` is required.** If you specify both, then [any Steps will overrule the template](https://transloadit.com/docs/topics/templates/#overruling-templates-at-runtime).
319
+ - `fields` - An object of form fields to add to the request, to make use of in the Assembly instructions via [Assembly variables](https://transloadit.com/docs#assembly-variables).
320
+ - `notify_url` - Transloadit can send a Pingback to your server when the Assembly is completed. We'll send the Assembly Status in JSON encoded string inside a transloadit field in a multipart POST request to the URL supplied here.
321
+ - `files` - An object (key-value pairs) containing one or more file paths to upload and use in your Assembly. The _key_ is the _field name_ and the _value_ is the path to the file to be uploaded. The _field name_ and the file's name may be used in the ([Assembly instructions](https://transloadit.com/docs/topics/assembly-instructions/)) (`params`.`steps`) to refer to the particular file. See example below.
322
+ - `'fieldName': '/path/to/file'`
323
+ - more files...
324
+ - `uploads` - An object (key-value pairs) containing one or more files to upload and use in your Assembly. The _key_ is the _file name_ and the _value_ is the _content_ of the file to be uploaded. _Value_ can be one of many types:
325
+ - `'fieldName': (Readable | Buffer | TypedArray | ArrayBuffer | string | Iterable<Buffer | string> | AsyncIterable<Buffer | string> | Promise)`.
326
+ - more uploads...
327
+ - `waitForCompletion` - A boolean (default is `false`) to indicate whether you want to wait for the Assembly to finish with all encoding results present before the promise is fulfilled. If `waitForCompletion` is `true`, this SDK will poll for status updates and fulfill the promise when all encoding work is done.
328
+ - `timeout` - Number of milliseconds to wait before aborting (default `86400000`: 24 hours).
329
+ - `onUploadProgress` - An optional function that will be periodically called with the file upload progress, which is an with an object containing:
330
+ - `uploadedBytes` - Number of bytes uploaded so far.
331
+ - `totalBytes` - Total number of bytes to upload or `undefined` if unknown (Streams).
332
+ - `onAssemblyProgress` - Once the Assembly has started processing this will be periodically called with the _Assembly Execution Status_ (result of `getAssembly`) **only if `waitForCompletion` is `true`**.
333
+ - `chunkSize` - (for uploads) a number indicating the maximum size of a tus `PATCH` request body in bytes. Default to `Infinity` for file uploads and 50MB for streams of unknown length. See [tus-js-client](https://github.com/tus/tus-js-client/blob/master/docs/api.md#chunksize).
334
+ - `uploadConcurrency` - Maximum number of concurrent tus file uploads to occur at any given time (default 10.)
335
+
336
+ **NOTE**: Make sure the key in `files` and `uploads` is not one of `signature`, `params` or `max_size`.
337
+
338
+ Example code showing all options:
339
+
340
+ ```js
341
+ await transloadit.createAssembly({
342
+ files: {
343
+ file1: '/path/to/file.jpg'
344
+ // ...
345
+ },
346
+ uploads: {
347
+ 'file2.bin': Buffer.from([0, 0, 7]), // A buffer
348
+ 'file3.txt': 'file contents', // A string
349
+ 'file4.jpg': process.stdin // A stream
350
+ // ...
351
+ },
352
+ params: {
353
+ steps: { ... },
354
+ template_id: 'MY_TEMPLATE_ID',
355
+ fields: {
356
+ field1: 'Field value',
357
+ // ...
358
+ },
359
+ notify_url: 'https://example.com/notify-url',
360
+ },
361
+ waitForCompletion: true,
362
+ timeout: 60000,
363
+ onUploadProgress,
364
+ onAssemblyProgress,
365
+ })
366
+ ```
367
+
368
+ Example `onUploadProgress` and `onAssemblyProgress` handlers:
369
+
370
+ ```javascript
371
+ function onUploadProgress({ uploadedBytes, totalBytes }) {
372
+ // NOTE: totalBytes may be undefined
373
+ console.log(`♻️ Upload progress polled: ${uploadedBytes} of ${totalBytes} bytes uploaded.`)
374
+ }
375
+ function onAssemblyProgress(assembly) {
376
+ console.log(
377
+ `♻️ Assembly progress polled: ${assembly.error ? assembly.error : assembly.ok} ${
378
+ assembly.assembly_id
379
+ } ... `
380
+ )
381
+ }
382
+ ```
383
+
384
+ **Tip:** `createAssembly` returns a `Promise` with an extra property `assemblyId`. This can be used to retrieve the Assembly ID before the Assembly has even been created. Useful for debugging by logging this ID when the request starts, for example:
385
+
386
+ ```js
387
+ const promise = transloadit.createAssembly(options)
388
+ console.log('Creating', promise.assemblyId)
389
+ const status = await promise
390
+ ```
391
+
392
+ See also:
393
+
394
+ - [API documentation](https://transloadit.com/docs/api/assemblies-post/)
395
+ - Error codes and retry logic below
396
+
397
+ #### async listAssemblies(params)
398
+
399
+ Retrieve Assemblies according to the given `params`.
400
+
401
+ Valid params can be `page`, `pagesize`, `type`, `fromdate`, `todate` and `keywords`. Please consult the [API documentation](https://transloadit.com/docs/api/assemblies-get/) for details.
402
+
403
+ The method returns an object containing these properties:
404
+
405
+ - `items`: An `Array` of up to `pagesize` Assemblies
406
+ - `count`: Total number of Assemblies
407
+
408
+ #### streamAssemblies(params)
409
+
410
+ Creates an `objectMode` `Readable` stream that automates handling of `listAssemblies` pagination. It accepts the same `params` as `listAssemblies`.
411
+
412
+ This can be used to iterate through Assemblies:
413
+
414
+ ```javascript
415
+ const assemblyStream = transloadit.streamAssemblies({ fromdate: '2016-08-19 01:15:00 UTC' })
416
+
417
+ assemblyStream.on('readable', function () {
418
+ const assembly = assemblyStream.read()
419
+ if (assembly == null) console.log('end of stream')
420
+
421
+ console.log(assembly.id)
422
+ })
423
+ ```
424
+
425
+ Results can also be piped. Here's an example using
426
+ [through2](https://github.com/rvagg/through2):
427
+
428
+ ```javascript
429
+ const assemblyStream = transloadit.streamAssemblies({ fromdate: '2016-08-19 01:15:00 UTC' })
430
+
431
+ assemblyStream
432
+ .pipe(
433
+ through.obj(function (chunk, enc, callback) {
434
+ this.push(chunk.id + '\n')
435
+ callback()
436
+ })
437
+ )
438
+ .pipe(fs.createWriteStream('assemblies.txt'))
439
+ ```
440
+
441
+ #### async getAssembly(assemblyId)
442
+
443
+ Retrieves the JSON status of the Assembly identified by the given `assemblyId`. See [API documentation](https://transloadit.com/docs/api/assemblies-assembly-id-get/).
444
+
445
+ #### async cancelAssembly(assemblyId)
446
+
447
+ Removes the Assembly identified by the given `assemblyId` from the memory of the Transloadit machines, ultimately cancelling it. This does not delete the Assembly from the database - you can still access it on `https://transloadit.com/assemblies/{assembly_id}` in your Transloadit account. This also does not delete any files associated with the Assembly from the Transloadit servers. See [API documentation](https://transloadit.com/docs/api/assemblies-assembly-id-delete/).
448
+
449
+ #### async replayAssembly(assemblyId, params)
450
+
451
+ Replays the Assembly identified by the given `assemblyId` (required argument). Optionally you can also provide a `notify_url` key inside `params` if you want to change the notification target. See [API documentation](https://transloadit.com/docs/api/assemblies-assembly-id-replay-post/) for more info about `params`.
452
+
453
+ The response from the `replayAssembly` is minimal and does not contain much information about the replayed assembly. Please call `getAssembly` or `awaitAssemblyCompletion` after replay to get more information:
454
+
455
+ ```js
456
+ const replayAssemblyResponse = await transloadit.replayAssembly(failedAssemblyId)
457
+
458
+ const assembly = await transloadit.getAssembly(replayAssemblyResponse.assembly_id)
459
+ // Or
460
+ const completedAssembly = await transloadit.awaitAssemblyCompletion(
461
+ replayAssemblyResponse.assembly_id
462
+ )
463
+ ```
464
+
465
+ #### async awaitAssemblyCompletion(assemblyId, opts)
466
+
467
+ This function will continously poll the specified Assembly `assemblyId` and resolve when it is done uploading and executing (until `result.ok` is no longer `ASSEMBLY_UPLOADING`, `ASSEMBLY_EXECUTING` or `ASSEMBLY_REPLAYING`). It resolves with the same value as `getAssembly`.
468
+
469
+ `opts` is an object with the keys:
470
+
471
+ - `onAssemblyProgress` - A progress function called on each poll. See `createAssembly`
472
+ - `timeout` - How many milliseconds until polling times out (default: no timeout)
473
+ - `interval` - Poll interval in milliseconds (default `1000`)
474
+ - `signal` - An `AbortSignal` to cancel polling. When aborted, the promise rejects with an `AbortError`.
475
+ - `onPoll` - A callback invoked at the start of each poll iteration. Return `false` to stop polling early and resolve with the last known status. Useful for implementing custom cancellation logic (e.g., superseding assemblies in watch mode).
476
+
477
+ #### getLastUsedAssemblyUrl()
478
+
479
+ Returns the internal url that was used for the last call to `createAssembly`. This is meant to be used for debugging purposes.
480
+
481
+ ### Assembly notifications
482
+
483
+ #### async replayAssemblyNotification(assemblyId, params)
484
+
485
+ Replays the notification for the Assembly identified by the given `assemblyId` (required argument). Optionally you can also provide a `notify_url` key inside `params` if you want to change the notification target. See [API documentation](https://transloadit.com/docs/api/assembly-notifications-assembly-id-replay-post/) for more info about `params`.
486
+
487
+ ### Templates
488
+
489
+ Templates are Steps that can be reused. [See example template code](examples/template_api.ts).
490
+
491
+ #### async createTemplate(params)
492
+
493
+ Creates a template the provided params. The required `params` keys are:
494
+
495
+ - `name` - The template name
496
+ - `template` - The template JSON object containing its `steps`
497
+
498
+ See also [API documentation](https://transloadit.com/docs/api/templates-post/).
499
+
500
+ ```js
501
+ const template = {
502
+ steps: {
503
+ encode: {
504
+ use: ':original',
505
+ robot: '/video/encode',
506
+ preset: 'ipad-high',
507
+ },
508
+ thumbnail: {
509
+ use: 'encode',
510
+ robot: '/video/thumbnails',
511
+ },
512
+ },
513
+ }
514
+
515
+ const result = await transloadit.createTemplate({ name: 'my-template-name', template })
516
+ console.log('✅ Template created with template_id', result.id)
517
+ ```
518
+
519
+ #### async editTemplate(templateId, params)
520
+
521
+ Updates the template represented by the given `templateId` with the new value. The `params` works just like the one from the `createTemplate` call. See [API documentation](https://transloadit.com/docs/api/templates-template-id-put/).
522
+
523
+ #### async getTemplate(templateId)
524
+
525
+ Retrieves the name and the template JSON for the template represented by the given `templateId`. See [API documentation](https://transloadit.com/docs/api/templates-template-id-get/).
526
+
527
+ #### async deleteTemplate(templateId)
528
+
529
+ Deletes the template represented by the given `templateId`. See [API documentation](https://transloadit.com/docs/api/templates-template-id-delete/).
530
+
531
+ #### async listTemplates(params)
532
+
533
+ Retrieve all your templates. See [API documentation](https://transloadit.com/docs/api/templates-template-id-get/) for more info about `params`.
534
+
535
+ The method returns an object containing these properties:
536
+
537
+ - `items`: An `Array` of up to `pagesize` templates
538
+ - `count`: Total number of templates
539
+
540
+ #### streamTemplates(params)
541
+
542
+ Creates an `objectMode` `Readable` stream that automates handling of `listTemplates` pagination. Similar to `streamAssemblies`.
543
+
544
+ ### Template Credentials
545
+
546
+ Template Credentials allow you to store third-party credentials (e.g., AWS S3, Google Cloud Storage, FTP) securely on Transloadit for use in your Assembly Instructions.
547
+
548
+ #### async createTemplateCredential(params)
549
+
550
+ Creates a new Template Credential. The `params` object should contain the credential configuration. See [API documentation](https://transloadit.com/docs/api/template-credentials-post/).
551
+
552
+ #### async editTemplateCredential(credentialId, params)
553
+
554
+ Updates an existing Template Credential identified by `credentialId`. See [API documentation](https://transloadit.com/docs/api/template-credentials-credential-id-put/).
555
+
556
+ #### async deleteTemplateCredential(credentialId)
557
+
558
+ Deletes the Template Credential identified by `credentialId`. See [API documentation](https://transloadit.com/docs/api/template-credentials-credential-id-delete/).
559
+
560
+ #### async getTemplateCredential(credentialId)
561
+
562
+ Retrieves the Template Credential identified by `credentialId`. See [API documentation](https://transloadit.com/docs/api/template-credentials-credential-id-get/).
563
+
564
+ #### async listTemplateCredentials(params)
565
+
566
+ Lists all Template Credentials. See [API documentation](https://transloadit.com/docs/api/template-credentials-get/).
567
+
568
+ #### streamTemplateCredentials(params)
569
+
570
+ Creates an `objectMode` `Readable` stream that automates handling of `listTemplateCredentials` pagination. Similar to `streamAssemblies`.
571
+
572
+ ### Other
573
+
574
+ #### setDefaultTimeout(timeout)
575
+
576
+ Same as `constructor` `timeout` option: Set the default timeout (in milliseconds) for all requests (except `createAssembly`)
577
+
578
+ #### async getBill(date)
579
+
580
+ Retrieves the billing data for a given `date` string with format `YYYY-MM`. See [API documentation](https://transloadit.com/docs/api/bill-date-get/).
581
+
582
+ #### calcSignature(params)
583
+
584
+ Calculates a signature for the given `params` JSON object. If the `params` object does not include an `authKey` or `expires` keys (and their values) in the `auth` sub-key, then they are set automatically.
585
+
586
+ This function returns an object with the key `signature` (containing the calculated signature string) and a key `params`, which contains the stringified version of the passed `params` object (including the set expires and authKey keys).
587
+
588
+ See [Signature Generation](#signature-generation) in the CLI section for command-line usage.
589
+
590
+ #### getSignedSmartCDNUrl(params)
591
+
592
+ Constructs a signed Smart CDN URL, as defined in the [API documentation](https://transloadit.com/docs/topics/signature-authentication/#smart-cdn). `params` must be an object with the following properties:
593
+
594
+ - `workspace` - Workspace slug (required)
595
+ - `template` - Template slug or template ID (required)
596
+ - `input` - Input value that is provided as `${fields.input}` in the template (required)
597
+ - `urlParams` - Object with additional parameters for the URL query string (optional)
598
+ - `expiresAt` - Expiration timestamp of the signature in milliseconds since UNIX epoch. Defaults to 1 hour from now. (optional)
599
+
600
+ Example:
601
+
602
+ ```js
603
+ const client = new Transloadit({ authKey: 'foo_key', authSecret: 'foo_secret' })
604
+ const url = client.getSignedSmartCDNUrl({
605
+ workspace: 'foo_workspace',
606
+ template: 'foo_template',
607
+ input: 'foo_input',
608
+ urlParams: {
609
+ foo: 'bar',
610
+ },
611
+ })
612
+
613
+ // url is:
614
+ // https://foo_workspace.tlcdn.com/foo_template/foo_input?auth_key=foo_key&exp=1714525200000&foo=bar&sig=sha256:9548915ec70a5f0d05de9497289e792201ceec19a526fe315f4f4fd2e7e377ac
615
+ ```
616
+
617
+ ### Errors
618
+
619
+ Any errors originating from Node.js will be passed on and we use [GOT](https://github.com/sindresorhus/got) v11 for HTTP requests. [Errors from `got`](https://github.com/sindresorhus/got/tree/v11.8.6?tab=readme-ov-file#errors) will also be passed on, _except_ the `got.HTTPError` which will be replaced with a `transloadit.ApiError`, which will have its `cause` property set to the instance of the original `got.HTTPError`. `transloadit.ApiError` has these properties:
620
+
621
+ - `code` (`string`) - [The Transloadit API error code](https://transloadit.com/docs/api/response-codes/#error-codes).
622
+ - `rawMessage` (`string`) - A textual representation of the Transloadit API error.
623
+ - `reason` (`string`) - Additional information about the Transloadit API error.
624
+ - `assemblyId`: (`string`) - If the request is related to an assembly, this will be the ID of the assembly.
625
+ - `assemblySslUrl` (`string`) - If the request is related to an assembly, this will be the SSL URL to the assembly .
626
+
627
+ To identify errors you can either check its props or use `instanceof`, e.g.:
628
+
629
+ ```js
630
+ try {
631
+ await transloadit.createAssembly(options)
632
+ } catch (err) {
633
+ if (err instanceof got.TimeoutError) {
634
+ return console.error('The request timed out', err)
635
+ }
636
+ if (err.code === 'ENOENT') {
637
+ return console.error('Cannot open file', err)
638
+ }
639
+ if (err instanceof ApiError && err.code === 'ASSEMBLY_INVALID_STEPS') {
640
+ return console.error('Invalid Assembly Steps', err)
641
+ }
642
+ }
643
+ ```
644
+
645
+ **Note:** Assemblies that have an error status (`assembly.error`) will only result in an error being thrown from `createAssembly` and `replayAssembly`. For other Assembly methods, no errors will be thrown, but any error can be found in the response's `error` property (also `ApiError.code`).
646
+
647
+ - [More information on Transloadit errors (`ApiError.code`)](https://transloadit.com/docs/api/response-codes/#error-codes)
648
+ - [More information on request errors](https://github.com/sindresorhus/got#errors)
649
+
650
+ ### Rate limiting & auto retry
651
+
652
+ There are three kinds of retries:
653
+
654
+ #### Retry on rate limiting (`maxRetries`, default `5`)
655
+
656
+ All functions of the client automatically obey all rate limiting imposed by Transloadit (e.g. `RATE_LIMIT_REACHED`), so there is no need to write your own wrapper scripts to handle rate limits. The SDK will by default retry requests **5 times** with auto back-off (See `maxRetries` constructor option).
657
+
658
+ #### GOT HTTP retries (`gotRetry`, default `{ limit: 0 }`)
659
+
660
+ Because we use [got](https://github.com/sindresorhus/got) under the hood, you can pass a `gotRetry` constructor option which is passed on to `got`. This offers great flexibility for handling retries on network errors and HTTP status codes with auto back-off. See [`got` `retry` object documentation](https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md).
661
+
662
+ **Note that the above `maxRetries` option does not affect the `gotRetry` logic.**
663
+
664
+ #### Validate API responses (`validateResponses`, default `false`)
665
+
666
+ As we have ported the JavaScript SDK to TypeScript in v4, we are now also validating API responses using `zod` schemas. Having schema validation enabled (`true`), guarantees that the data returned by the SDK adheres to the TypeScript types of this SDK. However we are still working on improving the schemas and they are not yet 100% complete. This means that if you hit a bug in the schemas, a `zod` schema validation error will be thrown. If you encounter such an error, please report it and we will fix it as soon as possible. If you set this option to `false`, schema validation will be disabled, and you won't get any such errors, however the TypeScript types will not protect you should such a bug be encountered.
667
+
668
+ #### Custom retry logic
669
+
670
+ If you want to retry on other errors, please see the [retry example code](examples/retry.ts).
671
+
672
+ - https://transloadit.com/docs/api/rate-limiting/
673
+ - https://transloadit.com/blog/2012/04/introducing-rate-limiting/
674
+
675
+ ## Debugging
676
+
677
+ This project uses [debug](https://github.com/visionmedia/debug) so you can run node with the `DEBUG=transloadit` evironment variable to enable verbose logging. Example:
678
+
679
+ ```bash
680
+ DEBUG=transloadit* npx tsx examples/template_api.ts
681
+ ```
682
+
683
+ ## Maintainers
684
+
685
+ - [Mikael Finstad](https://github.com/mifi)
686
+
687
+ ### Changelog
688
+
689
+ See [Releases](https://github.com/transloadit/node-sdk/releases)
690
+
691
+ ## Attribution
692
+
693
+ Thanks to [Ian Hansen](https://github.com/supershabam) for donating the `transloadit` npm name. You can still access his code under [`v0.0.0`](https://www.npmjs.com/package/transloadit/v/0.0.0).
694
+
695
+ ## License
696
+
697
+ [MIT](LICENSE) © [Transloadit](https://transloadit.com)
698
+
699
+ ## Development
700
+
701
+ See [CONTRIBUTING](./CONTRIBUTING.md).