@backblaze-labs/b2-sdk 0.1.0 → 0.3.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 (885) hide show
  1. package/CHANGELOG.md +151 -5
  2. package/README.md +163 -34
  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/backup/client.cjs +206 -0
  44. package/dist/backup/client.cjs.map +1 -0
  45. package/dist/backup/client.d.cts +238 -0
  46. package/dist/backup/client.d.cts.map +1 -0
  47. package/dist/backup/client.d.ts +238 -0
  48. package/dist/backup/client.d.ts.map +1 -0
  49. package/dist/backup/client.js +206 -0
  50. package/dist/backup/client.js.map +1 -0
  51. package/dist/backup/index.cjs +15 -0
  52. package/dist/backup/index.d.cts +22 -0
  53. package/dist/backup/index.d.cts.map +1 -0
  54. package/dist/backup/index.d.ts +22 -0
  55. package/dist/backup/index.d.ts.map +1 -0
  56. package/dist/backup/index.js +7 -0
  57. package/dist/backup/raw.cjs +146 -0
  58. package/dist/backup/raw.cjs.map +1 -0
  59. package/dist/backup/raw.d.cts +122 -0
  60. package/dist/backup/raw.d.cts.map +1 -0
  61. package/dist/backup/raw.d.ts +122 -0
  62. package/dist/backup/raw.d.ts.map +1 -0
  63. package/dist/backup/raw.js +146 -0
  64. package/dist/backup/raw.js.map +1 -0
  65. package/dist/bucket.cjs +786 -787
  66. package/dist/bucket.cjs.map +1 -1
  67. package/dist/bucket.d.cts +35 -47
  68. package/dist/bucket.d.cts.map +1 -1
  69. package/dist/bucket.d.ts +35 -47
  70. package/dist/bucket.d.ts.map +1 -1
  71. package/dist/bucket.js +781 -782
  72. package/dist/bucket.js.map +1 -1
  73. package/dist/client.cjs +246 -228
  74. package/dist/client.cjs.map +1 -1
  75. package/dist/client.d.cts +25 -17
  76. package/dist/client.d.cts.map +1 -1
  77. package/dist/client.d.ts +25 -17
  78. package/dist/client.d.ts.map +1 -1
  79. package/dist/client.js +243 -225
  80. package/dist/client.js.map +1 -1
  81. package/dist/copy/large.cjs +116 -71
  82. package/dist/copy/large.cjs.map +1 -1
  83. package/dist/copy/large.d.cts +6 -0
  84. package/dist/copy/large.d.cts.map +1 -1
  85. package/dist/copy/large.d.ts +6 -0
  86. package/dist/copy/large.d.ts.map +1 -1
  87. package/dist/copy/large.js +114 -69
  88. package/dist/copy/large.js.map +1 -1
  89. package/dist/download/checksum.cjs +93 -0
  90. package/dist/download/checksum.cjs.map +1 -0
  91. package/dist/download/checksum.d.cts +40 -0
  92. package/dist/download/checksum.d.cts.map +1 -0
  93. package/dist/download/checksum.d.ts +40 -0
  94. package/dist/download/checksum.d.ts.map +1 -0
  95. package/dist/download/checksum.js +91 -0
  96. package/dist/download/checksum.js.map +1 -0
  97. package/dist/download/parallel.cjs +251 -118
  98. package/dist/download/parallel.cjs.map +1 -1
  99. package/dist/download/parallel.d.cts +13 -2
  100. package/dist/download/parallel.d.cts.map +1 -1
  101. package/dist/download/parallel.d.ts +13 -2
  102. package/dist/download/parallel.d.ts.map +1 -1
  103. package/dist/download/parallel.js +249 -116
  104. package/dist/download/parallel.js.map +1 -1
  105. package/dist/download/single.cjs +323 -97
  106. package/dist/download/single.cjs.map +1 -1
  107. package/dist/download/single.d.cts +6 -1
  108. package/dist/download/single.d.cts.map +1 -1
  109. package/dist/download/single.d.ts +6 -1
  110. package/dist/download/single.d.ts.map +1 -1
  111. package/dist/download/single.js +322 -99
  112. package/dist/download/single.js.map +1 -1
  113. package/dist/errors/index.cjs +869 -243
  114. package/dist/errors/index.cjs.map +1 -1
  115. package/dist/errors/index.d.cts +404 -82
  116. package/dist/errors/index.d.cts.map +1 -1
  117. package/dist/errors/index.d.ts +404 -82
  118. package/dist/errors/index.d.ts.map +1 -1
  119. package/dist/errors/index.js +835 -261
  120. package/dist/errors/index.js.map +1 -1
  121. package/dist/http/retry.cjs +45 -28
  122. package/dist/http/retry.cjs.map +1 -1
  123. package/dist/http/retry.d.cts +15 -2
  124. package/dist/http/retry.d.cts.map +1 -1
  125. package/dist/http/retry.d.ts +15 -2
  126. package/dist/http/retry.d.ts.map +1 -1
  127. package/dist/http/retry.js +46 -31
  128. package/dist/http/retry.js.map +1 -1
  129. package/dist/http/transport.cjs +476 -140
  130. package/dist/http/transport.cjs.map +1 -1
  131. package/dist/http/transport.d.cts +46 -5
  132. package/dist/http/transport.d.cts.map +1 -1
  133. package/dist/http/transport.d.ts +46 -5
  134. package/dist/http/transport.d.ts.map +1 -1
  135. package/dist/http/transport.js +474 -140
  136. package/dist/http/transport.js.map +1 -1
  137. package/dist/http/url-guard.cjs +154 -89
  138. package/dist/http/url-guard.cjs.map +1 -1
  139. package/dist/http/url-guard.d.cts +25 -3
  140. package/dist/http/url-guard.d.cts.map +1 -1
  141. package/dist/http/url-guard.d.ts +25 -3
  142. package/dist/http/url-guard.d.ts.map +1 -1
  143. package/dist/http/url-guard.js +152 -90
  144. package/dist/http/url-guard.js.map +1 -1
  145. package/dist/http/user-agent.cjs +84 -44
  146. package/dist/http/user-agent.cjs.map +1 -1
  147. package/dist/http/user-agent.js +84 -46
  148. package/dist/http/user-agent.js.map +1 -1
  149. package/dist/index.cjs +124 -77
  150. package/dist/index.d.cts +29 -21
  151. package/dist/index.d.cts.map +1 -1
  152. package/dist/index.d.ts +29 -21
  153. package/dist/index.d.ts.map +1 -1
  154. package/dist/index.js +18 -72
  155. package/dist/internal/b2-naming.cjs +66 -0
  156. package/dist/internal/b2-naming.cjs.map +1 -0
  157. package/dist/internal/b2-naming.d.cts +43 -0
  158. package/dist/internal/b2-naming.d.cts.map +1 -0
  159. package/dist/internal/b2-naming.d.ts +43 -0
  160. package/dist/internal/b2-naming.d.ts.map +1 -0
  161. package/dist/internal/b2-naming.js +60 -0
  162. package/dist/internal/b2-naming.js.map +1 -0
  163. package/dist/internal/upload-retry-options.cjs +21 -0
  164. package/dist/internal/upload-retry-options.cjs.map +1 -0
  165. package/dist/internal/upload-retry-options.d.cts +12 -0
  166. package/dist/internal/upload-retry-options.d.cts.map +1 -0
  167. package/dist/internal/upload-retry-options.d.ts +12 -0
  168. package/dist/internal/upload-retry-options.d.ts.map +1 -0
  169. package/dist/internal/upload-retry-options.js +21 -0
  170. package/dist/internal/upload-retry-options.js.map +1 -0
  171. package/dist/internal/url-redaction.cjs +31 -0
  172. package/dist/internal/url-redaction.cjs.map +1 -0
  173. package/dist/internal/url-redaction.d.cts +17 -0
  174. package/dist/internal/url-redaction.d.cts.map +1 -0
  175. package/dist/internal/url-redaction.d.ts +17 -0
  176. package/dist/internal/url-redaction.d.ts.map +1 -0
  177. package/dist/internal/url-redaction.js +31 -0
  178. package/dist/internal/url-redaction.js.map +1 -0
  179. package/dist/notifications/index.cjs +4 -6
  180. package/dist/notifications/index.d.cts +1 -1
  181. package/dist/notifications/index.d.cts.map +1 -1
  182. package/dist/notifications/index.d.ts +1 -1
  183. package/dist/notifications/index.d.ts.map +1 -1
  184. package/dist/notifications/index.js +1 -6
  185. package/dist/notifications/webhook.cjs +195 -85
  186. package/dist/notifications/webhook.cjs.map +1 -1
  187. package/dist/notifications/webhook.d.cts.map +1 -1
  188. package/dist/notifications/webhook.d.ts.map +1 -1
  189. package/dist/notifications/webhook.js +195 -87
  190. package/dist/notifications/webhook.js.map +1 -1
  191. package/dist/object.cjs +253 -210
  192. package/dist/object.cjs.map +1 -1
  193. package/dist/object.d.cts +13 -57
  194. package/dist/object.d.cts.map +1 -1
  195. package/dist/object.d.ts +13 -57
  196. package/dist/object.d.ts.map +1 -1
  197. package/dist/object.js +249 -206
  198. package/dist/object.js.map +1 -1
  199. package/dist/partner/account-info.d.cts +43 -0
  200. package/dist/partner/account-info.d.cts.map +1 -0
  201. package/dist/partner/account-info.d.ts +43 -0
  202. package/dist/partner/account-info.d.ts.map +1 -0
  203. package/dist/partner/auth-clone.cjs +64 -0
  204. package/dist/partner/auth-clone.cjs.map +1 -0
  205. package/dist/partner/auth-clone.d.cts +27 -0
  206. package/dist/partner/auth-clone.d.cts.map +1 -0
  207. package/dist/partner/auth-clone.d.ts +27 -0
  208. package/dist/partner/auth-clone.d.ts.map +1 -0
  209. package/dist/partner/auth-clone.js +63 -0
  210. package/dist/partner/auth-clone.js.map +1 -0
  211. package/dist/partner/auth-core.cjs +175 -0
  212. package/dist/partner/auth-core.cjs.map +1 -0
  213. package/dist/partner/auth-core.d.cts +111 -0
  214. package/dist/partner/auth-core.d.cts.map +1 -0
  215. package/dist/partner/auth-core.d.ts +111 -0
  216. package/dist/partner/auth-core.d.ts.map +1 -0
  217. package/dist/partner/auth-core.js +175 -0
  218. package/dist/partner/auth-core.js.map +1 -0
  219. package/dist/partner/auth-shape.cjs +36 -0
  220. package/dist/partner/auth-shape.cjs.map +1 -0
  221. package/dist/partner/auth-shape.d.cts +12 -0
  222. package/dist/partner/auth-shape.d.cts.map +1 -0
  223. package/dist/partner/auth-shape.d.ts +12 -0
  224. package/dist/partner/auth-shape.d.ts.map +1 -0
  225. package/dist/partner/auth-shape.js +36 -0
  226. package/dist/partner/auth-shape.js.map +1 -0
  227. package/dist/partner/client.cjs +255 -0
  228. package/dist/partner/client.cjs.map +1 -0
  229. package/dist/partner/client.d.cts +335 -0
  230. package/dist/partner/client.d.cts.map +1 -0
  231. package/dist/partner/client.d.ts +335 -0
  232. package/dist/partner/client.d.ts.map +1 -0
  233. package/dist/partner/client.js +255 -0
  234. package/dist/partner/client.js.map +1 -0
  235. package/dist/partner/endpoint-url.cjs +108 -0
  236. package/dist/partner/endpoint-url.cjs.map +1 -0
  237. package/dist/partner/endpoint-url.d.cts +72 -0
  238. package/dist/partner/endpoint-url.d.cts.map +1 -0
  239. package/dist/partner/endpoint-url.d.ts +72 -0
  240. package/dist/partner/endpoint-url.d.ts.map +1 -0
  241. package/dist/partner/endpoint-url.js +105 -0
  242. package/dist/partner/endpoint-url.js.map +1 -0
  243. package/dist/partner/in-memory.cjs +135 -0
  244. package/dist/partner/in-memory.cjs.map +1 -0
  245. package/dist/partner/in-memory.d.cts +99 -0
  246. package/dist/partner/in-memory.d.cts.map +1 -0
  247. package/dist/partner/in-memory.d.ts +99 -0
  248. package/dist/partner/in-memory.d.ts.map +1 -0
  249. package/dist/partner/in-memory.js +135 -0
  250. package/dist/partner/in-memory.js.map +1 -0
  251. package/dist/partner/index.cjs +18 -0
  252. package/dist/partner/index.d.cts +23 -0
  253. package/dist/partner/index.d.cts.map +1 -0
  254. package/dist/partner/index.d.ts +23 -0
  255. package/dist/partner/index.d.ts.map +1 -0
  256. package/dist/partner/index.js +7 -0
  257. package/dist/partner/raw.cjs +392 -0
  258. package/dist/partner/raw.cjs.map +1 -0
  259. package/dist/partner/raw.d.cts +223 -0
  260. package/dist/partner/raw.d.cts.map +1 -0
  261. package/dist/partner/raw.d.ts +223 -0
  262. package/dist/partner/raw.d.ts.map +1 -0
  263. package/dist/partner/raw.js +390 -0
  264. package/dist/partner/raw.js.map +1 -0
  265. package/dist/partner/redaction-placeholders.cjs +10 -0
  266. package/dist/partner/redaction-placeholders.cjs.map +1 -0
  267. package/dist/partner/redaction-placeholders.d.cts +5 -0
  268. package/dist/partner/redaction-placeholders.d.cts.map +1 -0
  269. package/dist/partner/redaction-placeholders.d.ts +5 -0
  270. package/dist/partner/redaction-placeholders.d.ts.map +1 -0
  271. package/dist/partner/redaction-placeholders.js +9 -0
  272. package/dist/partner/redaction-placeholders.js.map +1 -0
  273. package/dist/partner/redaction.cjs +267 -0
  274. package/dist/partner/redaction.cjs.map +1 -0
  275. package/dist/partner/redaction.d.cts +124 -0
  276. package/dist/partner/redaction.d.cts.map +1 -0
  277. package/dist/partner/redaction.d.ts +124 -0
  278. package/dist/partner/redaction.d.ts.map +1 -0
  279. package/dist/partner/redaction.js +257 -0
  280. package/dist/partner/redaction.js.map +1 -0
  281. package/dist/raw/encoding.cjs +74 -35
  282. package/dist/raw/encoding.cjs.map +1 -1
  283. package/dist/raw/encoding.js +74 -38
  284. package/dist/raw/encoding.js.map +1 -1
  285. package/dist/raw/index.cjs +740 -587
  286. package/dist/raw/index.cjs.map +1 -1
  287. package/dist/raw/index.d.cts +126 -19
  288. package/dist/raw/index.d.cts.map +1 -1
  289. package/dist/raw/index.d.ts +126 -19
  290. package/dist/raw/index.d.ts.map +1 -1
  291. package/dist/raw/index.js +736 -589
  292. package/dist/raw/index.js.map +1 -1
  293. package/dist/raw/url.cjs +111 -0
  294. package/dist/raw/url.cjs.map +1 -0
  295. package/dist/raw/url.d.cts +41 -0
  296. package/dist/raw/url.d.cts.map +1 -0
  297. package/dist/raw/url.d.ts +41 -0
  298. package/dist/raw/url.d.ts.map +1 -0
  299. package/dist/raw/url.js +110 -0
  300. package/dist/raw/url.js.map +1 -0
  301. package/dist/s3/index.cjs +355 -18
  302. package/dist/s3/index.cjs.map +1 -1
  303. package/dist/s3/index.d.cts +233 -5
  304. package/dist/s3/index.d.cts.map +1 -1
  305. package/dist/s3/index.d.ts +233 -5
  306. package/dist/s3/index.d.ts.map +1 -1
  307. package/dist/s3/index.js +351 -22
  308. package/dist/s3/index.js.map +1 -1
  309. package/dist/s3/sigv4.cjs +154 -0
  310. package/dist/s3/sigv4.cjs.map +1 -0
  311. package/dist/s3/sigv4.d.cts +43 -0
  312. package/dist/s3/sigv4.d.cts.map +1 -0
  313. package/dist/s3/sigv4.d.ts +43 -0
  314. package/dist/s3/sigv4.d.ts.map +1 -0
  315. package/dist/s3/sigv4.js +153 -0
  316. package/dist/s3/sigv4.js.map +1 -0
  317. package/dist/s3/validation.cjs +69 -0
  318. package/dist/s3/validation.cjs.map +1 -0
  319. package/dist/s3/validation.d.cts +43 -0
  320. package/dist/s3/validation.d.cts.map +1 -0
  321. package/dist/s3/validation.d.ts +43 -0
  322. package/dist/s3/validation.d.ts.map +1 -0
  323. package/dist/s3/validation.js +66 -0
  324. package/dist/s3/validation.js.map +1 -0
  325. package/dist/simulator/capabilities.cjs +63 -48
  326. package/dist/simulator/capabilities.cjs.map +1 -1
  327. package/dist/simulator/capabilities.js +63 -49
  328. package/dist/simulator/capabilities.js.map +1 -1
  329. package/dist/simulator/index.cjs +3114 -1547
  330. package/dist/simulator/index.cjs.map +1 -1
  331. package/dist/simulator/index.d.cts +186 -20
  332. package/dist/simulator/index.d.cts.map +1 -1
  333. package/dist/simulator/index.d.ts +186 -20
  334. package/dist/simulator/index.d.ts.map +1 -1
  335. package/dist/simulator/index.js +3098 -1545
  336. package/dist/simulator/index.js.map +1 -1
  337. package/dist/simulator/partner.cjs +719 -0
  338. package/dist/simulator/partner.cjs.map +1 -0
  339. package/dist/simulator/partner.d.cts +183 -0
  340. package/dist/simulator/partner.d.cts.map +1 -0
  341. package/dist/simulator/partner.d.ts +183 -0
  342. package/dist/simulator/partner.d.ts.map +1 -0
  343. package/dist/simulator/partner.js +718 -0
  344. package/dist/simulator/partner.js.map +1 -0
  345. package/dist/simulator/validation.cjs +772 -157
  346. package/dist/simulator/validation.cjs.map +1 -1
  347. package/dist/simulator/validation.d.cts +120 -21
  348. package/dist/simulator/validation.d.cts.map +1 -1
  349. package/dist/simulator/validation.d.ts +120 -21
  350. package/dist/simulator/validation.d.ts.map +1 -1
  351. package/dist/simulator/validation.js +755 -167
  352. package/dist/simulator/validation.js.map +1 -1
  353. package/dist/streams/collect.cjs +74 -24
  354. package/dist/streams/collect.cjs.map +1 -1
  355. package/dist/streams/collect.d.cts +14 -1
  356. package/dist/streams/collect.d.cts.map +1 -1
  357. package/dist/streams/collect.d.ts +14 -1
  358. package/dist/streams/collect.d.ts.map +1 -1
  359. package/dist/streams/collect.js +74 -25
  360. package/dist/streams/collect.js.map +1 -1
  361. package/dist/streams/file-source.cjs +287 -0
  362. package/dist/streams/file-source.cjs.map +1 -0
  363. package/dist/streams/file-source.d.cts +96 -0
  364. package/dist/streams/file-source.d.cts.map +1 -0
  365. package/dist/streams/file-source.d.ts +96 -0
  366. package/dist/streams/file-source.d.ts.map +1 -0
  367. package/dist/streams/file-source.js +286 -0
  368. package/dist/streams/file-source.js.map +1 -0
  369. package/dist/streams/hash.cjs +207 -115
  370. package/dist/streams/hash.cjs.map +1 -1
  371. package/dist/streams/hash.d.cts +5 -4
  372. package/dist/streams/hash.d.cts.map +1 -1
  373. package/dist/streams/hash.d.ts +5 -4
  374. package/dist/streams/hash.d.ts.map +1 -1
  375. package/dist/streams/hash.js +208 -95
  376. package/dist/streams/hash.js.map +1 -1
  377. package/dist/streams/index.cjs +12 -12
  378. package/dist/streams/index.d.cts +3 -3
  379. package/dist/streams/index.d.cts.map +1 -1
  380. package/dist/streams/index.d.ts +3 -3
  381. package/dist/streams/index.d.ts.map +1 -1
  382. package/dist/streams/index.js +3 -11
  383. package/dist/streams/progress.cjs +60 -46
  384. package/dist/streams/progress.cjs.map +1 -1
  385. package/dist/streams/progress.js +60 -46
  386. package/dist/streams/progress.js.map +1 -1
  387. package/dist/streams/source.cjs +317 -146
  388. package/dist/streams/source.cjs.map +1 -1
  389. package/dist/streams/source.d.cts +56 -18
  390. package/dist/streams/source.d.cts.map +1 -1
  391. package/dist/streams/source.d.ts +56 -18
  392. package/dist/streams/source.d.ts.map +1 -1
  393. package/dist/streams/source.js +313 -149
  394. package/dist/streams/source.js.map +1 -1
  395. package/dist/sync/actions/index.cjs +236 -184
  396. package/dist/sync/actions/index.cjs.map +1 -1
  397. package/dist/sync/actions/index.d.cts +29 -21
  398. package/dist/sync/actions/index.d.cts.map +1 -1
  399. package/dist/sync/actions/index.d.ts +29 -21
  400. package/dist/sync/actions/index.d.ts.map +1 -1
  401. package/dist/sync/actions/index.js +236 -190
  402. package/dist/sync/actions/index.js.map +1 -1
  403. package/dist/sync/b2-sha1-reader.cjs +152 -0
  404. package/dist/sync/b2-sha1-reader.cjs.map +1 -0
  405. package/dist/sync/b2-sha1-reader.d.cts +58 -0
  406. package/dist/sync/b2-sha1-reader.d.cts.map +1 -0
  407. package/dist/sync/b2-sha1-reader.d.ts +58 -0
  408. package/dist/sync/b2-sha1-reader.d.ts.map +1 -0
  409. package/dist/sync/b2-sha1-reader.js +149 -0
  410. package/dist/sync/b2-sha1-reader.js.map +1 -0
  411. package/dist/sync/download-staging.cjs +266 -0
  412. package/dist/sync/download-staging.cjs.map +1 -0
  413. package/dist/sync/download-staging.d.cts +55 -0
  414. package/dist/sync/download-staging.d.cts.map +1 -0
  415. package/dist/sync/download-staging.d.ts +55 -0
  416. package/dist/sync/download-staging.d.ts.map +1 -0
  417. package/dist/sync/download-staging.js +260 -0
  418. package/dist/sync/download-staging.js.map +1 -0
  419. package/dist/sync/filesystem-errors.cjs +32 -0
  420. package/dist/sync/filesystem-errors.cjs.map +1 -0
  421. package/dist/sync/filesystem-errors.d.cts +8 -0
  422. package/dist/sync/filesystem-errors.d.cts.map +1 -0
  423. package/dist/sync/filesystem-errors.d.ts +8 -0
  424. package/dist/sync/filesystem-errors.d.ts.map +1 -0
  425. package/dist/sync/filesystem-errors.js +32 -0
  426. package/dist/sync/filesystem-errors.js.map +1 -0
  427. package/dist/sync/filters.cjs +217 -0
  428. package/dist/sync/filters.cjs.map +1 -0
  429. package/dist/sync/filters.d.cts +51 -0
  430. package/dist/sync/filters.d.cts.map +1 -0
  431. package/dist/sync/filters.d.ts +51 -0
  432. package/dist/sync/filters.d.ts.map +1 -0
  433. package/dist/sync/filters.js +213 -0
  434. package/dist/sync/filters.js.map +1 -0
  435. package/dist/sync/index.cjs +39 -22
  436. package/dist/sync/index.d.cts +14 -9
  437. package/dist/sync/index.d.cts.map +1 -1
  438. package/dist/sync/index.d.ts +14 -9
  439. package/dist/sync/index.d.ts.map +1 -1
  440. package/dist/sync/index.js +9 -20
  441. package/dist/sync/local-file-identity.cjs +61 -0
  442. package/dist/sync/local-file-identity.cjs.map +1 -0
  443. package/dist/sync/local-file-identity.d.cts +37 -0
  444. package/dist/sync/local-file-identity.d.cts.map +1 -0
  445. package/dist/sync/local-file-identity.d.ts +37 -0
  446. package/dist/sync/local-file-identity.d.ts.map +1 -0
  447. package/dist/sync/local-file-identity.js +60 -0
  448. package/dist/sync/local-file-identity.js.map +1 -0
  449. package/dist/sync/local-file-io.cjs +369 -0
  450. package/dist/sync/local-file-io.cjs.map +1 -0
  451. package/dist/sync/local-file-io.d.cts +76 -0
  452. package/dist/sync/local-file-io.d.cts.map +1 -0
  453. package/dist/sync/local-file-io.d.ts +76 -0
  454. package/dist/sync/local-file-io.d.ts.map +1 -0
  455. package/dist/sync/local-file-io.js +365 -0
  456. package/dist/sync/local-file-io.js.map +1 -0
  457. package/dist/sync/local-filesystem-root.cjs +27 -0
  458. package/dist/sync/local-filesystem-root.cjs.map +1 -0
  459. package/dist/sync/local-filesystem-root.d.cts +18 -0
  460. package/dist/sync/local-filesystem-root.d.cts.map +1 -0
  461. package/dist/sync/local-filesystem-root.d.ts +18 -0
  462. package/dist/sync/local-filesystem-root.d.ts.map +1 -0
  463. package/dist/sync/local-filesystem-root.js +26 -0
  464. package/dist/sync/local-filesystem-root.js.map +1 -0
  465. package/dist/sync/local-sha1.cjs +110 -0
  466. package/dist/sync/local-sha1.cjs.map +1 -0
  467. package/dist/sync/local-sha1.d.cts +31 -0
  468. package/dist/sync/local-sha1.d.cts.map +1 -0
  469. package/dist/sync/local-sha1.d.ts +31 -0
  470. package/dist/sync/local-sha1.d.ts.map +1 -0
  471. package/dist/sync/local-sha1.js +109 -0
  472. package/dist/sync/local-sha1.js.map +1 -0
  473. package/dist/sync/pairing.cjs +118 -29
  474. package/dist/sync/pairing.cjs.map +1 -1
  475. package/dist/sync/pairing.d.cts +7 -2
  476. package/dist/sync/pairing.d.cts.map +1 -1
  477. package/dist/sync/pairing.d.ts +7 -2
  478. package/dist/sync/pairing.d.ts.map +1 -1
  479. package/dist/sync/pairing.js +120 -31
  480. package/dist/sync/pairing.js.map +1 -1
  481. package/dist/sync/path-order.cjs +30 -0
  482. package/dist/sync/path-order.cjs.map +1 -0
  483. package/dist/sync/path-order.d.cts +28 -0
  484. package/dist/sync/path-order.d.cts.map +1 -0
  485. package/dist/sync/path-order.d.ts +28 -0
  486. package/dist/sync/path-order.d.ts.map +1 -0
  487. package/dist/sync/path-order.js +29 -0
  488. package/dist/sync/path-order.js.map +1 -0
  489. package/dist/sync/path-safety.cjs +111 -0
  490. package/dist/sync/path-safety.cjs.map +1 -0
  491. package/dist/sync/path-safety.d.cts +78 -0
  492. package/dist/sync/path-safety.d.cts.map +1 -0
  493. package/dist/sync/path-safety.d.ts +78 -0
  494. package/dist/sync/path-safety.d.ts.map +1 -0
  495. package/dist/sync/path-safety.js +105 -0
  496. package/dist/sync/path-safety.js.map +1 -0
  497. package/dist/sync/paths.d.cts +19 -0
  498. package/dist/sync/paths.d.cts.map +1 -0
  499. package/dist/sync/paths.d.ts +19 -0
  500. package/dist/sync/paths.d.ts.map +1 -0
  501. package/dist/sync/policies/compare.cjs +391 -11
  502. package/dist/sync/policies/compare.cjs.map +1 -1
  503. package/dist/sync/policies/compare.d.cts +100 -2
  504. package/dist/sync/policies/compare.d.cts.map +1 -1
  505. package/dist/sync/policies/compare.d.ts +100 -2
  506. package/dist/sync/policies/compare.d.ts.map +1 -1
  507. package/dist/sync/policies/compare.js +389 -13
  508. package/dist/sync/policies/compare.js.map +1 -1
  509. package/dist/sync/policies/index.cjs +70 -65
  510. package/dist/sync/policies/index.cjs.map +1 -1
  511. package/dist/sync/policies/index.d.cts +35 -6
  512. package/dist/sync/policies/index.d.cts.map +1 -1
  513. package/dist/sync/policies/index.d.ts +35 -6
  514. package/dist/sync/policies/index.d.ts.map +1 -1
  515. package/dist/sync/policies/index.js +70 -65
  516. package/dist/sync/policies/index.js.map +1 -1
  517. package/dist/sync/prefix.cjs +96 -0
  518. package/dist/sync/prefix.cjs.map +1 -0
  519. package/dist/sync/prefix.d.cts +55 -0
  520. package/dist/sync/prefix.d.cts.map +1 -0
  521. package/dist/sync/prefix.d.ts +55 -0
  522. package/dist/sync/prefix.d.ts.map +1 -0
  523. package/dist/sync/prefix.js +92 -0
  524. package/dist/sync/prefix.js.map +1 -0
  525. package/dist/sync/regexp-safety.cjs +192 -0
  526. package/dist/sync/regexp-safety.cjs.map +1 -0
  527. package/dist/sync/regexp-safety.d.cts +29 -0
  528. package/dist/sync/regexp-safety.d.cts.map +1 -0
  529. package/dist/sync/regexp-safety.d.ts +29 -0
  530. package/dist/sync/regexp-safety.d.ts.map +1 -0
  531. package/dist/sync/regexp-safety.js +190 -0
  532. package/dist/sync/regexp-safety.js.map +1 -0
  533. package/dist/sync/scan-events.cjs +33 -0
  534. package/dist/sync/scan-events.cjs.map +1 -0
  535. package/dist/sync/scan-events.d.cts +17 -0
  536. package/dist/sync/scan-events.d.cts.map +1 -0
  537. package/dist/sync/scan-events.d.ts +17 -0
  538. package/dist/sync/scan-events.d.ts.map +1 -0
  539. package/dist/sync/scan-events.js +32 -0
  540. package/dist/sync/scan-events.js.map +1 -0
  541. package/dist/sync/scan-limit.cjs +33 -0
  542. package/dist/sync/scan-limit.cjs.map +1 -0
  543. package/dist/sync/scan-limit.d.cts +21 -0
  544. package/dist/sync/scan-limit.d.cts.map +1 -0
  545. package/dist/sync/scan-limit.d.ts +21 -0
  546. package/dist/sync/scan-limit.d.ts.map +1 -0
  547. package/dist/sync/scan-limit.js +31 -0
  548. package/dist/sync/scan-limit.js.map +1 -0
  549. package/dist/sync/scanners/b2.cjs +239 -55
  550. package/dist/sync/scanners/b2.cjs.map +1 -1
  551. package/dist/sync/scanners/b2.d.cts +26 -7
  552. package/dist/sync/scanners/b2.d.cts.map +1 -1
  553. package/dist/sync/scanners/b2.d.ts +26 -7
  554. package/dist/sync/scanners/b2.d.ts.map +1 -1
  555. package/dist/sync/scanners/b2.js +239 -55
  556. package/dist/sync/scanners/b2.js.map +1 -1
  557. package/dist/sync/scanners/local.cjs +215 -56
  558. package/dist/sync/scanners/local.cjs.map +1 -1
  559. package/dist/sync/scanners/local.d.cts +22 -7
  560. package/dist/sync/scanners/local.d.cts.map +1 -1
  561. package/dist/sync/scanners/local.d.ts +22 -7
  562. package/dist/sync/scanners/local.d.ts.map +1 -1
  563. package/dist/sync/scanners/local.js +216 -57
  564. package/dist/sync/scanners/local.js.map +1 -1
  565. package/dist/sync/sha1-metadata.cjs +94 -0
  566. package/dist/sync/sha1-metadata.cjs.map +1 -0
  567. package/dist/sync/sha1-metadata.d.cts +82 -0
  568. package/dist/sync/sha1-metadata.d.cts.map +1 -0
  569. package/dist/sync/sha1-metadata.d.ts +82 -0
  570. package/dist/sync/sha1-metadata.d.ts.map +1 -0
  571. package/dist/sync/sha1-metadata.js +89 -0
  572. package/dist/sync/sha1-metadata.js.map +1 -0
  573. package/dist/sync/sha1-options.cjs +23 -0
  574. package/dist/sync/sha1-options.cjs.map +1 -0
  575. package/dist/sync/sha1-options.d.cts +14 -0
  576. package/dist/sync/sha1-options.d.cts.map +1 -0
  577. package/dist/sync/sha1-options.d.ts +14 -0
  578. package/dist/sync/sha1-options.d.ts.map +1 -0
  579. package/dist/sync/sha1-options.js +21 -0
  580. package/dist/sync/sha1-options.js.map +1 -0
  581. package/dist/sync/synchronizer.cjs +783 -197
  582. package/dist/sync/synchronizer.cjs.map +1 -1
  583. package/dist/sync/synchronizer.d.cts +47 -1
  584. package/dist/sync/synchronizer.d.cts.map +1 -1
  585. package/dist/sync/synchronizer.d.ts +47 -1
  586. package/dist/sync/synchronizer.d.ts.map +1 -1
  587. package/dist/sync/synchronizer.js +780 -173
  588. package/dist/sync/synchronizer.js.map +1 -1
  589. package/dist/sync/types.d.cts +208 -16
  590. package/dist/sync/types.d.cts.map +1 -1
  591. package/dist/sync/types.d.ts +208 -16
  592. package/dist/sync/types.d.ts.map +1 -1
  593. package/dist/types/auth.cjs +80 -56
  594. package/dist/types/auth.cjs.map +1 -1
  595. package/dist/types/auth.d.cts +71 -9
  596. package/dist/types/auth.d.cts.map +1 -1
  597. package/dist/types/auth.d.ts +71 -9
  598. package/dist/types/auth.d.ts.map +1 -1
  599. package/dist/types/auth.js +81 -57
  600. package/dist/types/auth.js.map +1 -1
  601. package/dist/types/backup.d.cts +80 -0
  602. package/dist/types/backup.d.cts.map +1 -0
  603. package/dist/types/backup.d.ts +80 -0
  604. package/dist/types/backup.d.ts.map +1 -0
  605. package/dist/types/bucket.cjs +74 -38
  606. package/dist/types/bucket.cjs.map +1 -1
  607. package/dist/types/bucket.d.cts +4 -2
  608. package/dist/types/bucket.d.cts.map +1 -1
  609. package/dist/types/bucket.d.ts +4 -2
  610. package/dist/types/bucket.d.ts.map +1 -1
  611. package/dist/types/bucket.js +75 -41
  612. package/dist/types/bucket.js.map +1 -1
  613. package/dist/types/download.cjs +62 -0
  614. package/dist/types/download.cjs.map +1 -0
  615. package/dist/types/download.d.cts +98 -0
  616. package/dist/types/download.d.cts.map +1 -1
  617. package/dist/types/download.d.ts +98 -0
  618. package/dist/types/download.d.ts.map +1 -1
  619. package/dist/types/download.js +61 -0
  620. package/dist/types/download.js.map +1 -0
  621. package/dist/types/encryption.cjs +194 -328
  622. package/dist/types/encryption.cjs.map +1 -1
  623. package/dist/types/encryption.d.cts +48 -0
  624. package/dist/types/encryption.d.cts.map +1 -1
  625. package/dist/types/encryption.d.ts +48 -0
  626. package/dist/types/encryption.d.ts.map +1 -1
  627. package/dist/types/encryption.js +192 -311
  628. package/dist/types/encryption.js.map +1 -1
  629. package/dist/types/errors.cjs +56 -0
  630. package/dist/types/errors.cjs.map +1 -0
  631. package/dist/types/errors.d.cts +13 -4
  632. package/dist/types/errors.d.cts.map +1 -1
  633. package/dist/types/errors.d.ts +13 -4
  634. package/dist/types/errors.d.ts.map +1 -1
  635. package/dist/types/errors.js +56 -0
  636. package/dist/types/errors.js.map +1 -0
  637. package/dist/types/file.cjs +36 -19
  638. package/dist/types/file.cjs.map +1 -1
  639. package/dist/types/file.d.cts +17 -4
  640. package/dist/types/file.d.cts.map +1 -1
  641. package/dist/types/file.d.ts +17 -4
  642. package/dist/types/file.d.ts.map +1 -1
  643. package/dist/types/file.js +37 -21
  644. package/dist/types/file.js.map +1 -1
  645. package/dist/types/ids.cjs +83 -9
  646. package/dist/types/ids.cjs.map +1 -1
  647. package/dist/types/ids.d.cts +32 -0
  648. package/dist/types/ids.d.cts.map +1 -1
  649. package/dist/types/ids.d.ts +32 -0
  650. package/dist/types/ids.d.ts.map +1 -1
  651. package/dist/types/ids.js +82 -16
  652. package/dist/types/ids.js.map +1 -1
  653. package/dist/types/index.d.cts +18 -13
  654. package/dist/types/index.d.cts.map +1 -1
  655. package/dist/types/index.d.ts +18 -13
  656. package/dist/types/index.d.ts.map +1 -1
  657. package/dist/types/key.d.cts +44 -8
  658. package/dist/types/key.d.cts.map +1 -1
  659. package/dist/types/key.d.ts +44 -8
  660. package/dist/types/key.d.ts.map +1 -1
  661. package/dist/types/lock.cjs +33 -13
  662. package/dist/types/lock.cjs.map +1 -1
  663. package/dist/types/lock.d.cts +14 -0
  664. package/dist/types/lock.d.cts.map +1 -1
  665. package/dist/types/lock.d.ts +14 -0
  666. package/dist/types/lock.d.ts.map +1 -1
  667. package/dist/types/lock.js +34 -15
  668. package/dist/types/lock.js.map +1 -1
  669. package/dist/types/notifications.cjs +44 -22
  670. package/dist/types/notifications.cjs.map +1 -1
  671. package/dist/types/notifications.d.cts +5 -3
  672. package/dist/types/notifications.d.cts.map +1 -1
  673. package/dist/types/notifications.d.ts +5 -3
  674. package/dist/types/notifications.d.ts.map +1 -1
  675. package/dist/types/notifications.js +45 -23
  676. package/dist/types/notifications.js.map +1 -1
  677. package/dist/types/partner.cjs +32 -0
  678. package/dist/types/partner.cjs.map +1 -0
  679. package/dist/types/partner.d.cts +394 -0
  680. package/dist/types/partner.d.cts.map +1 -0
  681. package/dist/types/partner.d.ts +394 -0
  682. package/dist/types/partner.d.ts.map +1 -0
  683. package/dist/types/partner.js +29 -0
  684. package/dist/types/partner.js.map +1 -0
  685. package/dist/types/upload.d.cts +53 -6
  686. package/dist/types/upload.d.cts.map +1 -1
  687. package/dist/types/upload.d.ts +53 -6
  688. package/dist/types/upload.d.ts.map +1 -1
  689. package/dist/upload/abort-scope.cjs +46 -0
  690. package/dist/upload/abort-scope.cjs.map +1 -0
  691. package/dist/upload/abort-scope.d.cts +26 -0
  692. package/dist/upload/abort-scope.d.cts.map +1 -0
  693. package/dist/upload/abort-scope.d.ts +26 -0
  694. package/dist/upload/abort-scope.d.ts.map +1 -0
  695. package/dist/upload/abort-scope.js +45 -0
  696. package/dist/upload/abort-scope.js.map +1 -0
  697. package/dist/upload/cancel.cjs +183 -8
  698. package/dist/upload/cancel.cjs.map +1 -1
  699. package/dist/upload/cancel.d.cts +110 -2
  700. package/dist/upload/cancel.d.cts.map +1 -1
  701. package/dist/upload/cancel.d.ts +110 -2
  702. package/dist/upload/cancel.d.ts.map +1 -1
  703. package/dist/upload/cancel.js +178 -9
  704. package/dist/upload/cancel.js.map +1 -1
  705. package/dist/upload/concurrency.cjs +79 -52
  706. package/dist/upload/concurrency.cjs.map +1 -1
  707. package/dist/upload/concurrency.js +79 -53
  708. package/dist/upload/concurrency.js.map +1 -1
  709. package/dist/upload/finish.cjs +54 -0
  710. package/dist/upload/finish.cjs.map +1 -0
  711. package/dist/upload/finish.d.cts +26 -0
  712. package/dist/upload/finish.d.cts.map +1 -0
  713. package/dist/upload/finish.d.ts +26 -0
  714. package/dist/upload/finish.d.ts.map +1 -0
  715. package/dist/upload/finish.js +54 -0
  716. package/dist/upload/finish.js.map +1 -0
  717. package/dist/upload/large.cjs +305 -218
  718. package/dist/upload/large.cjs.map +1 -1
  719. package/dist/upload/large.d.cts +90 -9
  720. package/dist/upload/large.d.cts.map +1 -1
  721. package/dist/upload/large.d.ts +90 -9
  722. package/dist/upload/large.d.ts.map +1 -1
  723. package/dist/upload/large.js +305 -218
  724. package/dist/upload/large.js.map +1 -1
  725. package/dist/upload/options.cjs +28 -0
  726. package/dist/upload/options.cjs.map +1 -0
  727. package/dist/upload/options.d.cts +116 -0
  728. package/dist/upload/options.d.cts.map +1 -0
  729. package/dist/upload/options.d.ts +116 -0
  730. package/dist/upload/options.d.ts.map +1 -0
  731. package/dist/upload/options.js +27 -0
  732. package/dist/upload/options.js.map +1 -0
  733. package/dist/upload/resume.cjs +334 -33
  734. package/dist/upload/resume.cjs.map +1 -1
  735. package/dist/upload/resume.d.cts +84 -12
  736. package/dist/upload/resume.d.cts.map +1 -1
  737. package/dist/upload/resume.d.ts +84 -12
  738. package/dist/upload/resume.d.ts.map +1 -1
  739. package/dist/upload/resume.js +331 -33
  740. package/dist/upload/resume.js.map +1 -1
  741. package/dist/upload/retry.cjs +191 -0
  742. package/dist/upload/retry.cjs.map +1 -0
  743. package/dist/upload/retry.d.cts +127 -0
  744. package/dist/upload/retry.d.cts.map +1 -0
  745. package/dist/upload/retry.d.ts +127 -0
  746. package/dist/upload/retry.d.ts.map +1 -0
  747. package/dist/upload/retry.js +187 -0
  748. package/dist/upload/retry.js.map +1 -0
  749. package/dist/upload/single.cjs +69 -44
  750. package/dist/upload/single.cjs.map +1 -1
  751. package/dist/upload/single.d.cts +8 -1
  752. package/dist/upload/single.d.cts.map +1 -1
  753. package/dist/upload/single.d.ts +8 -1
  754. package/dist/upload/single.d.ts.map +1 -1
  755. package/dist/upload/single.js +69 -44
  756. package/dist/upload/single.js.map +1 -1
  757. package/dist/upload/stream.cjs +319 -193
  758. package/dist/upload/stream.cjs.map +1 -1
  759. package/dist/upload/stream.d.cts +9 -1
  760. package/dist/upload/stream.d.cts.map +1 -1
  761. package/dist/upload/stream.d.ts +9 -1
  762. package/dist/upload/stream.d.ts.map +1 -1
  763. package/dist/upload/stream.js +318 -192
  764. package/dist/upload/stream.js.map +1 -1
  765. package/dist/util/abort.cjs +114 -0
  766. package/dist/util/abort.cjs.map +1 -0
  767. package/dist/util/abort.d.cts +65 -0
  768. package/dist/util/abort.d.cts.map +1 -0
  769. package/dist/util/abort.d.ts +65 -0
  770. package/dist/util/abort.d.ts.map +1 -0
  771. package/dist/util/abort.js +109 -0
  772. package/dist/util/abort.js.map +1 -0
  773. package/dist/util/best-effort.cjs +42 -8
  774. package/dist/util/best-effort.cjs.map +1 -1
  775. package/dist/util/best-effort.d.cts +2 -1
  776. package/dist/util/best-effort.d.cts.map +1 -1
  777. package/dist/util/best-effort.d.ts +2 -1
  778. package/dist/util/best-effort.d.ts.map +1 -1
  779. package/dist/util/best-effort.js +43 -9
  780. package/dist/util/best-effort.js.map +1 -1
  781. package/dist/util/bytes.cjs +23 -0
  782. package/dist/util/bytes.cjs.map +1 -0
  783. package/dist/util/bytes.d.cts +15 -0
  784. package/dist/util/bytes.d.cts.map +1 -0
  785. package/dist/util/bytes.d.ts +15 -0
  786. package/dist/util/bytes.d.ts.map +1 -0
  787. package/dist/util/bytes.js +23 -0
  788. package/dist/util/bytes.js.map +1 -0
  789. package/dist/util/crypto.cjs +68 -0
  790. package/dist/util/crypto.cjs.map +1 -0
  791. package/dist/util/crypto.d.cts +26 -0
  792. package/dist/util/crypto.d.cts.map +1 -0
  793. package/dist/util/crypto.d.ts +26 -0
  794. package/dist/util/crypto.d.ts.map +1 -0
  795. package/dist/util/crypto.js +66 -0
  796. package/dist/util/crypto.js.map +1 -0
  797. package/dist/util/defaults.cjs +28 -9
  798. package/dist/util/defaults.cjs.map +1 -1
  799. package/dist/util/defaults.d.cts +2 -0
  800. package/dist/util/defaults.d.cts.map +1 -1
  801. package/dist/util/defaults.d.ts +2 -0
  802. package/dist/util/defaults.d.ts.map +1 -1
  803. package/dist/util/defaults.js +28 -11
  804. package/dist/util/defaults.js.map +1 -1
  805. package/dist/util/error-reason.cjs +41 -0
  806. package/dist/util/error-reason.cjs.map +1 -0
  807. package/dist/util/error-reason.d.cts +9 -0
  808. package/dist/util/error-reason.d.cts.map +1 -0
  809. package/dist/util/error-reason.d.ts +9 -0
  810. package/dist/util/error-reason.d.ts.map +1 -0
  811. package/dist/util/error-reason.js +41 -0
  812. package/dist/util/error-reason.js.map +1 -0
  813. package/dist/util/http.cjs +23 -0
  814. package/dist/util/http.cjs.map +1 -0
  815. package/dist/util/http.d.cts +13 -0
  816. package/dist/util/http.d.cts.map +1 -0
  817. package/dist/util/http.d.ts +13 -0
  818. package/dist/util/http.d.ts.map +1 -0
  819. package/dist/util/http.js +23 -0
  820. package/dist/util/http.js.map +1 -0
  821. package/dist/util/md5.cjs +211 -0
  822. package/dist/util/md5.cjs.map +1 -0
  823. package/dist/util/md5.d.cts +43 -0
  824. package/dist/util/md5.d.cts.map +1 -0
  825. package/dist/util/md5.d.ts +43 -0
  826. package/dist/util/md5.d.ts.map +1 -0
  827. package/dist/util/md5.js +209 -0
  828. package/dist/util/md5.js.map +1 -0
  829. package/dist/util/normalize.cjs +66 -7
  830. package/dist/util/normalize.cjs.map +1 -1
  831. package/dist/util/normalize.d.cts +7 -7
  832. package/dist/util/normalize.d.cts.map +1 -1
  833. package/dist/util/normalize.d.ts +7 -7
  834. package/dist/util/normalize.d.ts.map +1 -1
  835. package/dist/util/normalize.js +67 -10
  836. package/dist/util/normalize.js.map +1 -1
  837. package/dist/util/paginator.cjs +69 -14
  838. package/dist/util/paginator.cjs.map +1 -1
  839. package/dist/util/paginator.d.cts +3 -1
  840. package/dist/util/paginator.d.cts.map +1 -1
  841. package/dist/util/paginator.d.ts +3 -1
  842. package/dist/util/paginator.d.ts.map +1 -1
  843. package/dist/util/paginator.js +70 -16
  844. package/dist/util/paginator.js.map +1 -1
  845. package/dist/util/plan-ranges.cjs +47 -22
  846. package/dist/util/plan-ranges.cjs.map +1 -1
  847. package/dist/util/plan-ranges.js +48 -24
  848. package/dist/util/plan-ranges.js.map +1 -1
  849. package/dist/util/sha1.cjs +27 -0
  850. package/dist/util/sha1.cjs.map +1 -0
  851. package/dist/util/sha1.d.cts +17 -0
  852. package/dist/util/sha1.d.cts.map +1 -0
  853. package/dist/util/sha1.d.ts +17 -0
  854. package/dist/util/sha1.d.ts.map +1 -0
  855. package/dist/util/sha1.js +26 -0
  856. package/dist/util/sha1.js.map +1 -0
  857. package/dist/util/text-codec.cjs +29 -5
  858. package/dist/util/text-codec.cjs.map +1 -1
  859. package/dist/util/text-codec.js +30 -7
  860. package/dist/util/text-codec.js.map +1 -1
  861. package/dist/util/to-error.cjs +18 -4
  862. package/dist/util/to-error.cjs.map +1 -1
  863. package/dist/util/to-error.js +19 -5
  864. package/dist/util/to-error.js.map +1 -1
  865. package/dist/version.cjs +17 -5
  866. package/dist/version.cjs.map +1 -1
  867. package/dist/version.d.cts +3 -3
  868. package/dist/version.d.ts +3 -3
  869. package/dist/version.js +19 -6
  870. package/dist/version.js.map +1 -1
  871. package/package.json +45 -20
  872. package/dist/auth/index.cjs.map +0 -1
  873. package/dist/auth/index.js.map +0 -1
  874. package/dist/index.cjs.map +0 -1
  875. package/dist/index.js.map +0 -1
  876. package/dist/notifications/index.cjs.map +0 -1
  877. package/dist/notifications/index.js.map +0 -1
  878. package/dist/package.json.cjs +0 -9
  879. package/dist/package.json.cjs.map +0 -1
  880. package/dist/package.json.js +0 -9
  881. package/dist/package.json.js.map +0 -1
  882. package/dist/streams/index.cjs.map +0 -1
  883. package/dist/streams/index.js.map +0 -1
  884. package/dist/sync/index.cjs.map +0 -1
  885. package/dist/sync/index.js.map +0 -1
