@backblaze-labs/b2-sdk 0.1.0

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 (512) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/LICENSE +21 -0
  3. package/README.md +664 -0
  4. package/dist/auth/account-info.d.cts +51 -0
  5. package/dist/auth/account-info.d.cts.map +1 -0
  6. package/dist/auth/account-info.d.ts +51 -0
  7. package/dist/auth/account-info.d.ts.map +1 -0
  8. package/dist/auth/file.cjs +210 -0
  9. package/dist/auth/file.cjs.map +1 -0
  10. package/dist/auth/file.d.cts +157 -0
  11. package/dist/auth/file.d.cts.map +1 -0
  12. package/dist/auth/file.d.ts +157 -0
  13. package/dist/auth/file.d.ts.map +1 -0
  14. package/dist/auth/file.js +210 -0
  15. package/dist/auth/file.js.map +1 -0
  16. package/dist/auth/in-memory.cjs +184 -0
  17. package/dist/auth/in-memory.cjs.map +1 -0
  18. package/dist/auth/in-memory.d.cts +147 -0
  19. package/dist/auth/in-memory.d.cts.map +1 -0
  20. package/dist/auth/in-memory.d.ts +147 -0
  21. package/dist/auth/in-memory.d.ts.map +1 -0
  22. package/dist/auth/in-memory.js +184 -0
  23. package/dist/auth/in-memory.js.map +1 -0
  24. package/dist/auth/index.cjs +10 -0
  25. package/dist/auth/index.cjs.map +1 -0
  26. package/dist/auth/index.d.cts +6 -0
  27. package/dist/auth/index.d.cts.map +1 -0
  28. package/dist/auth/index.d.ts +6 -0
  29. package/dist/auth/index.d.ts.map +1 -0
  30. package/dist/auth/index.js +10 -0
  31. package/dist/auth/index.js.map +1 -0
  32. package/dist/auth/realms.cjs +12 -0
  33. package/dist/auth/realms.cjs.map +1 -0
  34. package/dist/auth/realms.d.cts +12 -0
  35. package/dist/auth/realms.d.cts.map +1 -0
  36. package/dist/auth/realms.d.ts +12 -0
  37. package/dist/auth/realms.d.ts.map +1 -0
  38. package/dist/auth/realms.js +12 -0
  39. package/dist/auth/realms.js.map +1 -0
  40. package/dist/auth/upload-url-pool.cjs +52 -0
  41. package/dist/auth/upload-url-pool.cjs.map +1 -0
  42. package/dist/auth/upload-url-pool.d.cts +35 -0
  43. package/dist/auth/upload-url-pool.d.cts.map +1 -0
  44. package/dist/auth/upload-url-pool.d.ts +35 -0
  45. package/dist/auth/upload-url-pool.d.ts.map +1 -0
  46. package/dist/auth/upload-url-pool.js +52 -0
  47. package/dist/auth/upload-url-pool.js.map +1 -0
  48. package/dist/bucket.cjs +789 -0
  49. package/dist/bucket.cjs.map +1 -0
  50. package/dist/bucket.d.cts +659 -0
  51. package/dist/bucket.d.cts.map +1 -0
  52. package/dist/bucket.d.ts +659 -0
  53. package/dist/bucket.d.ts.map +1 -0
  54. package/dist/bucket.js +789 -0
  55. package/dist/bucket.js.map +1 -0
  56. package/dist/client.cjs +230 -0
  57. package/dist/client.cjs.map +1 -0
  58. package/dist/client.d.cts +222 -0
  59. package/dist/client.d.cts.map +1 -0
  60. package/dist/client.d.ts +222 -0
  61. package/dist/client.d.ts.map +1 -0
  62. package/dist/client.js +230 -0
  63. package/dist/client.js.map +1 -0
  64. package/dist/copy/large.cjs +74 -0
  65. package/dist/copy/large.cjs.map +1 -0
  66. package/dist/copy/large.d.cts +53 -0
  67. package/dist/copy/large.d.cts.map +1 -0
  68. package/dist/copy/large.d.ts +53 -0
  69. package/dist/copy/large.d.ts.map +1 -0
  70. package/dist/copy/large.js +74 -0
  71. package/dist/copy/large.js.map +1 -0
  72. package/dist/download/parallel.cjs +122 -0
  73. package/dist/download/parallel.cjs.map +1 -0
  74. package/dist/download/parallel.d.cts +42 -0
  75. package/dist/download/parallel.d.cts.map +1 -0
  76. package/dist/download/parallel.d.ts +42 -0
  77. package/dist/download/parallel.d.ts.map +1 -0
  78. package/dist/download/parallel.js +122 -0
  79. package/dist/download/parallel.js.map +1 -0
  80. package/dist/download/single.cjs +117 -0
  81. package/dist/download/single.cjs.map +1 -0
  82. package/dist/download/single.d.cts +152 -0
  83. package/dist/download/single.d.cts.map +1 -0
  84. package/dist/download/single.d.ts +152 -0
  85. package/dist/download/single.d.ts.map +1 -0
  86. package/dist/download/single.js +117 -0
  87. package/dist/download/single.js.map +1 -0
  88. package/dist/errors/index.cjs +268 -0
  89. package/dist/errors/index.cjs.map +1 -0
  90. package/dist/errors/index.d.cts +264 -0
  91. package/dist/errors/index.d.cts.map +1 -0
  92. package/dist/errors/index.d.ts +264 -0
  93. package/dist/errors/index.d.ts.map +1 -0
  94. package/dist/errors/index.js +268 -0
  95. package/dist/errors/index.js.map +1 -0
  96. package/dist/http/retry.cjs +36 -0
  97. package/dist/http/retry.cjs.map +1 -0
  98. package/dist/http/retry.d.cts +34 -0
  99. package/dist/http/retry.d.cts.map +1 -0
  100. package/dist/http/retry.d.ts +34 -0
  101. package/dist/http/retry.d.ts.map +1 -0
  102. package/dist/http/retry.js +36 -0
  103. package/dist/http/retry.js.map +1 -0
  104. package/dist/http/transport.cjs +143 -0
  105. package/dist/http/transport.cjs.map +1 -0
  106. package/dist/http/transport.d.cts +122 -0
  107. package/dist/http/transport.d.cts.map +1 -0
  108. package/dist/http/transport.d.ts +122 -0
  109. package/dist/http/transport.d.ts.map +1 -0
  110. package/dist/http/transport.js +143 -0
  111. package/dist/http/transport.js.map +1 -0
  112. package/dist/http/url-guard.cjs +97 -0
  113. package/dist/http/url-guard.cjs.map +1 -0
  114. package/dist/http/url-guard.d.cts +88 -0
  115. package/dist/http/url-guard.d.cts.map +1 -0
  116. package/dist/http/url-guard.d.ts +88 -0
  117. package/dist/http/url-guard.d.ts.map +1 -0
  118. package/dist/http/url-guard.js +97 -0
  119. package/dist/http/url-guard.js.map +1 -0
  120. package/dist/http/user-agent.cjs +51 -0
  121. package/dist/http/user-agent.cjs.map +1 -0
  122. package/dist/http/user-agent.d.cts +28 -0
  123. package/dist/http/user-agent.d.cts.map +1 -0
  124. package/dist/http/user-agent.d.ts +28 -0
  125. package/dist/http/user-agent.d.ts.map +1 -0
  126. package/dist/http/user-agent.js +51 -0
  127. package/dist/http/user-agent.js.map +1 -0
  128. package/dist/index.cjs +78 -0
  129. package/dist/index.cjs.map +1 -0
  130. package/dist/index.d.cts +39 -0
  131. package/dist/index.d.cts.map +1 -0
  132. package/dist/index.d.ts +39 -0
  133. package/dist/index.d.ts.map +1 -0
  134. package/dist/index.js +78 -0
  135. package/dist/index.js.map +1 -0
  136. package/dist/notifications/index.cjs +7 -0
  137. package/dist/notifications/index.cjs.map +1 -0
  138. package/dist/notifications/index.d.cts +3 -0
  139. package/dist/notifications/index.d.cts.map +1 -0
  140. package/dist/notifications/index.d.ts +3 -0
  141. package/dist/notifications/index.d.ts.map +1 -0
  142. package/dist/notifications/index.js +7 -0
  143. package/dist/notifications/index.js.map +1 -0
  144. package/dist/notifications/webhook.cjs +106 -0
  145. package/dist/notifications/webhook.cjs.map +1 -0
  146. package/dist/notifications/webhook.d.cts +146 -0
  147. package/dist/notifications/webhook.d.cts.map +1 -0
  148. package/dist/notifications/webhook.d.ts +146 -0
  149. package/dist/notifications/webhook.d.ts.map +1 -0
  150. package/dist/notifications/webhook.js +106 -0
  151. package/dist/notifications/webhook.js.map +1 -0
  152. package/dist/object.cjs +212 -0
  153. package/dist/object.cjs.map +1 -0
  154. package/dist/object.d.cts +263 -0
  155. package/dist/object.d.cts.map +1 -0
  156. package/dist/object.d.ts +263 -0
  157. package/dist/object.d.ts.map +1 -0
  158. package/dist/object.js +212 -0
  159. package/dist/object.js.map +1 -0
  160. package/dist/package.json.cjs +9 -0
  161. package/dist/package.json.cjs.map +1 -0
  162. package/dist/package.json.js +9 -0
  163. package/dist/package.json.js.map +1 -0
  164. package/dist/raw/encoding.cjs +47 -0
  165. package/dist/raw/encoding.cjs.map +1 -0
  166. package/dist/raw/encoding.d.cts +46 -0
  167. package/dist/raw/encoding.d.cts.map +1 -0
  168. package/dist/raw/encoding.d.ts +46 -0
  169. package/dist/raw/encoding.d.ts.map +1 -0
  170. package/dist/raw/encoding.js +47 -0
  171. package/dist/raw/encoding.js.map +1 -0
  172. package/dist/raw/index.cjs +600 -0
  173. package/dist/raw/index.cjs.map +1 -0
  174. package/dist/raw/index.d.cts +381 -0
  175. package/dist/raw/index.d.cts.map +1 -0
  176. package/dist/raw/index.d.ts +381 -0
  177. package/dist/raw/index.d.ts.map +1 -0
  178. package/dist/raw/index.js +601 -0
  179. package/dist/raw/index.js.map +1 -0
  180. package/dist/s3/index.cjs +23 -0
  181. package/dist/s3/index.cjs.map +1 -0
  182. package/dist/s3/index.d.cts +74 -0
  183. package/dist/s3/index.d.cts.map +1 -0
  184. package/dist/s3/index.d.ts +74 -0
  185. package/dist/s3/index.d.ts.map +1 -0
  186. package/dist/s3/index.js +23 -0
  187. package/dist/s3/index.js.map +1 -0
  188. package/dist/simulator/capabilities.cjs +53 -0
  189. package/dist/simulator/capabilities.cjs.map +1 -0
  190. package/dist/simulator/capabilities.d.cts +15 -0
  191. package/dist/simulator/capabilities.d.cts.map +1 -0
  192. package/dist/simulator/capabilities.d.ts +15 -0
  193. package/dist/simulator/capabilities.d.ts.map +1 -0
  194. package/dist/simulator/capabilities.js +53 -0
  195. package/dist/simulator/capabilities.js.map +1 -0
  196. package/dist/simulator/index.cjs +1559 -0
  197. package/dist/simulator/index.cjs.map +1 -0
  198. package/dist/simulator/index.d.cts +495 -0
  199. package/dist/simulator/index.d.cts.map +1 -0
  200. package/dist/simulator/index.d.ts +495 -0
  201. package/dist/simulator/index.d.ts.map +1 -0
  202. package/dist/simulator/index.js +1560 -0
  203. package/dist/simulator/index.js.map +1 -0
  204. package/dist/simulator/validation.cjs +174 -0
  205. package/dist/simulator/validation.cjs.map +1 -0
  206. package/dist/simulator/validation.d.cts +104 -0
  207. package/dist/simulator/validation.d.cts.map +1 -0
  208. package/dist/simulator/validation.d.ts +104 -0
  209. package/dist/simulator/validation.d.ts.map +1 -0
  210. package/dist/simulator/validation.js +174 -0
  211. package/dist/simulator/validation.js.map +1 -0
  212. package/dist/streams/collect.cjs +26 -0
  213. package/dist/streams/collect.cjs.map +1 -0
  214. package/dist/streams/collect.d.cts +18 -0
  215. package/dist/streams/collect.d.cts.map +1 -0
  216. package/dist/streams/collect.d.ts +18 -0
  217. package/dist/streams/collect.d.ts.map +1 -0
  218. package/dist/streams/collect.js +26 -0
  219. package/dist/streams/collect.js.map +1 -0
  220. package/dist/streams/hash.cjs +123 -0
  221. package/dist/streams/hash.cjs.map +1 -0
  222. package/dist/streams/hash.d.cts +42 -0
  223. package/dist/streams/hash.d.cts.map +1 -0
  224. package/dist/streams/hash.d.ts +42 -0
  225. package/dist/streams/hash.d.ts.map +1 -0
  226. package/dist/streams/hash.js +101 -0
  227. package/dist/streams/hash.js.map +1 -0
  228. package/dist/streams/index.cjs +13 -0
  229. package/dist/streams/index.cjs.map +1 -0
  230. package/dist/streams/index.d.cts +7 -0
  231. package/dist/streams/index.d.cts.map +1 -0
  232. package/dist/streams/index.d.ts +7 -0
  233. package/dist/streams/index.d.ts.map +1 -0
  234. package/dist/streams/index.js +13 -0
  235. package/dist/streams/index.js.map +1 -0
  236. package/dist/streams/progress.cjs +47 -0
  237. package/dist/streams/progress.cjs.map +1 -0
  238. package/dist/streams/progress.d.cts +53 -0
  239. package/dist/streams/progress.d.cts.map +1 -0
  240. package/dist/streams/progress.d.ts +53 -0
  241. package/dist/streams/progress.d.ts.map +1 -0
  242. package/dist/streams/progress.js +47 -0
  243. package/dist/streams/progress.js.map +1 -0
  244. package/dist/streams/source.cjs +155 -0
  245. package/dist/streams/source.cjs.map +1 -0
  246. package/dist/streams/source.d.cts +140 -0
  247. package/dist/streams/source.d.cts.map +1 -0
  248. package/dist/streams/source.d.ts +140 -0
  249. package/dist/streams/source.d.ts.map +1 -0
  250. package/dist/streams/source.js +155 -0
  251. package/dist/streams/source.js.map +1 -0
  252. package/dist/sync/actions/index.cjs +191 -0
  253. package/dist/sync/actions/index.cjs.map +1 -0
  254. package/dist/sync/actions/index.d.cts +167 -0
  255. package/dist/sync/actions/index.d.cts.map +1 -0
  256. package/dist/sync/actions/index.d.ts +167 -0
  257. package/dist/sync/actions/index.d.ts.map +1 -0
  258. package/dist/sync/actions/index.js +191 -0
  259. package/dist/sync/actions/index.js.map +1 -0
  260. package/dist/sync/index.cjs +23 -0
  261. package/dist/sync/index.cjs.map +1 -0
  262. package/dist/sync/index.d.cts +21 -0
  263. package/dist/sync/index.d.cts.map +1 -0
  264. package/dist/sync/index.d.ts +21 -0
  265. package/dist/sync/index.d.ts.map +1 -0
  266. package/dist/sync/index.js +23 -0
  267. package/dist/sync/index.js.map +1 -0
  268. package/dist/sync/pairing.cjs +31 -0
  269. package/dist/sync/pairing.cjs.map +1 -0
  270. package/dist/sync/pairing.d.cts +13 -0
  271. package/dist/sync/pairing.d.cts.map +1 -0
  272. package/dist/sync/pairing.d.ts +13 -0
  273. package/dist/sync/pairing.d.ts.map +1 -0
  274. package/dist/sync/pairing.js +31 -0
  275. package/dist/sync/pairing.js.map +1 -0
  276. package/dist/sync/policies/compare.cjs +14 -0
  277. package/dist/sync/policies/compare.cjs.map +1 -0
  278. package/dist/sync/policies/compare.d.cts +13 -0
  279. package/dist/sync/policies/compare.d.cts.map +1 -0
  280. package/dist/sync/policies/compare.d.ts +13 -0
  281. package/dist/sync/policies/compare.d.ts.map +1 -0
  282. package/dist/sync/policies/compare.js +14 -0
  283. package/dist/sync/policies/compare.js.map +1 -0
  284. package/dist/sync/policies/index.cjs +74 -0
  285. package/dist/sync/policies/index.cjs.map +1 -0
  286. package/dist/sync/policies/index.d.cts +42 -0
  287. package/dist/sync/policies/index.d.cts.map +1 -0
  288. package/dist/sync/policies/index.d.ts +42 -0
  289. package/dist/sync/policies/index.d.ts.map +1 -0
  290. package/dist/sync/policies/index.js +74 -0
  291. package/dist/sync/policies/index.js.map +1 -0
  292. package/dist/sync/scanners/b2.cjs +57 -0
  293. package/dist/sync/scanners/b2.cjs.map +1 -0
  294. package/dist/sync/scanners/b2.d.cts +20 -0
  295. package/dist/sync/scanners/b2.d.cts.map +1 -0
  296. package/dist/sync/scanners/b2.d.ts +20 -0
  297. package/dist/sync/scanners/b2.d.ts.map +1 -0
  298. package/dist/sync/scanners/b2.js +57 -0
  299. package/dist/sync/scanners/b2.js.map +1 -0
  300. package/dist/sync/scanners/local.cjs +58 -0
  301. package/dist/sync/scanners/local.cjs.map +1 -0
  302. package/dist/sync/scanners/local.d.cts +24 -0
  303. package/dist/sync/scanners/local.d.cts.map +1 -0
  304. package/dist/sync/scanners/local.d.ts +24 -0
  305. package/dist/sync/scanners/local.d.ts.map +1 -0
  306. package/dist/sync/scanners/local.js +58 -0
  307. package/dist/sync/scanners/local.js.map +1 -0
  308. package/dist/sync/synchronizer.cjs +203 -0
  309. package/dist/sync/synchronizer.cjs.map +1 -0
  310. package/dist/sync/synchronizer.d.cts +52 -0
  311. package/dist/sync/synchronizer.d.cts.map +1 -0
  312. package/dist/sync/synchronizer.d.ts +52 -0
  313. package/dist/sync/synchronizer.d.ts.map +1 -0
  314. package/dist/sync/synchronizer.js +181 -0
  315. package/dist/sync/synchronizer.js.map +1 -0
  316. package/dist/sync/types.d.cts +121 -0
  317. package/dist/sync/types.d.cts.map +1 -0
  318. package/dist/sync/types.d.ts +121 -0
  319. package/dist/sync/types.d.ts.map +1 -0
  320. package/dist/types/auth.cjs +58 -0
  321. package/dist/types/auth.cjs.map +1 -0
  322. package/dist/types/auth.d.cts +150 -0
  323. package/dist/types/auth.d.cts.map +1 -0
  324. package/dist/types/auth.d.ts +150 -0
  325. package/dist/types/auth.d.ts.map +1 -0
  326. package/dist/types/auth.js +58 -0
  327. package/dist/types/auth.js.map +1 -0
  328. package/dist/types/bucket.cjs +44 -0
  329. package/dist/types/bucket.cjs.map +1 -0
  330. package/dist/types/bucket.d.cts +245 -0
  331. package/dist/types/bucket.d.cts.map +1 -0
  332. package/dist/types/bucket.d.ts +245 -0
  333. package/dist/types/bucket.d.ts.map +1 -0
  334. package/dist/types/bucket.js +44 -0
  335. package/dist/types/bucket.js.map +1 -0
  336. package/dist/types/download.d.cts +110 -0
  337. package/dist/types/download.d.cts.map +1 -0
  338. package/dist/types/download.d.ts +110 -0
  339. package/dist/types/download.d.ts.map +1 -0
  340. package/dist/types/encryption.cjs +343 -0
  341. package/dist/types/encryption.cjs.map +1 -0
  342. package/dist/types/encryption.d.cts +132 -0
  343. package/dist/types/encryption.d.cts.map +1 -0
  344. package/dist/types/encryption.d.ts +132 -0
  345. package/dist/types/encryption.d.ts.map +1 -0
  346. package/dist/types/encryption.js +321 -0
  347. package/dist/types/encryption.js.map +1 -0
  348. package/dist/types/errors.d.cts +16 -0
  349. package/dist/types/errors.d.cts.map +1 -0
  350. package/dist/types/errors.d.ts +16 -0
  351. package/dist/types/errors.d.ts.map +1 -0
  352. package/dist/types/file.cjs +23 -0
  353. package/dist/types/file.cjs.map +1 -0
  354. package/dist/types/file.d.cts +220 -0
  355. package/dist/types/file.d.cts.map +1 -0
  356. package/dist/types/file.d.ts +220 -0
  357. package/dist/types/file.d.ts.map +1 -0
  358. package/dist/types/file.js +23 -0
  359. package/dist/types/file.js.map +1 -0
  360. package/dist/types/ids.cjs +27 -0
  361. package/dist/types/ids.cjs.map +1 -0
  362. package/dist/types/ids.d.cts +84 -0
  363. package/dist/types/ids.d.cts.map +1 -0
  364. package/dist/types/ids.d.ts +84 -0
  365. package/dist/types/ids.d.ts.map +1 -0
  366. package/dist/types/ids.js +27 -0
  367. package/dist/types/ids.js.map +1 -0
  368. package/dist/types/index.d.cts +25 -0
  369. package/dist/types/index.d.cts.map +1 -0
  370. package/dist/types/index.d.ts +25 -0
  371. package/dist/types/index.d.ts.map +1 -0
  372. package/dist/types/key.d.cts +84 -0
  373. package/dist/types/key.d.cts.map +1 -0
  374. package/dist/types/key.d.ts +84 -0
  375. package/dist/types/key.d.ts.map +1 -0
  376. package/dist/types/lock.cjs +17 -0
  377. package/dist/types/lock.cjs.map +1 -0
  378. package/dist/types/lock.d.cts +92 -0
  379. package/dist/types/lock.d.cts.map +1 -0
  380. package/dist/types/lock.d.ts +92 -0
  381. package/dist/types/lock.d.ts.map +1 -0
  382. package/dist/types/lock.js +17 -0
  383. package/dist/types/lock.js.map +1 -0
  384. package/dist/types/notifications.cjs +24 -0
  385. package/dist/types/notifications.cjs.map +1 -0
  386. package/dist/types/notifications.d.cts +97 -0
  387. package/dist/types/notifications.d.cts.map +1 -0
  388. package/dist/types/notifications.d.ts +97 -0
  389. package/dist/types/notifications.d.ts.map +1 -0
  390. package/dist/types/notifications.js +24 -0
  391. package/dist/types/notifications.js.map +1 -0
  392. package/dist/types/replication.d.cts +42 -0
  393. package/dist/types/replication.d.cts.map +1 -0
  394. package/dist/types/replication.d.ts +42 -0
  395. package/dist/types/replication.d.ts.map +1 -0
  396. package/dist/types/upload.d.cts +219 -0
  397. package/dist/types/upload.d.cts.map +1 -0
  398. package/dist/types/upload.d.ts +219 -0
  399. package/dist/types/upload.d.ts.map +1 -0
  400. package/dist/upload/cancel.cjs +10 -0
  401. package/dist/upload/cancel.cjs.map +1 -0
  402. package/dist/upload/cancel.d.cts +23 -0
  403. package/dist/upload/cancel.d.cts.map +1 -0
  404. package/dist/upload/cancel.d.ts +23 -0
  405. package/dist/upload/cancel.d.ts.map +1 -0
  406. package/dist/upload/cancel.js +10 -0
  407. package/dist/upload/cancel.js.map +1 -0
  408. package/dist/upload/concurrency.cjs +54 -0
  409. package/dist/upload/concurrency.cjs.map +1 -0
  410. package/dist/upload/concurrency.d.cts +46 -0
  411. package/dist/upload/concurrency.d.cts.map +1 -0
  412. package/dist/upload/concurrency.d.ts +46 -0
  413. package/dist/upload/concurrency.d.ts.map +1 -0
  414. package/dist/upload/concurrency.js +54 -0
  415. package/dist/upload/concurrency.js.map +1 -0
  416. package/dist/upload/large.cjs +222 -0
  417. package/dist/upload/large.cjs.map +1 -0
  418. package/dist/upload/large.d.cts +71 -0
  419. package/dist/upload/large.d.cts.map +1 -0
  420. package/dist/upload/large.d.ts +71 -0
  421. package/dist/upload/large.d.ts.map +1 -0
  422. package/dist/upload/large.js +222 -0
  423. package/dist/upload/large.js.map +1 -0
  424. package/dist/upload/resume.cjs +34 -0
  425. package/dist/upload/resume.cjs.map +1 -0
  426. package/dist/upload/resume.d.cts +33 -0
  427. package/dist/upload/resume.d.cts.map +1 -0
  428. package/dist/upload/resume.d.ts +33 -0
  429. package/dist/upload/resume.d.ts.map +1 -0
  430. package/dist/upload/resume.js +34 -0
  431. package/dist/upload/resume.js.map +1 -0
  432. package/dist/upload/single.cjs +47 -0
  433. package/dist/upload/single.cjs.map +1 -0
  434. package/dist/upload/single.d.cts +51 -0
  435. package/dist/upload/single.d.cts.map +1 -0
  436. package/dist/upload/single.d.ts +51 -0
  437. package/dist/upload/single.d.ts.map +1 -0
  438. package/dist/upload/single.js +47 -0
  439. package/dist/upload/single.js.map +1 -0
  440. package/dist/upload/stream.cjs +198 -0
  441. package/dist/upload/stream.cjs.map +1 -0
  442. package/dist/upload/stream.d.cts +61 -0
  443. package/dist/upload/stream.d.cts.map +1 -0
  444. package/dist/upload/stream.d.ts +61 -0
  445. package/dist/upload/stream.d.ts.map +1 -0
  446. package/dist/upload/stream.js +198 -0
  447. package/dist/upload/stream.js.map +1 -0
  448. package/dist/util/best-effort.cjs +10 -0
  449. package/dist/util/best-effort.cjs.map +1 -0
  450. package/dist/util/best-effort.d.cts +31 -0
  451. package/dist/util/best-effort.d.cts.map +1 -0
  452. package/dist/util/best-effort.d.ts +31 -0
  453. package/dist/util/best-effort.d.ts.map +1 -0
  454. package/dist/util/best-effort.js +10 -0
  455. package/dist/util/best-effort.js.map +1 -0
  456. package/dist/util/defaults.cjs +11 -0
  457. package/dist/util/defaults.cjs.map +1 -0
  458. package/dist/util/defaults.d.cts +54 -0
  459. package/dist/util/defaults.d.cts.map +1 -0
  460. package/dist/util/defaults.d.ts +54 -0
  461. package/dist/util/defaults.d.ts.map +1 -0
  462. package/dist/util/defaults.js +11 -0
  463. package/dist/util/defaults.js.map +1 -0
  464. package/dist/util/normalize.cjs +16 -0
  465. package/dist/util/normalize.cjs.map +1 -0
  466. package/dist/util/normalize.d.cts +62 -0
  467. package/dist/util/normalize.d.cts.map +1 -0
  468. package/dist/util/normalize.d.ts +62 -0
  469. package/dist/util/normalize.d.ts.map +1 -0
  470. package/dist/util/normalize.js +16 -0
  471. package/dist/util/normalize.js.map +1 -0
  472. package/dist/util/paginator.cjs +20 -0
  473. package/dist/util/paginator.cjs.map +1 -0
  474. package/dist/util/paginator.d.cts +120 -0
  475. package/dist/util/paginator.d.cts.map +1 -0
  476. package/dist/util/paginator.d.ts +120 -0
  477. package/dist/util/paginator.d.ts.map +1 -0
  478. package/dist/util/paginator.js +20 -0
  479. package/dist/util/paginator.js.map +1 -0
  480. package/dist/util/plan-ranges.cjs +28 -0
  481. package/dist/util/plan-ranges.cjs.map +1 -0
  482. package/dist/util/plan-ranges.d.cts +56 -0
  483. package/dist/util/plan-ranges.d.cts.map +1 -0
  484. package/dist/util/plan-ranges.d.ts +56 -0
  485. package/dist/util/plan-ranges.d.ts.map +1 -0
  486. package/dist/util/plan-ranges.js +28 -0
  487. package/dist/util/plan-ranges.js.map +1 -0
  488. package/dist/util/text-codec.cjs +7 -0
  489. package/dist/util/text-codec.cjs.map +1 -0
  490. package/dist/util/text-codec.d.cts +26 -0
  491. package/dist/util/text-codec.d.cts.map +1 -0
  492. package/dist/util/text-codec.d.ts +26 -0
  493. package/dist/util/text-codec.d.ts.map +1 -0
  494. package/dist/util/text-codec.js +7 -0
  495. package/dist/util/text-codec.js.map +1 -0
  496. package/dist/util/to-error.cjs +7 -0
  497. package/dist/util/to-error.cjs.map +1 -0
  498. package/dist/util/to-error.d.cts +15 -0
  499. package/dist/util/to-error.d.cts.map +1 -0
  500. package/dist/util/to-error.d.ts +15 -0
  501. package/dist/util/to-error.d.ts.map +1 -0
  502. package/dist/util/to-error.js +7 -0
  503. package/dist/util/to-error.js.map +1 -0
  504. package/dist/version.cjs +6 -0
  505. package/dist/version.cjs.map +1 -0
  506. package/dist/version.d.cts +14 -0
  507. package/dist/version.d.cts.map +1 -0
  508. package/dist/version.d.ts +14 -0
  509. package/dist/version.d.ts.map +1 -0
  510. package/dist/version.js +6 -0
  511. package/dist/version.js.map +1 -0
  512. package/package.json +198 -0
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Uniform adapter for upload content. Wraps File, Blob, Buffer, or ReadableStream
3
+ * behind a common interface so upload logic does not depend on the input type.
4
+ */
5
+ export interface ContentSource {
6
+ /** Total size of the content in bytes. */
7
+ readonly size: number;
8
+ /** Pre-computed SHA-1 hex digest, if available. */
9
+ readonly sha1?: string;
10
+ /**
11
+ * Whether {@link slice} is safe to call on this source.
12
+ *
13
+ * `true` for in-memory / random-access sources (`BufferSource`,
14
+ * `BlobSource`) — the multipart upload engine can dispatch part reads
15
+ * in parallel by slicing the source into disjoint ranges. `false`
16
+ * for forward-only sources (`StreamSource`) — the engine must read
17
+ * sequentially, one `partSize` chunk at a time. Callers that branch
18
+ * on this flag are expected to fall back to the sequential path
19
+ * rather than call `slice()` and catch the throw.
20
+ */
21
+ readonly canSlice: boolean;
22
+ /** Return a sub-range of this source as a new ContentSource. */
23
+ slice(start: number, end: number): ContentSource;
24
+ /** Open the content as a ReadableStream. */
25
+ stream(): ReadableStream<Uint8Array>;
26
+ /** Read the entire content into an ArrayBuffer. */
27
+ toArrayBuffer(): Promise<ArrayBuffer>;
28
+ }
29
+ /** ContentSource backed by a Blob or File. */
30
+ export declare class BlobSource implements ContentSource {
31
+ private readonly blob;
32
+ /** {@inheritDoc} */
33
+ readonly size: number;
34
+ /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */
35
+ readonly canSlice = true;
36
+ /**
37
+ * Create a BlobSource wrapping the given Blob.
38
+ * @param blob - The Blob or File to use as the underlying content.
39
+ */
40
+ constructor(blob: Blob);
41
+ /**
42
+ * Return a new BlobSource covering the specified byte range.
43
+ * @param start - The zero-based byte offset to begin the slice.
44
+ * @param end - The exclusive byte offset where the slice ends.
45
+ *
46
+ * @returns A new ContentSource representing the requested sub-range.
47
+ */
48
+ slice(start: number, end: number): ContentSource;
49
+ /**
50
+ * Open the Blob content as a ReadableStream.
51
+ * @returns A ReadableStream of the Blob bytes.
52
+ */
53
+ stream(): ReadableStream<Uint8Array>;
54
+ /**
55
+ * Read the entire Blob content into an ArrayBuffer.
56
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
57
+ */
58
+ toArrayBuffer(): Promise<ArrayBuffer>;
59
+ }
60
+ /** ContentSource backed by a Uint8Array buffer. */
61
+ export declare class BufferSource implements ContentSource {
62
+ private readonly buffer;
63
+ /** {@inheritDoc} */
64
+ readonly size: number;
65
+ /** Random-access: the entire payload lives in memory. */
66
+ readonly canSlice = true;
67
+ /**
68
+ * Create a BufferSource wrapping the given Uint8Array.
69
+ * @param buffer - The byte buffer to use as the underlying content.
70
+ */
71
+ constructor(buffer: Uint8Array);
72
+ /**
73
+ * Return a new BufferSource covering the specified byte range.
74
+ * @param start - The zero-based byte offset to begin the slice.
75
+ * @param end - The exclusive byte offset where the slice ends.
76
+ *
77
+ * @returns A new ContentSource representing the requested sub-range.
78
+ */
79
+ slice(start: number, end: number): ContentSource;
80
+ /**
81
+ * Open the buffer content as a ReadableStream.
82
+ * @returns A ReadableStream that emits the buffer bytes in a single chunk.
83
+ */
84
+ stream(): ReadableStream<Uint8Array>;
85
+ /**
86
+ * Read the entire buffer content into an ArrayBuffer.
87
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
88
+ */
89
+ toArrayBuffer(): Promise<ArrayBuffer>;
90
+ }
91
+ /** ContentSource backed by a ReadableStream. Can only be consumed once and does not support slicing. */
92
+ export declare class StreamSource implements ContentSource {
93
+ private readonly readable;
94
+ /** {@inheritDoc} */
95
+ readonly size: number;
96
+ /**
97
+ * Forward-only: ReadableStreams cannot be repositioned, so multipart
98
+ * uploads must take the sequential path. See the interface comment on
99
+ * `canSlice` for what the engine does with this flag.
100
+ */
101
+ readonly canSlice = false;
102
+ /** Whether the stream has already been read. */
103
+ private consumed;
104
+ /**
105
+ * Create a StreamSource wrapping the given ReadableStream with a known byte size.
106
+ * @param readable - The ReadableStream to wrap as a content source.
107
+ * @param size - The total number of bytes the stream will produce.
108
+ */
109
+ constructor(readable: ReadableStream<Uint8Array>, size: number);
110
+ /**
111
+ * Always throws because streams cannot be sliced. Buffer the stream first.
112
+ *
113
+ * @throws If slicing is attempted on a stream-backed source.
114
+ */
115
+ slice(): ContentSource;
116
+ /**
117
+ * Open the underlying ReadableStream. Can only be called once.
118
+ * @returns The underlying ReadableStream of bytes.
119
+ *
120
+ * @throws If the stream has already been consumed.
121
+ */
122
+ stream(): ReadableStream<Uint8Array>;
123
+ /**
124
+ * Read the entire stream into an ArrayBuffer.
125
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
126
+ */
127
+ toArrayBuffer(): Promise<ArrayBuffer>;
128
+ }
129
+ /**
130
+ * Convert a Uint8Array, Blob, or ReadableStream into a {@link ContentSource}.
131
+ * When passing a ReadableStream, the `size` parameter is required.
132
+ * @param input - The content to wrap, as a Uint8Array, Blob, or ReadableStream.
133
+ * @param size - The total byte length, required when input is a ReadableStream.
134
+ *
135
+ * @returns A ContentSource adapter for the given input.
136
+ *
137
+ * @throws If input is a ReadableStream and size is not provided.
138
+ */
139
+ export declare function toContentSource(input: Uint8Array | Blob | ReadableStream<Uint8Array>, size?: number): ContentSource;
140
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/streams/source.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,gEAAgE;IAChE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;IAChD,4CAA4C;IAC5C,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC,CAAA;IACpC,mDAAmD;IACnD,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;CACtC;AAED,8CAA8C;AAC9C,qBAAa,UAAW,YAAW,aAAa;IAUlC,OAAO,CAAC,QAAQ,CAAC,IAAI;IATjC,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,QAAO;IAExB;;;OAGG;gBAC0B,IAAI,EAAE,IAAI;IAIvC;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAIhD;;;OAGG;IACH,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC;IAIpC;;;OAGG;IACH,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC;CAGtC;AAED,mDAAmD;AACnD,qBAAa,YAAa,YAAW,aAAa;IAUpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IATnC,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,QAAO;IAExB;;;OAGG;gBAC0B,MAAM,EAAE,UAAU;IAI/C;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAIhD;;;OAGG;IACH,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC;IAUpC;;;OAGG;IACH,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC;CAQtC;AAED,wGAAwG;AACxG,qBAAa,YAAa,YAAW,aAAa;IAkB9C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAjB3B,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,SAAQ;IACzB,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAQ;IAExB;;;;OAIG;gBAEgB,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,EACrD,IAAI,EAAE,MAAM;IAKd;;;;OAIG;IACH,KAAK,IAAI,aAAa;IAItB;;;;;OAKG;IACH,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC;IAMpC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC;CAI5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC,EACrD,IAAI,CAAC,EAAE,MAAM,GACZ,aAAa,CAWf"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Uniform adapter for upload content. Wraps File, Blob, Buffer, or ReadableStream
3
+ * behind a common interface so upload logic does not depend on the input type.
4
+ */
5
+ export interface ContentSource {
6
+ /** Total size of the content in bytes. */
7
+ readonly size: number;
8
+ /** Pre-computed SHA-1 hex digest, if available. */
9
+ readonly sha1?: string;
10
+ /**
11
+ * Whether {@link slice} is safe to call on this source.
12
+ *
13
+ * `true` for in-memory / random-access sources (`BufferSource`,
14
+ * `BlobSource`) — the multipart upload engine can dispatch part reads
15
+ * in parallel by slicing the source into disjoint ranges. `false`
16
+ * for forward-only sources (`StreamSource`) — the engine must read
17
+ * sequentially, one `partSize` chunk at a time. Callers that branch
18
+ * on this flag are expected to fall back to the sequential path
19
+ * rather than call `slice()` and catch the throw.
20
+ */
21
+ readonly canSlice: boolean;
22
+ /** Return a sub-range of this source as a new ContentSource. */
23
+ slice(start: number, end: number): ContentSource;
24
+ /** Open the content as a ReadableStream. */
25
+ stream(): ReadableStream<Uint8Array>;
26
+ /** Read the entire content into an ArrayBuffer. */
27
+ toArrayBuffer(): Promise<ArrayBuffer>;
28
+ }
29
+ /** ContentSource backed by a Blob or File. */
30
+ export declare class BlobSource implements ContentSource {
31
+ private readonly blob;
32
+ /** {@inheritDoc} */
33
+ readonly size: number;
34
+ /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */
35
+ readonly canSlice = true;
36
+ /**
37
+ * Create a BlobSource wrapping the given Blob.
38
+ * @param blob - The Blob or File to use as the underlying content.
39
+ */
40
+ constructor(blob: Blob);
41
+ /**
42
+ * Return a new BlobSource covering the specified byte range.
43
+ * @param start - The zero-based byte offset to begin the slice.
44
+ * @param end - The exclusive byte offset where the slice ends.
45
+ *
46
+ * @returns A new ContentSource representing the requested sub-range.
47
+ */
48
+ slice(start: number, end: number): ContentSource;
49
+ /**
50
+ * Open the Blob content as a ReadableStream.
51
+ * @returns A ReadableStream of the Blob bytes.
52
+ */
53
+ stream(): ReadableStream<Uint8Array>;
54
+ /**
55
+ * Read the entire Blob content into an ArrayBuffer.
56
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
57
+ */
58
+ toArrayBuffer(): Promise<ArrayBuffer>;
59
+ }
60
+ /** ContentSource backed by a Uint8Array buffer. */
61
+ export declare class BufferSource implements ContentSource {
62
+ private readonly buffer;
63
+ /** {@inheritDoc} */
64
+ readonly size: number;
65
+ /** Random-access: the entire payload lives in memory. */
66
+ readonly canSlice = true;
67
+ /**
68
+ * Create a BufferSource wrapping the given Uint8Array.
69
+ * @param buffer - The byte buffer to use as the underlying content.
70
+ */
71
+ constructor(buffer: Uint8Array);
72
+ /**
73
+ * Return a new BufferSource covering the specified byte range.
74
+ * @param start - The zero-based byte offset to begin the slice.
75
+ * @param end - The exclusive byte offset where the slice ends.
76
+ *
77
+ * @returns A new ContentSource representing the requested sub-range.
78
+ */
79
+ slice(start: number, end: number): ContentSource;
80
+ /**
81
+ * Open the buffer content as a ReadableStream.
82
+ * @returns A ReadableStream that emits the buffer bytes in a single chunk.
83
+ */
84
+ stream(): ReadableStream<Uint8Array>;
85
+ /**
86
+ * Read the entire buffer content into an ArrayBuffer.
87
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
88
+ */
89
+ toArrayBuffer(): Promise<ArrayBuffer>;
90
+ }
91
+ /** ContentSource backed by a ReadableStream. Can only be consumed once and does not support slicing. */
92
+ export declare class StreamSource implements ContentSource {
93
+ private readonly readable;
94
+ /** {@inheritDoc} */
95
+ readonly size: number;
96
+ /**
97
+ * Forward-only: ReadableStreams cannot be repositioned, so multipart
98
+ * uploads must take the sequential path. See the interface comment on
99
+ * `canSlice` for what the engine does with this flag.
100
+ */
101
+ readonly canSlice = false;
102
+ /** Whether the stream has already been read. */
103
+ private consumed;
104
+ /**
105
+ * Create a StreamSource wrapping the given ReadableStream with a known byte size.
106
+ * @param readable - The ReadableStream to wrap as a content source.
107
+ * @param size - The total number of bytes the stream will produce.
108
+ */
109
+ constructor(readable: ReadableStream<Uint8Array>, size: number);
110
+ /**
111
+ * Always throws because streams cannot be sliced. Buffer the stream first.
112
+ *
113
+ * @throws If slicing is attempted on a stream-backed source.
114
+ */
115
+ slice(): ContentSource;
116
+ /**
117
+ * Open the underlying ReadableStream. Can only be called once.
118
+ * @returns The underlying ReadableStream of bytes.
119
+ *
120
+ * @throws If the stream has already been consumed.
121
+ */
122
+ stream(): ReadableStream<Uint8Array>;
123
+ /**
124
+ * Read the entire stream into an ArrayBuffer.
125
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
126
+ */
127
+ toArrayBuffer(): Promise<ArrayBuffer>;
128
+ }
129
+ /**
130
+ * Convert a Uint8Array, Blob, or ReadableStream into a {@link ContentSource}.
131
+ * When passing a ReadableStream, the `size` parameter is required.
132
+ * @param input - The content to wrap, as a Uint8Array, Blob, or ReadableStream.
133
+ * @param size - The total byte length, required when input is a ReadableStream.
134
+ *
135
+ * @returns A ContentSource adapter for the given input.
136
+ *
137
+ * @throws If input is a ReadableStream and size is not provided.
138
+ */
139
+ export declare function toContentSource(input: Uint8Array | Blob | ReadableStream<Uint8Array>, size?: number): ContentSource;
140
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/streams/source.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,gEAAgE;IAChE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;IAChD,4CAA4C;IAC5C,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC,CAAA;IACpC,mDAAmD;IACnD,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;CACtC;AAED,8CAA8C;AAC9C,qBAAa,UAAW,YAAW,aAAa;IAUlC,OAAO,CAAC,QAAQ,CAAC,IAAI;IATjC,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,QAAO;IAExB;;;OAGG;gBAC0B,IAAI,EAAE,IAAI;IAIvC;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAIhD;;;OAGG;IACH,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC;IAIpC;;;OAGG;IACH,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC;CAGtC;AAED,mDAAmD;AACnD,qBAAa,YAAa,YAAW,aAAa;IAUpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IATnC,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,QAAO;IAExB;;;OAGG;gBAC0B,MAAM,EAAE,UAAU;IAI/C;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAIhD;;;OAGG;IACH,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC;IAUpC;;;OAGG;IACH,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC;CAQtC;AAED,wGAAwG;AACxG,qBAAa,YAAa,YAAW,aAAa;IAkB9C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAjB3B,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,SAAQ;IACzB,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAQ;IAExB;;;;OAIG;gBAEgB,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,EACrD,IAAI,EAAE,MAAM;IAKd;;;;OAIG;IACH,KAAK,IAAI,aAAa;IAItB;;;;;OAKG;IACH,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC;IAMpC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC;CAI5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC,EACrD,IAAI,CAAC,EAAE,MAAM,GACZ,aAAa,CAWf"}
@@ -0,0 +1,155 @@
1
+ import { collectStream } from "./collect.js";
2
+ class BlobSource {
3
+ /**
4
+ * Create a BlobSource wrapping the given Blob.
5
+ * @param blob - The Blob or File to use as the underlying content.
6
+ */
7
+ constructor(blob) {
8
+ this.blob = blob;
9
+ this.size = blob.size;
10
+ }
11
+ /** {@inheritDoc} */
12
+ size;
13
+ /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */
14
+ canSlice = true;
15
+ /**
16
+ * Return a new BlobSource covering the specified byte range.
17
+ * @param start - The zero-based byte offset to begin the slice.
18
+ * @param end - The exclusive byte offset where the slice ends.
19
+ *
20
+ * @returns A new ContentSource representing the requested sub-range.
21
+ */
22
+ slice(start, end) {
23
+ return new BlobSource(this.blob.slice(start, end));
24
+ }
25
+ /**
26
+ * Open the Blob content as a ReadableStream.
27
+ * @returns A ReadableStream of the Blob bytes.
28
+ */
29
+ stream() {
30
+ return this.blob.stream();
31
+ }
32
+ /**
33
+ * Read the entire Blob content into an ArrayBuffer.
34
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
35
+ */
36
+ toArrayBuffer() {
37
+ return this.blob.arrayBuffer();
38
+ }
39
+ }
40
+ class BufferSource {
41
+ /**
42
+ * Create a BufferSource wrapping the given Uint8Array.
43
+ * @param buffer - The byte buffer to use as the underlying content.
44
+ */
45
+ constructor(buffer) {
46
+ this.buffer = buffer;
47
+ this.size = buffer.byteLength;
48
+ }
49
+ /** {@inheritDoc} */
50
+ size;
51
+ /** Random-access: the entire payload lives in memory. */
52
+ canSlice = true;
53
+ /**
54
+ * Return a new BufferSource covering the specified byte range.
55
+ * @param start - The zero-based byte offset to begin the slice.
56
+ * @param end - The exclusive byte offset where the slice ends.
57
+ *
58
+ * @returns A new ContentSource representing the requested sub-range.
59
+ */
60
+ slice(start, end) {
61
+ return new BufferSource(this.buffer.slice(start, end));
62
+ }
63
+ /**
64
+ * Open the buffer content as a ReadableStream.
65
+ * @returns A ReadableStream that emits the buffer bytes in a single chunk.
66
+ */
67
+ stream() {
68
+ const buffer = this.buffer;
69
+ return new ReadableStream({
70
+ start(controller) {
71
+ controller.enqueue(buffer);
72
+ controller.close();
73
+ }
74
+ });
75
+ }
76
+ /**
77
+ * Read the entire buffer content into an ArrayBuffer.
78
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
79
+ */
80
+ toArrayBuffer() {
81
+ return Promise.resolve(
82
+ this.buffer.buffer.slice(
83
+ this.buffer.byteOffset,
84
+ this.buffer.byteOffset + this.buffer.byteLength
85
+ )
86
+ );
87
+ }
88
+ }
89
+ class StreamSource {
90
+ /**
91
+ * Create a StreamSource wrapping the given ReadableStream with a known byte size.
92
+ * @param readable - The ReadableStream to wrap as a content source.
93
+ * @param size - The total number of bytes the stream will produce.
94
+ */
95
+ constructor(readable, size) {
96
+ this.readable = readable;
97
+ this.size = size;
98
+ }
99
+ /** {@inheritDoc} */
100
+ size;
101
+ /**
102
+ * Forward-only: ReadableStreams cannot be repositioned, so multipart
103
+ * uploads must take the sequential path. See the interface comment on
104
+ * `canSlice` for what the engine does with this flag.
105
+ */
106
+ canSlice = false;
107
+ /** Whether the stream has already been read. */
108
+ consumed = false;
109
+ /**
110
+ * Always throws because streams cannot be sliced. Buffer the stream first.
111
+ *
112
+ * @throws If slicing is attempted on a stream-backed source.
113
+ */
114
+ slice() {
115
+ throw new Error("StreamSource does not support slicing. Buffer the stream first.");
116
+ }
117
+ /**
118
+ * Open the underlying ReadableStream. Can only be called once.
119
+ * @returns The underlying ReadableStream of bytes.
120
+ *
121
+ * @throws If the stream has already been consumed.
122
+ */
123
+ stream() {
124
+ if (this.consumed) throw new Error("StreamSource can only be consumed once.");
125
+ this.consumed = true;
126
+ return this.readable;
127
+ }
128
+ /**
129
+ * Read the entire stream into an ArrayBuffer.
130
+ * @returns A promise that resolves with the full content as an ArrayBuffer.
131
+ */
132
+ async toArrayBuffer() {
133
+ const bytes = await collectStream(this.stream());
134
+ return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
135
+ }
136
+ }
137
+ function toContentSource(input, size) {
138
+ if (input instanceof Uint8Array) {
139
+ return new BufferSource(input);
140
+ }
141
+ if (input instanceof Blob) {
142
+ return new BlobSource(input);
143
+ }
144
+ if (size === void 0) {
145
+ throw new Error("size is required when using a ReadableStream as input.");
146
+ }
147
+ return new StreamSource(input, size);
148
+ }
149
+ export {
150
+ BlobSource,
151
+ BufferSource,
152
+ StreamSource,
153
+ toContentSource
154
+ };
155
+ //# sourceMappingURL=source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.js","sources":["../../src/streams/source.ts"],"sourcesContent":["import { collectStream } from './collect.ts'\n\n/**\n * Uniform adapter for upload content. Wraps File, Blob, Buffer, or ReadableStream\n * behind a common interface so upload logic does not depend on the input type.\n */\nexport interface ContentSource {\n /** Total size of the content in bytes. */\n readonly size: number\n /** Pre-computed SHA-1 hex digest, if available. */\n readonly sha1?: string\n /**\n * Whether {@link slice} is safe to call on this source.\n *\n * `true` for in-memory / random-access sources (`BufferSource`,\n * `BlobSource`) — the multipart upload engine can dispatch part reads\n * in parallel by slicing the source into disjoint ranges. `false`\n * for forward-only sources (`StreamSource`) — the engine must read\n * sequentially, one `partSize` chunk at a time. Callers that branch\n * on this flag are expected to fall back to the sequential path\n * rather than call `slice()` and catch the throw.\n */\n readonly canSlice: boolean\n /** Return a sub-range of this source as a new ContentSource. */\n slice(start: number, end: number): ContentSource\n /** Open the content as a ReadableStream. */\n stream(): ReadableStream<Uint8Array>\n /** Read the entire content into an ArrayBuffer. */\n toArrayBuffer(): Promise<ArrayBuffer>\n}\n\n/** ContentSource backed by a Blob or File. */\nexport class BlobSource implements ContentSource {\n /** {@inheritDoc} */\n readonly size: number\n /** Random-access: `Blob.slice()` is cheap and returns a new Blob view. */\n readonly canSlice = true\n\n /**\n * Create a BlobSource wrapping the given Blob.\n * @param blob - The Blob or File to use as the underlying content.\n */\n constructor(private readonly blob: Blob) {\n this.size = blob.size\n }\n\n /**\n * Return a new BlobSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start: number, end: number): ContentSource {\n return new BlobSource(this.blob.slice(start, end))\n }\n\n /**\n * Open the Blob content as a ReadableStream.\n * @returns A ReadableStream of the Blob bytes.\n */\n stream(): ReadableStream<Uint8Array> {\n return this.blob.stream() as ReadableStream<Uint8Array>\n }\n\n /**\n * Read the entire Blob content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer(): Promise<ArrayBuffer> {\n return this.blob.arrayBuffer()\n }\n}\n\n/** ContentSource backed by a Uint8Array buffer. */\nexport class BufferSource implements ContentSource {\n /** {@inheritDoc} */\n readonly size: number\n /** Random-access: the entire payload lives in memory. */\n readonly canSlice = true\n\n /**\n * Create a BufferSource wrapping the given Uint8Array.\n * @param buffer - The byte buffer to use as the underlying content.\n */\n constructor(private readonly buffer: Uint8Array) {\n this.size = buffer.byteLength\n }\n\n /**\n * Return a new BufferSource covering the specified byte range.\n * @param start - The zero-based byte offset to begin the slice.\n * @param end - The exclusive byte offset where the slice ends.\n *\n * @returns A new ContentSource representing the requested sub-range.\n */\n slice(start: number, end: number): ContentSource {\n return new BufferSource(this.buffer.slice(start, end))\n }\n\n /**\n * Open the buffer content as a ReadableStream.\n * @returns A ReadableStream that emits the buffer bytes in a single chunk.\n */\n stream(): ReadableStream<Uint8Array> {\n const buffer = this.buffer\n return new ReadableStream({\n start(controller) {\n controller.enqueue(buffer)\n controller.close()\n },\n })\n }\n\n /**\n * Read the entire buffer content into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n toArrayBuffer(): Promise<ArrayBuffer> {\n return Promise.resolve(\n this.buffer.buffer.slice(\n this.buffer.byteOffset,\n this.buffer.byteOffset + this.buffer.byteLength,\n ) as ArrayBuffer,\n )\n }\n}\n\n/** ContentSource backed by a ReadableStream. Can only be consumed once and does not support slicing. */\nexport class StreamSource implements ContentSource {\n /** {@inheritDoc} */\n readonly size: number\n /**\n * Forward-only: ReadableStreams cannot be repositioned, so multipart\n * uploads must take the sequential path. See the interface comment on\n * `canSlice` for what the engine does with this flag.\n */\n readonly canSlice = false\n /** Whether the stream has already been read. */\n private consumed = false\n\n /**\n * Create a StreamSource wrapping the given ReadableStream with a known byte size.\n * @param readable - The ReadableStream to wrap as a content source.\n * @param size - The total number of bytes the stream will produce.\n */\n constructor(\n private readonly readable: ReadableStream<Uint8Array>,\n size: number,\n ) {\n this.size = size\n }\n\n /**\n * Always throws because streams cannot be sliced. Buffer the stream first.\n *\n * @throws If slicing is attempted on a stream-backed source.\n */\n slice(): ContentSource {\n throw new Error('StreamSource does not support slicing. Buffer the stream first.')\n }\n\n /**\n * Open the underlying ReadableStream. Can only be called once.\n * @returns The underlying ReadableStream of bytes.\n *\n * @throws If the stream has already been consumed.\n */\n stream(): ReadableStream<Uint8Array> {\n if (this.consumed) throw new Error('StreamSource can only be consumed once.')\n this.consumed = true\n return this.readable\n }\n\n /**\n * Read the entire stream into an ArrayBuffer.\n * @returns A promise that resolves with the full content as an ArrayBuffer.\n */\n async toArrayBuffer(): Promise<ArrayBuffer> {\n const bytes = await collectStream(this.stream())\n return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer\n }\n}\n\n/**\n * Convert a Uint8Array, Blob, or ReadableStream into a {@link ContentSource}.\n * When passing a ReadableStream, the `size` parameter is required.\n * @param input - The content to wrap, as a Uint8Array, Blob, or ReadableStream.\n * @param size - The total byte length, required when input is a ReadableStream.\n *\n * @returns A ContentSource adapter for the given input.\n *\n * @throws If input is a ReadableStream and size is not provided.\n */\nexport function toContentSource(\n input: Uint8Array | Blob | ReadableStream<Uint8Array>,\n size?: number,\n): ContentSource {\n if (input instanceof Uint8Array) {\n return new BufferSource(input)\n }\n if (input instanceof Blob) {\n return new BlobSource(input)\n }\n if (size === undefined) {\n throw new Error('size is required when using a ReadableStream as input.')\n }\n return new StreamSource(input, size)\n}\n"],"names":[],"mappings":";AAgCO,MAAM,WAAoC;AAAA;AAAA;AAAA;AAAA;AAAA,EAU/C,YAA6B,MAAY;AAAZ,SAAA,OAAA;AAC3B,SAAK,OAAO,KAAK;AAAA,EACnB;AAAA;AAAA,EAVS;AAAA;AAAA,EAEA,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBpB,MAAM,OAAe,KAA4B;AAC/C,WAAO,IAAI,WAAW,KAAK,KAAK,MAAM,OAAO,GAAG,CAAC;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAqC;AACnC,WAAO,KAAK,KAAK,OAAA;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAsC;AACpC,WAAO,KAAK,KAAK,YAAA;AAAA,EACnB;AACF;AAGO,MAAM,aAAsC;AAAA;AAAA;AAAA;AAAA;AAAA,EAUjD,YAA6B,QAAoB;AAApB,SAAA,SAAA;AAC3B,SAAK,OAAO,OAAO;AAAA,EACrB;AAAA;AAAA,EAVS;AAAA;AAAA,EAEA,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBpB,MAAM,OAAe,KAA4B;AAC/C,WAAO,IAAI,aAAa,KAAK,OAAO,MAAM,OAAO,GAAG,CAAC;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAqC;AACnC,UAAM,SAAS,KAAK;AACpB,WAAO,IAAI,eAAe;AAAA,MACxB,MAAM,YAAY;AAChB,mBAAW,QAAQ,MAAM;AACzB,mBAAW,MAAA;AAAA,MACb;AAAA,IAAA,CACD;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAsC;AACpC,WAAO,QAAQ;AAAA,MACb,KAAK,OAAO,OAAO;AAAA,QACjB,KAAK,OAAO;AAAA,QACZ,KAAK,OAAO,aAAa,KAAK,OAAO;AAAA,MAAA;AAAA,IACvC;AAAA,EAEJ;AACF;AAGO,MAAM,aAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBjD,YACmB,UACjB,MACA;AAFiB,SAAA,WAAA;AAGjB,SAAK,OAAO;AAAA,EACd;AAAA;AAAA,EApBS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW;AAAA;AAAA,EAEZ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBnB,QAAuB;AACrB,UAAM,IAAI,MAAM,iEAAiE;AAAA,EACnF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,SAAqC;AACnC,QAAI,KAAK,SAAU,OAAM,IAAI,MAAM,yCAAyC;AAC5E,SAAK,WAAW;AAChB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,gBAAsC;AAC1C,UAAM,QAAQ,MAAM,cAAc,KAAK,QAAQ;AAC/C,WAAO,MAAM,OAAO,MAAM,MAAM,YAAY,MAAM,aAAa,MAAM,UAAU;AAAA,EACjF;AACF;AAYO,SAAS,gBACd,OACA,MACe;AACf,MAAI,iBAAiB,YAAY;AAC/B,WAAO,IAAI,aAAa,KAAK;AAAA,EAC/B;AACA,MAAI,iBAAiB,MAAM;AACzB,WAAO,IAAI,WAAW,KAAK;AAAA,EAC7B;AACA,MAAI,SAAS,QAAW;AACtB,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AACA,SAAO,IAAI,aAAa,OAAO,IAAI;AACrC;"}
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ class UploadAction {
4
+ /**
5
+ * Creates a new UploadAction for the given relative path.
6
+ * @param relativePath - Path relative to the sync root.
7
+ * @param absolutePath - Absolute local filesystem path.
8
+ * @param size - File size in bytes.
9
+ * @param doUpload - Callback that performs the actual upload.
10
+ */
11
+ constructor(relativePath, absolutePath, size, doUpload) {
12
+ this.relativePath = relativePath;
13
+ this.absolutePath = absolutePath;
14
+ this.size = size;
15
+ this.doUpload = doUpload;
16
+ }
17
+ type = "upload";
18
+ /**
19
+ * Uploads the file (unless dryRun) and returns an 'upload-done' event.
20
+ * @param dryRun - Whether to simulate the action without making changes.
21
+ *
22
+ * @returns An async generator yielding sync progress events.
23
+ */
24
+ async execute(dryRun) {
25
+ if (!dryRun) {
26
+ await this.doUpload(this.absolutePath, this.relativePath);
27
+ }
28
+ return { type: "upload-done", path: this.relativePath, size: this.size };
29
+ }
30
+ }
31
+ class DownloadAction {
32
+ /**
33
+ * Creates a new DownloadAction for the given relative path.
34
+ * @param relativePath - Path relative to the sync root.
35
+ * @param size - File size in bytes.
36
+ * @param doDownload - Callback that performs the actual download.
37
+ */
38
+ constructor(relativePath, size, doDownload) {
39
+ this.relativePath = relativePath;
40
+ this.size = size;
41
+ this.doDownload = doDownload;
42
+ }
43
+ type = "download";
44
+ /**
45
+ * Downloads the file (unless dryRun) and returns a 'download-done' event.
46
+ * @param dryRun - Whether to simulate the action without making changes.
47
+ *
48
+ * @returns An async generator yielding sync progress events.
49
+ */
50
+ async execute(dryRun) {
51
+ if (!dryRun) {
52
+ await this.doDownload(this.relativePath);
53
+ }
54
+ return { type: "download-done", path: this.relativePath, size: this.size };
55
+ }
56
+ }
57
+ class CopyAction {
58
+ /**
59
+ * Creates a new CopyAction for the given relative path.
60
+ * @param relativePath - Path relative to the sync root.
61
+ * @param size - File size in bytes.
62
+ * @param doCopy - Callback that performs the server-side copy.
63
+ */
64
+ constructor(relativePath, size, doCopy) {
65
+ this.relativePath = relativePath;
66
+ this.size = size;
67
+ this.doCopy = doCopy;
68
+ }
69
+ type = "copy";
70
+ /**
71
+ * Copies the file (unless dryRun) and returns a 'copy-done' event.
72
+ * @param dryRun - Whether to simulate the action without making changes.
73
+ *
74
+ * @returns An async generator yielding sync progress events.
75
+ */
76
+ async execute(dryRun) {
77
+ if (!dryRun) {
78
+ await this.doCopy(this.relativePath);
79
+ }
80
+ return { type: "copy-done", path: this.relativePath, size: this.size };
81
+ }
82
+ }
83
+ class HideAction {
84
+ /**
85
+ * Creates a new HideAction for the given relative path.
86
+ * @param relativePath - Path relative to the sync root.
87
+ * @param doHide - Callback that creates the hide marker.
88
+ */
89
+ constructor(relativePath, doHide) {
90
+ this.relativePath = relativePath;
91
+ this.doHide = doHide;
92
+ }
93
+ type = "hide";
94
+ size = 0;
95
+ /**
96
+ * Hides the file (unless dryRun) and returns a 'hide' event.
97
+ * @param dryRun - Whether to simulate the action without making changes.
98
+ *
99
+ * @returns An async generator yielding sync progress events.
100
+ */
101
+ async execute(dryRun) {
102
+ if (!dryRun) {
103
+ await this.doHide(this.relativePath);
104
+ }
105
+ return { type: "hide", path: this.relativePath, size: 0 };
106
+ }
107
+ }
108
+ class DeleteRemoteAction {
109
+ /**
110
+ * Creates a new DeleteRemoteAction for the given relative path.
111
+ * @param relativePath - Path relative to the sync root.
112
+ * @param fileId - The B2 file version ID to delete.
113
+ * @param doDelete - Callback that performs the deletion.
114
+ */
115
+ constructor(relativePath, fileId, doDelete) {
116
+ this.relativePath = relativePath;
117
+ this.fileId = fileId;
118
+ this.doDelete = doDelete;
119
+ }
120
+ type = "delete-remote";
121
+ size = 0;
122
+ /**
123
+ * Deletes the remote file version (unless dryRun) and returns a 'delete-remote' event.
124
+ * @param dryRun - Whether to simulate the action without making changes.
125
+ *
126
+ * @returns An async generator yielding sync progress events.
127
+ */
128
+ async execute(dryRun) {
129
+ if (!dryRun) {
130
+ await this.doDelete(this.fileId, this.relativePath);
131
+ }
132
+ return { type: "delete-remote", path: this.relativePath, size: 0 };
133
+ }
134
+ }
135
+ class DeleteLocalAction {
136
+ /**
137
+ * Creates a new DeleteLocalAction for the given relative path.
138
+ * @param relativePath - Path relative to the sync root.
139
+ * @param absolutePath - Absolute local filesystem path.
140
+ * @param doDelete - Callback that performs the deletion.
141
+ */
142
+ constructor(relativePath, absolutePath, doDelete) {
143
+ this.relativePath = relativePath;
144
+ this.absolutePath = absolutePath;
145
+ this.doDelete = doDelete;
146
+ }
147
+ type = "delete-local";
148
+ size = 0;
149
+ /**
150
+ * Deletes the local file (unless dryRun) and returns a 'delete-local' event.
151
+ * @param dryRun - Whether to simulate the action without making changes.
152
+ *
153
+ * @returns An async generator yielding sync progress events.
154
+ */
155
+ async execute(dryRun) {
156
+ if (!dryRun) {
157
+ await this.doDelete(this.absolutePath);
158
+ }
159
+ return { type: "delete-local", path: this.relativePath, size: 0 };
160
+ }
161
+ }
162
+ class SkipAction {
163
+ /**
164
+ * Creates a new SkipAction for the given relative path.
165
+ * @param relativePath - Path relative to the sync root.
166
+ * @param reason - Human-readable explanation for why the file was skipped.
167
+ */
168
+ constructor(relativePath, reason) {
169
+ this.relativePath = relativePath;
170
+ this.reason = reason;
171
+ }
172
+ type = "skip";
173
+ size = 0;
174
+ /**
175
+ * Returns a 'skip' event with the reason message. No I/O is performed.
176
+ * @param _dryRun - Whether to simulate the action (unused for no-op).
177
+ *
178
+ * @returns An async generator yielding sync progress events.
179
+ */
180
+ async execute(_dryRun) {
181
+ return { type: "skip", path: this.relativePath, size: 0, message: this.reason };
182
+ }
183
+ }
184
+ exports.CopyAction = CopyAction;
185
+ exports.DeleteLocalAction = DeleteLocalAction;
186
+ exports.DeleteRemoteAction = DeleteRemoteAction;
187
+ exports.DownloadAction = DownloadAction;
188
+ exports.HideAction = HideAction;
189
+ exports.SkipAction = SkipAction;
190
+ exports.UploadAction = UploadAction;
191
+ //# sourceMappingURL=index.cjs.map