@backblaze-labs/b2-sdk 0.1.0 → 0.2.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 (701) hide show
  1. package/CHANGELOG.md +110 -5
  2. package/README.md +144 -33
  3. package/dist/_virtual/_b2-sdk-version-json.cjs +4 -0
  4. package/dist/_virtual/_b2-sdk-version-json.js +4 -0
  5. package/dist/auth/account-info.d.cts +32 -0
  6. package/dist/auth/account-info.d.cts.map +1 -1
  7. package/dist/auth/account-info.d.ts +32 -0
  8. package/dist/auth/account-info.d.ts.map +1 -1
  9. package/dist/auth/file.cjs +408 -207
  10. package/dist/auth/file.cjs.map +1 -1
  11. package/dist/auth/file.d.cts +77 -3
  12. package/dist/auth/file.d.cts.map +1 -1
  13. package/dist/auth/file.d.ts +77 -3
  14. package/dist/auth/file.d.ts.map +1 -1
  15. package/dist/auth/file.js +407 -207
  16. package/dist/auth/file.js.map +1 -1
  17. package/dist/auth/in-memory.cjs +212 -183
  18. package/dist/auth/in-memory.cjs.map +1 -1
  19. package/dist/auth/in-memory.d.cts +8 -0
  20. package/dist/auth/in-memory.d.cts.map +1 -1
  21. package/dist/auth/in-memory.d.ts +8 -0
  22. package/dist/auth/in-memory.d.ts.map +1 -1
  23. package/dist/auth/in-memory.js +211 -182
  24. package/dist/auth/in-memory.js.map +1 -1
  25. package/dist/auth/index.cjs +7 -9
  26. package/dist/auth/index.d.cts +3 -2
  27. package/dist/auth/index.d.cts.map +1 -1
  28. package/dist/auth/index.d.ts +3 -2
  29. package/dist/auth/index.d.ts.map +1 -1
  30. package/dist/auth/index.js +2 -8
  31. package/dist/auth/realms.cjs +80 -7
  32. package/dist/auth/realms.cjs.map +1 -1
  33. package/dist/auth/realms.d.cts +27 -4
  34. package/dist/auth/realms.d.cts.map +1 -1
  35. package/dist/auth/realms.d.ts +27 -4
  36. package/dist/auth/realms.d.ts.map +1 -1
  37. package/dist/auth/realms.js +80 -9
  38. package/dist/auth/realms.js.map +1 -1
  39. package/dist/auth/upload-url-pool.cjs +55 -51
  40. package/dist/auth/upload-url-pool.cjs.map +1 -1
  41. package/dist/auth/upload-url-pool.js +55 -51
  42. package/dist/auth/upload-url-pool.js.map +1 -1
  43. package/dist/bucket.cjs +785 -787
  44. package/dist/bucket.cjs.map +1 -1
  45. package/dist/bucket.d.cts +35 -47
  46. package/dist/bucket.d.cts.map +1 -1
  47. package/dist/bucket.d.ts +35 -47
  48. package/dist/bucket.d.ts.map +1 -1
  49. package/dist/bucket.js +780 -782
  50. package/dist/bucket.js.map +1 -1
  51. package/dist/client.cjs +246 -228
  52. package/dist/client.cjs.map +1 -1
  53. package/dist/client.d.cts +25 -17
  54. package/dist/client.d.cts.map +1 -1
  55. package/dist/client.d.ts +25 -17
  56. package/dist/client.d.ts.map +1 -1
  57. package/dist/client.js +243 -225
  58. package/dist/client.js.map +1 -1
  59. package/dist/copy/large.cjs +114 -71
  60. package/dist/copy/large.cjs.map +1 -1
  61. package/dist/copy/large.d.cts +6 -0
  62. package/dist/copy/large.d.cts.map +1 -1
  63. package/dist/copy/large.d.ts +6 -0
  64. package/dist/copy/large.d.ts.map +1 -1
  65. package/dist/copy/large.js +112 -69
  66. package/dist/copy/large.js.map +1 -1
  67. package/dist/download/checksum.cjs +89 -0
  68. package/dist/download/checksum.cjs.map +1 -0
  69. package/dist/download/checksum.d.cts +40 -0
  70. package/dist/download/checksum.d.cts.map +1 -0
  71. package/dist/download/checksum.d.ts +40 -0
  72. package/dist/download/checksum.d.ts.map +1 -0
  73. package/dist/download/checksum.js +87 -0
  74. package/dist/download/checksum.js.map +1 -0
  75. package/dist/download/parallel.cjs +214 -118
  76. package/dist/download/parallel.cjs.map +1 -1
  77. package/dist/download/parallel.d.cts +5 -1
  78. package/dist/download/parallel.d.cts.map +1 -1
  79. package/dist/download/parallel.d.ts +5 -1
  80. package/dist/download/parallel.d.ts.map +1 -1
  81. package/dist/download/parallel.js +212 -116
  82. package/dist/download/parallel.js.map +1 -1
  83. package/dist/download/single.cjs +188 -97
  84. package/dist/download/single.cjs.map +1 -1
  85. package/dist/download/single.d.cts +6 -1
  86. package/dist/download/single.d.cts.map +1 -1
  87. package/dist/download/single.d.ts +6 -1
  88. package/dist/download/single.d.ts.map +1 -1
  89. package/dist/download/single.js +186 -98
  90. package/dist/download/single.js.map +1 -1
  91. package/dist/errors/index.cjs +699 -243
  92. package/dist/errors/index.cjs.map +1 -1
  93. package/dist/errors/index.d.cts +285 -82
  94. package/dist/errors/index.d.cts.map +1 -1
  95. package/dist/errors/index.d.ts +285 -82
  96. package/dist/errors/index.d.ts.map +1 -1
  97. package/dist/errors/index.js +678 -261
  98. package/dist/errors/index.js.map +1 -1
  99. package/dist/http/retry.cjs +45 -28
  100. package/dist/http/retry.cjs.map +1 -1
  101. package/dist/http/retry.d.cts +15 -2
  102. package/dist/http/retry.d.cts.map +1 -1
  103. package/dist/http/retry.d.ts +15 -2
  104. package/dist/http/retry.d.ts.map +1 -1
  105. package/dist/http/retry.js +46 -31
  106. package/dist/http/retry.js.map +1 -1
  107. package/dist/http/transport.cjs +438 -140
  108. package/dist/http/transport.cjs.map +1 -1
  109. package/dist/http/transport.d.cts +21 -2
  110. package/dist/http/transport.d.cts.map +1 -1
  111. package/dist/http/transport.d.ts +21 -2
  112. package/dist/http/transport.d.ts.map +1 -1
  113. package/dist/http/transport.js +437 -140
  114. package/dist/http/transport.js.map +1 -1
  115. package/dist/http/url-guard.cjs +154 -89
  116. package/dist/http/url-guard.cjs.map +1 -1
  117. package/dist/http/url-guard.d.cts +25 -3
  118. package/dist/http/url-guard.d.cts.map +1 -1
  119. package/dist/http/url-guard.d.ts +25 -3
  120. package/dist/http/url-guard.d.ts.map +1 -1
  121. package/dist/http/url-guard.js +152 -90
  122. package/dist/http/url-guard.js.map +1 -1
  123. package/dist/http/user-agent.cjs +84 -44
  124. package/dist/http/user-agent.cjs.map +1 -1
  125. package/dist/http/user-agent.js +84 -46
  126. package/dist/http/user-agent.js.map +1 -1
  127. package/dist/index.cjs +101 -77
  128. package/dist/index.d.cts +27 -21
  129. package/dist/index.d.cts.map +1 -1
  130. package/dist/index.d.ts +27 -21
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +15 -71
  133. package/dist/internal/b2-naming.cjs +66 -0
  134. package/dist/internal/b2-naming.cjs.map +1 -0
  135. package/dist/internal/b2-naming.d.cts +43 -0
  136. package/dist/internal/b2-naming.d.cts.map +1 -0
  137. package/dist/internal/b2-naming.d.ts +43 -0
  138. package/dist/internal/b2-naming.d.ts.map +1 -0
  139. package/dist/internal/b2-naming.js +60 -0
  140. package/dist/internal/b2-naming.js.map +1 -0
  141. package/dist/internal/upload-retry-options.cjs +21 -0
  142. package/dist/internal/upload-retry-options.cjs.map +1 -0
  143. package/dist/internal/upload-retry-options.d.cts +12 -0
  144. package/dist/internal/upload-retry-options.d.cts.map +1 -0
  145. package/dist/internal/upload-retry-options.d.ts +12 -0
  146. package/dist/internal/upload-retry-options.d.ts.map +1 -0
  147. package/dist/internal/upload-retry-options.js +21 -0
  148. package/dist/internal/upload-retry-options.js.map +1 -0
  149. package/dist/internal/url-redaction.cjs +31 -0
  150. package/dist/internal/url-redaction.cjs.map +1 -0
  151. package/dist/internal/url-redaction.d.cts +17 -0
  152. package/dist/internal/url-redaction.d.cts.map +1 -0
  153. package/dist/internal/url-redaction.d.ts +17 -0
  154. package/dist/internal/url-redaction.d.ts.map +1 -0
  155. package/dist/internal/url-redaction.js +31 -0
  156. package/dist/internal/url-redaction.js.map +1 -0
  157. package/dist/notifications/index.cjs +4 -6
  158. package/dist/notifications/index.d.cts +1 -1
  159. package/dist/notifications/index.d.cts.map +1 -1
  160. package/dist/notifications/index.d.ts +1 -1
  161. package/dist/notifications/index.d.ts.map +1 -1
  162. package/dist/notifications/index.js +1 -6
  163. package/dist/notifications/webhook.cjs +195 -85
  164. package/dist/notifications/webhook.cjs.map +1 -1
  165. package/dist/notifications/webhook.d.cts.map +1 -1
  166. package/dist/notifications/webhook.d.ts.map +1 -1
  167. package/dist/notifications/webhook.js +195 -87
  168. package/dist/notifications/webhook.js.map +1 -1
  169. package/dist/object.cjs +253 -210
  170. package/dist/object.cjs.map +1 -1
  171. package/dist/object.d.cts +9 -55
  172. package/dist/object.d.cts.map +1 -1
  173. package/dist/object.d.ts +9 -55
  174. package/dist/object.d.ts.map +1 -1
  175. package/dist/object.js +249 -206
  176. package/dist/object.js.map +1 -1
  177. package/dist/raw/encoding.cjs +74 -35
  178. package/dist/raw/encoding.cjs.map +1 -1
  179. package/dist/raw/encoding.js +74 -38
  180. package/dist/raw/encoding.js.map +1 -1
  181. package/dist/raw/index.cjs +678 -587
  182. package/dist/raw/index.cjs.map +1 -1
  183. package/dist/raw/index.d.cts +121 -18
  184. package/dist/raw/index.d.cts.map +1 -1
  185. package/dist/raw/index.d.ts +121 -18
  186. package/dist/raw/index.d.ts.map +1 -1
  187. package/dist/raw/index.js +674 -589
  188. package/dist/raw/index.js.map +1 -1
  189. package/dist/s3/index.cjs +355 -18
  190. package/dist/s3/index.cjs.map +1 -1
  191. package/dist/s3/index.d.cts +233 -5
  192. package/dist/s3/index.d.cts.map +1 -1
  193. package/dist/s3/index.d.ts +233 -5
  194. package/dist/s3/index.d.ts.map +1 -1
  195. package/dist/s3/index.js +351 -22
  196. package/dist/s3/index.js.map +1 -1
  197. package/dist/s3/sigv4.cjs +149 -0
  198. package/dist/s3/sigv4.cjs.map +1 -0
  199. package/dist/s3/sigv4.d.cts +43 -0
  200. package/dist/s3/sigv4.d.cts.map +1 -0
  201. package/dist/s3/sigv4.d.ts +43 -0
  202. package/dist/s3/sigv4.d.ts.map +1 -0
  203. package/dist/s3/sigv4.js +148 -0
  204. package/dist/s3/sigv4.js.map +1 -0
  205. package/dist/s3/validation.cjs +69 -0
  206. package/dist/s3/validation.cjs.map +1 -0
  207. package/dist/s3/validation.d.cts +43 -0
  208. package/dist/s3/validation.d.cts.map +1 -0
  209. package/dist/s3/validation.d.ts +43 -0
  210. package/dist/s3/validation.d.ts.map +1 -0
  211. package/dist/s3/validation.js +66 -0
  212. package/dist/s3/validation.js.map +1 -0
  213. package/dist/simulator/capabilities.cjs +63 -48
  214. package/dist/simulator/capabilities.cjs.map +1 -1
  215. package/dist/simulator/capabilities.js +63 -49
  216. package/dist/simulator/capabilities.js.map +1 -1
  217. package/dist/simulator/index.cjs +2124 -1548
  218. package/dist/simulator/index.cjs.map +1 -1
  219. package/dist/simulator/index.d.cts +79 -11
  220. package/dist/simulator/index.d.cts.map +1 -1
  221. package/dist/simulator/index.d.ts +79 -11
  222. package/dist/simulator/index.d.ts.map +1 -1
  223. package/dist/simulator/index.js +2112 -1546
  224. package/dist/simulator/index.js.map +1 -1
  225. package/dist/simulator/validation.cjs +191 -153
  226. package/dist/simulator/validation.cjs.map +1 -1
  227. package/dist/simulator/validation.d.cts +3 -21
  228. package/dist/simulator/validation.d.cts.map +1 -1
  229. package/dist/simulator/validation.d.ts +3 -21
  230. package/dist/simulator/validation.d.ts.map +1 -1
  231. package/dist/simulator/validation.js +188 -162
  232. package/dist/simulator/validation.js.map +1 -1
  233. package/dist/streams/collect.cjs +74 -24
  234. package/dist/streams/collect.cjs.map +1 -1
  235. package/dist/streams/collect.d.cts +14 -1
  236. package/dist/streams/collect.d.cts.map +1 -1
  237. package/dist/streams/collect.d.ts +14 -1
  238. package/dist/streams/collect.d.ts.map +1 -1
  239. package/dist/streams/collect.js +74 -25
  240. package/dist/streams/collect.js.map +1 -1
  241. package/dist/streams/file-source.cjs +287 -0
  242. package/dist/streams/file-source.cjs.map +1 -0
  243. package/dist/streams/file-source.d.cts +96 -0
  244. package/dist/streams/file-source.d.cts.map +1 -0
  245. package/dist/streams/file-source.d.ts +96 -0
  246. package/dist/streams/file-source.d.ts.map +1 -0
  247. package/dist/streams/file-source.js +286 -0
  248. package/dist/streams/file-source.js.map +1 -0
  249. package/dist/streams/hash.cjs +207 -115
  250. package/dist/streams/hash.cjs.map +1 -1
  251. package/dist/streams/hash.d.cts +5 -4
  252. package/dist/streams/hash.d.cts.map +1 -1
  253. package/dist/streams/hash.d.ts +5 -4
  254. package/dist/streams/hash.d.ts.map +1 -1
  255. package/dist/streams/hash.js +208 -95
  256. package/dist/streams/hash.js.map +1 -1
  257. package/dist/streams/index.cjs +12 -12
  258. package/dist/streams/index.d.cts +3 -3
  259. package/dist/streams/index.d.cts.map +1 -1
  260. package/dist/streams/index.d.ts +3 -3
  261. package/dist/streams/index.d.ts.map +1 -1
  262. package/dist/streams/index.js +2 -10
  263. package/dist/streams/progress.cjs +60 -46
  264. package/dist/streams/progress.cjs.map +1 -1
  265. package/dist/streams/progress.js +60 -46
  266. package/dist/streams/progress.js.map +1 -1
  267. package/dist/streams/source.cjs +316 -146
  268. package/dist/streams/source.cjs.map +1 -1
  269. package/dist/streams/source.d.cts +56 -18
  270. package/dist/streams/source.d.cts.map +1 -1
  271. package/dist/streams/source.d.ts +56 -18
  272. package/dist/streams/source.d.ts.map +1 -1
  273. package/dist/streams/source.js +312 -149
  274. package/dist/streams/source.js.map +1 -1
  275. package/dist/sync/actions/index.cjs +236 -184
  276. package/dist/sync/actions/index.cjs.map +1 -1
  277. package/dist/sync/actions/index.d.cts +29 -21
  278. package/dist/sync/actions/index.d.cts.map +1 -1
  279. package/dist/sync/actions/index.d.ts +29 -21
  280. package/dist/sync/actions/index.d.ts.map +1 -1
  281. package/dist/sync/actions/index.js +236 -190
  282. package/dist/sync/actions/index.js.map +1 -1
  283. package/dist/sync/b2-sha1-reader.cjs +148 -0
  284. package/dist/sync/b2-sha1-reader.cjs.map +1 -0
  285. package/dist/sync/b2-sha1-reader.d.cts +58 -0
  286. package/dist/sync/b2-sha1-reader.d.cts.map +1 -0
  287. package/dist/sync/b2-sha1-reader.d.ts +58 -0
  288. package/dist/sync/b2-sha1-reader.d.ts.map +1 -0
  289. package/dist/sync/b2-sha1-reader.js +145 -0
  290. package/dist/sync/b2-sha1-reader.js.map +1 -0
  291. package/dist/sync/download-staging.cjs +265 -0
  292. package/dist/sync/download-staging.cjs.map +1 -0
  293. package/dist/sync/download-staging.d.cts +54 -0
  294. package/dist/sync/download-staging.d.cts.map +1 -0
  295. package/dist/sync/download-staging.d.ts +54 -0
  296. package/dist/sync/download-staging.d.ts.map +1 -0
  297. package/dist/sync/download-staging.js +259 -0
  298. package/dist/sync/download-staging.js.map +1 -0
  299. package/dist/sync/filesystem-errors.cjs +32 -0
  300. package/dist/sync/filesystem-errors.cjs.map +1 -0
  301. package/dist/sync/filesystem-errors.d.cts +8 -0
  302. package/dist/sync/filesystem-errors.d.cts.map +1 -0
  303. package/dist/sync/filesystem-errors.d.ts +8 -0
  304. package/dist/sync/filesystem-errors.d.ts.map +1 -0
  305. package/dist/sync/filesystem-errors.js +32 -0
  306. package/dist/sync/filesystem-errors.js.map +1 -0
  307. package/dist/sync/filters.cjs +217 -0
  308. package/dist/sync/filters.cjs.map +1 -0
  309. package/dist/sync/filters.d.cts +51 -0
  310. package/dist/sync/filters.d.cts.map +1 -0
  311. package/dist/sync/filters.d.ts +51 -0
  312. package/dist/sync/filters.d.ts.map +1 -0
  313. package/dist/sync/filters.js +213 -0
  314. package/dist/sync/filters.js.map +1 -0
  315. package/dist/sync/index.cjs +39 -22
  316. package/dist/sync/index.d.cts +14 -9
  317. package/dist/sync/index.d.cts.map +1 -1
  318. package/dist/sync/index.d.ts +14 -9
  319. package/dist/sync/index.d.ts.map +1 -1
  320. package/dist/sync/index.js +9 -20
  321. package/dist/sync/local-file-identity.cjs +61 -0
  322. package/dist/sync/local-file-identity.cjs.map +1 -0
  323. package/dist/sync/local-file-identity.d.cts +37 -0
  324. package/dist/sync/local-file-identity.d.cts.map +1 -0
  325. package/dist/sync/local-file-identity.d.ts +37 -0
  326. package/dist/sync/local-file-identity.d.ts.map +1 -0
  327. package/dist/sync/local-file-identity.js +60 -0
  328. package/dist/sync/local-file-identity.js.map +1 -0
  329. package/dist/sync/local-file-io.cjs +364 -0
  330. package/dist/sync/local-file-io.cjs.map +1 -0
  331. package/dist/sync/local-file-io.d.cts +75 -0
  332. package/dist/sync/local-file-io.d.cts.map +1 -0
  333. package/dist/sync/local-file-io.d.ts +75 -0
  334. package/dist/sync/local-file-io.d.ts.map +1 -0
  335. package/dist/sync/local-file-io.js +360 -0
  336. package/dist/sync/local-file-io.js.map +1 -0
  337. package/dist/sync/local-filesystem-root.cjs +27 -0
  338. package/dist/sync/local-filesystem-root.cjs.map +1 -0
  339. package/dist/sync/local-filesystem-root.d.cts +18 -0
  340. package/dist/sync/local-filesystem-root.d.cts.map +1 -0
  341. package/dist/sync/local-filesystem-root.d.ts +18 -0
  342. package/dist/sync/local-filesystem-root.d.ts.map +1 -0
  343. package/dist/sync/local-filesystem-root.js +26 -0
  344. package/dist/sync/local-filesystem-root.js.map +1 -0
  345. package/dist/sync/local-sha1.cjs +119 -0
  346. package/dist/sync/local-sha1.cjs.map +1 -0
  347. package/dist/sync/local-sha1.d.cts +39 -0
  348. package/dist/sync/local-sha1.d.cts.map +1 -0
  349. package/dist/sync/local-sha1.d.ts +39 -0
  350. package/dist/sync/local-sha1.d.ts.map +1 -0
  351. package/dist/sync/local-sha1.js +117 -0
  352. package/dist/sync/local-sha1.js.map +1 -0
  353. package/dist/sync/pairing.cjs +118 -29
  354. package/dist/sync/pairing.cjs.map +1 -1
  355. package/dist/sync/pairing.d.cts +7 -2
  356. package/dist/sync/pairing.d.cts.map +1 -1
  357. package/dist/sync/pairing.d.ts +7 -2
  358. package/dist/sync/pairing.d.ts.map +1 -1
  359. package/dist/sync/pairing.js +120 -31
  360. package/dist/sync/pairing.js.map +1 -1
  361. package/dist/sync/path-order.cjs +30 -0
  362. package/dist/sync/path-order.cjs.map +1 -0
  363. package/dist/sync/path-order.d.cts +28 -0
  364. package/dist/sync/path-order.d.cts.map +1 -0
  365. package/dist/sync/path-order.d.ts +28 -0
  366. package/dist/sync/path-order.d.ts.map +1 -0
  367. package/dist/sync/path-order.js +29 -0
  368. package/dist/sync/path-order.js.map +1 -0
  369. package/dist/sync/path-safety.cjs +111 -0
  370. package/dist/sync/path-safety.cjs.map +1 -0
  371. package/dist/sync/path-safety.d.cts +78 -0
  372. package/dist/sync/path-safety.d.cts.map +1 -0
  373. package/dist/sync/path-safety.d.ts +78 -0
  374. package/dist/sync/path-safety.d.ts.map +1 -0
  375. package/dist/sync/path-safety.js +105 -0
  376. package/dist/sync/path-safety.js.map +1 -0
  377. package/dist/sync/paths.d.cts +19 -0
  378. package/dist/sync/paths.d.cts.map +1 -0
  379. package/dist/sync/paths.d.ts +19 -0
  380. package/dist/sync/paths.d.ts.map +1 -0
  381. package/dist/sync/policies/compare.cjs +389 -11
  382. package/dist/sync/policies/compare.cjs.map +1 -1
  383. package/dist/sync/policies/compare.d.cts +100 -2
  384. package/dist/sync/policies/compare.d.cts.map +1 -1
  385. package/dist/sync/policies/compare.d.ts +100 -2
  386. package/dist/sync/policies/compare.d.ts.map +1 -1
  387. package/dist/sync/policies/compare.js +387 -13
  388. package/dist/sync/policies/compare.js.map +1 -1
  389. package/dist/sync/policies/index.cjs +76 -65
  390. package/dist/sync/policies/index.cjs.map +1 -1
  391. package/dist/sync/policies/index.d.cts +35 -6
  392. package/dist/sync/policies/index.d.cts.map +1 -1
  393. package/dist/sync/policies/index.d.ts +35 -6
  394. package/dist/sync/policies/index.d.ts.map +1 -1
  395. package/dist/sync/policies/index.js +76 -65
  396. package/dist/sync/policies/index.js.map +1 -1
  397. package/dist/sync/prefix.cjs +96 -0
  398. package/dist/sync/prefix.cjs.map +1 -0
  399. package/dist/sync/prefix.d.cts +55 -0
  400. package/dist/sync/prefix.d.cts.map +1 -0
  401. package/dist/sync/prefix.d.ts +55 -0
  402. package/dist/sync/prefix.d.ts.map +1 -0
  403. package/dist/sync/prefix.js +92 -0
  404. package/dist/sync/prefix.js.map +1 -0
  405. package/dist/sync/regexp-safety.cjs +192 -0
  406. package/dist/sync/regexp-safety.cjs.map +1 -0
  407. package/dist/sync/regexp-safety.d.cts +29 -0
  408. package/dist/sync/regexp-safety.d.cts.map +1 -0
  409. package/dist/sync/regexp-safety.d.ts +29 -0
  410. package/dist/sync/regexp-safety.d.ts.map +1 -0
  411. package/dist/sync/regexp-safety.js +190 -0
  412. package/dist/sync/regexp-safety.js.map +1 -0
  413. package/dist/sync/scan-events.cjs +33 -0
  414. package/dist/sync/scan-events.cjs.map +1 -0
  415. package/dist/sync/scan-events.d.cts +17 -0
  416. package/dist/sync/scan-events.d.cts.map +1 -0
  417. package/dist/sync/scan-events.d.ts +17 -0
  418. package/dist/sync/scan-events.d.ts.map +1 -0
  419. package/dist/sync/scan-events.js +32 -0
  420. package/dist/sync/scan-events.js.map +1 -0
  421. package/dist/sync/scan-limit.cjs +33 -0
  422. package/dist/sync/scan-limit.cjs.map +1 -0
  423. package/dist/sync/scan-limit.d.cts +21 -0
  424. package/dist/sync/scan-limit.d.cts.map +1 -0
  425. package/dist/sync/scan-limit.d.ts +21 -0
  426. package/dist/sync/scan-limit.d.ts.map +1 -0
  427. package/dist/sync/scan-limit.js +31 -0
  428. package/dist/sync/scan-limit.js.map +1 -0
  429. package/dist/sync/scanners/b2.cjs +239 -55
  430. package/dist/sync/scanners/b2.cjs.map +1 -1
  431. package/dist/sync/scanners/b2.d.cts +26 -7
  432. package/dist/sync/scanners/b2.d.cts.map +1 -1
  433. package/dist/sync/scanners/b2.d.ts +26 -7
  434. package/dist/sync/scanners/b2.d.ts.map +1 -1
  435. package/dist/sync/scanners/b2.js +239 -55
  436. package/dist/sync/scanners/b2.js.map +1 -1
  437. package/dist/sync/scanners/local.cjs +215 -56
  438. package/dist/sync/scanners/local.cjs.map +1 -1
  439. package/dist/sync/scanners/local.d.cts +22 -7
  440. package/dist/sync/scanners/local.d.cts.map +1 -1
  441. package/dist/sync/scanners/local.d.ts +22 -7
  442. package/dist/sync/scanners/local.d.ts.map +1 -1
  443. package/dist/sync/scanners/local.js +216 -57
  444. package/dist/sync/scanners/local.js.map +1 -1
  445. package/dist/sync/sha1-metadata.cjs +94 -0
  446. package/dist/sync/sha1-metadata.cjs.map +1 -0
  447. package/dist/sync/sha1-metadata.d.cts +82 -0
  448. package/dist/sync/sha1-metadata.d.cts.map +1 -0
  449. package/dist/sync/sha1-metadata.d.ts +82 -0
  450. package/dist/sync/sha1-metadata.d.ts.map +1 -0
  451. package/dist/sync/sha1-metadata.js +89 -0
  452. package/dist/sync/sha1-metadata.js.map +1 -0
  453. package/dist/sync/sha1-options.cjs +23 -0
  454. package/dist/sync/sha1-options.cjs.map +1 -0
  455. package/dist/sync/sha1-options.d.cts +14 -0
  456. package/dist/sync/sha1-options.d.cts.map +1 -0
  457. package/dist/sync/sha1-options.d.ts +14 -0
  458. package/dist/sync/sha1-options.d.ts.map +1 -0
  459. package/dist/sync/sha1-options.js +21 -0
  460. package/dist/sync/sha1-options.js.map +1 -0
  461. package/dist/sync/synchronizer.cjs +782 -197
  462. package/dist/sync/synchronizer.cjs.map +1 -1
  463. package/dist/sync/synchronizer.d.cts +47 -1
  464. package/dist/sync/synchronizer.d.cts.map +1 -1
  465. package/dist/sync/synchronizer.d.ts +47 -1
  466. package/dist/sync/synchronizer.d.ts.map +1 -1
  467. package/dist/sync/synchronizer.js +779 -173
  468. package/dist/sync/synchronizer.js.map +1 -1
  469. package/dist/sync/types.d.cts +208 -16
  470. package/dist/sync/types.d.cts.map +1 -1
  471. package/dist/sync/types.d.ts +208 -16
  472. package/dist/sync/types.d.ts.map +1 -1
  473. package/dist/types/auth.cjs +76 -56
  474. package/dist/types/auth.cjs.map +1 -1
  475. package/dist/types/auth.d.cts +67 -9
  476. package/dist/types/auth.d.cts.map +1 -1
  477. package/dist/types/auth.d.ts +67 -9
  478. package/dist/types/auth.d.ts.map +1 -1
  479. package/dist/types/auth.js +77 -57
  480. package/dist/types/auth.js.map +1 -1
  481. package/dist/types/bucket.cjs +74 -38
  482. package/dist/types/bucket.cjs.map +1 -1
  483. package/dist/types/bucket.js +75 -41
  484. package/dist/types/bucket.js.map +1 -1
  485. package/dist/types/encryption.cjs +364 -327
  486. package/dist/types/encryption.cjs.map +1 -1
  487. package/dist/types/encryption.d.cts +16 -0
  488. package/dist/types/encryption.d.cts.map +1 -1
  489. package/dist/types/encryption.d.ts +16 -0
  490. package/dist/types/encryption.d.ts.map +1 -1
  491. package/dist/types/encryption.js +364 -310
  492. package/dist/types/encryption.js.map +1 -1
  493. package/dist/types/errors.cjs +47 -0
  494. package/dist/types/errors.cjs.map +1 -0
  495. package/dist/types/errors.d.cts +13 -4
  496. package/dist/types/errors.d.cts.map +1 -1
  497. package/dist/types/errors.d.ts +13 -4
  498. package/dist/types/errors.d.ts.map +1 -1
  499. package/dist/types/errors.js +47 -0
  500. package/dist/types/errors.js.map +1 -0
  501. package/dist/types/file.cjs +36 -19
  502. package/dist/types/file.cjs.map +1 -1
  503. package/dist/types/file.d.cts +2 -2
  504. package/dist/types/file.d.cts.map +1 -1
  505. package/dist/types/file.d.ts +2 -2
  506. package/dist/types/file.d.ts.map +1 -1
  507. package/dist/types/file.js +37 -21
  508. package/dist/types/file.js.map +1 -1
  509. package/dist/types/ids.cjs +53 -9
  510. package/dist/types/ids.cjs.map +1 -1
  511. package/dist/types/ids.js +54 -15
  512. package/dist/types/ids.js.map +1 -1
  513. package/dist/types/index.d.cts +12 -11
  514. package/dist/types/index.d.cts.map +1 -1
  515. package/dist/types/index.d.ts +12 -11
  516. package/dist/types/index.d.ts.map +1 -1
  517. package/dist/types/key.d.cts +44 -8
  518. package/dist/types/key.d.cts.map +1 -1
  519. package/dist/types/key.d.ts +44 -8
  520. package/dist/types/key.d.ts.map +1 -1
  521. package/dist/types/lock.cjs +33 -13
  522. package/dist/types/lock.cjs.map +1 -1
  523. package/dist/types/lock.js +34 -15
  524. package/dist/types/lock.js.map +1 -1
  525. package/dist/types/notifications.cjs +44 -22
  526. package/dist/types/notifications.cjs.map +1 -1
  527. package/dist/types/notifications.js +45 -23
  528. package/dist/types/notifications.js.map +1 -1
  529. package/dist/types/upload.d.cts +39 -5
  530. package/dist/types/upload.d.cts.map +1 -1
  531. package/dist/types/upload.d.ts +39 -5
  532. package/dist/types/upload.d.ts.map +1 -1
  533. package/dist/upload/abort-scope.cjs +91 -0
  534. package/dist/upload/abort-scope.cjs.map +1 -0
  535. package/dist/upload/abort-scope.d.cts +48 -0
  536. package/dist/upload/abort-scope.d.cts.map +1 -0
  537. package/dist/upload/abort-scope.d.ts +48 -0
  538. package/dist/upload/abort-scope.d.ts.map +1 -0
  539. package/dist/upload/abort-scope.js +88 -0
  540. package/dist/upload/abort-scope.js.map +1 -0
  541. package/dist/upload/cancel.cjs +183 -8
  542. package/dist/upload/cancel.cjs.map +1 -1
  543. package/dist/upload/cancel.d.cts +110 -2
  544. package/dist/upload/cancel.d.cts.map +1 -1
  545. package/dist/upload/cancel.d.ts +110 -2
  546. package/dist/upload/cancel.d.ts.map +1 -1
  547. package/dist/upload/cancel.js +178 -9
  548. package/dist/upload/cancel.js.map +1 -1
  549. package/dist/upload/concurrency.cjs +79 -52
  550. package/dist/upload/concurrency.cjs.map +1 -1
  551. package/dist/upload/concurrency.js +79 -53
  552. package/dist/upload/concurrency.js.map +1 -1
  553. package/dist/upload/finish.cjs +59 -0
  554. package/dist/upload/finish.cjs.map +1 -0
  555. package/dist/upload/finish.d.cts +26 -0
  556. package/dist/upload/finish.d.cts.map +1 -0
  557. package/dist/upload/finish.d.ts +26 -0
  558. package/dist/upload/finish.d.ts.map +1 -0
  559. package/dist/upload/finish.js +59 -0
  560. package/dist/upload/finish.js.map +1 -0
  561. package/dist/upload/large.cjs +301 -218
  562. package/dist/upload/large.cjs.map +1 -1
  563. package/dist/upload/large.d.cts +76 -9
  564. package/dist/upload/large.d.cts.map +1 -1
  565. package/dist/upload/large.d.ts +76 -9
  566. package/dist/upload/large.d.ts.map +1 -1
  567. package/dist/upload/large.js +301 -218
  568. package/dist/upload/large.js.map +1 -1
  569. package/dist/upload/options.cjs +28 -0
  570. package/dist/upload/options.cjs.map +1 -0
  571. package/dist/upload/options.d.cts +104 -0
  572. package/dist/upload/options.d.cts.map +1 -0
  573. package/dist/upload/options.d.ts +104 -0
  574. package/dist/upload/options.d.ts.map +1 -0
  575. package/dist/upload/options.js +27 -0
  576. package/dist/upload/options.js.map +1 -0
  577. package/dist/upload/resume.cjs +333 -33
  578. package/dist/upload/resume.cjs.map +1 -1
  579. package/dist/upload/resume.d.cts +82 -12
  580. package/dist/upload/resume.d.cts.map +1 -1
  581. package/dist/upload/resume.d.ts +82 -12
  582. package/dist/upload/resume.d.ts.map +1 -1
  583. package/dist/upload/resume.js +330 -33
  584. package/dist/upload/resume.js.map +1 -1
  585. package/dist/upload/retry.cjs +186 -0
  586. package/dist/upload/retry.cjs.map +1 -0
  587. package/dist/upload/retry.d.cts +127 -0
  588. package/dist/upload/retry.d.cts.map +1 -0
  589. package/dist/upload/retry.d.ts +127 -0
  590. package/dist/upload/retry.d.ts.map +1 -0
  591. package/dist/upload/retry.js +182 -0
  592. package/dist/upload/retry.js.map +1 -0
  593. package/dist/upload/single.cjs +68 -44
  594. package/dist/upload/single.cjs.map +1 -1
  595. package/dist/upload/single.d.cts +2 -1
  596. package/dist/upload/single.d.cts.map +1 -1
  597. package/dist/upload/single.d.ts +2 -1
  598. package/dist/upload/single.d.ts.map +1 -1
  599. package/dist/upload/single.js +68 -44
  600. package/dist/upload/single.js.map +1 -1
  601. package/dist/upload/stream.cjs +317 -193
  602. package/dist/upload/stream.cjs.map +1 -1
  603. package/dist/upload/stream.d.cts +3 -1
  604. package/dist/upload/stream.d.cts.map +1 -1
  605. package/dist/upload/stream.d.ts +3 -1
  606. package/dist/upload/stream.d.ts.map +1 -1
  607. package/dist/upload/stream.js +316 -192
  608. package/dist/upload/stream.js.map +1 -1
  609. package/dist/util/best-effort.cjs +42 -8
  610. package/dist/util/best-effort.cjs.map +1 -1
  611. package/dist/util/best-effort.d.cts +2 -1
  612. package/dist/util/best-effort.d.cts.map +1 -1
  613. package/dist/util/best-effort.d.ts +2 -1
  614. package/dist/util/best-effort.d.ts.map +1 -1
  615. package/dist/util/best-effort.js +43 -9
  616. package/dist/util/best-effort.js.map +1 -1
  617. package/dist/util/bytes.cjs +23 -0
  618. package/dist/util/bytes.cjs.map +1 -0
  619. package/dist/util/bytes.d.cts +15 -0
  620. package/dist/util/bytes.d.cts.map +1 -0
  621. package/dist/util/bytes.d.ts +15 -0
  622. package/dist/util/bytes.d.ts.map +1 -0
  623. package/dist/util/bytes.js +23 -0
  624. package/dist/util/bytes.js.map +1 -0
  625. package/dist/util/crypto.cjs +68 -0
  626. package/dist/util/crypto.cjs.map +1 -0
  627. package/dist/util/crypto.d.cts +26 -0
  628. package/dist/util/crypto.d.cts.map +1 -0
  629. package/dist/util/crypto.d.ts +26 -0
  630. package/dist/util/crypto.d.ts.map +1 -0
  631. package/dist/util/crypto.js +66 -0
  632. package/dist/util/crypto.js.map +1 -0
  633. package/dist/util/defaults.cjs +25 -9
  634. package/dist/util/defaults.cjs.map +1 -1
  635. package/dist/util/defaults.js +26 -11
  636. package/dist/util/defaults.js.map +1 -1
  637. package/dist/util/error-reason.cjs +41 -0
  638. package/dist/util/error-reason.cjs.map +1 -0
  639. package/dist/util/error-reason.d.cts +9 -0
  640. package/dist/util/error-reason.d.cts.map +1 -0
  641. package/dist/util/error-reason.d.ts +9 -0
  642. package/dist/util/error-reason.d.ts.map +1 -0
  643. package/dist/util/error-reason.js +41 -0
  644. package/dist/util/error-reason.js.map +1 -0
  645. package/dist/util/http.cjs +23 -0
  646. package/dist/util/http.cjs.map +1 -0
  647. package/dist/util/http.d.cts +13 -0
  648. package/dist/util/http.d.cts.map +1 -0
  649. package/dist/util/http.d.ts +13 -0
  650. package/dist/util/http.d.ts.map +1 -0
  651. package/dist/util/http.js +23 -0
  652. package/dist/util/http.js.map +1 -0
  653. package/dist/util/normalize.cjs +66 -7
  654. package/dist/util/normalize.cjs.map +1 -1
  655. package/dist/util/normalize.js +67 -10
  656. package/dist/util/normalize.js.map +1 -1
  657. package/dist/util/paginator.cjs +63 -14
  658. package/dist/util/paginator.cjs.map +1 -1
  659. package/dist/util/paginator.js +64 -16
  660. package/dist/util/paginator.js.map +1 -1
  661. package/dist/util/plan-ranges.cjs +47 -22
  662. package/dist/util/plan-ranges.cjs.map +1 -1
  663. package/dist/util/plan-ranges.js +48 -24
  664. package/dist/util/plan-ranges.js.map +1 -1
  665. package/dist/util/sha1.cjs +27 -0
  666. package/dist/util/sha1.cjs.map +1 -0
  667. package/dist/util/sha1.d.cts +17 -0
  668. package/dist/util/sha1.d.cts.map +1 -0
  669. package/dist/util/sha1.d.ts +17 -0
  670. package/dist/util/sha1.d.ts.map +1 -0
  671. package/dist/util/sha1.js +26 -0
  672. package/dist/util/sha1.js.map +1 -0
  673. package/dist/util/text-codec.cjs +29 -5
  674. package/dist/util/text-codec.cjs.map +1 -1
  675. package/dist/util/text-codec.js +30 -7
  676. package/dist/util/text-codec.js.map +1 -1
  677. package/dist/util/to-error.cjs +18 -4
  678. package/dist/util/to-error.cjs.map +1 -1
  679. package/dist/util/to-error.js +19 -5
  680. package/dist/util/to-error.js.map +1 -1
  681. package/dist/version.cjs +17 -5
  682. package/dist/version.cjs.map +1 -1
  683. package/dist/version.d.cts +3 -3
  684. package/dist/version.d.ts +3 -3
  685. package/dist/version.js +19 -6
  686. package/dist/version.js.map +1 -1
  687. package/package.json +19 -16
  688. package/dist/auth/index.cjs.map +0 -1
  689. package/dist/auth/index.js.map +0 -1
  690. package/dist/index.cjs.map +0 -1
  691. package/dist/index.js.map +0 -1
  692. package/dist/notifications/index.cjs.map +0 -1
  693. package/dist/notifications/index.js.map +0 -1
  694. package/dist/package.json.cjs +0 -9
  695. package/dist/package.json.cjs.map +0 -1
  696. package/dist/package.json.js +0 -9
  697. package/dist/package.json.js.map +0 -1
  698. package/dist/streams/index.cjs.map +0 -1
  699. package/dist/streams/index.js.map +0 -1
  700. package/dist/sync/index.cjs.map +0 -1
  701. package/dist/sync/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"encryption.js","sources":["../../src/types/encryption.ts"],"sourcesContent":["/** Named constants for the supported server-side encryption algorithms. */\nexport const EncryptionAlgorithm = {\n /** AES with a 256-bit key. The only algorithm B2 currently supports. */\n Aes256: 'AES256',\n} as const\n\n/** Supported server-side encryption algorithm. Derived from {@link EncryptionAlgorithm}. */\nexport type EncryptionAlgorithm = (typeof EncryptionAlgorithm)[keyof typeof EncryptionAlgorithm]\n\n/**\n * Named constants for the server-side encryption mode used by a file.\n *\n * Most callers should use the {@link SSE_B2}, {@link SSE_NONE}, and\n * {@link sseCustomer} helpers below which return complete\n * {@link EncryptionSetting} objects. These constants are useful when you\n * need the bare mode discriminator (e.g., when introspecting a file's\n * current encryption setting).\n */\nexport const EncryptionMode = {\n /** B2-managed encryption keys. */\n SseB2: 'SSE-B2',\n /** Customer-provided encryption keys. */\n SseC: 'SSE-C',\n /** No encryption. */\n None: 'none',\n} as const\n\n/** Server-side encryption mode for files stored in B2. Derived from {@link EncryptionMode}. */\nexport type EncryptionMode = (typeof EncryptionMode)[keyof typeof EncryptionMode]\n\n/** Server-side encryption using B2-managed keys (SSE-B2). */\nexport interface SseB2Setting {\n /** Encryption mode discriminator. Always `'SSE-B2'`. */\n readonly mode: 'SSE-B2'\n /** Encryption algorithm. Always `'AES256'`. */\n readonly algorithm: EncryptionAlgorithm\n}\n\n/** Server-side encryption using customer-provided keys (SSE-C). */\nexport interface SseCCustomerSetting {\n /** Encryption mode discriminator. Always `'SSE-C'`. */\n readonly mode: 'SSE-C'\n /** Encryption algorithm. Always `'AES256'`. */\n readonly algorithm: EncryptionAlgorithm\n /** Base64-encoded 256-bit encryption key provided by the customer. */\n readonly customerKey: string\n /** Base64-encoded MD5 digest of the customer-provided key, used for integrity verification. */\n readonly customerKeyMd5: string\n}\n\n/** Indicates no server-side encryption is applied. */\nexport interface NoEncryption {\n /** Encryption mode discriminator. Always `'none'`. */\n readonly mode: 'none'\n}\n\n/** Union of all server-side encryption settings: B2-managed, customer-provided, or none. */\nexport type EncryptionSetting = SseB2Setting | SseCCustomerSetting | NoEncryption\n\n/** Pre-built SSE-B2 encryption setting using AES-256. */\nexport const SSE_B2: SseB2Setting = { mode: 'SSE-B2', algorithm: 'AES256' }\n\n/** Pre-built setting indicating no server-side encryption. */\nexport const SSE_NONE: NoEncryption = { mode: 'none' }\n\n/**\n * Creates an SSE-C encryption setting with a customer-provided key.\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @returns An SSE-C encryption setting ready to pass to upload or download calls.\n */\nexport function sseCustomer(customerKey: string, customerKeyMd5: string): SseCCustomerSetting {\n return { mode: 'SSE-C', algorithm: 'AES256', customerKey, customerKeyMd5 }\n}\n\n/**\n * Encodes raw bytes as base64 in an isomorphic way (Node Buffer fallback to btoa).\n *\n * @param bytes - The raw bytes to encode.\n *\n * @returns The base64-encoded string.\n */\nfunction bytesToBase64(bytes: Uint8Array): string {\n // Prefer Node's Buffer when available (faster), but degrade to btoa() in\n // browsers / Deno / Workers where Buffer isn't a global. We access via\n // globalThis to avoid a hard reference to a Node-only symbol — that would\n // break the type-check in non-Node runtimes (Deno, browser-mode Vitest).\n const g = globalThis as {\n Buffer?: { from(b: Uint8Array): { toString(encoding: string): string } }\n }\n if (g.Buffer) {\n return g.Buffer.from(bytes).toString('base64')\n }\n let binary = ''\n for (const b of bytes) binary += String.fromCharCode(b)\n return btoa(binary)\n}\n\n/**\n * Computes the MD5 digest of the given bytes as a base64 string. Prefers\n * `node:crypto` for native speed when available; falls back to a pure-JS\n * implementation in browser / edge runtimes because WebCrypto's\n * `crypto.subtle.digest` deliberately does not support MD5.\n *\n * MD5 is used here only for SSE-C key integrity (matching the B2 wire\n * protocol). It is **not** a security boundary; the customer key itself is\n * the secret. Bundling a pure-JS fallback keeps `EncryptionKey.fromBytes`\n * isomorphic.\n *\n * @param bytes - The bytes to digest.\n *\n * @returns The base64-encoded MD5 digest.\n */\nasync function md5Base64(bytes: Uint8Array): Promise<string> {\n try {\n const { createHash } = await import('node:crypto')\n // Vite's browser shim resolves the import but does not implement\n // `createHash`. Probe explicitly so we fall through to the pure-JS path.\n if (typeof createHash !== 'function') throw new Error('createHash unavailable')\n return createHash('md5').update(bytes).digest('base64')\n /* v8 ignore next 3 -- fallback only reachable in non-Node runtimes */\n } catch {\n return bytesToBase64(md5Bytes(bytes))\n }\n}\n\n/**\n * Pure-JS MD5 implementation per RFC 1321. Returns the 16-byte digest of the\n * input. Used as a browser fallback for SSE-C key MD5 computation; not\n * intended for security-sensitive purposes (MD5 is broken cryptographically).\n *\n * @param data - The bytes to hash.\n *\n * @returns The 16-byte MD5 digest.\n */\nfunction md5Bytes(data: Uint8Array): Uint8Array {\n // Padding: append 0x80, then zeros, then the original length in bits as a\n // little-endian 64-bit integer, so the total length is a multiple of 64.\n const originalBitLength = data.byteLength * 8\n const padLength = ((data.byteLength + 8) >>> 6) + 1\n const padded = new Uint8Array(padLength * 64)\n padded.set(data)\n padded[data.byteLength] = 0x80\n // Write the 64-bit length (little-endian). JS bitwise ops are 32-bit, so\n // split into low/high halves.\n const lowBits = originalBitLength >>> 0\n const highBits = Math.floor(originalBitLength / 0x1_0000_0000) >>> 0\n const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8)\n lengthView.setUint32(0, lowBits, true)\n lengthView.setUint32(4, highBits, true)\n\n // Per-round shift amounts.\n const s = [\n 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9,\n 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21,\n 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21,\n ]\n // Per-round sine-derived constants K[i] = floor(2^32 * abs(sin(i + 1))).\n const k = new Uint32Array([\n 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,\n 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,\n 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,\n 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,\n 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,\n 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,\n 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,\n 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,\n ])\n\n let a0 = 0x67452301\n let b0 = 0xefcdab89\n let c0 = 0x98badcfe\n let d0 = 0x10325476\n\n const m = new Uint32Array(16)\n const view = new DataView(padded.buffer)\n for (let block = 0; block < padded.byteLength; block += 64) {\n for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true)\n let A = a0\n let B = b0\n let C = c0\n let D = d0\n for (let i = 0; i < 64; i++) {\n let f: number\n let g: number\n if (i < 16) {\n f = (B & C) | (~B & D)\n g = i\n } else if (i < 32) {\n f = (D & B) | (~D & C)\n g = (5 * i + 1) % 16\n } else if (i < 48) {\n f = B ^ C ^ D\n g = (3 * i + 5) % 16\n } else {\n f = C ^ (B | ~D)\n g = (7 * i) % 16\n }\n const temp = D\n D = C\n C = B\n const sum = (A + f + (k[i] ?? 0) + (m[g] ?? 0)) >>> 0\n const shift = s[i] ?? 0\n const rotated = ((sum << shift) | (sum >>> (32 - shift))) >>> 0\n B = (B + rotated) >>> 0\n A = temp\n }\n a0 = (a0 + A) >>> 0\n b0 = (b0 + B) >>> 0\n c0 = (c0 + C) >>> 0\n d0 = (d0 + D) >>> 0\n }\n\n const out = new Uint8Array(16)\n const outView = new DataView(out.buffer)\n outView.setUint32(0, a0, true)\n outView.setUint32(4, b0, true)\n outView.setUint32(8, c0, true)\n outView.setUint32(12, d0, true)\n return out\n}\n\nconst KEY_REDACTED = '[redacted SSE-C key]'\n\n/**\n * Safe wrapper around an SSE-C customer key. Hides the key bytes from\n * `JSON.stringify`, `console.log`, and Node's `util.inspect`. Use {@link EncryptionKey.fromBytes}\n * to construct one from a raw 32-byte key; the MD5 digest is computed internally.\n */\nexport class EncryptionKey {\n /** Encryption mode discriminant. Always `'SSE-C'` for this class. */\n readonly mode = 'SSE-C' as const\n /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */\n readonly algorithm: EncryptionAlgorithm = 'AES256'\n /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */\n readonly customerKey: string\n /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */\n readonly customerKeyMd5: string\n\n /**\n * Internal constructor. Use {@link EncryptionKey.fromBytes} or\n * {@link EncryptionKey.fromBase64} instead.\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @internal\n */\n private constructor(customerKey: string, customerKeyMd5: string) {\n this.customerKey = customerKey\n this.customerKeyMd5 = customerKeyMd5\n }\n\n /**\n * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the\n * required base64 MD5 digest internally.\n *\n * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n *\n * @throws If the key is not exactly 32 bytes.\n */\n static async fromBytes(rawKey: Uint8Array): Promise<EncryptionKey> {\n if (rawKey.byteLength !== 32) {\n throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`)\n }\n const customerKey = bytesToBase64(rawKey)\n const customerKeyMd5 = await md5Base64(rawKey)\n return new EncryptionKey(customerKey, customerKeyMd5)\n }\n\n /**\n * Builds an EncryptionKey from precomputed base64 strings. Use this in\n * environments where MD5 must be computed externally (e.g., browsers).\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n */\n static fromBase64(customerKey: string, customerKeyMd5: string): EncryptionKey {\n return new EncryptionKey(customerKey, customerKeyMd5)\n }\n\n /**\n * Hides the key bytes from `JSON.stringify`.\n *\n * @returns A redacted shape: same mode and algorithm, but the key and MD5\n * replaced with a placeholder string.\n */\n toJSON(): {\n /** Encryption mode discriminant. */\n mode: 'SSE-C'\n /** Encryption algorithm. */\n algorithm: EncryptionAlgorithm\n /** Always the literal redaction placeholder; the real key never leaves the instance. */\n customerKey: string\n /** Always the literal redaction placeholder; the real MD5 never leaves the instance. */\n customerKeyMd5: string\n } {\n return {\n mode: this.mode,\n algorithm: this.algorithm,\n customerKey: KEY_REDACTED,\n customerKeyMd5: KEY_REDACTED,\n }\n }\n\n /**\n * Hides the key bytes from default `toString()`.\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n toString(): string {\n return `[EncryptionKey SSE-C ${KEY_REDACTED}]`\n }\n\n /**\n * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n [Symbol.for('nodejs.util.inspect.custom')](): string {\n return this.toString()\n }\n}\n"],"names":[],"mappings":"AACO,MAAM,sBAAsB;AAAA;AAAA,EAEjC,QAAQ;AACV;AAcO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,OAAO;AAAA;AAAA,EAEP,MAAM;AAAA;AAAA,EAEN,MAAM;AACR;AAmCO,MAAM,SAAuB,EAAE,MAAM,UAAU,WAAW,SAAA;AAG1D,MAAM,W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AAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAmB;AACjB,WAAO,wBAAwB,YAAY;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,CAAC,OAAO,IAAI,4BAA4B,CAAC,IAAY;AACnD,WAAO,KAAK,SAAA;AAAA,EACd;AACF;"}
