@backblaze-labs/b2-sdk 0.3.0 → 0.4.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 (393) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +18 -5
  3. package/dist/_virtual/_b2-sdk-version-json.cjs +1 -1
  4. package/dist/_virtual/_b2-sdk-version-json.js +1 -1
  5. package/dist/auth/reauth-coalescer.cjs +65 -0
  6. package/dist/auth/reauth-coalescer.cjs.map +1 -0
  7. package/dist/auth/reauth-coalescer.d.cts +34 -0
  8. package/dist/auth/reauth-coalescer.d.cts.map +1 -0
  9. package/dist/auth/reauth-coalescer.d.ts +34 -0
  10. package/dist/auth/reauth-coalescer.d.ts.map +1 -0
  11. package/dist/auth/reauth-coalescer.js +65 -0
  12. package/dist/auth/reauth-coalescer.js.map +1 -0
  13. package/dist/backup/raw.cjs +37 -15
  14. package/dist/backup/raw.cjs.map +1 -1
  15. package/dist/backup/raw.d.cts +2 -2
  16. package/dist/backup/raw.d.cts.map +1 -1
  17. package/dist/backup/raw.d.ts +2 -2
  18. package/dist/backup/raw.d.ts.map +1 -1
  19. package/dist/backup/raw.js +37 -15
  20. package/dist/backup/raw.js.map +1 -1
  21. package/dist/bucket-validation.cjs +111 -0
  22. package/dist/bucket-validation.cjs.map +1 -0
  23. package/dist/bucket-validation.d.cts +27 -0
  24. package/dist/bucket-validation.d.cts.map +1 -0
  25. package/dist/bucket-validation.d.ts +27 -0
  26. package/dist/bucket-validation.d.ts.map +1 -0
  27. package/dist/bucket-validation.js +109 -0
  28. package/dist/bucket-validation.js.map +1 -0
  29. package/dist/bucket.cjs +123 -73
  30. package/dist/bucket.cjs.map +1 -1
  31. package/dist/bucket.d.cts +156 -61
  32. package/dist/bucket.d.cts.map +1 -1
  33. package/dist/bucket.d.ts +156 -61
  34. package/dist/bucket.d.ts.map +1 -1
  35. package/dist/bucket.js +123 -73
  36. package/dist/bucket.js.map +1 -1
  37. package/dist/client.cjs +29 -8
  38. package/dist/client.cjs.map +1 -1
  39. package/dist/client.d.cts +30 -9
  40. package/dist/client.d.cts.map +1 -1
  41. package/dist/client.d.ts +30 -9
  42. package/dist/client.d.ts.map +1 -1
  43. package/dist/client.js +29 -8
  44. package/dist/client.js.map +1 -1
  45. package/dist/download/single.cjs +38 -13
  46. package/dist/download/single.cjs.map +1 -1
  47. package/dist/download/single.d.cts +10 -4
  48. package/dist/download/single.d.cts.map +1 -1
  49. package/dist/download/single.d.ts +10 -4
  50. package/dist/download/single.d.ts.map +1 -1
  51. package/dist/download/single.js +38 -13
  52. package/dist/download/single.js.map +1 -1
  53. package/dist/errors/index.cjs +27 -4
  54. package/dist/errors/index.cjs.map +1 -1
  55. package/dist/errors/index.d.cts +15 -0
  56. package/dist/errors/index.d.cts.map +1 -1
  57. package/dist/errors/index.d.ts +15 -0
  58. package/dist/errors/index.d.ts.map +1 -1
  59. package/dist/errors/index.js +27 -5
  60. package/dist/errors/index.js.map +1 -1
  61. package/dist/http/non-idempotent-mutations.cjs +38 -0
  62. package/dist/http/non-idempotent-mutations.cjs.map +1 -0
  63. package/dist/http/non-idempotent-mutations.d.cts +25 -0
  64. package/dist/http/non-idempotent-mutations.d.cts.map +1 -0
  65. package/dist/http/non-idempotent-mutations.d.ts +25 -0
  66. package/dist/http/non-idempotent-mutations.d.ts.map +1 -0
  67. package/dist/http/non-idempotent-mutations.js +35 -0
  68. package/dist/http/non-idempotent-mutations.js.map +1 -0
  69. package/dist/http/transport.cjs +9 -8
  70. package/dist/http/transport.cjs.map +1 -1
  71. package/dist/http/transport.d.cts +5 -0
  72. package/dist/http/transport.d.cts.map +1 -1
  73. package/dist/http/transport.d.ts +5 -0
  74. package/dist/http/transport.d.ts.map +1 -1
  75. package/dist/http/transport.js +9 -8
  76. package/dist/http/transport.js.map +1 -1
  77. package/dist/http/user-agent.cjs +12 -1
  78. package/dist/http/user-agent.cjs.map +1 -1
  79. package/dist/http/user-agent.d.cts +8 -0
  80. package/dist/http/user-agent.d.cts.map +1 -1
  81. package/dist/http/user-agent.d.ts +8 -0
  82. package/dist/http/user-agent.d.ts.map +1 -1
  83. package/dist/http/user-agent.js +13 -3
  84. package/dist/http/user-agent.js.map +1 -1
  85. package/dist/index.cjs +25 -0
  86. package/dist/index.d.cts +10 -9
  87. package/dist/index.d.cts.map +1 -1
  88. package/dist/index.d.ts +10 -9
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js +7 -6
  91. package/dist/notifications/index.cjs +3 -0
  92. package/dist/notifications/index.d.cts +2 -0
  93. package/dist/notifications/index.d.cts.map +1 -1
  94. package/dist/notifications/index.d.ts +2 -0
  95. package/dist/notifications/index.d.ts.map +1 -1
  96. package/dist/notifications/index.js +2 -1
  97. package/dist/object.cjs +12 -1
  98. package/dist/object.cjs.map +1 -1
  99. package/dist/object.d.cts +7 -1
  100. package/dist/object.d.cts.map +1 -1
  101. package/dist/object.d.ts +7 -1
  102. package/dist/object.d.ts.map +1 -1
  103. package/dist/object.js +12 -1
  104. package/dist/object.js.map +1 -1
  105. package/dist/partner/auth-core.cjs +4 -23
  106. package/dist/partner/auth-core.cjs.map +1 -1
  107. package/dist/partner/auth-core.d.cts +1 -1
  108. package/dist/partner/auth-core.d.cts.map +1 -1
  109. package/dist/partner/auth-core.d.ts +1 -1
  110. package/dist/partner/auth-core.d.ts.map +1 -1
  111. package/dist/partner/auth-core.js +5 -24
  112. package/dist/partner/auth-core.js.map +1 -1
  113. package/dist/partner/client.cjs +25 -10
  114. package/dist/partner/client.cjs.map +1 -1
  115. package/dist/partner/client.d.cts +32 -10
  116. package/dist/partner/client.d.cts.map +1 -1
  117. package/dist/partner/client.d.ts +32 -10
  118. package/dist/partner/client.d.ts.map +1 -1
  119. package/dist/partner/client.js +25 -10
  120. package/dist/partner/client.js.map +1 -1
  121. package/dist/partner/endpoint-url.cjs +1 -0
  122. package/dist/partner/endpoint-url.cjs.map +1 -1
  123. package/dist/partner/endpoint-url.d.cts +2 -0
  124. package/dist/partner/endpoint-url.d.cts.map +1 -1
  125. package/dist/partner/endpoint-url.d.ts +2 -0
  126. package/dist/partner/endpoint-url.d.ts.map +1 -1
  127. package/dist/partner/endpoint-url.js +1 -0
  128. package/dist/partner/endpoint-url.js.map +1 -1
  129. package/dist/partner/in-memory.cjs.map +1 -1
  130. package/dist/partner/in-memory.js.map +1 -1
  131. package/dist/partner/index.cjs +9 -0
  132. package/dist/partner/index.d.cts +11 -2
  133. package/dist/partner/index.d.cts.map +1 -1
  134. package/dist/partner/index.d.ts +11 -2
  135. package/dist/partner/index.d.ts.map +1 -1
  136. package/dist/partner/index.js +3 -1
  137. package/dist/partner/raw.cjs +52 -44
  138. package/dist/partner/raw.cjs.map +1 -1
  139. package/dist/partner/raw.d.cts +16 -19
  140. package/dist/partner/raw.d.cts.map +1 -1
  141. package/dist/partner/raw.d.ts +16 -19
  142. package/dist/partner/raw.d.ts.map +1 -1
  143. package/dist/partner/raw.js +52 -44
  144. package/dist/partner/raw.js.map +1 -1
  145. package/dist/partner/redaction.cjs +133 -108
  146. package/dist/partner/redaction.cjs.map +1 -1
  147. package/dist/partner/redaction.d.cts +47 -13
  148. package/dist/partner/redaction.d.cts.map +1 -1
  149. package/dist/partner/redaction.d.ts +47 -13
  150. package/dist/partner/redaction.d.ts.map +1 -1
  151. package/dist/partner/redaction.js +133 -109
  152. package/dist/partner/redaction.js.map +1 -1
  153. package/dist/raw/encoding.cjs +29 -10
  154. package/dist/raw/encoding.cjs.map +1 -1
  155. package/dist/raw/encoding.d.cts +3 -2
  156. package/dist/raw/encoding.d.cts.map +1 -1
  157. package/dist/raw/encoding.d.ts +3 -2
  158. package/dist/raw/encoding.d.ts.map +1 -1
  159. package/dist/raw/encoding.js +29 -10
  160. package/dist/raw/encoding.js.map +1 -1
  161. package/dist/raw/index.cjs +64 -39
  162. package/dist/raw/index.cjs.map +1 -1
  163. package/dist/raw/index.d.cts +21 -19
  164. package/dist/raw/index.d.cts.map +1 -1
  165. package/dist/raw/index.d.ts +21 -19
  166. package/dist/raw/index.d.ts.map +1 -1
  167. package/dist/raw/index.js +47 -40
  168. package/dist/raw/index.js.map +1 -1
  169. package/dist/raw/url.cjs.map +1 -1
  170. package/dist/raw/url.d.cts +3 -3
  171. package/dist/raw/url.d.ts +3 -3
  172. package/dist/raw/url.js.map +1 -1
  173. package/dist/simulator/index.cjs +456 -125
  174. package/dist/simulator/index.cjs.map +1 -1
  175. package/dist/simulator/index.d.cts +16 -1
  176. package/dist/simulator/index.d.cts.map +1 -1
  177. package/dist/simulator/index.d.ts +16 -1
  178. package/dist/simulator/index.d.ts.map +1 -1
  179. package/dist/simulator/index.js +449 -130
  180. package/dist/simulator/index.js.map +1 -1
  181. package/dist/simulator/partner-capabilities.cjs +77 -0
  182. package/dist/simulator/partner-capabilities.cjs.map +1 -0
  183. package/dist/simulator/partner-capabilities.d.cts +53 -0
  184. package/dist/simulator/partner-capabilities.d.cts.map +1 -0
  185. package/dist/simulator/partner-capabilities.d.ts +53 -0
  186. package/dist/simulator/partner-capabilities.d.ts.map +1 -0
  187. package/dist/simulator/partner-capabilities.js +73 -0
  188. package/dist/simulator/partner-capabilities.js.map +1 -0
  189. package/dist/simulator/partner.cjs +55 -61
  190. package/dist/simulator/partner.cjs.map +1 -1
  191. package/dist/simulator/partner.d.cts +5 -2
  192. package/dist/simulator/partner.d.cts.map +1 -1
  193. package/dist/simulator/partner.d.ts +5 -2
  194. package/dist/simulator/partner.d.ts.map +1 -1
  195. package/dist/simulator/partner.js +56 -61
  196. package/dist/simulator/partner.js.map +1 -1
  197. package/dist/simulator/validation.cjs +160 -30
  198. package/dist/simulator/validation.cjs.map +1 -1
  199. package/dist/simulator/validation.d.cts +28 -6
  200. package/dist/simulator/validation.d.cts.map +1 -1
  201. package/dist/simulator/validation.d.ts +28 -6
  202. package/dist/simulator/validation.d.ts.map +1 -1
  203. package/dist/simulator/validation.js +148 -31
  204. package/dist/simulator/validation.js.map +1 -1
  205. package/dist/streams/file-source.cjs +1 -1
  206. package/dist/streams/file-source.cjs.map +1 -1
  207. package/dist/streams/file-source.js +1 -1
  208. package/dist/streams/file-source.js.map +1 -1
  209. package/dist/streams/hash.cjs +246 -13
  210. package/dist/streams/hash.cjs.map +1 -1
  211. package/dist/streams/hash.d.cts +37 -12
  212. package/dist/streams/hash.d.cts.map +1 -1
  213. package/dist/streams/hash.d.ts +37 -12
  214. package/dist/streams/hash.d.ts.map +1 -1
  215. package/dist/streams/hash.js +246 -15
  216. package/dist/streams/hash.js.map +1 -1
  217. package/dist/streams/index.cjs +2 -0
  218. package/dist/streams/index.d.cts +1 -1
  219. package/dist/streams/index.d.cts.map +1 -1
  220. package/dist/streams/index.d.ts +1 -1
  221. package/dist/streams/index.d.ts.map +1 -1
  222. package/dist/streams/index.js +2 -2
  223. package/dist/streams/progress.cjs +63 -4
  224. package/dist/streams/progress.cjs.map +1 -1
  225. package/dist/streams/progress.d.cts +28 -2
  226. package/dist/streams/progress.d.cts.map +1 -1
  227. package/dist/streams/progress.d.ts +28 -2
  228. package/dist/streams/progress.d.ts.map +1 -1
  229. package/dist/streams/progress.js +63 -4
  230. package/dist/streams/progress.js.map +1 -1
  231. package/dist/sync/download-staging.cjs +147 -35
  232. package/dist/sync/download-staging.cjs.map +1 -1
  233. package/dist/sync/download-staging.d.cts +25 -2
  234. package/dist/sync/download-staging.d.cts.map +1 -1
  235. package/dist/sync/download-staging.d.ts +25 -2
  236. package/dist/sync/download-staging.d.ts.map +1 -1
  237. package/dist/sync/download-staging.js +146 -36
  238. package/dist/sync/download-staging.js.map +1 -1
  239. package/dist/sync/index.d.cts +1 -1
  240. package/dist/sync/index.d.cts.map +1 -1
  241. package/dist/sync/index.d.ts +1 -1
  242. package/dist/sync/index.d.ts.map +1 -1
  243. package/dist/sync/local-file-io.cjs +5 -1
  244. package/dist/sync/local-file-io.cjs.map +1 -1
  245. package/dist/sync/local-file-io.d.cts +2 -0
  246. package/dist/sync/local-file-io.d.cts.map +1 -1
  247. package/dist/sync/local-file-io.d.ts +2 -0
  248. package/dist/sync/local-file-io.d.ts.map +1 -1
  249. package/dist/sync/local-file-io.js +5 -1
  250. package/dist/sync/local-file-io.js.map +1 -1
  251. package/dist/sync/pairing.cjs +1 -0
  252. package/dist/sync/pairing.cjs.map +1 -1
  253. package/dist/sync/pairing.js +1 -0
  254. package/dist/sync/pairing.js.map +1 -1
  255. package/dist/sync/scanners/b2.cjs +2 -0
  256. package/dist/sync/scanners/b2.cjs.map +1 -1
  257. package/dist/sync/scanners/b2.d.cts.map +1 -1
  258. package/dist/sync/scanners/b2.d.ts.map +1 -1
  259. package/dist/sync/scanners/b2.js +2 -0
  260. package/dist/sync/scanners/b2.js.map +1 -1
  261. package/dist/sync/scanners/local.cjs +150 -33
  262. package/dist/sync/scanners/local.cjs.map +1 -1
  263. package/dist/sync/scanners/local.d.cts +6 -0
  264. package/dist/sync/scanners/local.d.cts.map +1 -1
  265. package/dist/sync/scanners/local.d.ts +6 -0
  266. package/dist/sync/scanners/local.d.ts.map +1 -1
  267. package/dist/sync/scanners/local.js +150 -33
  268. package/dist/sync/scanners/local.js.map +1 -1
  269. package/dist/sync/synchronizer.cjs +76 -29
  270. package/dist/sync/synchronizer.cjs.map +1 -1
  271. package/dist/sync/synchronizer.d.cts +1 -0
  272. package/dist/sync/synchronizer.d.cts.map +1 -1
  273. package/dist/sync/synchronizer.d.ts +1 -0
  274. package/dist/sync/synchronizer.d.ts.map +1 -1
  275. package/dist/sync/synchronizer.js +76 -29
  276. package/dist/sync/synchronizer.js.map +1 -1
  277. package/dist/sync/types.d.cts +19 -3
  278. package/dist/sync/types.d.cts.map +1 -1
  279. package/dist/sync/types.d.ts +19 -3
  280. package/dist/sync/types.d.ts.map +1 -1
  281. package/dist/types/backup.d.cts +6 -1
  282. package/dist/types/backup.d.cts.map +1 -1
  283. package/dist/types/backup.d.ts +6 -1
  284. package/dist/types/backup.d.ts.map +1 -1
  285. package/dist/types/bucket.cjs +81 -11
  286. package/dist/types/bucket.cjs.map +1 -1
  287. package/dist/types/bucket.d.cts +190 -39
  288. package/dist/types/bucket.d.cts.map +1 -1
  289. package/dist/types/bucket.d.ts +190 -39
  290. package/dist/types/bucket.d.ts.map +1 -1
  291. package/dist/types/bucket.js +67 -12
  292. package/dist/types/bucket.js.map +1 -1
  293. package/dist/types/download.cjs.map +1 -1
  294. package/dist/types/download.d.cts +3 -17
  295. package/dist/types/download.d.cts.map +1 -1
  296. package/dist/types/download.d.ts +3 -17
  297. package/dist/types/download.d.ts.map +1 -1
  298. package/dist/types/download.js.map +1 -1
  299. package/dist/types/encryption.cjs +18 -0
  300. package/dist/types/encryption.cjs.map +1 -1
  301. package/dist/types/encryption.d.cts +21 -11
  302. package/dist/types/encryption.d.cts.map +1 -1
  303. package/dist/types/encryption.d.ts +21 -11
  304. package/dist/types/encryption.d.ts.map +1 -1
  305. package/dist/types/encryption.js +18 -0
  306. package/dist/types/encryption.js.map +1 -1
  307. package/dist/types/file.cjs +3 -0
  308. package/dist/types/file.cjs.map +1 -1
  309. package/dist/types/file.d.cts +125 -16
  310. package/dist/types/file.d.cts.map +1 -1
  311. package/dist/types/file.d.ts +125 -16
  312. package/dist/types/file.d.ts.map +1 -1
  313. package/dist/types/file.js +3 -1
  314. package/dist/types/file.js.map +1 -1
  315. package/dist/types/index.d.cts +7 -7
  316. package/dist/types/index.d.cts.map +1 -1
  317. package/dist/types/index.d.ts +7 -7
  318. package/dist/types/index.d.ts.map +1 -1
  319. package/dist/types/key.d.cts +4 -3
  320. package/dist/types/key.d.cts.map +1 -1
  321. package/dist/types/key.d.ts +4 -3
  322. package/dist/types/key.d.ts.map +1 -1
  323. package/dist/types/notifications.cjs +30 -0
  324. package/dist/types/notifications.cjs.map +1 -1
  325. package/dist/types/notifications.d.cts +26 -1
  326. package/dist/types/notifications.d.cts.map +1 -1
  327. package/dist/types/notifications.d.ts +26 -1
  328. package/dist/types/notifications.d.ts.map +1 -1
  329. package/dist/types/notifications.js +29 -1
  330. package/dist/types/notifications.js.map +1 -1
  331. package/dist/types/partner.cjs.map +1 -1
  332. package/dist/types/partner.d.cts +28 -36
  333. package/dist/types/partner.d.cts.map +1 -1
  334. package/dist/types/partner.d.ts +28 -36
  335. package/dist/types/partner.d.ts.map +1 -1
  336. package/dist/types/partner.js.map +1 -1
  337. package/dist/types/upload.d.cts +4 -0
  338. package/dist/types/upload.d.cts.map +1 -1
  339. package/dist/types/upload.d.ts +4 -0
  340. package/dist/types/upload.d.ts.map +1 -1
  341. package/dist/upload/large.cjs +10 -7
  342. package/dist/upload/large.cjs.map +1 -1
  343. package/dist/upload/large.d.cts +15 -6
  344. package/dist/upload/large.d.cts.map +1 -1
  345. package/dist/upload/large.d.ts +15 -6
  346. package/dist/upload/large.d.ts.map +1 -1
  347. package/dist/upload/large.js +10 -7
  348. package/dist/upload/large.js.map +1 -1
  349. package/dist/upload/options.cjs.map +1 -1
  350. package/dist/upload/options.d.cts +12 -0
  351. package/dist/upload/options.d.cts.map +1 -1
  352. package/dist/upload/options.d.ts +12 -0
  353. package/dist/upload/options.d.ts.map +1 -1
  354. package/dist/upload/options.js.map +1 -1
  355. package/dist/upload/resume.cjs +4 -3
  356. package/dist/upload/resume.cjs.map +1 -1
  357. package/dist/upload/resume.d.cts +6 -4
  358. package/dist/upload/resume.d.cts.map +1 -1
  359. package/dist/upload/resume.d.ts +6 -4
  360. package/dist/upload/resume.d.ts.map +1 -1
  361. package/dist/upload/resume.js +4 -3
  362. package/dist/upload/resume.js.map +1 -1
  363. package/dist/upload/retry.cjs +17 -10
  364. package/dist/upload/retry.cjs.map +1 -1
  365. package/dist/upload/retry.d.cts.map +1 -1
  366. package/dist/upload/retry.d.ts.map +1 -1
  367. package/dist/upload/retry.js +17 -10
  368. package/dist/upload/retry.js.map +1 -1
  369. package/dist/upload/single.cjs +35 -31
  370. package/dist/upload/single.cjs.map +1 -1
  371. package/dist/upload/single.d.cts +6 -0
  372. package/dist/upload/single.d.cts.map +1 -1
  373. package/dist/upload/single.d.ts +6 -0
  374. package/dist/upload/single.d.ts.map +1 -1
  375. package/dist/upload/single.js +35 -31
  376. package/dist/upload/single.js.map +1 -1
  377. package/dist/upload/stream.cjs +12 -1
  378. package/dist/upload/stream.cjs.map +1 -1
  379. package/dist/upload/stream.d.cts +6 -0
  380. package/dist/upload/stream.d.cts.map +1 -1
  381. package/dist/upload/stream.d.ts +6 -0
  382. package/dist/upload/stream.d.ts.map +1 -1
  383. package/dist/upload/stream.js +12 -1
  384. package/dist/upload/stream.js.map +1 -1
  385. package/dist/version.cjs +56 -4
  386. package/dist/version.cjs.map +1 -1
  387. package/dist/version.d.cts +53 -4
  388. package/dist/version.d.cts.map +1 -1
  389. package/dist/version.d.ts +53 -4
  390. package/dist/version.d.ts.map +1 -1
  391. package/dist/version.js +52 -5
  392. package/dist/version.js.map +1 -1
  393. package/package.json +11 -4