package/README.md CHANGED
@@ -4,13 +4,13 @@
4
4
  [![API Docs](https://github.com/backblaze-labs/b2-sdk-typescript/actions/workflows/docs.yml/badge.svg)](https://backblaze-labs.github.io/b2-sdk-typescript/)
5
5
  [![npm](https://img.shields.io/npm/v/@backblaze-labs/b2-sdk?color=cb3837)](https://www.npmjs.com/package/@backblaze-labs/b2-sdk)
6
6
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178c6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
8
- [![Node.js](https://img.shields.io/badge/Node.js-%E2%89%A522-339933?logo=nodedotjs&logoColor=white)](https://nodejs.org/)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-6.x-3178c6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
8
+ [![Node.js](https://img.shields.io/badge/Node.js-%E2%89%A522.3-339933?logo=nodedotjs&logoColor=white)](https://nodejs.org/)
9
9
  [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](package.json)
10
10
 
11
- The official Backblaze B2 Cloud Storage SDK for TypeScript and JavaScript.
11
+ A Backblaze-maintained TypeScript and JavaScript SDK for Backblaze B2 Cloud Storage, currently incubating in [Backblaze Labs](https://github.com/backblaze-labs).
12
12
 
13
- **Isomorphic at the source level.** One source tree runs unmodified in Node.js 22+, Bun, Deno, browsers, Cloudflare Workers, and Vercel Edge. Internal imports use `.ts` extensions so Deno reads `src/` directly with no build step. See [Source isomorphism](#source-isomorphism).
13
+ **Isomorphic at the source level.** One source tree runs unmodified in Node.js 22.3+, Bun, Deno, and browsers, and is designed around the same Web APIs used by Cloudflare Workers and Vercel Edge. Internal imports use `.ts` extensions so Deno reads `src/` directly with no build step. See [Source isomorphism](#source-isomorphism).
14
14
 
15
15
  **Async-first.** Built on Web Streams, `AbortSignal`, and `crypto.subtle`. No callbacks, no legacy APIs.
16
16
 
@@ -80,12 +80,23 @@ await bucket.delete()
80
80
 
81
81
  > The `BucketType`, `RetentionMode`, `LegalHoldValue`, `Capability`, `EventType`, and `EncryptionMode` `as const` objects exported from the main entry give you type-safe alternatives to the raw string literals — pick whichever style you prefer; both are accepted at the type level.
82
82
 
83
+ ### Partner and Computer Backup APIs
84
+
85
+ Partner API and Computer Backup API helpers are exported from dedicated subpaths:
86
+
87
+ ```ts
88
+ import { PartnerClient } from '@backblaze-labs/b2-sdk/partner'
89
+ import { BackupClient } from '@backblaze-labs/b2-sdk/backup'
90
+ ```
91
+
92
+ Both clients authorize with a Master Application Key through the Partner authorization flow. Account-creating Partner operations, including group member creation and trial reservation, require a valid SMS phone number on the administrator account. See [examples/README.md](examples/README.md#partner-and-computer-backup-examples) for current prerequisites and runnable examples.
93
+
83
94
  ### Uploads
84
95
 
85
96
  Small files (under the recommended part size, typically 100 MB) are uploaded in a single request. Larger files automatically use multipart upload with parallel part uploads.
86
97
 
87
98
  ```ts
88
- import { BufferSource, BlobSource } from '@backblaze-labs/b2-sdk'
99
+ import { BufferSource, BlobSource, FileSource, toContentSource } from '@backblaze-labs/b2-sdk'
89
100
 
90
101
  // From a Uint8Array
91
102
  await bucket.upload({
@@ -100,10 +111,22 @@ await bucket.upload({
100
111
  contentType: 'image/jpeg',
101
112
  })
102
113
 
103
- // Large file with progress tracking
114
+ // From a local file path (Node)
115
+ await bucket.upload({
116
+ fileName: 'backups/db.dump',
117
+ source: await FileSource.fromPath('/var/backups/db.dump'),
118
+ })
119
+
120
+ // From a forward-only stream or async iterable (size required)
121
+ await bucket.upload({
122
+ fileName: 'exports/report.ndjson',
123
+ source: toContentSource(nodeReadable, knownByteLength),
124
+ })
125
+
126
+ // Large file with progress tracking (Node)
104
127
  await bucket.upload({
105
128
  fileName: 'backup.tar.gz',
106
- source: new BlobSource(largeBlob),
129
+ source: await FileSource.fromPath('/path/to/backup.tar.gz'),
107
130
  concurrency: 8,
108
131
  partSize: 64 * 1024 * 1024,
109
132
  onProgress: (event) => {
@@ -113,9 +136,44 @@ await bucket.upload({
113
136
  })
114
137
  ```
115
138
 
139
+ `FileSource` rejects non-regular leaf paths, later leaf path swaps, and same-size rewrites that restore mtime on POSIX platforms. Parent directory symlinks are followed unless your application validates the containing root first. On Windows, `FileSource` skips unreliable dev/inode and ctime comparisons and validates size and mtime instead.
140
+
141
+ Transient upload failures are retried with a fresh B2 upload URL, matching B2's documented flow. If the first upload POST succeeded but its response was lost, retrying can create a duplicate file version.
142
+
143
+ Use `onUploadRetry` to log or count retry attempts, compare returned file IDs and SHA-1 values when reconciling uploads, and configure lifecycle or version-retention rules for buckets where duplicate versions must be cleaned up automatically. Retry diagnostics are event-only: the SDK does not log, count, or persist them unless this listener records them. Payload re-POSTs and fresh-URL fetches spend one upload retry budget and are bounded by `retry.maxRetries + 1` attempts per file or part; aggregate retries scale with multipart transfer concurrency. Upload 429 throttling backs off on the same upload URL instead of fetching a new one.
144
+
145
+ Uploads do not retry lost success response bodies or upload POST network errors by default because re-posting `b2_upload_file` can create duplicate versions, especially in versioned or Object Lock buckets. If callers opt into this ambiguity with `retryResponseBodyFailures: true`, retryable upload POST network errors and unreadable response bodies can re-post the payload with a fresh URL, bounded by `retry.maxRetries`; any uploaded `fileRetention` or `legalHold` applies to each duplicate version and can prevent deletion until the retention policy expires or the hold is cleared. Multipart callers may also opt in when replaying the same `partNumber` is acceptable before `finishLargeFile`, including SSE-B2 encrypted parts.
146
+
147
+ Large-file part retries are coordinated per part, not by a shared circuit breaker. During a B2 pod or main-API incident, concurrent parts can independently back off with jitter, fetch fresh part URLs, and retry in parallel; aggregate fresh-URL traffic scales with multipart concurrency and `retry.maxRetries`. Multipart workers abort sibling work promptly after a fatal part failure, and best-effort cleanup is bounded so aborting a stream does not hang indefinitely. Tune `concurrency`, `retry`, and `onUploadRetry` for operators that need outage counters or stricter load shedding. Each HTTP attempt has a 15 minute deadline by default; for streamed download bodies the timeout is idle/no-progress and resets after each chunk. Set `retry.requestTimeoutMs` higher for very slow upload links or to `0` to rely only on your own `AbortSignal`.
148
+
149
+ `FileSource` is the Node.js-only content adapter. It is safe to import from the
150
+ main package in browser builds, but `FileSource.fromPath()` and its read methods
151
+ need local filesystem APIs at runtime. The source records the validated file
152
+ identity and fails with `FileSource file changed after validation` if the path is
153
+ replaced, truncated, content-modified, or has ctime-changing metadata updates
154
+ while a multipart upload is reading it. On platforms without `O_NOFOLLOW`,
155
+ leaf-symlink swaps are rejected by the post-open identity check rather than by
156
+ the open flag. Retry after active writers stop changing the file.
157
+
116
158
  #### Resume a failed multipart upload
117
159
 
118
- Pass `resume: true` and the SDK looks up the matching unfinished large file via `b2_list_unfinished_large_files`, checks which parts are already on the server, and only re-uploads the missing ones. Parts whose locally-recomputed SHA-1 matches the server's are skipped.
160
+ Resume has two paths. `resumeFileId` targets a known unfinished large-file ID returned by B2 when the multipart upload was started. `resume: true` without `resumeFileId` runs bounded same-name discovery and may continue uploading into the newest compatible unfinished upload; incompatible candidates are skipped and a fresh upload starts. Automatic discovery reuploads every planned part into the selected unfinished file instead of trusting pre-existing server parts by SHA-1 alone. With explicit `resumeFileId`, each local part is hashed again and matching server parts are skipped only when the locally recomputed SHA-1 equals B2's part SHA-1.
161
+
162
+ Resume discovery is intentionally conservative. The SDK reuses only the newest unfinished large file whose file name, content type, caller-provided file info, encryption, Object Lock retention, legal hold, and uploaded part lengths match the current call. If those checks fail, a new large file is started instead. Caller-provided file info such as `large_file_sha1` or `src_last_modified_millis` is part of that identity, so keep it stable across retries. Discovery does not add SDK metadata to unfinished or finished file info.
163
+
164
+ Automatic resume requires a stable content type. When the upload uses the SDK default `b2/x-auto`, same-name discovery starts a fresh large file unless B2 lists the unfinished file with the same `b2/x-auto` value. Provide an explicit `contentType` for automatic resume, or use `resumeFileId` when the caller deliberately trusts a specific unfinished file's listed content type. Explicit content types still require an exact match.
165
+
166
+ Automatic resume discovery does not use B2's stored part SHA-1 to skip local bytes because B2 unfinished-large-file records do not identify the writer that started them. It may still finish a compatible same-name unfinished upload after overwriting planned parts with locally read bytes, so use exact file names and stable caller-owned file info when shared buckets have concurrent writers. Use `resumeFileId` only when the caller deliberately trusts the specific unfinished file ID.
167
+
168
+ The discovery scan is bounded to avoid unbounded prefix-flood work in shared buckets, but it still runs before the first upload byte. By default the SDK inspects up to 10 unfinished-file pages, up to 25 metadata-compatible candidates, and up to 10 part pages per candidate, so a worst-case resume attempt can add many sequential B2 list calls before data transfer starts. Tune `resumeMaxListPages`, `resumeMaxPartCandidates`, and `resumeMaxPartPages` for buckets with many concurrent same-prefix uploads. The SDK does not install a default resume discovery timeout; set `resumeDiscoveryTimeoutMs` or pass an abort signal such as `AbortSignal.timeout(...)` when discovery needs a first-byte time budget. If the scan is truncated, the SDK reports `search-truncated`; when a compatible candidate was already scanned, that candidate may still be reused.
169
+
170
+ Rejected candidates and failed attempts that reused an existing unfinished file are left unfinished. B2 stores uploaded parts for unfinished large files until they are finished, cancelled, or removed by a lifecycle rule, so stricter matching or repeated prefix-flood truncation can leave billable unfinished uploads behind. Applications with strict resume matching should configure lifecycle cleanup or periodically use `listUnfinishedLargeFiles` and `cancelLargeFile` to remove stale unfinished uploads.
171
+
172
+ When the caller omits `serverSideEncryption`, high-level bucket and object uploads verify candidates against the bucket's current default encryption freshly fetched from B2, including default SSE-B2 or no encryption. Explicit `serverSideEncryption: { mode: 'none' }` still requires an unencrypted candidate. SSE-C uploads are not resumed automatically or with `resumeFileId` because B2 does not expose a non-secret customer-key identity for unfinished files. With `resume: true`, an SSE-C retry starts a new large file. With `resumeFileId`, SSE-C fails with `ResumeFileIdMismatchError` rather than risking a finish under an unverified key.
173
+
174
+ Object Lock state must also be verified before reuse. When the caller omits `fileRetention`, high-level bucket and object uploads use the readable bucket default retention freshly fetched from B2; candidates without the exact required default retention window are skipped. Unreadable bucket default retention, candidate retention, or candidate legal-hold fields fail closed. Explicit retention or legal-hold values still require readable matching candidate metadata.
175
+
176
+ Pass `onResumeCandidateRejected` to collect diagnostic events when a same-name unfinished large file is skipped, including reasons such as `file-info-mismatch`, `part-length-mismatch`, `search-truncated`, or `sse-c-unsupported`. Resume diagnostics are event-only: without this listener, a conservative resume decline falls back to a fresh upload without SDK logging or counters. Candidate-specific events include `requestedFileName` and `candidateFileName` so logging can distinguish the intended upload name from the rejected unfinished file. Pass `onResumePartReused` to observe each pre-existing server part accepted by explicit `resumeFileId` through the SHA-1 equality gate. If a supplied `resumeFileId` is incompatible or cannot be verified through B2's unfinished-large-file listing, `ResumeFileIdMismatchError` is thrown instead of silently starting a different large file.
119
177
 
120
178
  ```ts
121
179
  // Restart the upload that crashed at part 47 of 100
@@ -123,13 +181,6 @@ await bucket.upload({
123
181
  fileName: 'backup.tar.gz',
124
182
  source: new BlobSource(largeBlob),
125
183
  partSize: 64 * 1024 * 1024,
126
- resume: true,
127
- })
128
-
129
- // Or target a specific in-progress large file explicitly
130
- await bucket.upload({
131
- fileName: 'backup.tar.gz',
132
- source: new BlobSource(largeBlob),
133
184
  resumeFileId: knownLargeFileId,
134
185
  })
135
186
  ```
@@ -150,7 +201,7 @@ const fileVersion = await done
150
201
  console.log(`Streamed upload finished: ${fileVersion.fileName} (${fileVersion.contentLength} bytes)`)
151
202
  ```
152
203
 
153
- > Streaming uploads do not support resume because the total size and per-part SHA-1s are not known in advance. Use the buffered `upload` path with `resume: true` when that matters.
204
+ > Streaming uploads do not support resume because the total size and per-part SHA-1s are not known in advance. Use the buffered `upload` path with `resumeFileId` when that matters.
154
205
 
155
206
  ### Downloads
156
207
 
@@ -165,16 +216,23 @@ const partial = await bucket.download('large-file.bin', {
165
216
  })
166
217
 
167
218
  // Parallel ranged download (for large files).
168
- // Each range is retried independently with exponential backoff so a single
169
- // transient 503 does not kill the whole transfer.
219
+ // Each range uses the client's configured RetryTransport budget, so transient
220
+ // 503s are retried without adding a second default retry layer per chunk.
170
221
  const obj = bucket.file('big-dataset.parquet')
171
222
  const stream = obj.createReadStream(fileId, totalSize, {
172
223
  concurrency: 4,
173
224
  rangeSize: 10 * 1024 * 1024,
174
- maxRetries: 5,
175
225
  })
176
226
  ```
177
227
 
228
+ Full-body downloads are automatically verified when B2 returns a real `X-Bz-Content-Sha1` digest. If the downloaded bytes do not match, the body stream errors with `ChecksumMismatchError`; discard any partially written output when piping to disk. HEAD requests, range GETs, and files whose SHA-1 is unavailable are not verified because no matching whole-body digest exists.
229
+
230
+ ### Sync SHA-1 comparisons
231
+
232
+ `compareMode: 'sha1'` hashes matching-size local files and compares them with verifiable B2 SHA-1 metadata. B2 multipart objects do not have an authoritative `contentSha1`; when only `fileInfo.large_file_sha1` or another untrusted hint is available, a real sync downloads that selected B2 version and hashes the full object before skipping a transfer. The SDK does not persist that verification result, so an unchanged 100 GB multipart object can cost 100 GB of B2 download reads on every SHA-1 sync run. `compare.bytesVerified` reports those B2 verification bytes for the run. Use `sha1VerificationMaxBytes` to skip objects above your per-file verification budget, raise `sha1VerificationTimeoutMillis` for large objects on slow links, or use `size`/`modtime` mode when recurring verification egress is not acceptable.
233
+
234
+ B2-to-local sync streams downloads through a private managed staging directory under the destination root before renaming into place. The scanner ignores that managed directory and stale SDK-owned staging entries are reaped on later download setup. New files are published as 0600 by default, replacements keep the previous file mode, and download body stalls use `downloadIdleTimeoutMillis` (60 seconds by default) rather than `sha1ReadTimeoutMillis`. `B2Folder` prefixes are raw B2 key prefixes: use `photos/` for a slash-delimited folder, or `photos` to match every key beginning with those bytes.
235
+
178
236
  ### File operations
179
237
 
180
238
  ```ts
@@ -251,7 +309,7 @@ import { Capability } from '@backblaze-labs/b2-sdk'
251
309
  const key = await client.createKey({
252
310
  capabilities: [Capability.ReadFiles, Capability.WriteFiles],
253
311
  keyName: 'my-app-key',
254
- bucketId: bucket.id,
312
+ bucketIds: [bucket.id],
255
313
  namePrefix: 'uploads/',
256
314
  validDurationInSeconds: 86400,
257
315
  })
@@ -386,7 +444,10 @@ const auth = await bucket.getDownloadAuthorization('photos/', 3600)
386
444
  import { B2Client } from '@backblaze-labs/b2-sdk'
387
445
  import { FileAccountInfo } from '@backblaze-labs/b2-sdk/auth/file'
388
446
 
389
- const accountInfo = new FileAccountInfo('/var/cache/my-app/b2-auth.json')
447
+ const accountInfo = new FileAccountInfo('/var/cache/my-app/b2-auth.json', {
448
+ onDiscard: (event) => console.warn('ignored stale B2 auth cache', event.reason),
449
+ onWriteError: (event) => console.warn('could not persist B2 auth cache', event.error),
450
+ })
390
451
  await accountInfo.load() // populate from disk if the file exists
391
452
 
392
453
  const client = new B2Client({
@@ -400,7 +461,7 @@ if (accountInfo.getAuth() === null) {
400
461
  }
401
462
  ```
402
463
 
403
- `load()` returns silently on missing or corrupt files (a fresh `authorize()` will populate fresh state). Call `await accountInfo.flushed()` before process exit if you need to guarantee the latest state has hit disk.
464
+ `load()` returns silently on missing or corrupt files (a fresh `authorize()` will populate fresh state). `onDiscard` fires when a loaded cache entry is ignored because its realm, application key ID, or cached endpoints do not match the current client; `onWriteError` reports asynchronous write failures that would otherwise be best-effort. Call `await accountInfo.flushed()` before process exit if you need to guarantee the latest state has hit disk.
404
465
 
405
466
  ## Subpath exports
406
467
 
@@ -425,6 +486,10 @@ import {
425
486
  import { InMemoryAccountInfo } from '@backblaze-labs/b2-sdk/auth'
426
487
  import { FileAccountInfo } from '@backblaze-labs/b2-sdk/auth/file'
427
488
 
489
+ // Partner and Computer Backup API surfaces
490
+ import { PartnerClient, PartnerRawClient } from '@backblaze-labs/b2-sdk/partner'
491
+ import { BackupClient, BackupRawClient } from '@backblaze-labs/b2-sdk/backup'
492
+
428
493
  // Streaming utilities + SSE-C key wrapper
429
494
  import {
430
495
  IncrementalSha1,
@@ -436,15 +501,60 @@ import {
436
501
  // Sync engine (local <-> B2)
437
502
  import { synchronize, LocalFolder, B2Folder } from '@backblaze-labs/b2-sdk/sync'
438
503
 
439
- // S3-compatible helpers (requires @aws-sdk/client-s3 peer dependency)
440
- import { createS3ClientConfig, presignGetObjectUrl } from '@backblaze-labs/b2-sdk/s3'
504
+ // S3-compatible helpers
505
+ import {
506
+ createS3ClientConfig,
507
+ presignS3GetObjectUrl,
508
+ presignS3PutObjectUrl,
509
+ } from '@backblaze-labs/b2-sdk/s3'
510
+
511
+ // Webhook signature verification for B2 event notifications
512
+ import { verifyWebhookSignature, requireValidWebhook } from '@backblaze-labs/b2-sdk/notifications'
441
513
 
442
514
  // In-memory B2 server for tests (no network required)
443
515
  import { B2Simulator } from '@backblaze-labs/b2-sdk/simulator'
444
516
  ```
445
517
 
518
+ `createS3ClientConfig()` is for `@aws-sdk/client-s3`; install that optional peer
519
+ before constructing an AWS `S3Client`. The presign helpers sign internally and
520
+ do not require AWS presigner packages.
521
+
522
+ Raw methods use a trailing options bag for request controls such as cancellation
523
+ and per-request retry overrides: pass `{ signal, retry }` to `getUploadUrl`,
524
+ `getUploadPartUrl`, `uploadFile`, and `uploadPart`. The older positional
525
+ `signal, retry` form remains available only for source compatibility.
526
+
446
527
  Every export is documented with full type signatures in the [API reference](https://backblaze-labs.github.io/b2-sdk-typescript/).
447
528
 
529
+ ## Sync filters
530
+
531
+ `synchronize()` and the built-in `LocalFolder` / `B2Folder` scanners accept `include` and `exclude` filters for paths relative to each sync root:
532
+
533
+ ```ts
534
+ for await (const event of synchronize({
535
+ source: new LocalFolder('./site'),
536
+ dest: new B2Folder(bucket, 'site/'),
537
+ bucket,
538
+ prefix: 'site/',
539
+ options: {
540
+ compareMode: 'modtime',
541
+ keepMode: 'no-delete',
542
+ include: ['assets/**', '*.html'],
543
+ exclude: ['*.tmp', 'node_modules', 'dist/cache/**'],
544
+ },
545
+ })) {
546
+ console.log(event)
547
+ }
548
+ ```
549
+
550
+ Glob strings use the SDK dialect: `*` and `?` stay within one path segment, a whole `**` segment crosses directories, slash-less patterns match any basename or ancestor directory, and excludes win over includes. Use `dir/**` for directory-subtree patterns such as `dist/cache/**`; a slash-containing literal such as `dist/cache` matches only that exact path. RegExp filters are guarded by a best-effort synchronous safety heuristic whose exact subset may change as protections tighten. Paths beyond the RegExp input guard are skipped when any RegExp filter is present, including exclude-only RegExp deny-lists. B2 prefixes are raw object-name prefixes; backslashes are not rewritten to `/`.
551
+
552
+ `SyncFolder.scan()` direct consumers should expect paths sorted with `compareSyncRelativePaths`, exported from `@backblaze-labs/b2-sdk/sync`. During `synchronize()`, custom folders are filtered before pairing even when they set `appliesScanFilters: true`; scanner-side filtering is an optimization, not the policy boundary. Custom scanner authors can call `filterSyncPaths(paths, options)` and forward `SyncScanOptions.onSkip` so RegExp input-limit diagnostics are preserved. Custom folders that do not set `appliesScanSorting: true` are sorted before pairing. The built-in local and B2 scanners set both flags. `SyncOptions.maxScanEntries` / `SyncScanOptions.maxScanEntries` default to the SDK scan ceiling and fail with a defined scan-limit error when exceeded; B2 scans count every listed file-version record, including versions later skipped by prefix, safety, or filter checks, while local and fallback scans count retained sync paths. Pass `Infinity` only when the process heap is sized for the full result set; raising the limit increases peak scanner memory because built-in scans sort or group results before yielding.
553
+
554
+ Built-in scanner skip diagnostics use `SyncSkipReason` values such as `outside-prefix`, `unsafe-name`, `local-unsafe-name`, `relative-path-collision`, `local-path-collision`, `filesystem-error`, and `path-too-long-for-regexp`. The `onSkip` callback receives every diagnostic; the `SyncEvent` stream buffers the first 100 scanner diagnostics and then reports overflow with `scan-skip-overflow`.
555
+
556
+ B2-to-local sync skips object names that are unsafe on local filesystems, including NTFS alternate data stream names, DOS device basenames, trailing dot/space names, the reserved `.b2sdk-download-staging` namespace, and case/Unicode-canonical collisions. Downloads stream into private per-download entries under the destination root's managed `.b2sdk-download-staging` directory and publish completed files into place; SDK-owned staging roots and entries carry `.b2sdk-staging-marker.partial` files. Local scans are read-only and exclude the managed staging directory when those markers are present so abandoned staging state is not uploaded as source content. Later download setup reaps stale SDK-owned staging entries only when marker and partial-file activity is old and unchanged immediately before removal. Download body reads have a 60 second idle timeout by default; set `downloadIdleTimeoutMillis` to tune it or `Infinity` to disable the watchdog. Downloads and local deletes reject symlinked local roots and symlinked path components under the root, then revalidate root, parent, and leaf identity immediately before filesystem operations. Uploads support symlinked source roots by binding the resolved root identity before scanning, then reopening scanned files with no-follow semantics and verifying the opened file remains inside that bound source root before reading. Per-action failures are emitted as `error` events; the terminal aggregate error includes `failureCount`, up to 100 `failedPaths`, and `failedPathOmittedCount` when more paths were omitted.
557
+
448
558
  ## Custom transport
449
559
 
450
560
  The SDK uses a pluggable transport layer. The default `FetchTransport` uses the native `fetch` API. You can provide your own:
@@ -470,7 +580,7 @@ const client = new B2Client({
470
580
  Every request the SDK issues carries a User-Agent header that Backblaze can grep server logs by:
471
581
 
472
582
  ```
473
- b2-sdk-typescript/0.1.0 (typescript; @backblaze-labs/b2-sdk; node/24.14.1; linux; x64)
583
+ b2-sdk-typescript/<version> (typescript; @backblaze-labs/b2-sdk; node/<node-version>; linux; x64)
474
584
  ```
475
585
 
476
586
  Both `b2-sdk-typescript/` (stable product token) and `@backblaze-labs/b2-sdk` (npm package name) are part of the documented contract — log queries that match either one find every request issued by this SDK. The comment block also reports the runtime (`node/<version>`, `bun/<version>`, `deno/<version>`, or `browser`) plus the OS and architecture on non-browser runtimes.
@@ -485,7 +595,7 @@ const client = new B2Client({
485
595
  applicationKey,
486
596
  userAgent: 'my-app/1.0',
487
597
  })
488
- // → "my-app/1.0 b2-sdk-typescript/0.1.0 (typescript; @backblaze-labs/b2-sdk; node/24.14.1; linux; x64)"
598
+ // → "my-app/1.0 b2-sdk-typescript/<version> (typescript; @backblaze-labs/b2-sdk; node/<node-version>; linux; x64)"
489
599
  ```
490
600
 
491
601
  ## SSRF guard
@@ -513,6 +623,10 @@ new B2Client({
513
623
  })
514
624
  ```
515
625
 
626
+ Passing `allowedHostSuffixes: []` disables the guard entirely and should be reserved for trusted tests or controlled local harnesses. For custom realms, the SDK uses the hosts returned by `b2_authorize_account` as scoped suffixes, allowing those hosts and their subdomains without broadening unknown domains to public suffixes such as `co.uk`.
627
+
628
+ The default transport follows same-origin `GET` / `HEAD` redirects after each target passes the SSRF guard. Cross-origin redirects and `POST` redirects are blocked with `B2RedirectError`. Pass `followSameOriginRedirects: false` to the `B2Client` constructor to block same-origin redirects as well.
629
+
516
630
  Passing a custom `transport` opts out of the guard (your transport, your threat model).
517
631
 
518
632
  ## Retry behavior
@@ -520,7 +634,7 @@ Passing a custom `transport` opts out of the guard (your transport, your threat
520
634
  The SDK automatically retries transient errors with exponential backoff:
521
635
 
522
636
  - **401 expired_auth_token**: re-authorizes and retries
523
- - **503, 408, 429**: exponential backoff with jitter, respects `Retry-After` header
637
+ - **408, 429, transient 5xx (500, 502, 503, 504)**: exponential backoff with jitter, respects `Retry-After` header
524
638
  - **Network errors**: retried with backoff
525
639
  - **Permanent errors** (403 cap_exceeded, 404 not_found, etc.): thrown immediately
526
640
 
@@ -534,10 +648,21 @@ const client = new B2Client({
534
648
  maxRetries: 10,
535
649
  maxRetryDelayMs: 120_000,
536
650
  initialRetryDelayMs: 500,
651
+ requestTimeoutMs: 30 * 60_000,
537
652
  },
538
653
  })
539
654
  ```
540
655
 
656
+ `requestTimeoutMs` covers request dispatch, upload POST bodies, and
657
+ non-streaming response-body reads. For `response.body` download streams it is an
658
+ idle/no-progress timeout that resets after each received chunk, so healthy large
659
+ downloads are not aborted merely because the total transfer takes longer than
660
+ the timeout. Slow large-part uploads may need a higher value or `0` to rely on
661
+ your own `AbortSignal`. Worst-case terminal latency can be roughly
662
+ `(retry.maxRetries + 1) * requestTimeoutMs` plus backoff when an endpoint hangs.
663
+
664
+ When a multipart upload, streaming upload, or multipart copy fails, the SDK calls `b2_cancel_large_file` on a best-effort basis. Pass `onCleanupFailure` on those operations to observe failed cancellation or a skipped cancellation after an ambiguous `b2_finish_large_file` response, with the relevant `fileId` so operators can reconcile unfinished or possibly committed large files. Pair long-running resume workflows with lifecycle or version-retention cleanup so orphaned unfinished large files do not accumulate past the bounded resume discovery scan.
665
+
541
666
  ## Testing with the simulator
542
667
 
543
668
  The SDK ships an in-memory B2 simulator for unit testing without network access:
@@ -581,7 +706,7 @@ describe('my app', () => {
581
706
 
582
707
  ## Error handling
583
708
 
584
- All B2 API errors are thrown as typed `B2Error` subclasses (13 in total). Client-side capability checks throw `B2InsufficientCapabilityError`.
709
+ All B2 API errors are thrown as typed `B2Error` subclasses. Client-side capability checks throw `B2InsufficientCapabilityError`.
585
710
 
586
711
  ```ts
587
712
  import { BucketType } from '@backblaze-labs/b2-sdk'
@@ -611,7 +736,7 @@ try {
611
736
 
612
737
  The high-level surface (`B2Client`, `Bucket`, `B2Object`) gives you direct access to features that live in B2's native API:
613
738
 
614
- - **Per-part and whole-file SHA-1 verification** on multipart uploads.
739
+ - **Per-part and whole-file SHA-1 verification** on multipart uploads, plus automatic whole-file verification on downloads when B2 provides a digest.
615
740
  - **`b2_copy_part` server-side multipart copy** via `bucket.copyLargeFile()` — no client-side bytes touched.
616
741
  - **File retention + legal hold** (object lock) on `bucket.updateFileRetention()` and `bucket.updateFileLegalHold()`.
617
742
  - **Time-scoped download tokens** via `bucket.getDownloadAuthorization()` for sharing without exposing the application key.
@@ -619,7 +744,11 @@ The high-level surface (`B2Client`, `Bucket`, `B2Object`) gives you direct acces
619
744
  - **Event notification rules** via `bucket.getNotificationRules()` and `bucket.setNotificationRules()`.
620
745
  - **Application key restrictions** (per-bucket, per-prefix, per-capability) via `client.createKey()`.
621
746
 
622
- When you want S3 compatibility instead — for tooling that already speaks S3, or for the Bandwidth Alliance proxy pattern — `@backblaze-labs/b2-sdk/s3` exposes `createS3ClientConfig()` and `presignGetObjectUrl()` so the same SDK covers both surfaces.
747
+ When you want S3 compatibility instead — for tooling that already speaks S3, browser direct uploads, or for the Bandwidth Alliance proxy pattern — `@backblaze-labs/b2-sdk/s3` exposes `createS3ClientConfig()`, `presignS3GetObjectUrl()`, and `presignS3PutObjectUrl()` so the same SDK covers both surfaces.
748
+
749
+ S3 presigned URLs are bearer credentials. The helpers only emit `https:` URLs and require an explicit `region` for custom or proxied endpoints whose region cannot be derived from `s3.<region>.backblazeb2.com`; set `region` and call `createS3ClientConfig()` during startup or deployment health checks before serving traffic. Object keys with path segments exactly `.` or `..` cannot be S3-presigned safely because common URL parsers normalize them before sending; rename those objects, proxy the download through a trusted server, or use a B2-native download authorization URL when that fits the access model. URL validity depends on the signing host's clock, so URL-generating hosts should be NTP-synced, and downstream SigV4 403s should include a clock-skew check. For untrusted uploads, bind `contentType` and `contentLength` when you can; omitting `contentType` lets the uploader store any B2-accepted type, including browser-executable HTML, SVG, XML, or JavaScript. Bound active content types are rejected unless trusted server code passes `trustedUnsafeS3PresignOptIn` to `allowBrowserExecutableContentType`; booleans from request JSON are ignored. GET response overrides that force inline rendering or active content require the same token on their unsafe opt-in fields. The SDK's active-content checks are best-effort denylists, not a complete browser security policy; the SDK cannot set `X-Content-Type-Options: nosniff`, so callers accepting untrusted content should enforce their own content-type allow-list. Presigned PUT URLs are replayable until expiry; if a client retries after B2 stored the object but before the response was observed, the retry can create another file version. Use unique object keys or reconcile by listed file IDs/checksums, and configure lifecycle or version cleanup where duplicate versions must be removed automatically.
750
+
751
+ The deprecated `presignGetObjectUrl()` helper returns a B2-native download-authorization URL, not an S3 presigned URL. It keeps the legacy slash-escaped URL shape and permissive string-building behavior for compatibility. Use `createNativeDownloadAuthorizationUrl()` for new B2-native download-token URLs; it uses B2 path-preserving file-name encoding, requires an `https:` Backblaze download origin without userinfo, path, query, or fragment, rejects unsafe bucket names, control characters, invalid compatibility durations, and path-normalizing file names, and constructs the bearer URL from the parsed origin rather than raw-concatenating caller input.
623
752
 
624
753
  ## Source isomorphism
625
754
 
@@ -644,14 +773,14 @@ So you get both: an `npm install`-ready `dist/` (ESM + CJS + DTS), *and* a `src/
644
773
 
645
774
  | Runtime | Version | Status |
646
775
  |---|---|---|
647
- | Node.js | 22+ | Primary target. CI runs the full suite on Node 22 and 24 across Linux, Windows, and macOS. |
776
+ | Node.js | 22.3+ | Primary target. CI runs the fast suite on Linux, Windows, and macOS for Node 22.18 + 24; slow and coverage jobs run on Linux. `FileSource` uses weaker size/mtime validation on Windows because portable dev/inode and ctime fields are unreliable there. |
648
777
  | Bun | latest | Tested in CI via `bun test src/` + example typecheck. |
649
778
  | Deno | 2.x | Source isomorphism verified in CI via `deno check` against `src/`. |
650
779
  | Browsers | Chromium, Firefox, WebKit (last 2 evergreen) | Tested in CI via Playwright. |
651
- | Cloudflare Workers | - | Supported. |
652
- | Vercel Edge | - | Supported. |
780
+ | Cloudflare Workers | - | Compatible target when the standard Web APIs above are available; not yet smoke-tested in CI with a Workers runtime. |
781
+ | Vercel Edge | - | Compatible target when the standard Web APIs above are available; not yet smoke-tested in CI with Vercel Edge. |
653
782
 
654
- Requires: `fetch`, Web Streams, `crypto.subtle`, `AbortSignal`. Node < 22 is not supported (Node 20 reached EOL April 2026).
783
+ Requires: `fetch`, Web Streams, `crypto.subtle`, `AbortSignal`. Node < 22.3 is not supported (Node 20 reached EOL April 2026). `FileSource(path)` throws on older Node 22.x runtimes that lack synchronous `process.getBuiltinModule()`; `FileSource.fromPath(path)` remains the async construction path for supported Node filesystem platforms. On Windows, `FileSource` is supported with weaker size/mtime validation because portable dev/inode and ctime fields are unreliable there.
655
784
 
656
785
  The browser test suite (`pnpm test:browser`) runs the same source against real Chromium, Firefox, and WebKit instances. Only Node-specific tests (filename pattern `*.node.test.ts`, covering `node:fs`, `node:os`, `node:util.inspect`) are skipped.
657
786
 
@@ -0,0 +1,4 @@
1
+ //#region \0b2-sdk-version-json
2
+ var _b2_sdk_version_json_default = { "version": "0.3.0" };
3
+ //#endregion
4
+ exports.default = _b2_sdk_version_json_default;
@@ -0,0 +1,4 @@
1
+ //#region \0b2-sdk-version-json
2
+ var _b2_sdk_version_json_default = { "version": "0.3.0" };
3
+ //#endregion
4
+ export { _b2_sdk_version_json_default as default };
@@ -7,12 +7,42 @@ export interface UploadUrlEntry {
7
7
  /** Authorization token to include with the upload request. */
8
8
  readonly authorizationToken: string;
9
9
  }
10
+ /**
11
+ * Optional extension for persistent auth stores that need to bind cached auth
12
+ * to the current client configuration. `B2Client` calls these hooks during
13
+ * construction before it reuses any loaded auth.
14
+ */
15
+ export interface AuthContextAwareAccountInfo {
16
+ /**
17
+ * Bind persistent auth caches to the resolved realm URL. Implementations that
18
+ * persist auth should discard loaded state written for a different realm.
19
+ */
20
+ setRealmUrl(realmUrl: string): void;
21
+ /**
22
+ * Bind persistent auth caches to the configured application key ID.
23
+ * Implementations that persist auth should discard loaded state written for a
24
+ * different key ID.
25
+ */
26
+ setApplicationKeyId(applicationKeyId: string): void;
27
+ }
10
28
  /**
11
29
  * Stores B2 authorization state between requests.
12
30
  * Implementations cache the authorize-account response and manage
13
31
  * pools of reusable upload URLs (checkout/checkin/evict pattern).
14
32
  */
15
33
  export interface AccountInfo {
34
+ /**
35
+ * @deprecated Persistent auth stores should implement
36
+ * {@link AuthContextAwareAccountInfo}. This optional hook remains for
37
+ * source compatibility with older integrations.
38
+ */
39
+ setRealmUrl?(realmUrl: string): void;
40
+ /**
41
+ * @deprecated Persistent auth stores should implement
42
+ * {@link AuthContextAwareAccountInfo}. This optional hook remains for
43
+ * source compatibility with older integrations.
44
+ */
45
+ setApplicationKeyId?(applicationKeyId: string): void;
16
46
  /** Store a fresh authorization response, replacing any previous state. */
17
47
  setAuth(auth: AuthorizeAccountResponse): void;
18
48
  /** Return the current authorization response, or null if not authorized. */
@@ -35,6 +65,8 @@ export interface AccountInfo {
35
65
  getS3ApiUrl(): string;
36
66
  /** Bucket ID the key is restricted to, or null if unrestricted. */
37
67
  getAllowedBucketId(): BucketId | null;
68
+ /** Bucket IDs the key is restricted to, or null if unrestricted. */
69
+ getAllowedBucketIds(): readonly BucketId[] | null;
38
70
  /** Take an upload URL from the pool for the given bucket, or null if none available. */
39
71
  checkoutUploadUrl(bucketId: BucketId): UploadUrlEntry | null;
40
72
  /** Return a still-valid upload URL to the pool for reuse. */
@@ -1 +1 @@
1
- {"version":3,"file":"account-info.d.ts","sourceRoot":"","sources":["../../src/auth/account-info.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,OAAO,CAAC,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAAA;IAC7C,4EAA4E;IAC5E,OAAO,IAAI,wBAAwB,GAAG,IAAI,CAAA;IAC1C,8DAA8D;IAC9D,KAAK,IAAI,IAAI,CAAA;IAEb,iCAAiC;IACjC,SAAS,IAAI,MAAM,CAAA;IACnB,mCAAmC;IACnC,cAAc,IAAI,MAAM,CAAA;IACxB,mCAAmC;IACnC,YAAY,IAAI,MAAM,CAAA;IACtB,iCAAiC;IACjC,YAAY,IAAI,MAAM,CAAA;IACtB,qEAAqE;IACrE,sBAAsB,IAAI,MAAM,CAAA;IAChC,mEAAmE;IACnE,0BAA0B,IAAI,MAAM,CAAA;IACpC,0CAA0C;IAC1C,WAAW,IAAI,MAAM,CAAA;IACrB,mEAAmE;IACnE,kBAAkB,IAAI,QAAQ,GAAG,IAAI,CAAA;IAErC,wFAAwF;IACxF,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,GAAG,IAAI,CAAA;IAC5D,6DAA6D;IAC7D,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAChE,uEAAuE;IACvE,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAE/D,kFAAkF;IAClF,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAA;IAC5D,kEAAkE;IAClE,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAChE,6DAA6D;IAC7D,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;CAChE"}
1
+ {"version":3,"file":"account-info.d.ts","sourceRoot":"","sources":["../../src/auth/account-info.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC;;;;OAIG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CACpD;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,WAAW,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAEpD,0EAA0E;IAC1E,OAAO,CAAC,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAAA;IAC7C,4EAA4E;IAC5E,OAAO,IAAI,wBAAwB,GAAG,IAAI,CAAA;IAC1C,8DAA8D;IAC9D,KAAK,IAAI,IAAI,CAAA;IAEb,iCAAiC;IACjC,SAAS,IAAI,MAAM,CAAA;IACnB,mCAAmC;IACnC,cAAc,IAAI,MAAM,CAAA;IACxB,mCAAmC;IACnC,YAAY,IAAI,MAAM,CAAA;IACtB,iCAAiC;IACjC,YAAY,IAAI,MAAM,CAAA;IACtB,qEAAqE;IACrE,sBAAsB,IAAI,MAAM,CAAA;IAChC,mEAAmE;IACnE,0BAA0B,IAAI,MAAM,CAAA;IACpC,0CAA0C;IAC1C,WAAW,IAAI,MAAM,CAAA;IACrB,mEAAmE;IACnE,kBAAkB,IAAI,QAAQ,GAAG,IAAI,CAAA;IACrC,oEAAoE;IACpE,mBAAmB,IAAI,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAA;IAEjD,wFAAwF;IACxF,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,GAAG,IAAI,CAAA;IAC5D,6DAA6D;IAC7D,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAChE,uEAAuE;IACvE,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAE/D,kFAAkF;IAClF,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAA;IAC5D,kEAAkE;IAClE,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAChE,6DAA6D;IAC7D,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;CAChE"}
@@ -7,12 +7,42 @@ export interface UploadUrlEntry {
7
7
  /** Authorization token to include with the upload request. */
8
8
  readonly authorizationToken: string;
9
9
  }
10
+ /**
11
+ * Optional extension for persistent auth stores that need to bind cached auth
12
+ * to the current client configuration. `B2Client` calls these hooks during
13
+ * construction before it reuses any loaded auth.
14
+ */
15
+ export interface AuthContextAwareAccountInfo {
16
+ /**
17
+ * Bind persistent auth caches to the resolved realm URL. Implementations that
18
+ * persist auth should discard loaded state written for a different realm.
19
+ */
20
+ setRealmUrl(realmUrl: string): void;
21
+ /**
22
+ * Bind persistent auth caches to the configured application key ID.
23
+ * Implementations that persist auth should discard loaded state written for a
24
+ * different key ID.
25
+ */
26
+ setApplicationKeyId(applicationKeyId: string): void;
27
+ }
10
28
  /**
11
29
  * Stores B2 authorization state between requests.
12
30
  * Implementations cache the authorize-account response and manage
13
31
  * pools of reusable upload URLs (checkout/checkin/evict pattern).
14
32
  */
15
33
  export interface AccountInfo {
34
+ /**
35
+ * @deprecated Persistent auth stores should implement
36
+ * {@link AuthContextAwareAccountInfo}. This optional hook remains for
37
+ * source compatibility with older integrations.
38
+ */
39
+ setRealmUrl?(realmUrl: string): void;
40
+ /**
41
+ * @deprecated Persistent auth stores should implement
42
+ * {@link AuthContextAwareAccountInfo}. This optional hook remains for
43
+ * source compatibility with older integrations.
44
+ */
45
+ setApplicationKeyId?(applicationKeyId: string): void;
16
46
  /** Store a fresh authorization response, replacing any previous state. */
17
47
  setAuth(auth: AuthorizeAccountResponse): void;
18
48
  /** Return the current authorization response, or null if not authorized. */
@@ -35,6 +65,8 @@ export interface AccountInfo {
35
65
  getS3ApiUrl(): string;
36
66
  /** Bucket ID the key is restricted to, or null if unrestricted. */
37
67
  getAllowedBucketId(): BucketId | null;
68
+ /** Bucket IDs the key is restricted to, or null if unrestricted. */
69
+ getAllowedBucketIds(): readonly BucketId[] | null;
38
70
  /** Take an upload URL from the pool for the given bucket, or null if none available. */
39
71
  checkoutUploadUrl(bucketId: BucketId): UploadUrlEntry | null;
40
72
  /** Return a still-valid upload URL to the pool for reuse. */
@@ -1 +1 @@
1
- {"version":3,"file":"account-info.d.ts","sourceRoot":"","sources":["../../src/auth/account-info.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,OAAO,CAAC,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAAA;IAC7C,4EAA4E;IAC5E,OAAO,IAAI,wBAAwB,GAAG,IAAI,CAAA;IAC1C,8DAA8D;IAC9D,KAAK,IAAI,IAAI,CAAA;IAEb,iCAAiC;IACjC,SAAS,IAAI,MAAM,CAAA;IACnB,mCAAmC;IACnC,cAAc,IAAI,MAAM,CAAA;IACxB,mCAAmC;IACnC,YAAY,IAAI,MAAM,CAAA;IACtB,iCAAiC;IACjC,YAAY,IAAI,MAAM,CAAA;IACtB,qEAAqE;IACrE,sBAAsB,IAAI,MAAM,CAAA;IAChC,mEAAmE;IACnE,0BAA0B,IAAI,MAAM,CAAA;IACpC,0CAA0C;IAC1C,WAAW,IAAI,MAAM,CAAA;IACrB,mEAAmE;IACnE,kBAAkB,IAAI,QAAQ,GAAG,IAAI,CAAA;IAErC,wFAAwF;IACxF,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,GAAG,IAAI,CAAA;IAC5D,6DAA6D;IAC7D,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAChE,uEAAuE;IACvE,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAE/D,kFAAkF;IAClF,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAA;IAC5D,kEAAkE;IAClE,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAChE,6DAA6D;IAC7D,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;CAChE"}
1
+ {"version":3,"file":"account-info.d.ts","sourceRoot":"","sources":["../../src/auth/account-info.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC;;;;OAIG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CACpD;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,WAAW,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAEpD,0EAA0E;IAC1E,OAAO,CAAC,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAAA;IAC7C,4EAA4E;IAC5E,OAAO,IAAI,wBAAwB,GAAG,IAAI,CAAA;IAC1C,8DAA8D;IAC9D,KAAK,IAAI,IAAI,CAAA;IAEb,iCAAiC;IACjC,SAAS,IAAI,MAAM,CAAA;IACnB,mCAAmC;IACnC,cAAc,IAAI,MAAM,CAAA;IACxB,mCAAmC;IACnC,YAAY,IAAI,MAAM,CAAA;IACtB,iCAAiC;IACjC,YAAY,IAAI,MAAM,CAAA;IACtB,qEAAqE;IACrE,sBAAsB,IAAI,MAAM,CAAA;IAChC,mEAAmE;IACnE,0BAA0B,IAAI,MAAM,CAAA;IACpC,0CAA0C;IAC1C,WAAW,IAAI,MAAM,CAAA;IACrB,mEAAmE;IACnE,kBAAkB,IAAI,QAAQ,GAAG,IAAI,CAAA;IACrC,oEAAoE;IACpE,mBAAmB,IAAI,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAA;IAEjD,wFAAwF;IACxF,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,GAAG,IAAI,CAAA;IAC5D,6DAA6D;IAC7D,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAChE,uEAAuE;IACvE,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAE/D,kFAAkF;IAClF,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAA;IAC5D,kEAAkE;IAClE,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;IAChE,6DAA6D;IAC7D,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;CAChE"}