@backblaze-labs/b2-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (512) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/LICENSE +21 -0
  3. package/README.md +664 -0
  4. package/dist/auth/account-info.d.cts +51 -0
  5. package/dist/auth/account-info.d.cts.map +1 -0
  6. package/dist/auth/account-info.d.ts +51 -0
  7. package/dist/auth/account-info.d.ts.map +1 -0
  8. package/dist/auth/file.cjs +210 -0
  9. package/dist/auth/file.cjs.map +1 -0
  10. package/dist/auth/file.d.cts +157 -0
  11. package/dist/auth/file.d.cts.map +1 -0
  12. package/dist/auth/file.d.ts +157 -0
  13. package/dist/auth/file.d.ts.map +1 -0
  14. package/dist/auth/file.js +210 -0
  15. package/dist/auth/file.js.map +1 -0
  16. package/dist/auth/in-memory.cjs +184 -0
  17. package/dist/auth/in-memory.cjs.map +1 -0
  18. package/dist/auth/in-memory.d.cts +147 -0
  19. package/dist/auth/in-memory.d.cts.map +1 -0
  20. package/dist/auth/in-memory.d.ts +147 -0
  21. package/dist/auth/in-memory.d.ts.map +1 -0
  22. package/dist/auth/in-memory.js +184 -0
  23. package/dist/auth/in-memory.js.map +1 -0
  24. package/dist/auth/index.cjs +10 -0
  25. package/dist/auth/index.cjs.map +1 -0
  26. package/dist/auth/index.d.cts +6 -0
  27. package/dist/auth/index.d.cts.map +1 -0
  28. package/dist/auth/index.d.ts +6 -0
  29. package/dist/auth/index.d.ts.map +1 -0
  30. package/dist/auth/index.js +10 -0
  31. package/dist/auth/index.js.map +1 -0
  32. package/dist/auth/realms.cjs +12 -0
  33. package/dist/auth/realms.cjs.map +1 -0
  34. package/dist/auth/realms.d.cts +12 -0
  35. package/dist/auth/realms.d.cts.map +1 -0
  36. package/dist/auth/realms.d.ts +12 -0
  37. package/dist/auth/realms.d.ts.map +1 -0
  38. package/dist/auth/realms.js +12 -0
  39. package/dist/auth/realms.js.map +1 -0
  40. package/dist/auth/upload-url-pool.cjs +52 -0
  41. package/dist/auth/upload-url-pool.cjs.map +1 -0
  42. package/dist/auth/upload-url-pool.d.cts +35 -0
  43. package/dist/auth/upload-url-pool.d.cts.map +1 -0
  44. package/dist/auth/upload-url-pool.d.ts +35 -0
  45. package/dist/auth/upload-url-pool.d.ts.map +1 -0
  46. package/dist/auth/upload-url-pool.js +52 -0
  47. package/dist/auth/upload-url-pool.js.map +1 -0
  48. package/dist/bucket.cjs +789 -0
  49. package/dist/bucket.cjs.map +1 -0
  50. package/dist/bucket.d.cts +659 -0
  51. package/dist/bucket.d.cts.map +1 -0
  52. package/dist/bucket.d.ts +659 -0
  53. package/dist/bucket.d.ts.map +1 -0
  54. package/dist/bucket.js +789 -0
  55. package/dist/bucket.js.map +1 -0
  56. package/dist/client.cjs +230 -0
  57. package/dist/client.cjs.map +1 -0
  58. package/dist/client.d.cts +222 -0
  59. package/dist/client.d.cts.map +1 -0
  60. package/dist/client.d.ts +222 -0
  61. package/dist/client.d.ts.map +1 -0
  62. package/dist/client.js +230 -0
  63. package/dist/client.js.map +1 -0
  64. package/dist/copy/large.cjs +74 -0
  65. package/dist/copy/large.cjs.map +1 -0
  66. package/dist/copy/large.d.cts +53 -0
  67. package/dist/copy/large.d.cts.map +1 -0
  68. package/dist/copy/large.d.ts +53 -0
  69. package/dist/copy/large.d.ts.map +1 -0
  70. package/dist/copy/large.js +74 -0
  71. package/dist/copy/large.js.map +1 -0
  72. package/dist/download/parallel.cjs +122 -0
  73. package/dist/download/parallel.cjs.map +1 -0
  74. package/dist/download/parallel.d.cts +42 -0
  75. package/dist/download/parallel.d.cts.map +1 -0
  76. package/dist/download/parallel.d.ts +42 -0
  77. package/dist/download/parallel.d.ts.map +1 -0
  78. package/dist/download/parallel.js +122 -0
  79. package/dist/download/parallel.js.map +1 -0
  80. package/dist/download/single.cjs +117 -0
  81. package/dist/download/single.cjs.map +1 -0
  82. package/dist/download/single.d.cts +152 -0
  83. package/dist/download/single.d.cts.map +1 -0
  84. package/dist/download/single.d.ts +152 -0
  85. package/dist/download/single.d.ts.map +1 -0
  86. package/dist/download/single.js +117 -0
  87. package/dist/download/single.js.map +1 -0
  88. package/dist/errors/index.cjs +268 -0
  89. package/dist/errors/index.cjs.map +1 -0
  90. package/dist/errors/index.d.cts +264 -0
  91. package/dist/errors/index.d.cts.map +1 -0
  92. package/dist/errors/index.d.ts +264 -0
  93. package/dist/errors/index.d.ts.map +1 -0
  94. package/dist/errors/index.js +268 -0
  95. package/dist/errors/index.js.map +1 -0
  96. package/dist/http/retry.cjs +36 -0
  97. package/dist/http/retry.cjs.map +1 -0
  98. package/dist/http/retry.d.cts +34 -0
  99. package/dist/http/retry.d.cts.map +1 -0
  100. package/dist/http/retry.d.ts +34 -0
  101. package/dist/http/retry.d.ts.map +1 -0
  102. package/dist/http/retry.js +36 -0
  103. package/dist/http/retry.js.map +1 -0
  104. package/dist/http/transport.cjs +143 -0
  105. package/dist/http/transport.cjs.map +1 -0
  106. package/dist/http/transport.d.cts +122 -0
  107. package/dist/http/transport.d.cts.map +1 -0
  108. package/dist/http/transport.d.ts +122 -0
  109. package/dist/http/transport.d.ts.map +1 -0
  110. package/dist/http/transport.js +143 -0
  111. package/dist/http/transport.js.map +1 -0
  112. package/dist/http/url-guard.cjs +97 -0
  113. package/dist/http/url-guard.cjs.map +1 -0
  114. package/dist/http/url-guard.d.cts +88 -0
  115. package/dist/http/url-guard.d.cts.map +1 -0
  116. package/dist/http/url-guard.d.ts +88 -0
  117. package/dist/http/url-guard.d.ts.map +1 -0
  118. package/dist/http/url-guard.js +97 -0
  119. package/dist/http/url-guard.js.map +1 -0
  120. package/dist/http/user-agent.cjs +51 -0
  121. package/dist/http/user-agent.cjs.map +1 -0
  122. package/dist/http/user-agent.d.cts +28 -0
  123. package/dist/http/user-agent.d.cts.map +1 -0
  124. package/dist/http/user-agent.d.ts +28 -0
  125. package/dist/http/user-agent.d.ts.map +1 -0
  126. package/dist/http/user-agent.js +51 -0
  127. package/dist/http/user-agent.js.map +1 -0
  128. package/dist/index.cjs +78 -0
  129. package/dist/index.cjs.map +1 -0
  130. package/dist/index.d.cts +39 -0
  131. package/dist/index.d.cts.map +1 -0
  132. package/dist/index.d.ts +39 -0
  133. package/dist/index.d.ts.map +1 -0
  134. package/dist/index.js +78 -0
  135. package/dist/index.js.map +1 -0
  136. package/dist/notifications/index.cjs +7 -0
  137. package/dist/notifications/index.cjs.map +1 -0
  138. package/dist/notifications/index.d.cts +3 -0
  139. package/dist/notifications/index.d.cts.map +1 -0
  140. package/dist/notifications/index.d.ts +3 -0
  141. package/dist/notifications/index.d.ts.map +1 -0
  142. package/dist/notifications/index.js +7 -0
  143. package/dist/notifications/index.js.map +1 -0
  144. package/dist/notifications/webhook.cjs +106 -0
  145. package/dist/notifications/webhook.cjs.map +1 -0
  146. package/dist/notifications/webhook.d.cts +146 -0
  147. package/dist/notifications/webhook.d.cts.map +1 -0
  148. package/dist/notifications/webhook.d.ts +146 -0
  149. package/dist/notifications/webhook.d.ts.map +1 -0
  150. package/dist/notifications/webhook.js +106 -0
  151. package/dist/notifications/webhook.js.map +1 -0
  152. package/dist/object.cjs +212 -0
  153. package/dist/object.cjs.map +1 -0
  154. package/dist/object.d.cts +263 -0
  155. package/dist/object.d.cts.map +1 -0
  156. package/dist/object.d.ts +263 -0
  157. package/dist/object.d.ts.map +1 -0
  158. package/dist/object.js +212 -0
  159. package/dist/object.js.map +1 -0
  160. package/dist/package.json.cjs +9 -0
  161. package/dist/package.json.cjs.map +1 -0
  162. package/dist/package.json.js +9 -0
  163. package/dist/package.json.js.map +1 -0
  164. package/dist/raw/encoding.cjs +47 -0
  165. package/dist/raw/encoding.cjs.map +1 -0
  166. package/dist/raw/encoding.d.cts +46 -0
  167. package/dist/raw/encoding.d.cts.map +1 -0
  168. package/dist/raw/encoding.d.ts +46 -0
  169. package/dist/raw/encoding.d.ts.map +1 -0
  170. package/dist/raw/encoding.js +47 -0
  171. package/dist/raw/encoding.js.map +1 -0
  172. package/dist/raw/index.cjs +600 -0
  173. package/dist/raw/index.cjs.map +1 -0
  174. package/dist/raw/index.d.cts +381 -0
  175. package/dist/raw/index.d.cts.map +1 -0
  176. package/dist/raw/index.d.ts +381 -0
  177. package/dist/raw/index.d.ts.map +1 -0
  178. package/dist/raw/index.js +601 -0
  179. package/dist/raw/index.js.map +1 -0
  180. package/dist/s3/index.cjs +23 -0
  181. package/dist/s3/index.cjs.map +1 -0
  182. package/dist/s3/index.d.cts +74 -0
  183. package/dist/s3/index.d.cts.map +1 -0
  184. package/dist/s3/index.d.ts +74 -0
  185. package/dist/s3/index.d.ts.map +1 -0
  186. package/dist/s3/index.js +23 -0
  187. package/dist/s3/index.js.map +1 -0
  188. package/dist/simulator/capabilities.cjs +53 -0
  189. package/dist/simulator/capabilities.cjs.map +1 -0
  190. package/dist/simulator/capabilities.d.cts +15 -0
  191. package/dist/simulator/capabilities.d.cts.map +1 -0
  192. package/dist/simulator/capabilities.d.ts +15 -0
  193. package/dist/simulator/capabilities.d.ts.map +1 -0
  194. package/dist/simulator/capabilities.js +53 -0
  195. package/dist/simulator/capabilities.js.map +1 -0
  196. package/dist/simulator/index.cjs +1559 -0
  197. package/dist/simulator/index.cjs.map +1 -0
  198. package/dist/simulator/index.d.cts +495 -0
  199. package/dist/simulator/index.d.cts.map +1 -0
  200. package/dist/simulator/index.d.ts +495 -0
  201. package/dist/simulator/index.d.ts.map +1 -0
  202. package/dist/simulator/index.js +1560 -0
  203. package/dist/simulator/index.js.map +1 -0
  204. package/dist/simulator/validation.cjs +174 -0
  205. package/dist/simulator/validation.cjs.map +1 -0
  206. package/dist/simulator/validation.d.cts +104 -0
  207. package/dist/simulator/validation.d.cts.map +1 -0
  208. package/dist/simulator/validation.d.ts +104 -0
  209. package/dist/simulator/validation.d.ts.map +1 -0
  210. package/dist/simulator/validation.js +174 -0
  211. package/dist/simulator/validation.js.map +1 -0
  212. package/dist/streams/collect.cjs +26 -0
  213. package/dist/streams/collect.cjs.map +1 -0
  214. package/dist/streams/collect.d.cts +18 -0
  215. package/dist/streams/collect.d.cts.map +1 -0
  216. package/dist/streams/collect.d.ts +18 -0
  217. package/dist/streams/collect.d.ts.map +1 -0
  218. package/dist/streams/collect.js +26 -0
  219. package/dist/streams/collect.js.map +1 -0
  220. package/dist/streams/hash.cjs +123 -0
  221. package/dist/streams/hash.cjs.map +1 -0
  222. package/dist/streams/hash.d.cts +42 -0
  223. package/dist/streams/hash.d.cts.map +1 -0
  224. package/dist/streams/hash.d.ts +42 -0
  225. package/dist/streams/hash.d.ts.map +1 -0
  226. package/dist/streams/hash.js +101 -0
  227. package/dist/streams/hash.js.map +1 -0
  228. package/dist/streams/index.cjs +13 -0
  229. package/dist/streams/index.cjs.map +1 -0
  230. package/dist/streams/index.d.cts +7 -0
  231. package/dist/streams/index.d.cts.map +1 -0
  232. package/dist/streams/index.d.ts +7 -0
  233. package/dist/streams/index.d.ts.map +1 -0
  234. package/dist/streams/index.js +13 -0
  235. package/dist/streams/index.js.map +1 -0
  236. package/dist/streams/progress.cjs +47 -0
  237. package/dist/streams/progress.cjs.map +1 -0
  238. package/dist/streams/progress.d.cts +53 -0
  239. package/dist/streams/progress.d.cts.map +1 -0
  240. package/dist/streams/progress.d.ts +53 -0
  241. package/dist/streams/progress.d.ts.map +1 -0
  242. package/dist/streams/progress.js +47 -0
  243. package/dist/streams/progress.js.map +1 -0
  244. package/dist/streams/source.cjs +155 -0
  245. package/dist/streams/source.cjs.map +1 -0
  246. package/dist/streams/source.d.cts +140 -0
  247. package/dist/streams/source.d.cts.map +1 -0
  248. package/dist/streams/source.d.ts +140 -0
  249. package/dist/streams/source.d.ts.map +1 -0
  250. package/dist/streams/source.js +155 -0
  251. package/dist/streams/source.js.map +1 -0
  252. package/dist/sync/actions/index.cjs +191 -0
  253. package/dist/sync/actions/index.cjs.map +1 -0
  254. package/dist/sync/actions/index.d.cts +167 -0
  255. package/dist/sync/actions/index.d.cts.map +1 -0
  256. package/dist/sync/actions/index.d.ts +167 -0
  257. package/dist/sync/actions/index.d.ts.map +1 -0
  258. package/dist/sync/actions/index.js +191 -0
  259. package/dist/sync/actions/index.js.map +1 -0
  260. package/dist/sync/index.cjs +23 -0
  261. package/dist/sync/index.cjs.map +1 -0
  262. package/dist/sync/index.d.cts +21 -0
  263. package/dist/sync/index.d.cts.map +1 -0
  264. package/dist/sync/index.d.ts +21 -0
  265. package/dist/sync/index.d.ts.map +1 -0
  266. package/dist/sync/index.js +23 -0
  267. package/dist/sync/index.js.map +1 -0
  268. package/dist/sync/pairing.cjs +31 -0
  269. package/dist/sync/pairing.cjs.map +1 -0
  270. package/dist/sync/pairing.d.cts +13 -0
  271. package/dist/sync/pairing.d.cts.map +1 -0
  272. package/dist/sync/pairing.d.ts +13 -0
  273. package/dist/sync/pairing.d.ts.map +1 -0
  274. package/dist/sync/pairing.js +31 -0
  275. package/dist/sync/pairing.js.map +1 -0
  276. package/dist/sync/policies/compare.cjs +14 -0
  277. package/dist/sync/policies/compare.cjs.map +1 -0
  278. package/dist/sync/policies/compare.d.cts +13 -0
  279. package/dist/sync/policies/compare.d.cts.map +1 -0
  280. package/dist/sync/policies/compare.d.ts +13 -0
  281. package/dist/sync/policies/compare.d.ts.map +1 -0
  282. package/dist/sync/policies/compare.js +14 -0
  283. package/dist/sync/policies/compare.js.map +1 -0
  284. package/dist/sync/policies/index.cjs +74 -0
  285. package/dist/sync/policies/index.cjs.map +1 -0
  286. package/dist/sync/policies/index.d.cts +42 -0
  287. package/dist/sync/policies/index.d.cts.map +1 -0
  288. package/dist/sync/policies/index.d.ts +42 -0
  289. package/dist/sync/policies/index.d.ts.map +1 -0
  290. package/dist/sync/policies/index.js +74 -0
  291. package/dist/sync/policies/index.js.map +1 -0
  292. package/dist/sync/scanners/b2.cjs +57 -0
  293. package/dist/sync/scanners/b2.cjs.map +1 -0
  294. package/dist/sync/scanners/b2.d.cts +20 -0
  295. package/dist/sync/scanners/b2.d.cts.map +1 -0
  296. package/dist/sync/scanners/b2.d.ts +20 -0
  297. package/dist/sync/scanners/b2.d.ts.map +1 -0
  298. package/dist/sync/scanners/b2.js +57 -0
  299. package/dist/sync/scanners/b2.js.map +1 -0
  300. package/dist/sync/scanners/local.cjs +58 -0
  301. package/dist/sync/scanners/local.cjs.map +1 -0
  302. package/dist/sync/scanners/local.d.cts +24 -0
  303. package/dist/sync/scanners/local.d.cts.map +1 -0
  304. package/dist/sync/scanners/local.d.ts +24 -0
  305. package/dist/sync/scanners/local.d.ts.map +1 -0
  306. package/dist/sync/scanners/local.js +58 -0
  307. package/dist/sync/scanners/local.js.map +1 -0
  308. package/dist/sync/synchronizer.cjs +203 -0
  309. package/dist/sync/synchronizer.cjs.map +1 -0
  310. package/dist/sync/synchronizer.d.cts +52 -0
  311. package/dist/sync/synchronizer.d.cts.map +1 -0
  312. package/dist/sync/synchronizer.d.ts +52 -0
  313. package/dist/sync/synchronizer.d.ts.map +1 -0
  314. package/dist/sync/synchronizer.js +181 -0
  315. package/dist/sync/synchronizer.js.map +1 -0
  316. package/dist/sync/types.d.cts +121 -0
  317. package/dist/sync/types.d.cts.map +1 -0
  318. package/dist/sync/types.d.ts +121 -0
  319. package/dist/sync/types.d.ts.map +1 -0
  320. package/dist/types/auth.cjs +58 -0
  321. package/dist/types/auth.cjs.map +1 -0
  322. package/dist/types/auth.d.cts +150 -0
  323. package/dist/types/auth.d.cts.map +1 -0
  324. package/dist/types/auth.d.ts +150 -0
  325. package/dist/types/auth.d.ts.map +1 -0
  326. package/dist/types/auth.js +58 -0
  327. package/dist/types/auth.js.map +1 -0
  328. package/dist/types/bucket.cjs +44 -0
  329. package/dist/types/bucket.cjs.map +1 -0
  330. package/dist/types/bucket.d.cts +245 -0
  331. package/dist/types/bucket.d.cts.map +1 -0
  332. package/dist/types/bucket.d.ts +245 -0
  333. package/dist/types/bucket.d.ts.map +1 -0
  334. package/dist/types/bucket.js +44 -0
  335. package/dist/types/bucket.js.map +1 -0
  336. package/dist/types/download.d.cts +110 -0
  337. package/dist/types/download.d.cts.map +1 -0
  338. package/dist/types/download.d.ts +110 -0
  339. package/dist/types/download.d.ts.map +1 -0
  340. package/dist/types/encryption.cjs +343 -0
  341. package/dist/types/encryption.cjs.map +1 -0
  342. package/dist/types/encryption.d.cts +132 -0
  343. package/dist/types/encryption.d.cts.map +1 -0
  344. package/dist/types/encryption.d.ts +132 -0
  345. package/dist/types/encryption.d.ts.map +1 -0
  346. package/dist/types/encryption.js +321 -0
  347. package/dist/types/encryption.js.map +1 -0
  348. package/dist/types/errors.d.cts +16 -0
  349. package/dist/types/errors.d.cts.map +1 -0
  350. package/dist/types/errors.d.ts +16 -0
  351. package/dist/types/errors.d.ts.map +1 -0
  352. package/dist/types/file.cjs +23 -0
  353. package/dist/types/file.cjs.map +1 -0
  354. package/dist/types/file.d.cts +220 -0
  355. package/dist/types/file.d.cts.map +1 -0
  356. package/dist/types/file.d.ts +220 -0
  357. package/dist/types/file.d.ts.map +1 -0
  358. package/dist/types/file.js +23 -0
  359. package/dist/types/file.js.map +1 -0
  360. package/dist/types/ids.cjs +27 -0
  361. package/dist/types/ids.cjs.map +1 -0
  362. package/dist/types/ids.d.cts +84 -0
  363. package/dist/types/ids.d.cts.map +1 -0
  364. package/dist/types/ids.d.ts +84 -0
  365. package/dist/types/ids.d.ts.map +1 -0
  366. package/dist/types/ids.js +27 -0
  367. package/dist/types/ids.js.map +1 -0
  368. package/dist/types/index.d.cts +25 -0
  369. package/dist/types/index.d.cts.map +1 -0
  370. package/dist/types/index.d.ts +25 -0
  371. package/dist/types/index.d.ts.map +1 -0
  372. package/dist/types/key.d.cts +84 -0
  373. package/dist/types/key.d.cts.map +1 -0
  374. package/dist/types/key.d.ts +84 -0
  375. package/dist/types/key.d.ts.map +1 -0
  376. package/dist/types/lock.cjs +17 -0
  377. package/dist/types/lock.cjs.map +1 -0
  378. package/dist/types/lock.d.cts +92 -0
  379. package/dist/types/lock.d.cts.map +1 -0
  380. package/dist/types/lock.d.ts +92 -0
  381. package/dist/types/lock.d.ts.map +1 -0
  382. package/dist/types/lock.js +17 -0
  383. package/dist/types/lock.js.map +1 -0
  384. package/dist/types/notifications.cjs +24 -0
  385. package/dist/types/notifications.cjs.map +1 -0
  386. package/dist/types/notifications.d.cts +97 -0
  387. package/dist/types/notifications.d.cts.map +1 -0
  388. package/dist/types/notifications.d.ts +97 -0
  389. package/dist/types/notifications.d.ts.map +1 -0
  390. package/dist/types/notifications.js +24 -0
  391. package/dist/types/notifications.js.map +1 -0
  392. package/dist/types/replication.d.cts +42 -0
  393. package/dist/types/replication.d.cts.map +1 -0
  394. package/dist/types/replication.d.ts +42 -0
  395. package/dist/types/replication.d.ts.map +1 -0
  396. package/dist/types/upload.d.cts +219 -0
  397. package/dist/types/upload.d.cts.map +1 -0
  398. package/dist/types/upload.d.ts +219 -0
  399. package/dist/types/upload.d.ts.map +1 -0
  400. package/dist/upload/cancel.cjs +10 -0
  401. package/dist/upload/cancel.cjs.map +1 -0
  402. package/dist/upload/cancel.d.cts +23 -0
  403. package/dist/upload/cancel.d.cts.map +1 -0
  404. package/dist/upload/cancel.d.ts +23 -0
  405. package/dist/upload/cancel.d.ts.map +1 -0
  406. package/dist/upload/cancel.js +10 -0
  407. package/dist/upload/cancel.js.map +1 -0
  408. package/dist/upload/concurrency.cjs +54 -0
  409. package/dist/upload/concurrency.cjs.map +1 -0
  410. package/dist/upload/concurrency.d.cts +46 -0
  411. package/dist/upload/concurrency.d.cts.map +1 -0
  412. package/dist/upload/concurrency.d.ts +46 -0
  413. package/dist/upload/concurrency.d.ts.map +1 -0
  414. package/dist/upload/concurrency.js +54 -0
  415. package/dist/upload/concurrency.js.map +1 -0
  416. package/dist/upload/large.cjs +222 -0
  417. package/dist/upload/large.cjs.map +1 -0
  418. package/dist/upload/large.d.cts +71 -0
  419. package/dist/upload/large.d.cts.map +1 -0
  420. package/dist/upload/large.d.ts +71 -0
  421. package/dist/upload/large.d.ts.map +1 -0
  422. package/dist/upload/large.js +222 -0
  423. package/dist/upload/large.js.map +1 -0
  424. package/dist/upload/resume.cjs +34 -0
  425. package/dist/upload/resume.cjs.map +1 -0
  426. package/dist/upload/resume.d.cts +33 -0
  427. package/dist/upload/resume.d.cts.map +1 -0
  428. package/dist/upload/resume.d.ts +33 -0
  429. package/dist/upload/resume.d.ts.map +1 -0
  430. package/dist/upload/resume.js +34 -0
  431. package/dist/upload/resume.js.map +1 -0
  432. package/dist/upload/single.cjs +47 -0
  433. package/dist/upload/single.cjs.map +1 -0
  434. package/dist/upload/single.d.cts +51 -0
  435. package/dist/upload/single.d.cts.map +1 -0
  436. package/dist/upload/single.d.ts +51 -0
  437. package/dist/upload/single.d.ts.map +1 -0
  438. package/dist/upload/single.js +47 -0
  439. package/dist/upload/single.js.map +1 -0
  440. package/dist/upload/stream.cjs +198 -0
  441. package/dist/upload/stream.cjs.map +1 -0
  442. package/dist/upload/stream.d.cts +61 -0
  443. package/dist/upload/stream.d.cts.map +1 -0
  444. package/dist/upload/stream.d.ts +61 -0
  445. package/dist/upload/stream.d.ts.map +1 -0
  446. package/dist/upload/stream.js +198 -0
  447. package/dist/upload/stream.js.map +1 -0
  448. package/dist/util/best-effort.cjs +10 -0
  449. package/dist/util/best-effort.cjs.map +1 -0
  450. package/dist/util/best-effort.d.cts +31 -0
  451. package/dist/util/best-effort.d.cts.map +1 -0
  452. package/dist/util/best-effort.d.ts +31 -0
  453. package/dist/util/best-effort.d.ts.map +1 -0
  454. package/dist/util/best-effort.js +10 -0
  455. package/dist/util/best-effort.js.map +1 -0
  456. package/dist/util/defaults.cjs +11 -0
  457. package/dist/util/defaults.cjs.map +1 -0
  458. package/dist/util/defaults.d.cts +54 -0
  459. package/dist/util/defaults.d.cts.map +1 -0
  460. package/dist/util/defaults.d.ts +54 -0
  461. package/dist/util/defaults.d.ts.map +1 -0
  462. package/dist/util/defaults.js +11 -0
  463. package/dist/util/defaults.js.map +1 -0
  464. package/dist/util/normalize.cjs +16 -0
  465. package/dist/util/normalize.cjs.map +1 -0
  466. package/dist/util/normalize.d.cts +62 -0
  467. package/dist/util/normalize.d.cts.map +1 -0
  468. package/dist/util/normalize.d.ts +62 -0
  469. package/dist/util/normalize.d.ts.map +1 -0
  470. package/dist/util/normalize.js +16 -0
  471. package/dist/util/normalize.js.map +1 -0
  472. package/dist/util/paginator.cjs +20 -0
  473. package/dist/util/paginator.cjs.map +1 -0
  474. package/dist/util/paginator.d.cts +120 -0
  475. package/dist/util/paginator.d.cts.map +1 -0
  476. package/dist/util/paginator.d.ts +120 -0
  477. package/dist/util/paginator.d.ts.map +1 -0
  478. package/dist/util/paginator.js +20 -0
  479. package/dist/util/paginator.js.map +1 -0
  480. package/dist/util/plan-ranges.cjs +28 -0
  481. package/dist/util/plan-ranges.cjs.map +1 -0
  482. package/dist/util/plan-ranges.d.cts +56 -0
  483. package/dist/util/plan-ranges.d.cts.map +1 -0
  484. package/dist/util/plan-ranges.d.ts +56 -0
  485. package/dist/util/plan-ranges.d.ts.map +1 -0
  486. package/dist/util/plan-ranges.js +28 -0
  487. package/dist/util/plan-ranges.js.map +1 -0
  488. package/dist/util/text-codec.cjs +7 -0
  489. package/dist/util/text-codec.cjs.map +1 -0
  490. package/dist/util/text-codec.d.cts +26 -0
  491. package/dist/util/text-codec.d.cts.map +1 -0
  492. package/dist/util/text-codec.d.ts +26 -0
  493. package/dist/util/text-codec.d.ts.map +1 -0
  494. package/dist/util/text-codec.js +7 -0
  495. package/dist/util/text-codec.js.map +1 -0
  496. package/dist/util/to-error.cjs +7 -0
  497. package/dist/util/to-error.cjs.map +1 -0
  498. package/dist/util/to-error.d.cts +15 -0
  499. package/dist/util/to-error.d.cts.map +1 -0
  500. package/dist/util/to-error.d.ts +15 -0
  501. package/dist/util/to-error.d.ts.map +1 -0
  502. package/dist/util/to-error.js +7 -0
  503. package/dist/util/to-error.js.map +1 -0
  504. package/dist/version.cjs +6 -0
  505. package/dist/version.cjs.map +1 -0
  506. package/dist/version.d.cts +14 -0
  507. package/dist/version.d.cts.map +1 -0
  508. package/dist/version.d.ts +14 -0
  509. package/dist/version.d.ts.map +1 -0
  510. package/dist/version.js +6 -0
  511. package/dist/version.js.map +1 -0
  512. package/package.json +198 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,eAAe,GACf,WAAW,GACX,oBAAoB,GACpB,iBAAiB,GACjB,UAAU,GACV,uBAAuB,GACvB,kBAAkB,GAClB,gBAAgB,GAChB,cAAc,GACd,sBAAsB,GACtB,0BAA0B,GAC1B,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,UAAU,GACV,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,cAAc,GACd,uBAAuB,GACvB,iBAAiB,GACjB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEjB,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const FileAction = {
4
+ /** Large file upload started but not yet finished. */
5
+ Start: "start",
6
+ /** Normal upload (small or finished large file). */
7
+ Upload: "upload",
8
+ /** Hide marker (soft delete). */
9
+ Hide: "hide",
10
+ /** Virtual folder marker. */
11
+ Folder: "folder",
12
+ /** Created via server-side copy. */
13
+ Copy: "copy"
14
+ };
15
+ const MetadataDirective = {
16
+ /** Preserve the source file's contentType and fileInfo. */
17
+ Copy: "COPY",
18
+ /** Use the values provided in the copy request. */
19
+ Replace: "REPLACE"
20
+ };
21
+ exports.FileAction = FileAction;
22
+ exports.MetadataDirective = MetadataDirective;
23
+ //# sourceMappingURL=file.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.cjs","sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status, or null if replication is not configured. */\n readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: EncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n}\n"],"names":[],"mappings":";;AAYO,MAAM,aAAa;AAAA;AAAA,EAExB,OAAO;AAAA;AAAA,EAEP,QAAQ;AAAA;AAAA,EAER,MAAM;AAAA;AAAA,EAEN,QAAQ;AAAA;AAAA,EAER,MAAM;AACR;AAqJO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,MAAM;AAAA;AAAA,EAEN,SAAS;AACX;;;"}
@@ -0,0 +1,220 @@
1
+ import { EncryptionSetting } from './encryption.js';
2
+ import { AccountId, BucketId, FileId } from './ids.js';
3
+ import { FileRetentionValue, LegalHoldValue } from './lock.js';
4
+ /**
5
+ * Named constants for the action that created a file version.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * if (file.action === FileAction.Hide) { ... }
10
+ * ```
11
+ */
12
+ export declare const FileAction: {
13
+ /** Large file upload started but not yet finished. */
14
+ readonly Start: "start";
15
+ /** Normal upload (small or finished large file). */
16
+ readonly Upload: "upload";
17
+ /** Hide marker (soft delete). */
18
+ readonly Hide: "hide";
19
+ /** Virtual folder marker. */
20
+ readonly Folder: "folder";
21
+ /** Created via server-side copy. */
22
+ readonly Copy: "copy";
23
+ };
24
+ /**
25
+ * The action that created a file version. Derived from {@link FileAction}.
26
+ *
27
+ * - `'start'`: large file upload started but not yet finished.
28
+ * - `'upload'`: file was uploaded normally.
29
+ * - `'hide'`: file was hidden (soft-deleted).
30
+ * - `'folder'`: virtual folder marker.
31
+ * - `'copy'`: file was created via server-side copy.
32
+ */
33
+ export type FileAction = (typeof FileAction)[keyof typeof FileAction];
34
+ /**
35
+ * Complete metadata for a single file version in B2.
36
+ * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,
37
+ * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.
38
+ */
39
+ export interface FileVersion {
40
+ /** Account that owns this file. */
41
+ readonly accountId: AccountId;
42
+ /** Action that created this file version. */
43
+ readonly action: FileAction;
44
+ /** Bucket containing this file. */
45
+ readonly bucketId: BucketId;
46
+ /** Size of the file content in bytes. */
47
+ readonly contentLength: number;
48
+ /** MD5 checksum of the content, or null if not available. */
49
+ readonly contentMd5: string | null;
50
+ /** SHA-1 checksum of the content, or null if not available (e.g., large files). */
51
+ readonly contentSha1: string | null;
52
+ /** MIME type of the file content. */
53
+ readonly contentType: string;
54
+ /** Unique identifier for this file version. */
55
+ readonly fileId: FileId;
56
+ /** User-defined key-value metadata stored with the file. */
57
+ readonly fileInfo: Record<string, string>;
58
+ /** Full path and name of the file within the bucket. */
59
+ readonly fileName: string;
60
+ /** Object Lock retention settings for this file version. */
61
+ readonly fileRetention: {
62
+ /** Whether the caller is authorized to read retention settings. */
63
+ readonly isClientAuthorizedToRead: boolean;
64
+ /** Retention settings, or null if the caller lacks read authorization. */
65
+ readonly value: FileRetentionValue | null;
66
+ };
67
+ /** Legal hold status for this file version. */
68
+ readonly legalHold: {
69
+ /** Whether the caller is authorized to read legal hold status. */
70
+ readonly isClientAuthorizedToRead: boolean;
71
+ /** Legal hold value, or null if the caller lacks read authorization. */
72
+ readonly value: LegalHoldValue | null;
73
+ };
74
+ /** Replication status, or null if replication is not configured. */
75
+ readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null;
76
+ /** Server-side encryption settings applied to this file version. */
77
+ readonly serverSideEncryption: EncryptionSetting;
78
+ /** UTC timestamp (milliseconds) when this version was uploaded. */
79
+ readonly uploadTimestamp: number;
80
+ }
81
+ /** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */
82
+ export interface ListFileNamesRequest {
83
+ /** Bucket to list files from. */
84
+ readonly bucketId: BucketId;
85
+ /** Return files starting after this name (exclusive). Used for pagination. */
86
+ readonly startFileName?: string;
87
+ /** Maximum number of files to return (1 to 10000). */
88
+ readonly maxFileCount?: number;
89
+ /** Only return files whose names start with this prefix. */
90
+ readonly prefix?: string;
91
+ /** Delimiter for virtual folder grouping (typically `'/'`). */
92
+ readonly delimiter?: string;
93
+ }
94
+ /** Response from the `b2_list_file_names` API call. */
95
+ export interface ListFileNamesResponse {
96
+ /** Array of file versions matching the request. */
97
+ readonly files: readonly FileVersion[];
98
+ /** Next file name to use for pagination, or null if all files have been listed. */
99
+ readonly nextFileName: string | null;
100
+ }
101
+ /** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */
102
+ export interface ListFileVersionsRequest {
103
+ /** Bucket to list file versions from. */
104
+ readonly bucketId: BucketId;
105
+ /** Return files starting after this name (exclusive). Used for pagination. */
106
+ readonly startFileName?: string;
107
+ /** Return file versions starting after this ID. Used with startFileName for pagination. */
108
+ readonly startFileId?: FileId;
109
+ /** Maximum number of file versions to return (1 to 10000). */
110
+ readonly maxFileCount?: number;
111
+ /** Only return files whose names start with this prefix. */
112
+ readonly prefix?: string;
113
+ /** Delimiter for virtual folder grouping (typically `'/'`). */
114
+ readonly delimiter?: string;
115
+ }
116
+ /** Response from the `b2_list_file_versions` API call. */
117
+ export interface ListFileVersionsResponse {
118
+ /** Array of file versions matching the request. */
119
+ readonly files: readonly FileVersion[];
120
+ /** Next file name to use for pagination, or null if all versions have been listed. */
121
+ readonly nextFileName: string | null;
122
+ /** Next file ID to use for pagination, or null if all versions have been listed. */
123
+ readonly nextFileId: FileId | null;
124
+ }
125
+ /** Request parameters for the `b2_get_file_info` API call. */
126
+ export interface GetFileInfoRequest {
127
+ /** ID of the file version to retrieve info for. */
128
+ readonly fileId: FileId;
129
+ }
130
+ /** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */
131
+ export interface HideFileRequest {
132
+ /** Bucket containing the file to hide. */
133
+ readonly bucketId: BucketId;
134
+ /** Name of the file to hide. */
135
+ readonly fileName: string;
136
+ }
137
+ /** Request parameters for the `b2_delete_file_version` API call. */
138
+ export interface DeleteFileVersionRequest {
139
+ /** Name of the file version to delete. */
140
+ readonly fileName: string;
141
+ /** ID of the file version to delete. */
142
+ readonly fileId: FileId;
143
+ /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */
144
+ readonly bypassGovernance?: boolean;
145
+ }
146
+ /** Response from the `b2_delete_file_version` API call. */
147
+ export interface DeleteFileVersionResponse {
148
+ /** ID of the deleted file version. */
149
+ readonly fileId: FileId;
150
+ /** Name of the deleted file. */
151
+ readonly fileName: string;
152
+ }
153
+ /**
154
+ * Named constants for how metadata is handled during a file copy.
155
+ *
156
+ * @example
157
+ * ```ts
158
+ * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })
159
+ * ```
160
+ */
161
+ export declare const MetadataDirective: {
162
+ /** Preserve the source file's contentType and fileInfo. */
163
+ readonly Copy: "COPY";
164
+ /** Use the values provided in the copy request. */
165
+ readonly Replace: "REPLACE";
166
+ };
167
+ /** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */
168
+ export type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective];
169
+ /** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */
170
+ export interface CopyFileRequest {
171
+ /** ID of the source file version to copy from. */
172
+ readonly sourceFileId: FileId;
173
+ /** Destination bucket ID. Defaults to the source bucket if omitted. */
174
+ readonly destinationBucketId?: BucketId;
175
+ /** Name for the destination file. */
176
+ readonly fileName: string;
177
+ /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */
178
+ readonly range?: string;
179
+ /** Whether to copy or replace the source file's metadata. */
180
+ readonly metadataDirective?: MetadataDirective;
181
+ /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */
182
+ readonly contentType?: string;
183
+ /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */
184
+ readonly fileInfo?: Record<string, string>;
185
+ /** Object Lock retention for the destination file. */
186
+ readonly fileRetention?: FileRetentionValue;
187
+ /** Legal hold for the destination file. */
188
+ readonly legalHold?: LegalHoldValue;
189
+ /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */
190
+ readonly sourceServerSideEncryption?: EncryptionSetting;
191
+ /** Server-side encryption to apply to the destination file. */
192
+ readonly destinationServerSideEncryption?: EncryptionSetting;
193
+ }
194
+ /** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */
195
+ export interface CopyPartRequest {
196
+ /** ID of the source file version to copy from. */
197
+ readonly sourceFileId: FileId;
198
+ /** ID of the large file being assembled. */
199
+ readonly largeFileId: FileId;
200
+ /** Part number (1-based) for this part within the large file. */
201
+ readonly partNumber: number;
202
+ /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */
203
+ readonly range?: string;
204
+ /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */
205
+ readonly sourceServerSideEncryption?: EncryptionSetting;
206
+ /** Server-side encryption to apply to the destination part. */
207
+ readonly destinationServerSideEncryption?: EncryptionSetting;
208
+ }
209
+ /** Response from the `b2_copy_part` API call. */
210
+ export interface CopyPartResponse {
211
+ /** ID of the large file this part belongs to. */
212
+ readonly fileId: FileId;
213
+ /** Part number within the large file. */
214
+ readonly partNumber: number;
215
+ /** Size of the copied part in bytes. */
216
+ readonly contentLength: number;
217
+ /** SHA-1 checksum of the copied part content. */
218
+ readonly contentSha1: string;
219
+ }
220
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;IACrB,sDAAsD;;IAEtD,oDAAoD;;IAEpD,iCAAiC;;IAEjC,6BAA6B;;IAE7B,oCAAoC;;CAE5B,CAAA;AAEV;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAErE;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,mCAAmC;IACnC,QAA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,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,sDAAsD;IACtD,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAA;IAC3C,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAA;IACnC,yFAAyF;IACzF,QAAQ,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAA;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,+BAA+B,CAAC,EAAE,iBAAiB,CAAA;CAC7D;AAED,sGAAsG;AACtG,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,4CAA4C;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,kGAAkG;IAClG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,yFAAyF;IACzF,QAAQ,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAA;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,+BAA+B,CAAC,EAAE,iBAAiB,CAAA;CAC7D;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,yCAAyC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B"}
@@ -0,0 +1,220 @@
1
+ import { EncryptionSetting } from './encryption.js';
2
+ import { AccountId, BucketId, FileId } from './ids.js';
3
+ import { FileRetentionValue, LegalHoldValue } from './lock.js';
4
+ /**
5
+ * Named constants for the action that created a file version.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * if (file.action === FileAction.Hide) { ... }
10
+ * ```
11
+ */
12
+ export declare const FileAction: {
13
+ /** Large file upload started but not yet finished. */
14
+ readonly Start: "start";
15
+ /** Normal upload (small or finished large file). */
16
+ readonly Upload: "upload";
17
+ /** Hide marker (soft delete). */
18
+ readonly Hide: "hide";
19
+ /** Virtual folder marker. */
20
+ readonly Folder: "folder";
21
+ /** Created via server-side copy. */
22
+ readonly Copy: "copy";
23
+ };
24
+ /**
25
+ * The action that created a file version. Derived from {@link FileAction}.
26
+ *
27
+ * - `'start'`: large file upload started but not yet finished.
28
+ * - `'upload'`: file was uploaded normally.
29
+ * - `'hide'`: file was hidden (soft-deleted).
30
+ * - `'folder'`: virtual folder marker.
31
+ * - `'copy'`: file was created via server-side copy.
32
+ */
33
+ export type FileAction = (typeof FileAction)[keyof typeof FileAction];
34
+ /**
35
+ * Complete metadata for a single file version in B2.
36
+ * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,
37
+ * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.
38
+ */
39
+ export interface FileVersion {
40
+ /** Account that owns this file. */
41
+ readonly accountId: AccountId;
42
+ /** Action that created this file version. */
43
+ readonly action: FileAction;
44
+ /** Bucket containing this file. */
45
+ readonly bucketId: BucketId;
46
+ /** Size of the file content in bytes. */
47
+ readonly contentLength: number;
48
+ /** MD5 checksum of the content, or null if not available. */
49
+ readonly contentMd5: string | null;
50
+ /** SHA-1 checksum of the content, or null if not available (e.g., large files). */
51
+ readonly contentSha1: string | null;
52
+ /** MIME type of the file content. */
53
+ readonly contentType: string;
54
+ /** Unique identifier for this file version. */
55
+ readonly fileId: FileId;
56
+ /** User-defined key-value metadata stored with the file. */
57
+ readonly fileInfo: Record<string, string>;
58
+ /** Full path and name of the file within the bucket. */
59
+ readonly fileName: string;
60
+ /** Object Lock retention settings for this file version. */
61
+ readonly fileRetention: {
62
+ /** Whether the caller is authorized to read retention settings. */
63
+ readonly isClientAuthorizedToRead: boolean;
64
+ /** Retention settings, or null if the caller lacks read authorization. */
65
+ readonly value: FileRetentionValue | null;
66
+ };
67
+ /** Legal hold status for this file version. */
68
+ readonly legalHold: {
69
+ /** Whether the caller is authorized to read legal hold status. */
70
+ readonly isClientAuthorizedToRead: boolean;
71
+ /** Legal hold value, or null if the caller lacks read authorization. */
72
+ readonly value: LegalHoldValue | null;
73
+ };
74
+ /** Replication status, or null if replication is not configured. */
75
+ readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null;
76
+ /** Server-side encryption settings applied to this file version. */
77
+ readonly serverSideEncryption: EncryptionSetting;
78
+ /** UTC timestamp (milliseconds) when this version was uploaded. */
79
+ readonly uploadTimestamp: number;
80
+ }
81
+ /** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */
82
+ export interface ListFileNamesRequest {
83
+ /** Bucket to list files from. */
84
+ readonly bucketId: BucketId;
85
+ /** Return files starting after this name (exclusive). Used for pagination. */
86
+ readonly startFileName?: string;
87
+ /** Maximum number of files to return (1 to 10000). */
88
+ readonly maxFileCount?: number;
89
+ /** Only return files whose names start with this prefix. */
90
+ readonly prefix?: string;
91
+ /** Delimiter for virtual folder grouping (typically `'/'`). */
92
+ readonly delimiter?: string;
93
+ }
94
+ /** Response from the `b2_list_file_names` API call. */
95
+ export interface ListFileNamesResponse {
96
+ /** Array of file versions matching the request. */
97
+ readonly files: readonly FileVersion[];
98
+ /** Next file name to use for pagination, or null if all files have been listed. */
99
+ readonly nextFileName: string | null;
100
+ }
101
+ /** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */
102
+ export interface ListFileVersionsRequest {
103
+ /** Bucket to list file versions from. */
104
+ readonly bucketId: BucketId;
105
+ /** Return files starting after this name (exclusive). Used for pagination. */
106
+ readonly startFileName?: string;
107
+ /** Return file versions starting after this ID. Used with startFileName for pagination. */
108
+ readonly startFileId?: FileId;
109
+ /** Maximum number of file versions to return (1 to 10000). */
110
+ readonly maxFileCount?: number;
111
+ /** Only return files whose names start with this prefix. */
112
+ readonly prefix?: string;
113
+ /** Delimiter for virtual folder grouping (typically `'/'`). */
114
+ readonly delimiter?: string;
115
+ }
116
+ /** Response from the `b2_list_file_versions` API call. */
117
+ export interface ListFileVersionsResponse {
118
+ /** Array of file versions matching the request. */
119
+ readonly files: readonly FileVersion[];
120
+ /** Next file name to use for pagination, or null if all versions have been listed. */
121
+ readonly nextFileName: string | null;
122
+ /** Next file ID to use for pagination, or null if all versions have been listed. */
123
+ readonly nextFileId: FileId | null;
124
+ }
125
+ /** Request parameters for the `b2_get_file_info` API call. */
126
+ export interface GetFileInfoRequest {
127
+ /** ID of the file version to retrieve info for. */
128
+ readonly fileId: FileId;
129
+ }
130
+ /** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */
131
+ export interface HideFileRequest {
132
+ /** Bucket containing the file to hide. */
133
+ readonly bucketId: BucketId;
134
+ /** Name of the file to hide. */
135
+ readonly fileName: string;
136
+ }
137
+ /** Request parameters for the `b2_delete_file_version` API call. */
138
+ export interface DeleteFileVersionRequest {
139
+ /** Name of the file version to delete. */
140
+ readonly fileName: string;
141
+ /** ID of the file version to delete. */
142
+ readonly fileId: FileId;
143
+ /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */
144
+ readonly bypassGovernance?: boolean;
145
+ }
146
+ /** Response from the `b2_delete_file_version` API call. */
147
+ export interface DeleteFileVersionResponse {
148
+ /** ID of the deleted file version. */
149
+ readonly fileId: FileId;
150
+ /** Name of the deleted file. */
151
+ readonly fileName: string;
152
+ }
153
+ /**
154
+ * Named constants for how metadata is handled during a file copy.
155
+ *
156
+ * @example
157
+ * ```ts
158
+ * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })
159
+ * ```
160
+ */
161
+ export declare const MetadataDirective: {
162
+ /** Preserve the source file's contentType and fileInfo. */
163
+ readonly Copy: "COPY";
164
+ /** Use the values provided in the copy request. */
165
+ readonly Replace: "REPLACE";
166
+ };
167
+ /** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */
168
+ export type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective];
169
+ /** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */
170
+ export interface CopyFileRequest {
171
+ /** ID of the source file version to copy from. */
172
+ readonly sourceFileId: FileId;
173
+ /** Destination bucket ID. Defaults to the source bucket if omitted. */
174
+ readonly destinationBucketId?: BucketId;
175
+ /** Name for the destination file. */
176
+ readonly fileName: string;
177
+ /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */
178
+ readonly range?: string;
179
+ /** Whether to copy or replace the source file's metadata. */
180
+ readonly metadataDirective?: MetadataDirective;
181
+ /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */
182
+ readonly contentType?: string;
183
+ /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */
184
+ readonly fileInfo?: Record<string, string>;
185
+ /** Object Lock retention for the destination file. */
186
+ readonly fileRetention?: FileRetentionValue;
187
+ /** Legal hold for the destination file. */
188
+ readonly legalHold?: LegalHoldValue;
189
+ /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */
190
+ readonly sourceServerSideEncryption?: EncryptionSetting;
191
+ /** Server-side encryption to apply to the destination file. */
192
+ readonly destinationServerSideEncryption?: EncryptionSetting;
193
+ }
194
+ /** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */
195
+ export interface CopyPartRequest {
196
+ /** ID of the source file version to copy from. */
197
+ readonly sourceFileId: FileId;
198
+ /** ID of the large file being assembled. */
199
+ readonly largeFileId: FileId;
200
+ /** Part number (1-based) for this part within the large file. */
201
+ readonly partNumber: number;
202
+ /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */
203
+ readonly range?: string;
204
+ /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */
205
+ readonly sourceServerSideEncryption?: EncryptionSetting;
206
+ /** Server-side encryption to apply to the destination part. */
207
+ readonly destinationServerSideEncryption?: EncryptionSetting;
208
+ }
209
+ /** Response from the `b2_copy_part` API call. */
210
+ export interface CopyPartResponse {
211
+ /** ID of the large file this part belongs to. */
212
+ readonly fileId: FileId;
213
+ /** Part number within the large file. */
214
+ readonly partNumber: number;
215
+ /** Size of the copied part in bytes. */
216
+ readonly contentLength: number;
217
+ /** SHA-1 checksum of the copied part content. */
218
+ readonly contentSha1: string;
219
+ }
220
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/types/file.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;IACrB,sDAAsD;;IAEtD,oDAAoD;;IAEpD,iCAAiC;;IAEjC,6BAA6B;;IAE7B,oCAAoC;;CAE5B,CAAA;AAEV;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAErE;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,mFAAmF;IACnF,QAAQ,CAAC,WAAW,EAAE,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yF;IACzF,QAAQ,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAA;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,+BAA+B,CAAC,EAAE,iBAAiB,CAAA;CAC7D;AAED,sGAAsG;AACtG,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,4CAA4C;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,kGAAkG;IAClG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,yFAAyF;IACzF,QAAQ,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAA;IACvD,+DAA+D;IAC/D,QAAQ,CAAC,+BAA+B,CAAC,EAAE,iBAAiB,CAAA;CAC7D;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,yCAAyC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B"}
@@ -0,0 +1,23 @@
1
+ const FileAction = {
2
+ /** Large file upload started but not yet finished. */
3
+ Start: "start",
4
+ /** Normal upload (small or finished large file). */
5
+ Upload: "upload",
6
+ /** Hide marker (soft delete). */
7
+ Hide: "hide",
8
+ /** Virtual folder marker. */
9
+ Folder: "folder",
10
+ /** Created via server-side copy. */
11
+ Copy: "copy"
12
+ };
13
+ const MetadataDirective = {
14
+ /** Preserve the source file's contentType and fileInfo. */
15
+ Copy: "COPY",
16
+ /** Use the values provided in the copy request. */
17
+ Replace: "REPLACE"
18
+ };
19
+ export {
20
+ FileAction,
21
+ MetadataDirective
22
+ };
23
+ //# sourceMappingURL=file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.js","sources":["../../src/types/file.ts"],"sourcesContent":["import type { EncryptionSetting } from './encryption.ts'\nimport type { AccountId, BucketId, FileId } from './ids.ts'\nimport type { FileRetentionValue, LegalHoldValue } from './lock.ts'\n\n/**\n * Named constants for the action that created a file version.\n *\n * @example\n * ```ts\n * if (file.action === FileAction.Hide) { ... }\n * ```\n */\nexport const FileAction = {\n /** Large file upload started but not yet finished. */\n Start: 'start',\n /** Normal upload (small or finished large file). */\n Upload: 'upload',\n /** Hide marker (soft delete). */\n Hide: 'hide',\n /** Virtual folder marker. */\n Folder: 'folder',\n /** Created via server-side copy. */\n Copy: 'copy',\n} as const\n\n/**\n * The action that created a file version. Derived from {@link FileAction}.\n *\n * - `'start'`: large file upload started but not yet finished.\n * - `'upload'`: file was uploaded normally.\n * - `'hide'`: file was hidden (soft-deleted).\n * - `'folder'`: virtual folder marker.\n * - `'copy'`: file was created via server-side copy.\n */\nexport type FileAction = (typeof FileAction)[keyof typeof FileAction]\n\n/**\n * Complete metadata for a single file version in B2.\n * Returned by `b2_get_file_info`, `b2_list_file_names`, `b2_list_file_versions`,\n * `b2_upload_file`, `b2_copy_file`, and other file-related endpoints.\n */\nexport interface FileVersion {\n /** Account that owns this file. */\n readonly accountId: AccountId\n /** Action that created this file version. */\n readonly action: FileAction\n /** Bucket containing this file. */\n readonly bucketId: BucketId\n /** Size of the file content in bytes. */\n readonly contentLength: number\n /** MD5 checksum of the content, or null if not available. */\n readonly contentMd5: string | null\n /** SHA-1 checksum of the content, or null if not available (e.g., large files). */\n readonly contentSha1: string | null\n /** MIME type of the file content. */\n readonly contentType: string\n /** Unique identifier for this file version. */\n readonly fileId: FileId\n /** User-defined key-value metadata stored with the file. */\n readonly fileInfo: Record<string, string>\n /** Full path and name of the file within the bucket. */\n readonly fileName: string\n /** Object Lock retention settings for this file version. */\n readonly fileRetention: {\n /** Whether the caller is authorized to read retention settings. */\n readonly isClientAuthorizedToRead: boolean\n /** Retention settings, or null if the caller lacks read authorization. */\n readonly value: FileRetentionValue | null\n }\n /** Legal hold status for this file version. */\n readonly legalHold: {\n /** Whether the caller is authorized to read legal hold status. */\n readonly isClientAuthorizedToRead: boolean\n /** Legal hold value, or null if the caller lacks read authorization. */\n readonly value: LegalHoldValue | null\n }\n /** Replication status, or null if replication is not configured. */\n readonly replicationStatus: 'pending' | 'completed' | 'failed' | 'replica' | null\n /** Server-side encryption settings applied to this file version. */\n readonly serverSideEncryption: EncryptionSetting\n /** UTC timestamp (milliseconds) when this version was uploaded. */\n readonly uploadTimestamp: number\n}\n\n/** Request parameters for the `b2_list_file_names` API call. Lists the most recent version of each file in a bucket. */\nexport interface ListFileNamesRequest {\n /** Bucket to list files from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Maximum number of files to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_names` API call. */\nexport interface ListFileNamesResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all files have been listed. */\n readonly nextFileName: string | null\n}\n\n/** Request parameters for the `b2_list_file_versions` API call. Lists all versions of files in a bucket. */\nexport interface ListFileVersionsRequest {\n /** Bucket to list file versions from. */\n readonly bucketId: BucketId\n /** Return files starting after this name (exclusive). Used for pagination. */\n readonly startFileName?: string\n /** Return file versions starting after this ID. Used with startFileName for pagination. */\n readonly startFileId?: FileId\n /** Maximum number of file versions to return (1 to 10000). */\n readonly maxFileCount?: number\n /** Only return files whose names start with this prefix. */\n readonly prefix?: string\n /** Delimiter for virtual folder grouping (typically `'/'`). */\n readonly delimiter?: string\n}\n\n/** Response from the `b2_list_file_versions` API call. */\nexport interface ListFileVersionsResponse {\n /** Array of file versions matching the request. */\n readonly files: readonly FileVersion[]\n /** Next file name to use for pagination, or null if all versions have been listed. */\n readonly nextFileName: string | null\n /** Next file ID to use for pagination, or null if all versions have been listed. */\n readonly nextFileId: FileId | null\n}\n\n/** Request parameters for the `b2_get_file_info` API call. */\nexport interface GetFileInfoRequest {\n /** ID of the file version to retrieve info for. */\n readonly fileId: FileId\n}\n\n/** Request parameters for the `b2_hide_file` API call. Hides a file so it no longer appears in `b2_list_file_names`. */\nexport interface HideFileRequest {\n /** Bucket containing the file to hide. */\n readonly bucketId: BucketId\n /** Name of the file to hide. */\n readonly fileName: string\n}\n\n/** Request parameters for the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionRequest {\n /** Name of the file version to delete. */\n readonly fileName: string\n /** ID of the file version to delete. */\n readonly fileId: FileId\n /** If true, bypass governance-mode retention. Requires the `bypassGovernance` capability. */\n readonly bypassGovernance?: boolean\n}\n\n/** Response from the `b2_delete_file_version` API call. */\nexport interface DeleteFileVersionResponse {\n /** ID of the deleted file version. */\n readonly fileId: FileId\n /** Name of the deleted file. */\n readonly fileName: string\n}\n\n/**\n * Named constants for how metadata is handled during a file copy.\n *\n * @example\n * ```ts\n * await bucket.copyFile({ ..., metadataDirective: MetadataDirective.Replace })\n * ```\n */\nexport const MetadataDirective = {\n /** Preserve the source file's contentType and fileInfo. */\n Copy: 'COPY',\n /** Use the values provided in the copy request. */\n Replace: 'REPLACE',\n} as const\n\n/** Controls how metadata is handled during a file copy. Derived from {@link MetadataDirective}. */\nexport type MetadataDirective = (typeof MetadataDirective)[keyof typeof MetadataDirective]\n\n/** Request parameters for the `b2_copy_file` API call. Performs a server-side file copy. */\nexport interface CopyFileRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** Destination bucket ID. Defaults to the source bucket if omitted. */\n readonly destinationBucketId?: BucketId\n /** Name for the destination file. */\n readonly fileName: string\n /** Byte range to copy (e.g., `'bytes=0-999'`). Omit to copy the entire file. */\n readonly range?: string\n /** Whether to copy or replace the source file's metadata. */\n readonly metadataDirective?: MetadataDirective\n /** MIME type for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly contentType?: string\n /** User-defined metadata for the destination file (only used when metadataDirective is `'REPLACE'`). */\n readonly fileInfo?: Record<string, string>\n /** Object Lock retention for the destination file. */\n readonly fileRetention?: FileRetentionValue\n /** Legal hold for the destination file. */\n readonly legalHold?: LegalHoldValue\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination file. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Request parameters for the `b2_copy_part` API call. Copies a byte range into a large file part. */\nexport interface CopyPartRequest {\n /** ID of the source file version to copy from. */\n readonly sourceFileId: FileId\n /** ID of the large file being assembled. */\n readonly largeFileId: FileId\n /** Part number (1-based) for this part within the large file. */\n readonly partNumber: number\n /** Byte range to copy from the source (e.g., `'bytes=0-999'`). Omit to copy the entire source. */\n readonly range?: string\n /** SSE-C settings for reading the source file, if the source is encrypted with SSE-C. */\n readonly sourceServerSideEncryption?: EncryptionSetting\n /** Server-side encryption to apply to the destination part. */\n readonly destinationServerSideEncryption?: EncryptionSetting\n}\n\n/** Response from the `b2_copy_part` API call. */\nexport interface CopyPartResponse {\n /** ID of the large file this part belongs to. */\n readonly fileId: FileId\n /** Part number within the large file. */\n readonly partNumber: number\n /** Size of the copied part in bytes. */\n readonly contentLength: number\n /** SHA-1 checksum of the copied part content. */\n readonly contentSha1: string\n}\n"],"names":[],"mappings":"AAYO,MAAM,aAAa;AAAA;AAAA,EAExB,OAAO;AAAA;AAAA,EAEP,QAAQ;AAAA;AAAA,EAER,MAAM;AAAA;AAAA,EAEN,QAAQ;AAAA;AAAA,EAER,MAAM;AACR;AAqJO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,MAAM;AAAA;AAAA,EAEN,SAAS;AACX;"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function accountId(raw) {
4
+ return raw;
5
+ }
6
+ function bucketId(raw) {
7
+ return raw;
8
+ }
9
+ function fileId(raw) {
10
+ return raw;
11
+ }
12
+ function keyId(raw) {
13
+ return raw;
14
+ }
15
+ function applicationKeyId(raw) {
16
+ return raw;
17
+ }
18
+ function largeFileId(raw) {
19
+ return raw;
20
+ }
21
+ exports.accountId = accountId;
22
+ exports.applicationKeyId = applicationKeyId;
23
+ exports.bucketId = bucketId;
24
+ exports.fileId = fileId;
25
+ exports.keyId = keyId;
26
+ exports.largeFileId = largeFileId;
27
+ //# sourceMappingURL=ids.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.cjs","sources":["../../src/types/ids.ts"],"sourcesContent":["/**\n * Unique symbol used to brand string types, preventing accidental mixing of different ID types.\n */\ndeclare const __brand: unique symbol\n\n/** Compile-time brand tag interface. Never instantiated at runtime. */\nexport interface BrandTag<B extends string> {\n /** Discriminant tag that makes branded types structurally incompatible. */\n readonly [__brand]: B\n}\n\n/**\n * Utility type that intersects a base type with a branded tag.\n * This pattern ensures that branded types are structurally incompatible with each other\n * even though they share the same underlying representation.\n */\nexport type Brand<T, B extends string> = T & BrandTag<B>\n\n/** Unique identifier for a B2 account. Branded to prevent mixing with other string IDs. */\nexport type AccountId = Brand<string, 'AccountId'>\n\n/** Unique identifier for a B2 bucket. Branded to prevent mixing with other string IDs. */\nexport type BucketId = Brand<string, 'BucketId'>\n\n/** Unique identifier for a B2 file version. Branded to prevent mixing with other string IDs. */\nexport type FileId = Brand<string, 'FileId'>\n\n/** Unique identifier for a B2 application key. Branded to prevent mixing with other string IDs. */\nexport type KeyId = Brand<string, 'KeyId'>\n\n/** Unique identifier for a B2 application key, as returned by the API. Branded to prevent mixing with other string IDs. */\nexport type ApplicationKeyId = Brand<string, 'ApplicationKeyId'>\n\n/** Pre-signed URL for uploading files to a specific bucket. Branded to prevent misuse as a regular string. */\nexport type UploadUrl = Brand<string, 'UploadUrl'>\n\n/** Authorization token scoped to a specific upload URL. Branded to prevent mixing with other tokens. */\nexport type UploadAuthToken = Brand<string, 'UploadAuthToken'>\n\n/** Authorization token for B2 API requests. Branded to prevent mixing with other string values. */\nexport type AuthToken = Brand<string, 'AuthToken'>\n\n/** Unique identifier for a large file upload in progress. Branded to prevent mixing with regular FileId values. */\nexport type LargeFileId = Brand<string, 'LargeFileId'>\n\n/**\n * Creates a branded {@link AccountId} from a raw string.\n * @param raw - The raw account ID string from the B2 API.\n *\n * @returns A branded AccountId value.\n */\nexport function accountId(raw: string): AccountId {\n return raw as AccountId\n}\n\n/**\n * Creates a branded {@link BucketId} from a raw string.\n * @param raw - The raw bucket ID string from the B2 API.\n *\n * @returns A branded BucketId value.\n */\nexport function bucketId(raw: string): BucketId {\n return raw as BucketId\n}\n\n/**\n * Creates a branded {@link FileId} from a raw string.\n * @param raw - The raw file ID string from the B2 API.\n *\n * @returns A branded FileId value.\n */\nexport function fileId(raw: string): FileId {\n return raw as FileId\n}\n\n/**\n * Creates a branded {@link KeyId} from a raw string.\n * @param raw - The raw key ID string from the B2 API.\n *\n * @returns A branded KeyId value.\n */\nexport function keyId(raw: string): KeyId {\n return raw as KeyId\n}\n\n/**\n * Creates a branded {@link ApplicationKeyId} from a raw string.\n * @param raw - The raw application key ID string from the B2 API.\n *\n * @returns A branded ApplicationKeyId value.\n */\nexport function applicationKeyId(raw: string): ApplicationKeyId {\n return raw as ApplicationKeyId\n}\n\n/**\n * Creates a branded {@link LargeFileId} from a raw string.\n *\n * `LargeFileId` is the same wire-level shape as `FileId` but is a\n * distinct brand so that \"ID of an in-progress multipart upload\" and\n * \"ID of a committed file version\" don't get mixed up by accident.\n * `b2_start_large_file` returns one; `b2_finish_large_file` consumes it\n * and produces a regular `FileId`.\n *\n * @param raw - The raw large-file ID string from the B2 API.\n *\n * @returns A branded LargeFileId value.\n */\nexport function largeFileId(raw: string): LargeFileId {\n return raw as LargeFileId\n}\n"],"names":[],"mappings":";;AAmDO,SAAS,UAAU,KAAwB;AAChD,SAAO;AACT;AAQO,SAAS,SAAS,KAAuB;AAC9C,SAAO;AACT;AAQO,SAAS,OAAO,KAAqB;AAC1C,SAAO;AACT;AAQO,SAAS,MAAM,KAAoB;AACxC,SAAO;AACT;AAQO,SAAS,iBAAiB,KAA+B;AAC9D,SAAO;AACT;AAeO,SAAS,YAAY,KAA0B;AACpD,SAAO;AACT;;;;;;;"}