@@ -1,5 +1,5 @@
1
1
  import { EncryptionSetting } from '../types/encryption.js';
2
- import { FileVersion } from '../types/file.js';
2
+ import { FileVersion, ListedConcreteFileVersion } from '../types/file.js';
3
3
  import { SyncSha1State } from './sha1-metadata.js';
4
4
  /**
5
5
  * Strategy for comparing source and destination files.
@@ -17,6 +17,8 @@ export type CompareMode = 'modtime' | 'size' | 'sha1' | 'none';
17
17
  export type KeepMode = 'no-delete' | 'delete' | 'keep-days';
18
18
  /** Direction of a sync operation. */
19
19
  export type SyncDirection = 'local-to-b2' | 'b2-to-local' | 'b2-to-b2';
20
+ /** Policy for child symlinks encountered by {@link LocalFolder} scans. */
21
+ export type LocalSymlinkPolicy = 'skip' | 'follow';
20
22
  /**
21
23
  * Glob string or regular expression used to include or exclude sync paths.
22
24
  *
@@ -91,6 +93,13 @@ export interface SyncScanOptions extends SyncFilterOptions {
91
93
  * continuing toward unbounded heap growth. Defaults to the SDK scan limit.
92
94
  */
93
95
  readonly maxScanEntries?: number;