1
+ {"version":3,"file":"encryption.js","names":[],"sources":["../../src/types/encryption.ts"],"sourcesContent":["/** Named constants for the supported server-side encryption algorithms. */\nexport const EncryptionAlgorithm = {\n /** AES with a 256-bit key. The only algorithm B2 currently supports. */\n Aes256: 'AES256',\n} as const\n\n/** Supported server-side encryption algorithm. Derived from {@link EncryptionAlgorithm}. */\nexport type EncryptionAlgorithm = (typeof EncryptionAlgorithm)[keyof typeof EncryptionAlgorithm]\n\n/**\n * Named constants for the server-side encryption mode used by a file.\n *\n * Most callers should use the {@link SSE_B2}, {@link SSE_NONE}, and\n * {@link sseCustomer} helpers below which return complete\n * {@link EncryptionSetting} objects. These constants are useful when you\n * need the bare mode discriminator (e.g., when introspecting a file's\n * current encryption setting).\n */\nexport const EncryptionMode = {\n /** B2-managed encryption keys. */\n SseB2: 'SSE-B2',\n /** Customer-provided encryption keys. */\n SseC: 'SSE-C',\n /** No encryption. */\n None: 'none',\n} as const\n\n/** Server-side encryption mode for files stored in B2. Derived from {@link EncryptionMode}. */\nexport type EncryptionMode = (typeof EncryptionMode)[keyof typeof EncryptionMode]\n\n/** Server-side encryption using B2-managed keys (SSE-B2). */\nexport interface SseB2Setting {\n /** Encryption mode discriminator. Always `'SSE-B2'`. */\n readonly mode: 'SSE-B2'\n /** Encryption algorithm. Always `'AES256'`. */\n readonly algorithm: EncryptionAlgorithm\n}\n\n/** Server-side encryption using customer-provided keys (SSE-C). */\nexport interface SseCCustomerSetting {\n /** Encryption mode discriminator. Always `'SSE-C'`. */\n readonly mode: 'SSE-C'\n /** Encryption algorithm. Always `'AES256'`. */\n readonly algorithm: EncryptionAlgorithm\n /** Base64-encoded 256-bit encryption key provided by the customer. */\n readonly customerKey: string\n /** Base64-encoded MD5 digest of the customer-provided key, used for integrity verification. */\n readonly customerKeyMd5: string\n}\n\n/** Server-side encryption using customer-provided keys as returned by B2 responses. */\nexport interface SseCPublicSetting {\n /** Encryption mode discriminator. Always `'SSE-C'`. */\n readonly mode: 'SSE-C'\n /** Encryption algorithm. Always `'AES256'`. */\n readonly algorithm: EncryptionAlgorithm\n}\n\n/** Indicates no server-side encryption is applied. */\nexport interface NoEncryption {\n /** Encryption mode discriminator. Always `'none'`. */\n readonly mode: 'none'\n}\n\n/** No-encryption shape returned by B2 response objects. */\nexport interface NoEncryptionWireSetting {\n /** Encryption mode discriminator. B2 response payloads use null for no encryption. */\n readonly mode: null\n /** Encryption algorithm. B2 response payloads use null when no encryption is applied. */\n readonly algorithm: null\n}\n\n/** Union of all server-side encryption settings: B2-managed, customer-provided, or none. */\nexport type EncryptionSetting = SseB2Setting | SseCCustomerSetting | NoEncryption\n\n/** Server-side encryption setting returned by B2 response objects. */\nexport type PublicEncryptionSetting =\n | SseB2Setting\n | SseCPublicSetting\n | NoEncryption\n | NoEncryptionWireSetting\n\n/** Pre-built SSE-B2 encryption setting using AES-256. */\nexport const SSE_B2: SseB2Setting = { mode: 'SSE-B2', algorithm: 'AES256' }\n\n/** Pre-built setting indicating no server-side encryption. */\nexport const SSE_NONE: NoEncryption = { mode: 'none' }\n\n/**\n * Creates an SSE-C encryption setting with a customer-provided key.\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @returns An SSE-C encryption setting ready to pass to upload or download calls.\n */\nexport function sseCustomer(customerKey: string, customerKeyMd5: string): SseCCustomerSetting {\n return { mode: 'SSE-C', algorithm: 'AES256', customerKey, customerKeyMd5 }\n}\n\n/**\n * Encodes raw bytes as base64 in an isomorphic way (Node Buffer fallback to btoa).\n *\n * @param bytes - The raw bytes to encode.\n *\n * @returns The base64-encoded string.\n */\nfunction bytesToBase64(bytes: Uint8Array): string {\n // Prefer Node's Buffer when available (faster), but degrade to btoa() in\n // browsers / Deno / Workers where Buffer isn't a global. We access via\n // globalThis to avoid a hard reference to a Node-only symbol — that would\n // break the type-check in non-Node runtimes (Deno, browser-mode Vitest).\n const g = globalThis as {\n Buffer?: { from(b: Uint8Array): { toString(encoding: string): string } }\n }\n if (g.Buffer) {\n return g.Buffer.from(bytes).toString('base64')\n }\n let binary = ''\n for (const b of bytes) binary += String.fromCharCode(b)\n return btoa(binary)\n}\n\n/**\n * Computes the MD5 digest of the given bytes as a base64 string. Prefers\n * `node:crypto` for native speed when available; falls back to a pure-JS\n * implementation in browser / edge runtimes because WebCrypto's\n * `crypto.subtle.digest` deliberately does not support MD5.\n *\n * MD5 is used here only for SSE-C key integrity (matching the B2 wire\n * protocol). It is **not** a security boundary; the customer key itself is\n * the secret. Bundling a pure-JS fallback keeps `EncryptionKey.fromBytes`\n * isomorphic.\n *\n * @param bytes - The bytes to digest.\n *\n * @returns The base64-encoded MD5 digest.\n */\nasync function md5Base64(bytes: Uint8Array): Promise<string> {\n try {\n const { createHash } = await import('node:crypto')\n // Vite's browser shim resolves the import but does not implement\n // `createHash`. Probe explicitly so we fall through to the pure-JS path.\n if (typeof createHash !== 'function') throw new Error('createHash unavailable')\n return createHash('md5').update(bytes).digest('base64')\n /* v8 ignore next 3 -- fallback only reachable in non-Node runtimes */\n } catch {\n return bytesToBase64(md5Bytes(bytes))\n }\n}\n\n/**\n * Pure-JS MD5 implementation per RFC 1321. Returns the 16-byte digest of the\n * input. Used as a browser fallback for SSE-C key MD5 computation; not\n * intended for security-sensitive purposes (MD5 is broken cryptographically).\n *\n * @param data - The bytes to hash.\n *\n * @returns The 16-byte MD5 digest.\n */\nfunction md5Bytes(data: Uint8Array): Uint8Array {\n // Padding: append 0x80, then zeros, then the original length in bits as a\n // little-endian 64-bit integer, so the total length is a multiple of 64.\n const originalBitLength = data.byteLength * 8\n const padLength = ((data.byteLength + 8) >>> 6) + 1\n const padded = new Uint8Array(padLength * 64)\n padded.set(data)\n padded[data.byteLength] = 0x80\n // Write the 64-bit length (little-endian). JS bitwise ops are 32-bit, so\n // split into low/high halves.\n const lowBits = originalBitLength >>> 0\n const highBits = Math.floor(originalBitLength / 0x1_0000_0000) >>> 0\n const lengthView = new DataView(padded.buffer, padded.byteLength - 8, 8)\n lengthView.setUint32(0, lowBits, true)\n lengthView.setUint32(4, highBits, true)\n\n // Per-round shift amounts.\n const s = [\n 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9,\n 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21,\n 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21,\n ]\n // Per-round sine-derived constants K[i] = floor(2^32 * abs(sin(i + 1))).\n const k = new Uint32Array([\n 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,\n 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,\n 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,\n 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,\n 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,\n 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,\n 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,\n 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,\n ])\n\n let a0 = 0x67452301\n let b0 = 0xefcdab89\n let c0 = 0x98badcfe\n let d0 = 0x10325476\n\n const m = new Uint32Array(16)\n const view = new DataView(padded.buffer)\n for (let block = 0; block < padded.byteLength; block += 64) {\n for (let i = 0; i < 16; i++) m[i] = view.getUint32(block + i * 4, true)\n let A = a0\n let B = b0\n let C = c0\n let D = d0\n for (let i = 0; i < 64; i++) {\n let f: number\n let g: number\n if (i < 16) {\n f = (B & C) | (~B & D)\n g = i\n } else if (i < 32) {\n f = (D & B) | (~D & C)\n g = (5 * i + 1) % 16\n } else if (i < 48) {\n f = B ^ C ^ D\n g = (3 * i + 5) % 16\n } else {\n f = C ^ (B | ~D)\n g = (7 * i) % 16\n }\n const temp = D\n D = C\n C = B\n const sum = (A + f + (k[i] ?? 0) + (m[g] ?? 0)) >>> 0\n const shift = s[i] ?? 0\n const rotated = ((sum << shift) | (sum >>> (32 - shift))) >>> 0\n B = (B + rotated) >>> 0\n A = temp\n }\n a0 = (a0 + A) >>> 0\n b0 = (b0 + B) >>> 0\n c0 = (c0 + C) >>> 0\n d0 = (d0 + D) >>> 0\n }\n\n const out = new Uint8Array(16)\n const outView = new DataView(out.buffer)\n outView.setUint32(0, a0, true)\n outView.setUint32(4, b0, true)\n outView.setUint32(8, c0, true)\n outView.setUint32(12, d0, true)\n return out\n}\n\nconst KEY_REDACTED = '[redacted SSE-C key]'\n\n/**\n * Safe wrapper around an SSE-C customer key. Hides the key bytes from\n * `JSON.stringify`, `console.log`, and Node's `util.inspect`. Use {@link EncryptionKey.fromBytes}\n * to construct one from a raw 32-byte key; the MD5 digest is computed internally.\n */\nexport class EncryptionKey {\n /** Encryption mode discriminant. Always `'SSE-C'` for this class. */\n readonly mode = 'SSE-C' as const\n /** Encryption algorithm. B2's S3-compatible API only supports AES-256. */\n readonly algorithm: EncryptionAlgorithm = 'AES256'\n /** Base64-encoded 256-bit customer key. Logged as `[redacted SSE-C key]` via `toJSON` / `toString`. */\n readonly customerKey: string\n /** Base64-encoded MD5 digest of the customer key. Required by B2 for integrity verification. */\n readonly customerKeyMd5: string\n\n /**\n * Internal constructor. Use {@link EncryptionKey.fromBytes} or\n * {@link EncryptionKey.fromBase64} instead.\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @internal\n */\n private constructor(customerKey: string, customerKeyMd5: string) {\n this.customerKey = customerKey\n this.customerKeyMd5 = customerKeyMd5\n }\n\n /**\n * Builds an EncryptionKey from a raw 32-byte (256-bit) key. Computes the\n * required base64 MD5 digest internally.\n *\n * @param rawKey - The raw 256-bit key as bytes. Must be exactly 32 bytes.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n *\n * @throws If the key is not exactly 32 bytes.\n */\n static async fromBytes(rawKey: Uint8Array): Promise<EncryptionKey> {\n if (rawKey.byteLength !== 32) {\n throw new Error(`SSE-C key must be exactly 32 bytes (256 bits); got ${rawKey.byteLength}.`)\n }\n const customerKey = bytesToBase64(rawKey)\n const customerKeyMd5 = await md5Base64(rawKey)\n return new EncryptionKey(customerKey, customerKeyMd5)\n }\n\n /**\n * Builds an EncryptionKey from precomputed base64 strings. Use this in\n * environments where MD5 must be computed externally (e.g., browsers).\n *\n * @param customerKey - Base64-encoded 256-bit encryption key.\n * @param customerKeyMd5 - Base64-encoded MD5 digest of the key.\n *\n * @returns A safely-wrapped EncryptionKey ready for upload/download.\n */\n static fromBase64(customerKey: string, customerKeyMd5: string): EncryptionKey {\n return new EncryptionKey(customerKey, customerKeyMd5)\n }\n\n /**\n * Hides the key bytes from `JSON.stringify`.\n *\n * @returns A redacted shape: same mode and algorithm, but the key and MD5\n * replaced with a placeholder string.\n */\n toJSON(): {\n /** Encryption mode discriminant. */\n mode: 'SSE-C'\n /** Encryption algorithm. */\n algorithm: EncryptionAlgorithm\n /** Always the literal redaction placeholder; the real key never leaves the instance. */\n customerKey: string\n /** Always the literal redaction placeholder; the real MD5 never leaves the instance. */\n customerKeyMd5: string\n } {\n return {\n mode: this.mode,\n algorithm: this.algorithm,\n customerKey: KEY_REDACTED,\n customerKeyMd5: KEY_REDACTED,\n }\n }\n\n /**\n * Hides the key bytes from default `toString()`.\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n toString(): string {\n return `[EncryptionKey SSE-C ${KEY_REDACTED}]`\n }\n\n /**\n * Hides the key bytes from Node's `util.inspect` (and therefore `console.log`).\n *\n * @returns A short opaque label indicating this is an SSE-C key.\n */\n [Symbol.for('nodejs.util.inspect.custom')](): string {\n return this.toString()\n }\n}\n"],"mappings":";;AACA,IAAa,sBAAsB;;AAEjC,QAAQ,SACV;;;;;;;;;;AAcA,IAAa,iBAAiB;;CAE5B,OAAO;;CAEP,MAAM;;CAEN,MAAM;AACR;;AA0DA,IAAa,SAAuB;CAAE,MAAM;CAAU,WAAW;AAAS;;AAG1E,IAAa,WAAyB,EAAE,MAAM,OAAO;;;;;;;;AASrD,SAAgB,YAAY,aAAqB,gBAA6C;CAC5F,OAAO;EAAE,MAAM;EAAS,WAAW;EAAU;EAAa;CAAe;AAC3E;;;;;;;;AASA,SAAS,cAAc,OAA2B;CAKhD,MAAM,IAAI;CAGV,IAAI,EAAE,QACJ,OAAO,EAAE,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,QAAQ;CAE/C,IAAI,SAAS;CACb,KAAK,MAAM,KAAK,OAAO,UAAU,OAAO,aAAa,CAAC;CACtD,OAAO,KAAK,MAAM;AACpB;;;;;;;;;;;;;;;;AAiBA,eAAe,UAAU,OAAoC;CAC3D,IAAI;EACF,MAAM,EAAE,eAAe,MAAM,OAAO;EAGpC,IAAI,OAAO,eAAe,YAAY,MAAM,IAAI,MAAM,wBAAwB;EAC9E,OAAO,WAAW,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC,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AAW,EAAE;CAC7B,MAAM,UAAU,IAAI,SAAS,IAAI,MAAM;CACvC,QAAQ,UAAU,GAAG,IAAI,IAAI;CAC7B,QAAQ,UAAU,GAAG,IAAI,IAAI;CAC7B,QAAQ,UAAU,GAAG,IAAI,IAAI;CAC7B,QAAQ,UAAU,IAAI,IAAI,IAAI;CAC9B,OAAO;AACT;AAEA,IAAM,eAAe;;;;;;AAOrB,IAAa,gBAAb,MAAa,cAAc;;CAEzB,OAAgB;;CAEhB,YAA0C;;CAE1C;;CAEA;;;;;;;;;;CAWA,YAAoB,aAAqB,gBAAwB;EAC/D,KAAK,cAAc;EACnB,KAAK,iBAAiB;CACxB;;;;;;;;;;;CAYA,aAAa,UAAU,QAA4C;EACjE,IAAI,OAAO,eAAe,IACxB,MAAM,IAAI,MAAM,sDAAsD,OAAO,WAAW,EAAE;EAE5F,MAAM,cAAc,cAAc,MAAM;EACxC,MAAM,iBAAiB,MAAM,UAAU,MAAM;EAC7C,OAAO,IAAI,cAAc,aAAa,cAAc;CACtD;;;;;;;;;;CAWA,OAAO,WAAW,aAAqB,gBAAuC;EAC5E,OAAO,IAAI,cAAc,aAAa,cAAc;CACtD;;;;;;;CAQA,SASE;EACA,OAAO;GACL,MAAM,KAAK;GACX,WAAW,KAAK;GAChB,aAAa;GACb,gBAAgB;EAClB;CACF;;;;;;CAOA,WAAmB;EACjB,OAAO,wBAAwB,aAAa;CAC9C;;;;;;CAOA,CAAC,OAAO,IAAI,4BAA4B,KAAa;EACnD,OAAO,KAAK,SAAS;CACvB;AACF"}
@@ -0,0 +1,47 @@
1
+ //#region src/types/errors.ts
2
+ /**
3
+ * B2 API error codes documented by the SDK.
4
+ * This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback
5
+ * so callers can receive unknown future server codes while keeping autocomplete
6
+ * for known values.
7
+ */
8
+ var KNOWN_B2_ERROR_CODES = [
9
+ "expired_auth_token",
10
+ "bad_auth_token",
11
+ "unauthorized",
12
+ "bad_request",
13
+ "bad_bucket_name",
14
+ "bad_bucket_id",
15
+ "not_found",
16
+ "method_not_allowed",
17
+ "request_timeout",
18
+ "too_many_requests",
19
+ "conflict",
20
+ "duplicate_bucket_name",
21
+ "too_many_buckets",
22
+ "too_many_files",
23
+ "cap_exceeded",
24
+ "storage_cap_exceeded",
25
+ "transaction_cap_exceeded",
26
+ "download_cap_exceeded",
27
+ "access_denied",
28
+ "service_unavailable",
29
+ "internal_error",
30
+ "bad_json",
31
+ "invalid_bucket_id",
32
+ "invalid_bucket_name",
33
+ "invalid_bucket_info",
34
+ "file_not_present",
35
+ "no_such_file",
36
+ "out_of_range",
37
+ "range_not_satisfiable",
38
+ "invalid_file_id",
39
+ "invalid_file_name",
40
+ "invalid_file_info",
41
+ "invalid_part_number",
42
+ "bad_sha1_checksum"
43
+ ];
44
+ //#endregion
45
+ exports.KNOWN_B2_ERROR_CODES = KNOWN_B2_ERROR_CODES;
46
+
47
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.cjs","names":[],"sources":["../../src/types/errors.ts"],"sourcesContent":["/**\n * B2 API error codes documented by the SDK.\n * This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback\n * so callers can receive unknown future server codes while keeping autocomplete\n * for known values.\n */\nexport const KNOWN_B2_ERROR_CODES = [\n 'expired_auth_token',\n 'bad_auth_token',\n 'unauthorized',\n 'bad_request',\n 'bad_bucket_name',\n 'bad_bucket_id',\n 'not_found',\n 'method_not_allowed',\n 'request_timeout',\n 'too_many_requests',\n 'conflict',\n 'duplicate_bucket_name',\n 'too_many_buckets',\n 'too_many_files',\n 'cap_exceeded',\n 'storage_cap_exceeded',\n 'transaction_cap_exceeded',\n 'download_cap_exceeded',\n 'access_denied',\n 'service_unavailable',\n 'internal_error',\n 'bad_json',\n 'invalid_bucket_id',\n 'invalid_bucket_name',\n 'invalid_bucket_info',\n 'file_not_present',\n 'no_such_file',\n 'out_of_range',\n 'range_not_satisfiable',\n 'invalid_file_id',\n 'invalid_file_name',\n 'invalid_file_info',\n 'invalid_part_number',\n 'bad_sha1_checksum',\n] as const\n\n/** B2 error codes documented by the SDK and classified exhaustively. */\nexport type KnownB2ErrorCode = (typeof KNOWN_B2_ERROR_CODES)[number]\n\n/**\n * B2 API error code value.\n * Known codes are enumerated for autocomplete; unknown future server codes are\n * still accepted as strings.\n */\nexport type B2ErrorCode = KnownB2ErrorCode | (string & {})\n\n/** Standard error response body returned by the B2 API on failure. */\nexport interface B2ErrorResponse {\n /** HTTP status code from the B2 API response. */\n readonly status: number\n /** Machine-readable error code identifying the specific failure. */\n readonly code: B2ErrorCode\n /** Human-readable description of the error. */\n readonly message: string\n}\n"],"mappings":";;;;;;;AAMA,IAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
@@ -1,9 +1,18 @@
1
1
  /**
2
- * Known B2 API error codes.
3
- * The union includes a `string & {}` fallback to allow unknown error codes
4
- * while still providing autocomplete for well-known values.
2
+ * B2 API error codes documented by the SDK.
3
+ * This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback
4
+ * so callers can receive unknown future server codes while keeping autocomplete
5
+ * for known values.
5
6
  */
6
- export type B2ErrorCode = 'expired_auth_token' | 'bad_auth_token' | 'unauthorized' | 'bad_request' | 'bad_bucket_id' | 'not_found' | 'method_not_allowed' | 'request_timeout' | 'conflict' | 'duplicate_bucket_name' | 'too_many_buckets' | 'too_many_files' | 'cap_exceeded' | 'storage_cap_exceeded' | 'transaction_cap_exceeded' | 'access_denied' | 'service_unavailable' | 'internal_error' | 'bad_json' | 'invalid_bucket_id' | 'file_not_present' | 'no_such_file' | 'out_of_range' | 'range_not_satisfiable' | 'invalid_file_id' | 'invalid_part_number' | 'bad_sha1_checksum' | 'download_cap_exceeded' | (string & {});
7
+ export declare const KNOWN_B2_ERROR_CODES: readonly ["expired_auth_token", "bad_auth_token", "unauthorized", "bad_request", "bad_bucket_name", "bad_bucket_id", "not_found", "method_not_allowed", "request_timeout", "too_many_requests", "conflict", "duplicate_bucket_name", "too_many_buckets", "too_many_files", "cap_exceeded", "storage_cap_exceeded", "transaction_cap_exceeded", "download_cap_exceeded", "access_denied", "service_unavailable", "internal_error", "bad_json", "invalid_bucket_id", "invalid_bucket_name", "invalid_bucket_info", "file_not_present", "no_such_file", "out_of_range", "range_not_satisfiable", "invalid_file_id", "invalid_file_name", "invalid_file_info", "invalid_part_number", "bad_sha1_checksum"];
8
+ /** B2 error codes documented by the SDK and classified exhaustively. */
9
+ export type KnownB2ErrorCode = (typeof KNOWN_B2_ERROR_CODES)[number];
10
+ /**
11
+ * B2 API error code value.
12
+ * Known codes are enumerated for autocomplete; unknown future server codes are
13
+ * still accepted as strings.
14
+ */
15
+ export type B2ErrorCode = KnownB2ErrorCode | (string & {});
7
16
  /** Standard error response body returned by the B2 API on failure. */