96
+ /**
97
+ * How the built-in local scanner handles child symlinks. Defaults to `'skip'`.
98
+ * `'follow'` only follows targets that resolve inside the configured root and skips repeated
99
+ * followed directory identities. Symlinked roots are still followed because the configured root
100
+ * is the scan boundary.
101
+ */
102
+ readonly localSymlinks?: LocalSymlinkPolicy;
94
103
  }
95
104
  /** Common metadata for a file discovered during a folder scan. */
96
105
  export interface SyncPath {
@@ -151,7 +160,7 @@ export interface B2SyncPath extends SyncPath {
151
160
  /** The most recent visible file version. */
152
161
  readonly selectedVersion: FileVersion;
153
162
  /** All versions of this file, sorted newest first. */
154
- readonly allVersions: FileVersion[];
163
+ readonly allVersions: ListedConcreteFileVersion[];
155
164
  }
156
165
  /** Discriminated event types emitted during synchronization. */
157
166
  export type SyncEventType = 'upload-start' | 'upload-done' | 'download-start' | 'download-done' | 'copy-start' | 'copy-done' | 'hide' | 'delete-remote' | 'delete-local' | 'skip' | 'error' | 'compare';
@@ -162,7 +171,7 @@ export type SyncEventType = 'upload-start' | 'upload-done' | 'download-start' |
162
171
  */
163
172
  export type SyncActionEventType = 'upload-start' | 'upload-done' | 'download-start' | 'download-done' | 'copy-start' | 'copy-done' | 'hide' | 'delete-remote' | 'delete-local';
164
173
  /** Machine-readable reasons emitted with scanner and diagnostic skip events. */
165
- export type SyncSkipReason = 'outside-prefix' | 'unsafe-name' | 'local-unsafe-name' | 'relative-path-collision' | 'local-path-collision' | 'filesystem-error' | 'path-too-long-for-regexp' | 'scan-skip-overflow' | 'stale-download-partial';
174
+ export type SyncSkipReason = 'outside-prefix' | 'unsafe-name' | 'local-unsafe-name' | 'relative-path-collision' | 'local-path-collision' | 'filesystem-error' | 'path-too-long-for-regexp' | 'scan-skip-overflow' | 'stale-download-partial' | 'local-symlink' | 'local-symlink-loop';
166
175
  /**
167
176
  * Per-action progress event (transfer or metadata change). All
168
177
  * action-event variants share the same shape; the `type` tag distinguishes
@@ -274,6 +283,13 @@ export interface SyncOptions extends SyncFilterOptions {
274
283
  readonly downloadIdleTimeoutMillis?: number;
275
284
  /** Maximum scanner entries retained before failing with a defined scan-limit error. */
276
285
  readonly maxScanEntries?: number;
286
+ /**
287
+ * How built-in local scans handle child symlinks. Defaults to `'skip'`.
288
+ * `'follow'` only follows targets that resolve inside the local root; B2-to-local syncs still
289
+ * skip child symlinks during destination scans so download/delete actions never target them.
290
+ * Symlinked roots are controlled separately by the sync root safety checks.
291
+ */
292
+ readonly localSymlinks?: LocalSymlinkPolicy;
277
293
  /** Optional provider for per-file encryption settings. */
278
294
  readonly encryptionProvider?: SyncEncryptionProvider;
279
295
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAE9D,yEAAyE;AACzE,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAA;AAE3D,qCAAqC;AACrC,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,aAAa,GAAG,UAAU,CAAA;AAEtE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAA;AAE/C;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B;;;OAGG;IACH,QAAQ,CA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C,QAAQ,CAAC,CAAA;CACzD"}
@@ -1,5 +1,5 @@
1
1
  import { EncryptionSetting } from '../types/encryption.js';
2
- import { FileVersion } from '../types/file.js';
2
+ import { FileVersion, ListedConcreteFileVersion } from '../types/file.js';
3
3
  import { SyncSha1State } from './sha1-metadata.js';
4
4
  /**
5
5
  * Strategy for comparing source and destination files.
@@ -17,6 +17,8 @@ export type CompareMode = 'modtime' | 'size' | 'sha1' | 'none';
17
17
  export type KeepMode = 'no-delete' | 'delete' | 'keep-days';
18
18
  /** Direction of a sync operation. */
19
19
  export type SyncDirection = 'local-to-b2' | 'b2-to-local' | 'b2-to-b2';
20
+ /** Policy for child symlinks encountered by {@link LocalFolder} scans. */
21
+ export type LocalSymlinkPolicy = 'skip' | 'follow';
20
22
  /**
21
23
  * Glob string or regular expression used to include or exclude sync paths.
22
24
  *
@@ -91,6 +93,13 @@ export interface SyncScanOptions extends SyncFilterOptions {
91
93
  * continuing toward unbounded heap growth. Defaults to the SDK scan limit.
92
94
  */
93
95
  readonly maxScanEntries?: number;
96
+ /**
97
+ * How the built-in local scanner handles child symlinks. Defaults to `'skip'`.
98
+ * `'follow'` only follows targets that resolve inside the configured root and skips repeated
99
+ * followed directory identities. Symlinked roots are still followed because the configured root
100
+ * is the scan boundary.
101
+ */
102
+ readonly localSymlinks?: LocalSymlinkPolicy;
94
103
  }