8
17
  export interface B2ErrorResponse {
9
18
  /** HTTP status code from the B2 API response. */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,eAAe,GACf,WAAW,GACX,oBAAoB,GACpB,iBAAiB,GACjB,UAAU,GACV,uBAAuB,GACvB,kBAAkB,GAClB,gBAAgB,GAChB,cAAc,GACd,sBAAsB,GACtB,0BAA0B,GAC1B,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,UAAU,GACV,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,cAAc,GACd,uBAAuB,GACvB,iBAAiB,GACjB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEjB,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,wqBAmCvB,CAAA;AAEV,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAE1D,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB"}
@@ -1,9 +1,18 @@
1
1
  /**
2
- * Known B2 API error codes.
3
- * The union includes a `string & {}` fallback to allow unknown error codes
4
- * while still providing autocomplete for well-known values.
2
+ * B2 API error codes documented by the SDK.
3
+ * This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback
4
+ * so callers can receive unknown future server codes while keeping autocomplete
5
+ * for known values.
5
6
  */
6
- export type B2ErrorCode = 'expired_auth_token' | 'bad_auth_token' | 'unauthorized' | 'bad_request' | 'bad_bucket_id' | 'not_found' | 'method_not_allowed' | 'request_timeout' | 'conflict' | 'duplicate_bucket_name' | 'too_many_buckets' | 'too_many_files' | 'cap_exceeded' | 'storage_cap_exceeded' | 'transaction_cap_exceeded' | 'access_denied' | 'service_unavailable' | 'internal_error' | 'bad_json' | 'invalid_bucket_id' | 'file_not_present' | 'no_such_file' | 'out_of_range' | 'range_not_satisfiable' | 'invalid_file_id' | 'invalid_part_number' | 'bad_sha1_checksum' | 'download_cap_exceeded' | (string & {});
7
+ export declare const KNOWN_B2_ERROR_CODES: readonly ["expired_auth_token", "bad_auth_token", "unauthorized", "bad_request", "bad_bucket_name", "bad_bucket_id", "not_found", "method_not_allowed", "request_timeout", "too_many_requests", "conflict", "duplicate_bucket_name", "too_many_buckets", "too_many_files", "cap_exceeded", "storage_cap_exceeded", "transaction_cap_exceeded", "download_cap_exceeded", "access_denied", "service_unavailable", "internal_error", "bad_json", "invalid_bucket_id", "invalid_bucket_name", "invalid_bucket_info", "file_not_present", "no_such_file", "out_of_range", "range_not_satisfiable", "invalid_file_id", "invalid_file_name", "invalid_file_info", "invalid_part_number", "bad_sha1_checksum"];
8
+ /** B2 error codes documented by the SDK and classified exhaustively. */
9
+ export type KnownB2ErrorCode = (typeof KNOWN_B2_ERROR_CODES)[number];
10
+ /**
11
+ * B2 API error code value.
12
+ * Known codes are enumerated for autocomplete; unknown future server codes are
13
+ * still accepted as strings.
14
+ */
15
+ export type B2ErrorCode = KnownB2ErrorCode | (string & {});
7
16
  /** Standard error response body returned by the B2 API on failure. */
8
17
  export interface B2ErrorResponse {
9
18
  /** HTTP status code from the B2 API response. */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,eAAe,GACf,WAAW,GACX,oBAAoB,GACpB,iBAAiB,GACjB,UAAU,GACV,uBAAuB,GACvB,kBAAkB,GAClB,gBAAgB,GAChB,cAAc,GACd,sBAAsB,GACtB,0BAA0B,GAC1B,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,UAAU,GACV,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,cAAc,GACd,uBAAuB,GACvB,iBAAiB,GACjB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEjB,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,wqBAmCvB,CAAA;AAEV,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAE1D,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB"}
@@ -0,0 +1,47 @@
1
+ //#region src/types/errors.ts
2
+ /**
3
+ * B2 API error codes documented by the SDK.
4
+ * This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback
5
+ * so callers can receive unknown future server codes while keeping autocomplete
6
+ * for known values.
7
+ */
8
+ var KNOWN_B2_ERROR_CODES = [
9
+ "expired_auth_token",
10
+ "bad_auth_token",
11
+ "unauthorized",
12
+ "bad_request",
13
+ "bad_bucket_name",
14
+ "bad_bucket_id",
15
+ "not_found",
16
+ "method_not_allowed",
17
+ "request_timeout",
18
+ "too_many_requests",
19
+ "conflict",
20
+ "duplicate_bucket_name",
21
+ "too_many_buckets",
22
+ "too_many_files",
23
+ "cap_exceeded",
24
+ "storage_cap_exceeded",
25
+ "transaction_cap_exceeded",
26
+ "download_cap_exceeded",
27
+ "access_denied",
28
+ "service_unavailable",
29
+ "internal_error",
30
+ "bad_json",
31
+ "invalid_bucket_id",
32
+ "invalid_bucket_name",
33
+ "invalid_bucket_info",
34
+ "file_not_present",
35
+ "no_such_file",
36
+ "out_of_range",
37
+ "range_not_satisfiable",
38
+ "invalid_file_id",
39
+ "invalid_file_name",
40
+ "invalid_file_info",
41
+ "invalid_part_number",
42
+ "bad_sha1_checksum"
43
+ ];
44
+ //#endregion
45
+ export { KNOWN_B2_ERROR_CODES };
46
+
47
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","names":[],"sources":["../../src/types/errors.ts"],"sourcesContent":["/**\n * B2 API error codes documented by the SDK.\n * This list drives `KnownB2ErrorCode`; `B2ErrorCode` adds a string fallback\n * so callers can receive unknown future server codes while keeping autocomplete\n * for known values.\n */\nexport const KNOWN_B2_ERROR_CODES = [\n 'expired_auth_token',\n 'bad_auth_token',\n 'unauthorized',\n 'bad_request',\n 'bad_bucket_name',\n 'bad_bucket_id',\n 'not_found',\n 'method_not_allowed',\n 'request_timeout',\n 'too_many_requests',\n 'conflict',\n 'duplicate_bucket_name',\n 'too_many_buckets',\n 'too_many_files',\n 'cap_exceeded',\n 'storage_cap_exceeded',\n 'transaction_cap_exceeded',\n 'download_cap_exceeded',\n 'access_denied',\n 'service_unavailable',\n 'internal_error',\n 'bad_json',\n 'invalid_bucket_id',\n 'invalid_bucket_name',\n 'invalid_bucket_info',\n 'file_not_present',\n 'no_such_file',\n 'out_of_range',\n 'range_not_satisfiable',\n 'invalid_file_id',\n 'invalid_file_name',\n 'invalid_file_info',\n 'invalid_part_number',\n 'bad_sha1_checksum',\n] as const\n\n/** B2 error codes documented by the SDK and classified exhaustively. */\nexport type KnownB2ErrorCode = (typeof KNOWN_B2_ERROR_CODES)[number]\n\n/**\n * B2 API error code value.\n * Known codes are enumerated for autocomplete; unknown future server codes are\n * still accepted as strings.\n */\nexport type B2ErrorCode = KnownB2ErrorCode | (string & {})\n\n/** Standard error response body returned by the B2 API on failure. */\nexport interface B2ErrorResponse {\n /** HTTP status code from the B2 API response. */\n readonly status: number\n /** Machine-readable error code identifying the specific failure. */\n readonly code: B2ErrorCode\n /** Human-readable description of the error. */\n readonly message: string\n}\n"],"mappings":";;;;;;;AAMA,IAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
@@ -1,23 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const FileAction = {
4
- /** Large file upload started but not yet finished. */
5
- Start: "start",
6
- /** Normal upload (small or finished large file). */
7
- Upload: "upload",
8
- /** Hide marker (soft delete). */
9
- Hide: "hide",
10
- /** Virtual folder marker. */
11
- Folder: "folder",
12
- /** Created via server-side copy. */
13
- Copy: "copy"
1
+ //#region src/types/file.ts
2
+ /**
3
+ * Named constants for the action that created a file version.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * if (file.action === FileAction.Hide) { ... }
8
+ * ```
9
+ */
10
+ var FileAction = {
11
+ /** Large file upload started but not yet finished. */
12
+ Start: "start",
13
+ /** Normal upload (small or finished large file). */
14
+ Upload: "upload",
15
+ /** Hide marker (soft delete). */
16
+ Hide: "hide",
17
+ /** Virtual folder marker. */
18
+ Folder: "folder",
19
+ /** Created via server-side copy. */
20
+ Copy: "copy"
14
21
  };
15
- const MetadataDirective = {
16
- /** Preserve the source file's contentType and fileInfo. */
17
- Copy: "COPY",
18
- /** Use the values provided in the copy request. */
19
- Replace: "REPLACE"
22
+ /**
23
+ * Named constants for how metadata is handled during a file copy.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })
28
+ * ```
29
+ */
30
+ var MetadataDirective = {
31
+ /** Preserve the source file's contentType and fileInfo. */
32
+ Copy: "COPY",
33
+ /** Use the values provided in the copy request. */
34
+ Replace: "REPLACE"
20
35
  };
36
+ //#endregion
21
37
  exports.FileAction = FileAction;
22
38
  exports.MetadataDirective = MetadataDirective;
23
- //# sourceMappingURL=file.cjs.map
39
+
40
+ //# sourceMappingURL=file.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"file.cjs","sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status, or null if replication is not configured. */\n readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: EncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n}\n"],"names":[],"mappings":";;AAYO,MAAM,aAAa;AAAA;AAAA,EAExB,OAAO;AAAA;AAAA,EAEP,QAAQ;AAAA;AAAA,EAER,MAAM;AAAA;AAAA,EAEN,QAAQ;AAAA;AAAA,EAER,MAAM;AACR;AAqJO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,MAAM;AAAA;AAAA,EAEN,SAAS;AACX;;;"}
1
+ {"version":3,"file":"file.cjs","names":[],"sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting, PublicEncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status, or null if replication is not configured. */\n readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: PublicEncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n}\n"],"mappings":";;;;;;;;;AAYA,IAAa,aAAa;;CAExB,OAAO;;CAEP,QAAQ;;CAER,MAAM;;CAEN,QAAQ;;CAER,MAAM;AACR;;;;;;;;;AAqJA,IAAa,oBAAoB;;CAE/B,MAAM;;CAEN,SAAS;AACX"}
@@ -1,4 +1,4 @@
1
- import { EncryptionSetting } from './encryption.js';
1
+ import { EncryptionSetting, PublicEncryptionSetting } from './encryption.js';
2
2
  import { AccountId, BucketId, FileId } from './ids.js';
3
3
  import { FileRetentionValue, LegalHoldValue } from './lock.js';
4
4
  /**
@@ -74,7 +74,7 @@ export interface FileVersion {
74
74
  /** Replication status, or null if replication is not configured. */
75
75
  readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null;
76
76
  /** Server-side encryption settings applied to this file version. */
77
- readonly serverSideEncryption: EncryptionSetting;
77
+ readonly serverSideEncryption: PublicEncryptionSetting;
78
78
  /** UTC timestamp (milliseconds) when this version was uploaded. */
79
79
  readonly uploadTimestamp: number;
80
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;IACrB,sDAAsD;;IAEtD,oDAAoD;;IAEpD,iCAAiC;;IAEjC,6BAA6B;;IAE7B,oCAAoC;;CAE5B,CAAA;AAEV;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAErE;;;;GAIG;AACH,MAAM,WAAW,W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AC,UAAU,EAAE,MAAM,CAAA;IAC3B,kGAAkG;IAClG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,yFAAyF;IACzF,QAAQ,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAA;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,+BAA+B,CAAC,EAAE,iBAAiB,CAAA;CAC7D;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,yCAAyC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B"}
@@ -1,4 +1,4 @@
1
- import { EncryptionSetting } from './encryption.js';
1
+ import { EncryptionSetting, PublicEncryptionSetting } from './encryption.js';
2
2
  import { AccountId, BucketId, FileId } from './ids.js';
3
3
  import { FileRetentionValue, LegalHoldValue } from './lock.js';
4
4
  /**
@@ -74,7 +74,7 @@ export interface FileVersion {
74
74
  /** Replication status, or null if replication is not configured. */
75
75
  readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null;
76
76
  /** Server-side encryption settings applied to this file version. */
77
- readonly serverSideEncryption: EncryptionSetting;
77
+ readonly serverSideEncryption: PublicEncryptionSetting;
78
78
  /** UTC timestamp (milliseconds) when this version was uploaded. */
79
79
  readonly uploadTimestamp: number;
80
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,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QAAQ,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAA;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,+BAA+B,CAAC,EAAE,iBAAiB,CAAA;CAC7D;AAED,sGAAsG;AACtG,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,4CAA4C;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,kGAAkG;IAClG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,yFAAyF;IACzF,QAAQ,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAA;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,+BAA+B,CAAC,EAAE,iBAAiB,CAAA;CAC7D;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,yCAAyC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B"}
@@ -1,23 +1,39 @@
1
- const FileAction = {
2
- /** Large file upload started but not yet finished. */
3
- Start: "start",
4
- /** Normal upload (small or finished large file). */
5
- Upload: "upload",
6
- /** Hide marker (soft delete). */
7
- Hide: "hide",
8
- /** Virtual folder marker. */
9
- Folder: "folder",
10
- /** Created via server-side copy. */
11
- Copy: "copy"
1
+ //#region src/types/file.ts
2
+ /**
3
+ * Named constants for the action that created a file version.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * if (file.action === FileAction.Hide) { ... }
8
+ * ```
9
+ */
10
+ var FileAction = {
11
+ /** Large file upload started but not yet finished. */
12
+ Start: "start",
13
+ /** Normal upload (small or finished large file). */
14
+ Upload: "upload",
15
+ /** Hide marker (soft delete). */
16
+ Hide: "hide",
17
+ /** Virtual folder marker. */
18
+ Folder: "folder",
19
+ /** Created via server-side copy. */
20
+ Copy: "copy"
12
21
  };
13
- const MetadataDirective = {
14
- /** Preserve the source file's contentType and fileInfo. */
15
- Copy: "COPY",
16
- /** Use the values provided in the copy request. */
17
- Replace: "REPLACE"
22
+ /**
23
+ * Named constants for how metadata is handled during a file copy.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })
28
+ * ```
29
+ */
30
+ var MetadataDirective = {
31
+ /** Preserve the source file's contentType and fileInfo. */
32
+ Copy: "COPY",
33
+ /** Use the values provided in the copy request. */
34
+ Replace: "REPLACE"
18
35
  };
19
- export {
20
- FileAction,
21
- MetadataDirective
22
- };
23
- //# sourceMappingURL=file.js.map
36
+ //#endregion
37
+ export { FileAction, MetadataDirective };
38
+
39
+ //# sourceMappingURL=file.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file.js","sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status, or null if replication is not configured. */\n readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: EncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n}\n"],"names":[],"mappings":"AAYO,MAAM,aAAa;AAAA;AAAA,EAExB,OAAO;AAAA;AAAA,EAEP,QAAQ;AAAA;AAAA,EAER,MAAM;AAAA;AAAA,EAEN,QAAQ;AAAA;AAAA,EAER,MAAM;AACR;AAqJO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,MAAM;AAAA;AAAA,EAEN,SAAS;AACX;"}
1
+ {"version":3,"file":"file.js","names":[],"sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting, PublicEncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status, or null if replication is not configured. */\n readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: PublicEncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n}\n"],"mappings":";;;;;;;;;AAYA,IAAa,aAAa;;CAExB,OAAO;;CAEP,QAAQ;;CAER,MAAM;;CAEN,QAAQ;;CAER,MAAM;AACR;;;;;;;;;AAqJA,IAAa,oBAAoB;;CAE/B,MAAM;;CAEN,SAAS;AACX"}