95
104
  /** Common metadata for a file discovered during a folder scan. */
96
105
  export interface SyncPath {
@@ -151,7 +160,7 @@ export interface B2SyncPath extends SyncPath {
151
160
  /** The most recent visible file version. */
152
161
  readonly selectedVersion: FileVersion;
153
162
  /** All versions of this file, sorted newest first. */
154
- readonly allVersions: FileVersion[];
163
+ readonly allVersions: ListedConcreteFileVersion[];
155
164
  }
156
165
  /** Discriminated event types emitted during synchronization. */
157
166
  export type SyncEventType = 'upload-start' | 'upload-done' | 'download-start' | 'download-done' | 'copy-start' | 'copy-done' | 'hide' | 'delete-remote' | 'delete-local' | 'skip' | 'error' | 'compare';
@@ -162,7 +171,7 @@ export type SyncEventType = 'upload-start' | 'upload-done' | 'download-start' |
162
171
  */
163
172
  export type SyncActionEventType = 'upload-start' | 'upload-done' | 'download-start' | 'download-done' | 'copy-start' | 'copy-done' | 'hide' | 'delete-remote' | 'delete-local';
164
173
  /** Machine-readable reasons emitted with scanner and diagnostic skip events. */
165
- export type SyncSkipReason = 'outside-prefix' | 'unsafe-name' | 'local-unsafe-name' | 'relative-path-collision' | 'local-path-collision' | 'filesystem-error' | 'path-too-long-for-regexp' | 'scan-skip-overflow' | 'stale-download-partial';
174
+ export type SyncSkipReason = 'outside-prefix' | 'unsafe-name' | 'local-unsafe-name' | 'relative-path-collision' | 'local-path-collision' | 'filesystem-error' | 'path-too-long-for-regexp' | 'scan-skip-overflow' | 'stale-download-partial' | 'local-symlink' | 'local-symlink-loop';
166
175
  /**
167
176
  * Per-action progress event (transfer or metadata change). All
168
177
  * action-event variants share the same shape; the `type` tag distinguishes
@@ -274,6 +283,13 @@ export interface SyncOptions extends SyncFilterOptions {
274
283
  readonly downloadIdleTimeoutMillis?: number;
275
284
  /** Maximum scanner entries retained before failing with a defined scan-limit error. */
276
285
  readonly maxScanEntries?: number;
286
+ /**
287
+ * How built-in local scans handle child symlinks. Defaults to `'skip'`.
288
+ * `'follow'` only follows targets that resolve inside the local root; B2-to-local syncs still
289
+ * skip child symlinks during destination scans so download/delete actions never target them.
290
+ * Symlinked roots are controlled separately by the sync root safety checks.
291
+ */
292
+ readonly localSymlinks?: LocalSymlinkPolicy;
277
293
  /** Optional provider for per-file encryption settings. */
278
294
  readonly encryptionProvider?: SyncEncryptionProvider;
279
295
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa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AAC,cAAc,CAAC,EAAE,MAAM,CAAA;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAA;IAC3C,0DAA0D;IAC1D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,sBAAsB,CAAA;CACrD;AAED,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACrC,6FAA6F;IAC7F,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAA;IAClF,+FAA+F;IAC/F,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS,CAAA;CAC/E;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAA;IAClC;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAA;IAClC,qEAAqE;IACrE,IAAI,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;CACzD"}
@@ -59,7 +59,8 @@ export interface DeleteComputerRequest {
59
59
  /**
60
60
  * Single result element returned by `bz_delete_computer`.
61
61
  *
62
- * The `bz_delete_computer` wire response is a JSON array of these objects.
62
+ * The SDK models the `bz_delete_computer` wire response as a JSON array of
63
+ * these objects and keeps the simulator aligned with that array-shaped schema.
63
64
  *
64
65
  * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.
65
66
  */
@@ -74,6 +75,10 @@ export interface DeleteComputerResult {
74
75
  /**
75
76
  * Array-shaped wire response from `bz_delete_computer`.
76
77
  *
78
+ * The apidocs response schema declares an array while its example shows a bare
79
+ * object; the raw client normalizes both wire shapes to this array type, and
80
+ * the simulator emits the array shape.
81
+ *
77
82
  * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.
78
83
  */
79
84
  export type DeleteComputerResponse = readonly DeleteComputerResult[];
@@ -1 +1 @@
1
- {"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/types/backup.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,wDAAwD;IACxD,QAAQ,CAAC,eAAe,CAAC,EAAE,UAAU,CAAA;IACrC,oFAAoF;IACpF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAC/B,mCAAmC;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,gFAAgF;IAChF,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAA;CAC3C;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,yFAAyF;IACzF,QAAQ,CAAC,cAAc,EAAE,UAAU,GAAG,IAAI,CAAA;IAC1C,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAA;CAC9C;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,CAAA;AAEvD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC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DAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,gFAAgF;IAChF,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAA;CAC3C;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,oBAAoB,EAAE,CAAA"}
@@ -59,7 +59,8 @@ export interface DeleteComputerRequest {
59
59
  /**
60
60
  * Single result element returned by `bz_delete_computer`.
61
61
  *
62
- * The `bz_delete_computer` wire response is a JSON array of these objects.
62
+ * The SDK models the `bz_delete_computer` wire response as a JSON array of
63
+ * these objects and keeps the simulator aligned with that array-shaped schema.
63
64
  *
64
65
  * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.
65
66
  */
@@ -74,6 +75,10 @@ export interface DeleteComputerResult {
74
75
  /**
75
76
  * Array-shaped wire response from `bz_delete_computer`.
76
77
  *
78
+ * The apidocs response schema declares an array while its example shows a bare
79
+ * object; the raw client normalizes both wire shapes to this array type, and
80
+ * the simulator emits the array shape.
81
+ *
77
82
  * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.
78
83
  */
79
84
  export type DeleteComputerResponse = readonly DeleteComputerResult[];
@@ -1 +1 @@
1
- {"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/types/backup.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,wDAAwD;IACxD,QAAQ,CAAC,eAAe,CAAC,EAAE,UAAU,CAAA;IACrC,oFAAoF;IACpF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD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C,EAAE,MAAM,CAAA;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAC/B,mCAAmC;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,gFAAgF;IAChF,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAA;CAC3C;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,yFAAyF;IACzF,QAAQ,CAAC,cAAc,EAAE,UAAU,GAAG,IAAI,CAAA;IAC1C,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAA;CAC9C;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,CAAA;AAEvD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;CAChC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,gFAAgF;IAChF,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAA;CAC3C;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,oBAAoB,EAAE,CAAA"}
@@ -1,10 +1,6 @@
1
1
  //#region src/types/bucket.ts
2
2
  /**
3
- * Named constants for the bucket access level.
4
- *
5
- * The {@link BucketType} type alias is derived from the values of this
6
- * object, so the const is the single source of truth: adding a key here
7
- * automatically widens the type union.
3
+ * Named constants for bucket types accepted by create/update bucket requests.
8
4
  *
9
5
  * @example
10
6
  * ```ts
@@ -21,6 +17,34 @@ var BucketType = {
21
17
  /** B2-restricted bucket (e.g., for S3-compatible workflows). */
22
18
  Restricted: "restricted"
23
19
  };
20
+ /** Named constants for documented bucket response types known to the SDK. */
21
+ var KnownBucketResponseType = {
22
+ ...BucketType,
23
+ /** Response-only bucket type for buckets shared with the account. */
24
+ Shared: "shared"
25
+ };
26
+ /**
27
+ * Named constants for option flags returned on buckets and application keys.
28
+ *
29
+ * B2 currently documents only the S3-compatible API option.
30
+ */
31
+ var BucketKeyOption = {
32
+ /** Enables the S3-compatible API surface for the bucket or key. */
33
+ S3: "s3" };
34
+ /** Minimum UTF-8 byte length for each bucketInfo key. */
35
+ var BUCKET_INFO_KEY_MIN_BYTES = 1;
36
+ /** Maximum UTF-8 byte length for each bucketInfo key. */
37
+ var BUCKET_INFO_KEY_MAX_BYTES = 50;
38
+ /** Maximum aggregate UTF-8 byte length of all bucketInfo values. */
39
+ var BUCKET_INFO_VALUES_MAX_BYTES = 1e4;
40
+ /** Reserved bucketInfo key prefix used by Backblaze. */
41
+ var BUCKET_INFO_RESERVED_PREFIX = "b2-";
42
+ /**
43
+ * BucketInfo keys must match this regular-expression source. B2 accepts
44
+ * letters, digits, and these characters: `. _ ~ ! # $ % ^ & * ' | + -` plus the
45
+ * backtick.
46
+ */
47
+ var BUCKET_INFO_KEY_PATTERN = "^[A-Za-z0-9._`~!#$%^&*'|+-]+$";
24
48
  /**
25
49
  * Named constants for the B2 + S3 operations a CORS rule can permit.
26
50
  *
@@ -47,17 +71,48 @@ var CorsOperation = {
47
71
  B2UploadFile: "b2_upload_file",
48
72
  /** Native B2 multipart-part upload. */
49
73
  B2UploadPart: "b2_upload_part",
50
- /** S3-compatible DELETE. */
51
- S3Delete: "s3_delete",
52
74
  /** S3-compatible GET. */
53
75
  S3Get: "s3_get",
54
- /** S3-compatible HEAD. */
55
- S3Head: "s3_head",
56
- /** S3-compatible POST. */
76
+ /**
77
+ * S3-compatible POST.
78
+ *
79
+ * @deprecated B2 bucket CORS rules do not accept `s3_post`. This member is
80
+ * preserved so existing imports continue to compile. Use one of
81
+ * {@link CORS_ALLOWED_OPERATIONS} for newly validated bucket CORS rules.
82
+ */
57
83
  S3Post: "s3_post",
58
84
  /** S3-compatible PUT. */
59
- S3Put: "s3_put"
85
+ S3Put: "s3_put",
86
+ /** S3-compatible HEAD. */
87
+ S3Head: "s3_head",
88
+ /** S3-compatible DELETE. */
89
+ S3Delete: "s3_delete"
60
90
  };
91
+ /** All CORS operations accepted by B2 bucket CORS rules. */
92
+ var CORS_ALLOWED_OPERATIONS = [
93
+ CorsOperation.B2DownloadFileByName,
94
+ CorsOperation.B2DownloadFileById,
95
+ CorsOperation.B2UploadFile,
96
+ CorsOperation.B2UploadPart,
97
+ CorsOperation.S3Get,
98
+ CorsOperation.S3Put,
99
+ CorsOperation.S3Head,
100
+ CorsOperation.S3Delete
101
+ ];
102
+ /** Maximum number of CORS rules allowed on a bucket. */
103
+ var CORS_RULES_MAX_COUNT = 100;
104
+ /** Minimum character length for a CORS rule name. */
105
+ var CORS_RULE_NAME_MIN_LENGTH = 6;
106
+ /** Maximum character length for a CORS rule name. */
107
+ var CORS_RULE_NAME_MAX_LENGTH = 63;
108
+ /** CORS rule names must match this regular-expression source. */
109
+ var CORS_RULE_NAME_PATTERN = "^[A-Za-z0-9-]+$";
110
+ /** Reserved CORS rule-name prefix used by Backblaze. */
111
+ var CORS_RULE_NAME_RESERVED_PREFIX = "b2-";
112
+ /** Exclusive UTF-8 byte-size ceiling for each CORS rule definition. */
113
+ var CORS_RULE_MAX_BYTES = 1e3;
114
+ /** Maximum accepted CORS preflight cache duration in seconds. */
115
+ var CORS_MAX_AGE_SECONDS_MAX = 86400;
61
116
  /**
62
117
  * Named constants for the bucket-level Object Lock retention mode.
63
118
  *
@@ -73,8 +128,23 @@ var BucketRetentionMode = {
73
128
  None: "none"
74
129
  };
75
130
  //#endregion
131
+ exports.BUCKET_INFO_KEY_MAX_BYTES = BUCKET_INFO_KEY_MAX_BYTES;
132
+ exports.BUCKET_INFO_KEY_MIN_BYTES = BUCKET_INFO_KEY_MIN_BYTES;
133
+ exports.BUCKET_INFO_KEY_PATTERN = BUCKET_INFO_KEY_PATTERN;
134
+ exports.BUCKET_INFO_RESERVED_PREFIX = BUCKET_INFO_RESERVED_PREFIX;
135
+ exports.BUCKET_INFO_VALUES_MAX_BYTES = BUCKET_INFO_VALUES_MAX_BYTES;
136
+ exports.BucketKeyOption = BucketKeyOption;
76
137
  exports.BucketRetentionMode = BucketRetentionMode;
77
138
  exports.BucketType = BucketType;
139
+ exports.CORS_ALLOWED_OPERATIONS = CORS_ALLOWED_OPERATIONS;
140
+ exports.CORS_MAX_AGE_SECONDS_MAX = CORS_MAX_AGE_SECONDS_MAX;
141
+ exports.CORS_RULES_MAX_COUNT = CORS_RULES_MAX_COUNT;
142
+ exports.CORS_RULE_MAX_BYTES = CORS_RULE_MAX_BYTES;
143
+ exports.CORS_RULE_NAME_MAX_LENGTH = CORS_RULE_NAME_MAX_LENGTH;
144
+ exports.CORS_RULE_NAME_MIN_LENGTH = CORS_RULE_NAME_MIN_LENGTH;
145
+ exports.CORS_RULE_NAME_PATTERN = CORS_RULE_NAME_PATTERN;
146
+ exports.CORS_RULE_NAME_RESERVED_PREFIX = CORS_RULE_NAME_RESERVED_PREFIX;
78
147
  exports.CorsOperation = CorsOperation;
148
+ exports.KnownBucketResponseType = KnownBucketResponseType;
79
149
 
80
150
  //# sourceMappingURL=bucket.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bucket.cjs","names":[],"sources":["../../src/types/bucket.ts"],"sourcesContent":["import type { EncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId } from './ids.ts'\nimport type { ReplicationConfiguration } from './replication.ts'\n\n/**\n * Named constants for the bucket access level.\n *\n * The {@link BucketType} type alias is derived from the values of this\n * object, so the const is the single source of truth: adding a key here\n * automatically widens the type union.\n *\n * @example\n * ```ts\n * await client.createBucket({ bucketName: 'my-app-logs', bucketType: BucketType.AllPrivate })\n * ```\n */\nexport const BucketType = {\n /** Publicly downloadable without authentication. */\n AllPublic: 'allPublic',\n /** Requires a valid auth token to download. */\n AllPrivate: 'allPrivate',\n /** Internal snapshot bucket type, generally not user-created. */\n Snapshot: 'snapshot',\n /** B2-restricted bucket (e.g., for S3-compatible workflows). */\n Restricted: 'restricted',\n} as const\n\n/** Access level for a B2 bucket. Derived from {@link BucketType}. */\nexport type BucketType = (typeof BucketType)[keyof typeof BucketType]\n\n/** Rule that automatically hides or deletes files after a specified number of days. */\nexport interface LifecycleRule {\n /** Days after hiding before automatic deletion, or null to never auto-delete hidden files. */\n readonly daysFromHidingToDeleting?: number | null\n /** Days after upload before automatic hiding, or null to never auto-hide. */\n readonly daysFromUploadingToHiding?: number | null\n /** Days after starting before automatic cancellation of unfinished large files, or null to never auto-cancel. */\n readonly daysFromStartingToCancelingUnfinishedLargeFiles?: number | null\n /** File name prefix this rule applies to. Empty string matches all files. */\n readonly fileNamePrefix: string\n}\n\n/**\n * Named constants for the B2 + S3 operations a CORS rule can permit.\n *\n * @example\n * ```ts\n * await bucket.update({\n * corsRules: [{\n * corsRuleName: 'browser-downloads',\n * allowedOrigins: ['https://example.com'],\n * allowedOperations: [CorsOperation.B2DownloadFileByName, CorsOperation.S3Get],\n * allowedHeaders: null,\n * exposeHeaders: null,\n * maxAgeSeconds: 3600,\n * }],\n * })\n * ```\n */\nexport const CorsOperation = {\n /** Native B2 download-by-name request. */\n B2DownloadFileByName: 'b2_download_file_by_name',\n /** Native B2 download-by-id request. */\n B2DownloadFileById: 'b2_download_file_by_id',\n /** Native B2 small-file upload. */\n B2UploadFile: 'b2_upload_file',\n /** Native B2 multipart-part upload. */\n B2UploadPart: 'b2_upload_part',\n /** S3-compatible DELETE. */\n S3Delete: 's3_delete',\n /** S3-compatible GET. */\n S3Get: 's3_get',\n /** S3-compatible HEAD. */\n S3Head: 's3_head',\n /** S3-compatible POST. */\n S3Post: 's3_post',\n /** S3-compatible PUT. */\n S3Put: 's3_put',\n} as const\n\n/**\n * A B2 or S3 operation that a CORS rule can permit. Derived from\n * {@link CorsOperation}.\n */\nexport type CorsOperation = (typeof CorsOperation)[keyof typeof CorsOperation]\n\n/** Cross-Origin Resource Sharing (CORS) rule for browser-based access to a bucket. */\nexport interface CorsRule {\n /** Unique name identifying this CORS rule within the bucket. */\n readonly corsRuleName: string\n /** Origins allowed to make cross-origin requests (e.g., `'https://example.com'`). */\n readonly allowedOrigins: readonly string[]\n /** B2 and S3 operations permitted by this rule. */\n readonly allowedOperations: readonly CorsOperation[]\n /** Request headers allowed in preflight requests, or null if none are allowed. */\n readonly allowedHeaders: readonly string[] | null\n /** Response headers exposed to the browser, or null if none are exposed. */\n readonly exposeHeaders: readonly string[] | null\n /** Maximum time (in seconds) browsers may cache the preflight response. */\n readonly maxAgeSeconds: number\n}\n\n/**\n * Named constants for the bucket-level Object Lock retention mode.\n *\n * Pair with {@link BucketRetentionPolicy} when setting a bucket's default\n * retention: `{ mode: BucketRetentionMode.Compliance, period: { duration: 30, unit: 'days' } }`.\n */\nexport const BucketRetentionMode = {\n /** Files cannot be deleted or modified during the retention period, even by the account owner. */\n Compliance: 'compliance',\n /** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */\n Governance: 'governance',\n /** No default retention is applied to new uploads. */\n None: 'none',\n} as const\n\n/** Bucket-level Object Lock retention mode. Derived from {@link BucketRetentionMode}. */\nexport type BucketRetentionMode = (typeof BucketRetentionMode)[keyof typeof BucketRetentionMode]\n\n/** Duration and unit for a retention period. */\nexport interface RetentionPeriod {\n /** Length of the retention period. */\n readonly duration: number\n /** Time unit for the retention period. */\n readonly unit: 'days' | 'years'\n}\n\n/** Default Object Lock retention policy applied to new files in a bucket. */\nexport interface BucketRetentionPolicy {\n /** Retention mode for the policy. */\n readonly mode: BucketRetentionMode\n /** Retention period, or null when mode is `'none'`. */\n readonly period: RetentionPeriod | null\n}\n\n/**\n * Complete bucket metadata as returned by the B2 API.\n * Corresponds to the bucket object in responses from `b2_list_buckets`, `b2_create_bucket`, and `b2_update_bucket`.\n */\nexport interface BucketInfo {\n /** Account that owns this bucket. */\n readonly accountId: AccountId\n /** Unique identifier for this bucket. */\n readonly bucketId: BucketId\n /** Globally unique name of this bucket. */\n readonly bucketName: string\n /** Access level of this bucket. */\n readonly bucketType: BucketType\n /** User-defined key-value metadata stored on the bucket. */\n readonly bucketInfo: Record<string, string>\n /** CORS rules configured on this bucket. */\n readonly corsRules: readonly CorsRule[]\n /** Default server-side encryption setting for new files in this bucket. */\n readonly defaultServerSideEncryption: EncryptionSetting\n /** File Lock configuration including authorization status and current settings. */\n readonly fileLockConfiguration: {\n /** Whether the caller is authorized to read file lock settings. */\n readonly isClientAuthorizedToRead: boolean\n /** File lock settings, or null if the caller lacks read authorization. */\n readonly value: {\n /** Whether Object Lock is enabled on this bucket. */\n readonly isFileLockEnabled: boolean\n /** Default retention policy for newly uploaded files. */\n readonly defaultRetention: BucketRetentionPolicy\n } | null\n }\n /** Lifecycle rules configured on this bucket. */\n readonly lifecycleRules: readonly LifecycleRule[]\n /** Set of options enabled on this bucket (e.g., `'s3'`). */\n readonly options: readonly string[]\n /** Monotonically increasing revision number, incremented on each bucket update. */\n readonly revision: number\n /** Default retention policy for newly uploaded files. */\n readonly defaultRetention: BucketRetentionPolicy\n /** Cross-region replication configuration for this bucket. */\n readonly replicationConfiguration: ReplicationConfiguration\n}\n\n/**\n * Request parameters for the `b2_create_bucket` API call.\n */\nexport interface CreateBucketRequest {\n /** Account that will own the new bucket. */\n readonly accountId: AccountId\n /** Globally unique name for the bucket. */\n readonly bucketName: string\n /** Access level for the bucket. */\n readonly bucketType: BucketType\n /** Optional user-defined key-value metadata. */\n readonly bucketInfo?: Record<string, string>\n /** Optional CORS rules. */\n readonly corsRules?: readonly CorsRule[]\n /** Optional default server-side encryption setting. */\n readonly defaultServerSideEncryption?: EncryptionSetting\n /** Optional default Object Lock retention policy. */\n readonly defaultRetention?: BucketRetentionPolicy\n /** Whether to enable Object Lock on the bucket. Cannot be changed after creation. */\n readonly fileLockEnabled?: boolean\n /** Optional lifecycle rules. */\n readonly lifecycleRules?: readonly LifecycleRule[]\n /** Optional replication configuration. */\n readonly replicationConfiguration?: ReplicationConfiguration\n}\n\n/**\n * Request parameters for the `b2_update_bucket` API call.\n */\nexport interface UpdateBucketRequest {\n /** Account that owns the bucket. */\n readonly accountId: AccountId\n /** ID of the bucket to update. */\n readonly bucketId: BucketId\n /** New access level for the bucket. */\n readonly bucketType?: BucketType\n /** Updated user-defined key-value metadata. Replaces all existing metadata. */\n readonly bucketInfo?: Record<string, string>\n /** Updated CORS rules. Replaces all existing rules. */\n readonly corsRules?: readonly CorsRule[]\n /** Updated default server-side encryption setting. */\n readonly defaultServerSideEncryption?: EncryptionSetting\n /** Updated default Object Lock retention policy. */\n readonly defaultRetention?: BucketRetentionPolicy\n /** Whether to enable Object Lock. Can only transition from disabled to enabled. */\n readonly fileLockEnabled?: boolean\n /** Updated lifecycle rules. Replaces all existing rules. */\n readonly lifecycleRules?: readonly LifecycleRule[]\n /** Updated replication configuration. */\n readonly replicationConfiguration?: ReplicationConfiguration\n /** Optimistic locking: only update if the bucket's current revision matches this value. */\n readonly ifRevisionIs?: number\n}\n\n/**\n * Request parameters for the `b2_list_buckets` API call.\n */\nexport interface ListBucketsRequest {\n /** Account whose buckets to list. */\n readonly accountId: AccountId\n /** Optional filter to return only the bucket with this ID. */\n readonly bucketId?: BucketId\n /** Optional filter to return only the bucket with this name. */\n readonly bucketName?: string\n /** Optional filter to return only buckets of these types. */\n readonly bucketTypes?: readonly BucketType[]\n}\n\n/** Response from the `b2_list_buckets` API call. */\nexport interface ListBucketsResponse {\n /** Array of buckets matching the request filters. */\n readonly buckets: readonly BucketInfo[]\n}\n\n/**\n * Request parameters for the `b2_delete_bucket` API call.\n */\nexport interface DeleteBucketRequest {\n /** Account that owns the bucket. */\n readonly accountId: AccountId\n /** ID of the bucket to delete. The bucket must be empty. */\n readonly bucketId: BucketId\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,IAAa,aAAa;;CAExB,WAAW;;CAEX,YAAY;;CAEZ,UAAU;;CAEV,YAAY;AACd;;;;;;;;;;;;;;;;;;AAkCA,IAAa,gBAAgB;;CAE3B,sBAAsB;;CAEtB,oBAAoB;;CAEpB,cAAc;;CAEd,cAAc;;CAEd,UAAU;;CAEV,OAAO;;CAEP,QAAQ;;CAER,QAAQ;;CAER,OAAO;AACT;;;;;;;AA8BA,IAAa,sBAAsB;;CAEjC,YAAY;;CAEZ,YAAY;;CAEZ,MAAM;AACR"}
1
+ {"version":3,"file":"bucket.cjs","names":[],"sources":["../../src/types/bucket.ts"],"sourcesContent":["import type { NoEncryption, PublicEncryptionSetting, SseB2Setting } from './encryption.ts'\nimport type { AccountId, BucketId } from './ids.ts'\nimport type { ReplicationConfiguration } from './replication.ts'\n\n/**\n * Named constants for bucket types accepted by create/update bucket requests.\n *\n * @example\n * ```ts\n * await client.createBucket({ bucketName: 'my-app-logs', bucketType: BucketType.AllPrivate })\n * ```\n */\nexport const BucketType = {\n /** Publicly downloadable without authentication. */\n AllPublic: 'allPublic',\n /** Requires a valid auth token to download. */\n AllPrivate: 'allPrivate',\n /** Internal snapshot bucket type, generally not user-created. */\n Snapshot: 'snapshot',\n /** B2-restricted bucket (e.g., for S3-compatible workflows). */\n Restricted: 'restricted',\n} as const\n\n/** Bucket access levels accepted by B2 bucket create/update requests. */\nexport type BucketType = (typeof BucketType)[keyof typeof BucketType]\n\n/** Named constants for documented bucket response types known to the SDK. */\nexport const KnownBucketResponseType = {\n ...BucketType,\n /** Response-only bucket type for buckets shared with the account. */\n Shared: 'shared',\n} as const\n\n/** Closed union of documented bucket response types known to the SDK. */\nexport type KnownBucketResponseType =\n (typeof KnownBucketResponseType)[keyof typeof KnownBucketResponseType]\n\n/** Bucket type returned by B2 bucket responses, including future B2-added values. */\nexport type BucketResponseType = KnownBucketResponseType | (string & {})\n\n/**\n * Bucket type value accepted by `b2_list_buckets.bucketTypes`.\n *\n * This includes future B2-added strings, so TypeScript cannot statically exclude\n * the special `'all'` value from this open string type. Runtime validation still\n * enforces that `'all'` is only valid as `['all']` and that filters are non-empty.\n */\nexport type BucketListType = BucketResponseType\n\n/**\n * Bucket type filter accepted by `b2_list_buckets`.\n *\n * Use `['all']` by itself to request all bucket types. Other filters may include\n * documented response types such as `'shared'` and future B2-added type strings.\n * Because future bucket types are modeled as an open string, TypeScript cannot\n * reject empty arrays or mixed arrays containing `'all'`; B2 and the simulator\n * reject them at runtime.\n */\nexport type BucketTypesFilter = readonly ['all'] | readonly BucketListType[]\n\n/**\n * Named constants for option flags returned on buckets and application keys.\n *\n * B2 currently documents only the S3-compatible API option.\n */\nexport const BucketKeyOption = {\n /** Enables the S3-compatible API surface for the bucket or key. */\n S3: 's3',\n} as const\n\n/** Documented option flag returned on bucket and application key metadata. */\nexport type KnownBucketKeyOption = (typeof BucketKeyOption)[keyof typeof BucketKeyOption]\n\n/** Option flag returned on bucket and application key metadata, open to future B2-added strings. */\nexport type BucketKeyOption = KnownBucketKeyOption | (string & {})\n\n/** Minimum UTF-8 byte length for each bucketInfo key. */\nexport const BUCKET_INFO_KEY_MIN_BYTES = 1\n/** Maximum UTF-8 byte length for each bucketInfo key. */\nexport const BUCKET_INFO_KEY_MAX_BYTES = 50\n/** Maximum aggregate UTF-8 byte length of all bucketInfo values. */\nexport const BUCKET_INFO_VALUES_MAX_BYTES = 10_000\n/** Reserved bucketInfo key prefix used by Backblaze. */\nexport const BUCKET_INFO_RESERVED_PREFIX = 'b2-'\n/**\n * BucketInfo keys must match this regular-expression source. B2 accepts\n * letters, digits, and these characters: `. _ ~ ! # $ % ^ & * ' | + -` plus the\n * backtick.\n */\nexport const BUCKET_INFO_KEY_PATTERN = \"^[A-Za-z0-9._`~!#$%^&*'|+-]+$\"\n\n/** Rule that automatically hides or deletes files after a specified number of days. */\nexport interface LifecycleRule {\n /** Days after hiding before automatic deletion, or null to never auto-delete hidden files. */\n readonly daysFromHidingToDeleting?: number | null\n /** Days after upload before automatic hiding, or null to never auto-hide. */\n readonly daysFromUploadingToHiding?: number | null\n /** Days after starting before automatic cancellation of unfinished large files, or null to never auto-cancel. */\n readonly daysFromStartingToCancelingUnfinishedLargeFiles?: number | null\n /** File name prefix this rule applies to. Empty string matches all files. */\n readonly fileNamePrefix: string\n}\n\n/**\n * Named constants for the B2 + S3 operations a CORS rule can permit.\n *\n * @example\n * ```ts\n * await bucket.update({\n * corsRules: [{\n * corsRuleName: 'browser-downloads',\n * allowedOrigins: ['https://example.com'],\n * allowedOperations: [CorsOperation.B2DownloadFileByName, CorsOperation.S3Get],\n * allowedHeaders: null,\n * exposeHeaders: null,\n * maxAgeSeconds: 3600,\n * }],\n * })\n * ```\n */\nexport const CorsOperation = {\n /** Native B2 download-by-name request. */\n B2DownloadFileByName: 'b2_download_file_by_name',\n /** Native B2 download-by-id request. */\n B2DownloadFileById: 'b2_download_file_by_id',\n /** Native B2 small-file upload. */\n B2UploadFile: 'b2_upload_file',\n /** Native B2 multipart-part upload. */\n B2UploadPart: 'b2_upload_part',\n /** S3-compatible GET. */\n S3Get: 's3_get',\n /**\n * S3-compatible POST.\n *\n * @deprecated B2 bucket CORS rules do not accept `s3_post`. This member is\n * preserved so existing imports continue to compile. Use one of\n * {@link CORS_ALLOWED_OPERATIONS} for newly validated bucket CORS rules.\n */\n S3Post: 's3_post',\n /** S3-compatible PUT. */\n S3Put: 's3_put',\n /** S3-compatible HEAD. */\n S3Head: 's3_head',\n /** S3-compatible DELETE. */\n S3Delete: 's3_delete',\n} as const\n\n/**\n * A B2 or S3 operation that a CORS rule can permit. Derived from\n * {@link CorsOperation}.\n *\n * @remarks This includes the deprecated `s3_post` compatibility member. Use\n * {@link CorsAllowedOperation} for bucket CORS rules accepted by B2.\n */\nexport type CorsOperation = (typeof CorsOperation)[keyof typeof CorsOperation]\n\n/** All CORS operations accepted by B2 bucket CORS rules. */\nexport const CORS_ALLOWED_OPERATIONS = [\n CorsOperation.B2DownloadFileByName,\n CorsOperation.B2DownloadFileById,\n CorsOperation.B2UploadFile,\n CorsOperation.B2UploadPart,\n CorsOperation.S3Get,\n CorsOperation.S3Put,\n CorsOperation.S3Head,\n CorsOperation.S3Delete,\n] as const satisfies readonly CorsOperation[]\n\n/** B2 bucket CORS operation values accepted by validated CORS rules. */\nexport type CorsAllowedOperation = (typeof CORS_ALLOWED_OPERATIONS)[number]\n\n/** Maximum number of CORS rules allowed on a bucket. */\nexport const CORS_RULES_MAX_COUNT = 100\n/** Minimum character length for a CORS rule name. */\nexport const CORS_RULE_NAME_MIN_LENGTH = 6\n/** Maximum character length for a CORS rule name. */\nexport const CORS_RULE_NAME_MAX_LENGTH = 63\n/** CORS rule names must match this regular-expression source. */\nexport const CORS_RULE_NAME_PATTERN = '^[A-Za-z0-9-]+$'\n/** Reserved CORS rule-name prefix used by Backblaze. */\nexport const CORS_RULE_NAME_RESERVED_PREFIX = 'b2-'\n/** Exclusive UTF-8 byte-size ceiling for each CORS rule definition. */\nexport const CORS_RULE_MAX_BYTES = 1_000\n/** Maximum accepted CORS preflight cache duration in seconds. */\nexport const CORS_MAX_AGE_SECONDS_MAX = 86_400\n\n/**\n * Cross-Origin Resource Sharing (CORS) rule for browser-based access to a bucket.\n * A bucket may have up to {@link CORS_RULES_MAX_COUNT} rules, and each rule's\n * name, allowed origins, allowed operations, allowed headers, and exposed\n * headers must total less than {@link CORS_RULE_MAX_BYTES} UTF-8 bytes.\n */\nexport interface CorsRule {\n /**\n * Unique name identifying this CORS rule within the bucket.\n * Must be 6-63 characters, match `[A-Za-z0-9-]`, and not start with `b2-`.\n */\n readonly corsRuleName: string\n /**\n * Origins allowed to make cross-origin requests (e.g., `'https://example.com'`).\n * At least one origin is required.\n */\n readonly allowedOrigins: readonly string[]\n /**\n * B2 and S3 operations permitted by this rule.\n * At least one operation is required, and every value must be from\n * {@link CORS_ALLOWED_OPERATIONS}.\n */\n readonly allowedOperations: readonly CorsAllowedOperation[]\n /**\n * Request headers allowed in preflight requests, or null/omitted if none are allowed.\n */\n readonly allowedHeaders?: readonly string[] | null\n /**\n * Response headers exposed to the browser, or null/omitted if none are exposed.\n */\n readonly exposeHeaders?: readonly string[] | null\n /** Maximum time (0-86400 seconds) browsers may cache the preflight response. */\n readonly maxAgeSeconds: number\n}\n\n/**\n * Named constants for the bucket-level Object Lock retention mode.\n *\n * Pair with {@link BucketRetentionPolicy} when setting a bucket's default\n * retention: `{ mode: BucketRetentionMode.Compliance, period: { duration: 30, unit: 'days' } }`.\n */\nexport const BucketRetentionMode = {\n /** Files cannot be deleted or modified during the retention period, even by the account owner. */\n Compliance: 'compliance',\n /** Files cannot be deleted during retention except by callers with the `bypassGovernance` capability. */\n Governance: 'governance',\n /** No default retention is applied to new uploads. */\n None: 'none',\n} as const\n\n/** Bucket-level Object Lock retention mode. Derived from {@link BucketRetentionMode}. */\nexport type BucketRetentionMode = (typeof BucketRetentionMode)[keyof typeof BucketRetentionMode]\n\n/** Duration and unit for a retention period. */\nexport interface RetentionPeriod {\n /** Length of the retention period. */\n readonly duration: number\n /** Time unit for the retention period. */\n readonly unit: 'days' | 'years'\n}\n\n/** Default Object Lock retention policy applied to new files in a bucket. */\nexport interface BucketRetentionPolicy {\n /** Retention mode for the policy. */\n readonly mode: BucketRetentionMode\n /** Retention period, or null when mode is `'none'`. */\n readonly period: RetentionPeriod | null\n}\n\n/** B2 response shape for a bucket with no default Object Lock retention. */\nexport interface NoBucketDefaultRetention {\n /** B2 returns null when no bucket default retention policy is configured. */\n readonly mode: null\n /** No retention period is configured. */\n readonly period: null\n}\n\n/** Default Object Lock retention as returned in bucket metadata. */\nexport type BucketDefaultRetention = BucketRetentionPolicy | NoBucketDefaultRetention\n\n/** Cross-region replication settings as returned by readable B2 bucket metadata. */\nexport interface ReadableReplicationConfiguration {\n /** Whether the caller is authorized to read replication settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Replication settings, or null when none are configured or the caller is not authorized to read them. */\n readonly value: ReplicationConfiguration | null\n}\n\n/** Bucket default server-side encryption setting returned by B2 bucket responses. */\nexport type BucketDefaultServerSideEncryption = PublicEncryptionSetting\n\n/** Bucket default server-side encryption setting accepted by B2 bucket requests. */\nexport type BucketDefaultServerSideEncryptionSetting = SseB2Setting | NoEncryption\n\n/**\n * Complete bucket metadata as returned by the B2 API.\n * Corresponds to the bucket object in responses from `b2_list_buckets`, `b2_create_bucket`, and `b2_update_bucket`.\n */\nexport interface BucketInfo {\n /** Account that owns this bucket. */\n readonly accountId: AccountId\n /** Unique identifier for this bucket. */\n readonly bucketId: BucketId\n /** Globally unique name of this bucket. */\n readonly bucketName: string\n /** Access level or response-only type of this bucket. */\n readonly bucketType: BucketResponseType\n /** User-defined key-value metadata stored on the bucket. */\n readonly bucketInfo: Record<string, string>\n /** CORS rules configured on this bucket. */\n readonly corsRules: readonly CorsRule[]\n /** Default server-side encryption setting for new files in this bucket. */\n readonly defaultServerSideEncryption: {\n /** Whether the caller is authorized to read default server-side encryption settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Default server-side encryption settings, or null if the caller lacks read authorization. */\n readonly value: BucketDefaultServerSideEncryption | null\n }\n /** File Lock configuration including authorization status and current settings. */\n readonly fileLockConfiguration: {\n /** Whether the caller is authorized to read file lock settings. */\n readonly isClientAuthorizedToRead: boolean\n /** File lock settings, or null if the caller lacks read authorization. */\n readonly value: {\n /** Whether Object Lock is enabled on this bucket. */\n readonly isFileLockEnabled: boolean\n /** Default retention policy for newly uploaded files. */\n readonly defaultRetention: BucketDefaultRetention\n } | null\n }\n /** Lifecycle rules configured on this bucket. */\n readonly lifecycleRules: readonly LifecycleRule[]\n /** Set of options enabled on this bucket (e.g., {@link BucketKeyOption.S3}). */\n readonly options: readonly BucketKeyOption[]\n /** Monotonically increasing revision number, incremented on each bucket update. */\n readonly revision: number\n /** Cross-region replication configuration, filtered by caller authorization. */\n readonly replicationConfiguration: ReadableReplicationConfiguration\n}\n\n/**\n * Request parameters for the `b2_create_bucket` API call.\n */\nexport interface CreateBucketRequest {\n /** Account that will own the new bucket. */\n readonly accountId: AccountId\n /** Globally unique name for the bucket. */\n readonly bucketName: string\n /** Access level for the bucket. */\n readonly bucketType: BucketType\n /**\n * Optional user-defined key-value metadata.\n * Keys must be 1-50 UTF-8 bytes and must not start with `b2-`; the aggregate\n * UTF-8 byte length of all values must be at most 10,000 bytes. Keys must\n * match {@link BUCKET_INFO_KEY_PATTERN}. BucketInfo has no documented\n * pair-count cap.\n */\n readonly bucketInfo?: Record<string, string>\n /**\n * Optional CORS rules.\n * A bucket may have at most 100 rules. Each rule name must be unique, 6-63\n * characters, match `[A-Za-z0-9-]`, and not start with `b2-`. Each rule's\n * name, origins, operations, allowed headers, and exposed headers must total\n * less than 1,000 UTF-8 bytes. `maxAgeSeconds` must be at most 86,400.\n */\n readonly corsRules?: readonly CorsRule[]\n /** Optional default server-side encryption setting. */\n readonly defaultServerSideEncryption?: BucketDefaultServerSideEncryptionSetting\n /** Optional default Object Lock retention policy. */\n readonly defaultRetention?: BucketRetentionPolicy\n /** Whether to enable Object Lock on the bucket. Cannot be changed after creation. */\n readonly fileLockEnabled?: boolean\n /** Optional lifecycle rules. */\n readonly lifecycleRules?: readonly LifecycleRule[]\n /** Optional replication configuration. */\n readonly replicationConfiguration?: ReplicationConfiguration\n}\n\n/**\n * Request parameters for the `b2_update_bucket` API call.\n */\nexport interface UpdateBucketRequest {\n /** Account that owns the bucket. */\n readonly accountId: AccountId\n /** ID of the bucket to update. */\n readonly bucketId: BucketId\n /** New access level for the bucket. */\n readonly bucketType?: BucketType\n /**\n * Updated user-defined key-value metadata. Replaces all existing metadata.\n * Keys must be 1-50 UTF-8 bytes and must not start with `b2-`; the aggregate\n * UTF-8 byte length of all values must be at most 10,000 bytes. Keys must\n * match {@link BUCKET_INFO_KEY_PATTERN}. BucketInfo has no documented\n * pair-count cap.\n */\n readonly bucketInfo?: Record<string, string>\n /**\n * Updated CORS rules. Replaces all existing rules.\n * A bucket may have at most 100 rules. Each rule name must be unique, 6-63\n * characters, match `[A-Za-z0-9-]`, and not start with `b2-`. Each rule's\n * name, origins, operations, allowed headers, and exposed headers must total\n * less than 1,000 UTF-8 bytes. `maxAgeSeconds` must be at most 86,400.\n */\n readonly corsRules?: readonly CorsRule[]\n /** Updated default server-side encryption setting. */\n readonly defaultServerSideEncryption?: BucketDefaultServerSideEncryptionSetting\n /** Updated default Object Lock retention policy. */\n readonly defaultRetention?: BucketRetentionPolicy\n /** Whether to enable Object Lock. Can only transition from disabled to enabled. */\n readonly fileLockEnabled?: boolean\n /** Updated lifecycle rules. Replaces all existing rules. */\n readonly lifecycleRules?: readonly LifecycleRule[]\n /** Updated replication configuration. */\n readonly replicationConfiguration?: ReplicationConfiguration\n /** Optimistic locking: only update if the bucket's current revision matches this value. */\n readonly ifRevisionIs?: number\n}\n\n/**\n * Request parameters for the `b2_list_buckets` API call.\n */\nexport interface ListBucketsRequest {\n /** Account whose buckets to list. */\n readonly accountId: AccountId\n /** Optional filter to return only the bucket with this ID. */\n readonly bucketId?: BucketId\n /** Optional filter to return only the bucket with this name. */\n readonly bucketName?: string\n /** Optional filter to return only buckets of these types. */\n readonly bucketTypes?: BucketTypesFilter\n}\n\n/** Response from the `b2_list_buckets` API call. */\nexport interface ListBucketsResponse {\n /** Array of buckets matching the request filters. */\n readonly buckets: readonly BucketInfo[]\n}\n\n/**\n * Request parameters for the `b2_delete_bucket` API call.\n */\nexport interface DeleteBucketRequest {\n /** Account that owns the bucket. */\n readonly accountId: AccountId\n /** ID of the bucket to delete. The bucket must be empty. */\n readonly bucketId: BucketId\n}\n"],"mappings":";;;;;;;;;AAYA,IAAa,aAAa;;CAExB,WAAW;;CAEX,YAAY;;CAEZ,UAAU;;CAEV,YAAY;AACd;;AAMA,IAAa,0BAA0B;CACrC,GAAG;;CAEH,QAAQ;AACV;;;;;;AAkCA,IAAa,kBAAkB;;AAE7B,IAAI,KACN;;AASA,IAAa,4BAA4B;;AAEzC,IAAa,4BAA4B;;AAEzC,IAAa,+BAA+B;;AAE5C,IAAa,8BAA8B;;;;;;AAM3C,IAAa,0BAA0B;;;;;;;;;;;;;;;;;;AA+BvC,IAAa,gBAAgB;;CAE3B,sBAAsB;;CAEtB,oBAAoB;;CAEpB,cAAc;;CAEd,cAAc;;CAEd,OAAO;;;;;;;;CAQP,QAAQ;;CAER,OAAO;;CAEP,QAAQ;;CAER,UAAU;AACZ;;AAYA,IAAa,0BAA0B;CACrC,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;AAChB;;AAMA,IAAa,uBAAuB;;AAEpC,IAAa,4BAA4B;;AAEzC,IAAa,4BAA4B;;AAEzC,IAAa,yBAAyB;;AAEtC,IAAa,iCAAiC;;AAE9C,IAAa,sBAAsB;;AAEnC,IAAa,2BAA2B;;;;;;;AA2CxC,IAAa,sBAAsB;;CAEjC,YAAY;;CAEZ,YAAY;;CAEZ,MAAM;AACR"}