@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,84 @@
1
+ /**
2
+ * Unique symbol used to brand string types, preventing accidental mixing of different ID types.
3
+ */
4
+ declare const __brand: unique symbol;
5
+ /** Compile-time brand tag interface. Never instantiated at runtime. */
6
+ export interface BrandTag<B extends string> {
7
+ /** Discriminant tag that makes branded types structurally incompatible. */
8
+ readonly [__brand]: B;
9
+ }
10
+ /**
11
+ * Utility type that intersects a base type with a branded tag.
12
+ * This pattern ensures that branded types are structurally incompatible with each other
13
+ * even though they share the same underlying representation.
14
+ */
15
+ export type Brand<T, B extends string> = T & BrandTag<B>;
16
+ /** Unique identifier for a B2 account. Branded to prevent mixing with other string IDs. */
17
+ export type AccountId = Brand<string, 'AccountId'>;
18
+ /** Unique identifier for a B2 bucket. Branded to prevent mixing with other string IDs. */
19
+ export type BucketId = Brand<string, 'BucketId'>;
20
+ /** Unique identifier for a B2 file version. Branded to prevent mixing with other string IDs. */
21
+ export type FileId = Brand<string, 'FileId'>;
22
+ /** Unique identifier for a B2 application key. Branded to prevent mixing with other string IDs. */
23
+ export type KeyId = Brand<string, 'KeyId'>;
24
+ /** Unique identifier for a B2 application key, as returned by the API. Branded to prevent mixing with other string IDs. */
25
+ export type ApplicationKeyId = Brand<string, 'ApplicationKeyId'>;
26
+ /** Pre-signed URL for uploading files to a specific bucket. Branded to prevent misuse as a regular string. */
27
+ export type UploadUrl = Brand<string, 'UploadUrl'>;
28
+ /** Authorization token scoped to a specific upload URL. Branded to prevent mixing with other tokens. */
29
+ export type UploadAuthToken = Brand<string, 'UploadAuthToken'>;
30
+ /** Authorization token for B2 API requests. Branded to prevent mixing with other string values. */
31
+ export type AuthToken = Brand<string, 'AuthToken'>;
32
+ /** Unique identifier for a large file upload in progress. Branded to prevent mixing with regular FileId values. */
33
+ export type LargeFileId = Brand<string, 'LargeFileId'>;
34
+ /**
35
+ * Creates a branded {@link AccountId} from a raw string.
36
+ * @param raw - The raw account ID string from the B2 API.
37
+ *
38
+ * @returns A branded AccountId value.
39
+ */
40
+ export declare function accountId(raw: string): AccountId;
41
+ /**
42
+ * Creates a branded {@link BucketId} from a raw string.
43
+ * @param raw - The raw bucket ID string from the B2 API.
44
+ *
45
+ * @returns A branded BucketId value.
46
+ */
47
+ export declare function bucketId(raw: string): BucketId;
48
+ /**
49
+ * Creates a branded {@link FileId} from a raw string.
50
+ * @param raw - The raw file ID string from the B2 API.
51
+ *
52
+ * @returns A branded FileId value.
53
+ */
54
+ export declare function fileId(raw: string): FileId;
55
+ /**
56
+ * Creates a branded {@link KeyId} from a raw string.
57
+ * @param raw - The raw key ID string from the B2 API.
58
+ *
59
+ * @returns A branded KeyId value.
60
+ */
61
+ export declare function keyId(raw: string): KeyId;
62
+ /**
63
+ * Creates a branded {@link ApplicationKeyId} from a raw string.
64
+ * @param raw - The raw application key ID string from the B2 API.
65
+ *
66
+ * @returns A branded ApplicationKeyId value.
67
+ */
68
+ export declare function applicationKeyId(raw: string): ApplicationKeyId;
69
+ /**
70
+ * Creates a branded {@link LargeFileId} from a raw string.
71
+ *
72
+ * `LargeFileId` is the same wire-level shape as `FileId` but is a
73
+ * distinct brand so that "ID of an in-progress multipart upload" and
74
+ * "ID of a committed file version" don't get mixed up by accident.
75
+ * `b2_start_large_file` returns one; `b2_finish_large_file` consumes it
76
+ * and produces a regular `FileId`.
77
+ *
78
+ * @param raw - The raw large-file ID string from the B2 API.
79
+ *
80
+ * @returns A branded LargeFileId value.
81
+ */
82
+ export declare function largeFileId(raw: string): LargeFileId;
83
+ export {};
84
+ //# sourceMappingURL=ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/types/ids.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,CAAA;AAEpC,uEAAuE;AACvE,MA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AAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAExC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAE9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAEpD"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Unique symbol used to brand string types, preventing accidental mixing of different ID types.
3
+ */
4
+ declare const __brand: unique symbol;
5
+ /** Compile-time brand tag interface. Never instantiated at runtime. */
6
+ export interface BrandTag<B extends string> {
7
+ /** Discriminant tag that makes branded types structurally incompatible. */
8
+ readonly [__brand]: B;
9
+ }
10
+ /**
11
+ * Utility type that intersects a base type with a branded tag.
12
+ * This pattern ensures that branded types are structurally incompatible with each other
13
+ * even though they share the same underlying representation.
14
+ */
15
+ export type Brand<T, B extends string> = T & BrandTag<B>;
16
+ /** Unique identifier for a B2 account. Branded to prevent mixing with other string IDs. */
17
+ export type AccountId = Brand<string, 'AccountId'>;
18
+ /** Unique identifier for a B2 bucket. Branded to prevent mixing with other string IDs. */
19
+ export type BucketId = Brand<string, 'BucketId'>;
20
+ /** Unique identifier for a B2 file version. Branded to prevent mixing with other string IDs. */
21
+ export type FileId = Brand<string, 'FileId'>;
22
+ /** Unique identifier for a B2 application key. Branded to prevent mixing with other string IDs. */
23
+ export type KeyId = Brand<string, 'KeyId'>;
24
+ /** Unique identifier for a B2 application key, as returned by the API. Branded to prevent mixing with other string IDs. */
25
+ export type ApplicationKeyId = Brand<string, 'ApplicationKeyId'>;
26
+ /** Pre-signed URL for uploading files to a specific bucket. Branded to prevent misuse as a regular string. */
27
+ export type UploadUrl = Brand<string, 'UploadUrl'>;
28
+ /** Authorization token scoped to a specific upload URL. Branded to prevent mixing with other tokens. */
29
+ export type UploadAuthToken = Brand<string, 'UploadAuthToken'>;
30
+ /** Authorization token for B2 API requests. Branded to prevent mixing with other string values. */
31
+ export type AuthToken = Brand<string, 'AuthToken'>;
32
+ /** Unique identifier for a large file upload in progress. Branded to prevent mixing with regular FileId values. */
33
+ export type LargeFileId = Brand<string, 'LargeFileId'>;
34
+ /**
35
+ * Creates a branded {@link AccountId} from a raw string.
36
+ * @param raw - The raw account ID string from the B2 API.
37
+ *
38
+ * @returns A branded AccountId value.
39
+ */
40
+ export declare function accountId(raw: string): AccountId;
41
+ /**
42
+ * Creates a branded {@link BucketId} from a raw string.
43
+ * @param raw - The raw bucket ID string from the B2 API.
44
+ *
45
+ * @returns A branded BucketId value.
46
+ */
47
+ export declare function bucketId(raw: string): BucketId;
48
+ /**
49
+ * Creates a branded {@link FileId} from a raw string.
50
+ * @param raw - The raw file ID string from the B2 API.
51
+ *
52
+ * @returns A branded FileId value.
53
+ */
54
+ export declare function fileId(raw: string): FileId;
55
+ /**
56
+ * Creates a branded {@link KeyId} from a raw string.
57
+ * @param raw - The raw key ID string from the B2 API.
58
+ *
59
+ * @returns A branded KeyId value.
60
+ */
61
+ export declare function keyId(raw: string): KeyId;
62
+ /**
63
+ * Creates a branded {@link ApplicationKeyId} from a raw string.
64
+ * @param raw - The raw application key ID string from the B2 API.
65
+ *
66
+ * @returns A branded ApplicationKeyId value.
67
+ */
68
+ export declare function applicationKeyId(raw: string): ApplicationKeyId;
69
+ /**
70
+ * Creates a branded {@link LargeFileId} from a raw string.
71
+ *
72
+ * `LargeFileId` is the same wire-level shape as `FileId` but is a
73
+ * distinct brand so that "ID of an in-progress multipart upload" and
74
+ * "ID of a committed file version" don't get mixed up by accident.
75
+ * `b2_start_large_file` returns one; `b2_finish_large_file` consumes it
76
+ * and produces a regular `FileId`.
77
+ *
78
+ * @param raw - The raw large-file ID string from the B2 API.
79
+ *
80
+ * @returns A branded LargeFileId value.
81
+ */
82
+ export declare function largeFileId(raw: string): LargeFileId;
83
+ export {};
84
+ //# sourceMappingUR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AAEtD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAE9C;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAExC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAE9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAEpD"}
@@ -0,0 +1,27 @@
1
+ function accountId(raw) {
2
+ return raw;
3
+ }
4
+ function bucketId(raw) {
5
+ return raw;
6
+ }
7
+ function fileId(raw) {
8
+ return raw;
9
+ }
10
+ function keyId(raw) {
11
+ return raw;
12
+ }
13
+ function applicationKeyId(raw) {
14
+ return raw;
15
+ }
16
+ function largeFileId(raw) {
17
+ return raw;
18
+ }
19
+ export {
20
+ accountId,
21
+ applicationKeyId,
22
+ bucketId,
23
+ fileId,
24
+ keyId,
25
+ largeFileId
26
+ };
27
+ //# sourceMappingURL=ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.js","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;"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Public type definitions for the B2 SDK.
4
+ * Re-exports all branded IDs, request/response interfaces, and configuration types.
5
+ */
6
+ export type { AccountId, ApplicationKeyId, AuthToken, Brand, BrandTag, BucketId, FileId, KeyId, LargeFileId, UploadAuthToken, UploadUrl, } from './ids.js';
7
+ export { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId } from './ids.js';
8
+ export type { AllowedInfo, ApiInfo, AuthorizeAccountRequest, AuthorizeAccountResponse, GroupsApiInfo, StorageApiInfo, } from './auth.js';
9
+ export { Capability } from './auth.js';
10
+ export type { BucketInfo, BucketRetentionPolicy, RetentionPeriod, CorsRule, CreateBucketRequest, DeleteBucketRequest, LifecycleRule, ListBucketsRequest, ListBucketsResponse, UpdateBucketRequest, } from './bucket.js';
11
+ export { BucketRetentionMode, BucketType, CorsOperation } from './bucket.js';
12
+ export type { CopyFileRequest, CopyPartRequest, CopyPartResponse, DeleteFileVersionRequest, DeleteFileVersionResponse, FileVersion, GetFileInfoRequest, HideFileRequest, ListFileNamesRequest, ListFileNamesResponse, ListFileVersionsRequest, ListFileVersionsResponse, } from './file.js';
13
+ export { FileAction, MetadataDirective } from './file.js';
14
+ export type { CancelLargeFileRequest, CancelLargeFileResponse, FinishLargeFileRequest, GetUploadPartUrlRequest, GetUploadPartUrlResponse, GetUploadUrlRequest, GetUploadUrlResponse, ListPartsRequest, ListPartsResponse, ListUnfinishedLargeFilesRequest, ListUnfinishedLargeFilesResponse, PartInfo, StartLargeFileRequest, StartLargeFileResponse, UnfinishedLargeFile, UploadFileHeaders, UploadPartHeaders, UploadPartResponse, } from './upload.js';
15
+ export type { DownloadAuthorizationRequest, DownloadAuthorizationResponse, DownloadByIdRequest, DownloadByNameRequest, DownloadHeaders, } from './download.js';
16
+ export type { EncryptionSetting, NoEncryption, SseB2Setting, SseCCustomerSetting, } from './encryption.js';
17
+ export { EncryptionAlgorithm, EncryptionKey, EncryptionMode, SSE_B2, SSE_NONE, sseCustomer, } from './encryption.js';
18
+ export type { FileRetentionValue, UpdateFileLegalHoldRequest, UpdateFileLegalHoldResponse, UpdateFileRetentionRequest, UpdateFileRetentionResponse, } from './lock.js';
19
+ export { LegalHoldValue, RetentionMode } from './lock.js';
20
+ export type { ApplicationKey, CreateKeyRequest, DeleteKeyRequest, FullApplicationKey, ListKeysRequest, ListKeysResponse, } from './key.js';
21
+ export type { ReplicationConfiguration, ReplicationDestination, ReplicationRule, ReplicationSource, } from './replication.js';
22
+ export type { EventNotificationRule, GetBucketNotificationRulesRequest, GetBucketNotificationRulesResponse, SetBucketNotificationRulesRequest, SetBucketNotificationRulesResponse, } from './notifications.js';
23
+ export { EventType } from './notifications.js';
24
+ export type { B2ErrorCode, B2ErrorResponse } from './errors.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,WAAW,EACX,eAAe,EACf,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE5F,YAAY,EACV,WAAW,EACX,OAAO,EACP,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,EACb,cAAc,GACf,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,YAAY,EACV,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE5E,YAAY,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAEzD,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,+BAA+B,EAC/B,gCAAgC,EAChC,QAAQ,EACR,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,GAChB,MAAM,eAAe,CAAA;AAEtB,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,MAAM,EACN,QAAQ,EACR,WAAW,GACZ,MAAM,iBAAiB,CAAA;AAExB,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEzD,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,UAAU,CAAA;AAEjB,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAA;AAEzB,YAAY,EACV,qBAAqB,EACrB,iCAAiC,EACjC,kCAAkC,EAClC,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Public type definitions for the B2 SDK.
4
+ * Re-exports all branded IDs, request/response interfaces, and configuration types.
5
+ */
6
+ export type { AccountId, ApplicationKeyId, AuthToken, Brand, BrandTag, BucketId, FileId, KeyId, LargeFileId, UploadAuthToken, UploadUrl, } from './ids.js';
7
+ export { accountId, applicationKeyId, bucketId, fileId, keyId, largeFileId } from './ids.js';
8
+ export type { AllowedInfo, ApiInfo, AuthorizeAccountRequest, AuthorizeAccountResponse, GroupsApiInfo, StorageApiInfo, } from './auth.js';
9
+ export { Capability } from './auth.js';
10
+ export type { BucketInfo, BucketRetentionPolicy, RetentionPeriod, CorsRule, CreateBucketRequest, DeleteBucketRequest, LifecycleRule, ListBucketsRequest, ListBucketsResponse, UpdateBucketRequest, } from './bucket.js';
11
+ export { BucketRetentionMode, BucketType, CorsOperation } from './bucket.js';
12
+ export type { CopyFileRequest, CopyPartRequest, CopyPartResponse, DeleteFileVersionRequest, DeleteFileVersionResponse, FileVersion, GetFileInfoRequest, HideFileRequest, ListFileNamesRequest, ListFileNamesResponse, ListFileVersionsRequest, ListFileVersionsResponse, } from './file.js';
13
+ export { FileAction, MetadataDirective } from './file.js';
14
+ export type { CancelLargeFileRequest, CancelLargeFileResponse, FinishLargeFileRequest, GetUploadPartUrlRequest, GetUploadPartUrlResponse, GetUploadUrlRequest, GetUploadUrlResponse, ListPartsRequest, ListPartsResponse, ListUnfinishedLargeFilesRequest, ListUnfinishedLargeFilesResponse, PartInfo, StartLargeFileRequest, StartLargeFileResponse, UnfinishedLargeFile, UploadFileHeaders, UploadPartHeaders, UploadPartResponse, } from './upload.js';
15
+ export type { DownloadAuthorizationRequest, DownloadAuthorizationResponse, DownloadByIdRequest, DownloadByNameRequest, DownloadHeaders, } from './download.js';
16
+ export type { EncryptionSetting, NoEncryption, SseB2Setting, SseCCustomerSetting, } from './encryption.js';
17
+ export { EncryptionAlgorithm, EncryptionKey, EncryptionMode, SSE_B2, SSE_NONE, sseCustomer, } from './encryption.js';
18
+ export type { FileRetentionValue, UpdateFileLegalHoldRequest, UpdateFileLegalHoldResponse, UpdateFileRetentionRequest, UpdateFileRetentionResponse, } from './lock.js';
19
+ export { LegalHoldValue, RetentionMode } from './lock.js';
20
+ export type { ApplicationKey, CreateKeyRequest, DeleteKeyRequest, FullApplicationKey, ListKeysRequest, ListKeysResponse, } from './key.js';
21
+ export type { ReplicationConfiguration, ReplicationDestination, ReplicationRule, ReplicationSource, } from './replication.js';
22
+ export type { EventNotificationRule, GetBucketNotificationRulesRequest, GetBucketNotificationRulesResponse, SetBucketNotificationRulesRequest, SetBucketNotificationRulesResponse, } from './notifications.js';
23
+ export { EventType } from './notifications.js';
24
+ export type { B2ErrorCode, B2ErrorResponse } from './errors.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,WAAW,EACX,eAAe,EACf,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE5F,YAAY,EACV,WAAW,EACX,OAAO,EACP,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,EACb,cAAc,GACf,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,YAAY,EACV,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE5E,YAAY,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,W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EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,84 @@
1
+ import { Capability } from './auth.js';
2
+ import { AccountId, ApplicationKeyId, BucketId } from './ids.js';
3
+ /** Request parameters for the `b2_create_key` API call. Creates a new application key. */
4
+ export interface CreateKeyRequest {
5
+ /** Account to create the key for. */
6
+ readonly accountId: AccountId;
7
+ /** Capabilities to grant to the new key. */
8
+ readonly capabilities: readonly Capability[];
9
+ /** Human-readable name for the key (must be unique within the account). */
10
+ readonly keyName: string;
11
+ /** Optional duration in seconds before the key expires. Omit for a key that never expires. */
12
+ readonly validDurationInSeconds?: number;
13
+ /** Optional bucket restriction. When set, the key only grants access to this bucket. */
14
+ readonly bucketId?: BucketId;
15
+ /** Optional file name prefix restriction. When set, the key only grants access to files with this prefix. */
16
+ readonly namePrefix?: string;
17
+ }
18
+ /**
19
+ * Full application key including the secret, returned only at creation time by `b2_create_key`.
20
+ * The `applicationKey` secret is never returned again after this response.
21
+ */
22
+ export interface FullApplicationKey {
23
+ /** Human-readable name of the key. */
24
+ readonly keyName: string;
25
+ /** Unique identifier for the application key. */
26
+ readonly applicationKeyId: ApplicationKeyId;
27
+ /** The secret key value. Only available in the `b2_create_key` response. */
28
+ readonly applicationKey: string;
29
+ /** Capabilities granted to this key. */
30
+ readonly capabilities: readonly Capability[];
31
+ /** Account that owns this key. */
32
+ readonly accountId: AccountId;
33
+ /** UTC timestamp (milliseconds) when this key expires, or null if it does not expire. */
34
+ readonly expirationTimestamp: number | null;
35
+ /** Bucket ID this key is restricted to, or null if unrestricted. */
36
+ readonly bucketId: BucketId | null;
37
+ /** File name prefix this key is restricted to, or null if unrestricted. */
38
+ readonly namePrefix: string | null;
39
+ /** Set of options enabled on this key. */
40
+ readonly options: readonly string[];
41
+ }
42
+ /**
43
+ * Application key metadata (without the secret) as returned by `b2_list_keys`.
44
+ */
45
+ export interface ApplicationKey {
46
+ /** Human-readable name of the key. */
47
+ readonly keyName: string;
48
+ /** Unique identifier for the application key. */
49
+ readonly applicationKeyId: ApplicationKeyId;
50
+ /** Capabilities granted to this key. */
51
+ readonly capabilities: readonly Capability[];
52
+ /** Account that owns this key. */
53
+ readonly accountId: AccountId;
54
+ /** UTC timestamp (milliseconds) when this key expires, or null if it does not expire. */
55
+ readonly expirationTimestamp: number | null;
56
+ /** Bucket ID this key is restricted to, or null if unrestricted. */
57
+ readonly bucketId: BucketId | null;
58
+ /** File name prefix this key is restricted to, or null if unrestricted. */
59
+ readonly namePrefix: string | null;
60
+ /** Set of options enabled on this key. */
61
+ readonly options: readonly string[];
62
+ }
63
+ /** Request parameters for the `b2_list_keys` API call. */
64
+ export interface ListKeysRequest {
65
+ /** Account whose keys to list. */
66
+ readonly accountId: AccountId;
67
+ /** Maximum number of keys to return per request. */
68
+ readonly maxKeyCount?: number;
69
+ /** Application key ID to start listing from (exclusive). Used for pagination. */
70
+ readonly startApplicationKeyId?: ApplicationKeyId;
71
+ }
72
+ /** Response from the `b2_list_keys` API call. */
73
+ export interface ListKeysResponse {
74
+ /** Array of application keys (without secrets). */
75
+ readonly keys: readonly ApplicationKey[];
76
+ /** Next application key ID to use for pagination, or null if all keys have been listed. */
77
+ readonly nextApplicationKeyId: ApplicationKeyId | null;
78
+ }
79
+ /** Request parameters for the `b2_delete_key` API call. */
80
+ export interface DeleteKeyRequest {
81
+ /** ID of the application key to delete. */
82
+ readonly applicationKeyId: ApplicationKeyId;
83
+ }
84
+ //# sourceMappingURL=key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/types/key.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAErE,0FAA0F;AAC1F,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,QAAQ,CAAC,SAAS,EAAE,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AAkC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3C,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IAClC,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CACpC;AAED,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,CAAA;CAClD;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,CAAA;IACxC,2FAA2F;IAC3F,QAAQ,CAAC,oBAAoB,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACvD;AAED,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAA;CAC5C"}
@@ -0,0 +1,84 @@
1
+ import { Capability } from './auth.js';
2
+ import { AccountId, ApplicationKeyId, BucketId } from './ids.js';
3
+ /** Request parameters for the `b2_create_key` API call. Creates a new application key. */
4
+ export interface CreateKeyRequest {
5
+ /** Account to create the key for. */
6
+ readonly accountId: AccountId;
7
+ /** Capabilities to grant to the new key. */
8
+ readonly capabilities: readonly Capability[];
9
+ /** Human-readable name for the key (must be unique within the account). */
10
+ readonly keyName: string;
11
+ /** Optional duration in seconds before the key expires. Omit for a key that never expires. */
12
+ readonly validDurationInSeconds?: number;
13
+ /** Optional bucket restriction. When set, the key only grants access to this bucket. */
14
+ readonly bucketId?: BucketId;
15
+ /** Optional file name prefix restriction. When set, the key only grants access to files with this prefix. */
16
+ readonly namePrefix?: string;
17
+ }
18
+ /**
19
+ * Full application key including the secret, returned only at creation time by `b2_create_key`.
20
+ * The `applicationKey` secret is never returned again after this response.
21
+ */
22
+ export interface FullApplicationKey {
23
+ /** Human-readable name of the key. */
24
+ readonly keyName: string;
25
+ /** Unique identifier for the application key. */
26
+ readonly applicationKeyId: ApplicationKeyId;
27
+ /** The secret key value. Only available in the `b2_create_key` response. */
28
+ readonly applicationKey: string;
29
+ /** Capabilities granted to this key. */
30
+ readonly capabilities: readonly Capability[];
31
+ /** Account that owns this key. */
32
+ readonly accountId: AccountId;
33
+ /** UTC timestamp (milliseconds) when this key expires, or null if it does not expire. */
34
+ readonly expirationTimestamp: number | null;
35
+ /** Bucket ID this key is restricted to, or null if unrestricted. */
36
+ readonly bucketId: BucketId | null;
37
+ /** File name prefix this key is restricted to, or null if unrestricted. */
38
+ readonly namePrefix: string | null;
39
+ /** Set of options enabled on this key. */
40
+ readonly options: readonly string[];
41
+ }
42
+ /**
43
+ * Application key metadata (without the secret) as returned by `b2_list_keys`.
44
+ */
45
+ export interface ApplicationKey {
46
+ /** Human-readable name of the key. */
47
+ readonly keyName: string;
48
+ /** Unique identifier for the application key. */
49
+ readonly applicationKeyId: ApplicationKeyId;
50
+ /** Capabilities granted to this key. */
51
+ readonly capabilities: readonly Capability[];
52
+ /** Account that owns this key. */
53
+ readonly accountId: AccountId;
54
+ /** UTC timestamp (milliseconds) when this key expires, or null if it does not expire. */
55
+ readonly expirationTimestamp: number | null;
56
+ /** Bucket ID this key is restricted to, or null if unrestricted. */
57
+ readonly bucketId: BucketId | null;
58
+ /** File name prefix this key is restricted to, or null if unrestricted. */
59
+ readonly namePrefix: string | null;
60
+ /** Set of options enabled on this key. */
61
+ readonly options: readonly string[];
62
+ }
63
+ /** Request parameters for the `b2_list_keys` API call. */
64
+ export interface ListKeysRequest {
65
+ /** Account whose keys to list. */
66
+ readonly accountId: AccountId;
67
+ /** Maximum number of keys to return per request. */
68
+ readonly maxKeyCount?: number;
69
+ /** Application key ID to start listing from (exclusive). Used for pagination. */
70
+ readonly startApplicationKeyId?: ApplicationKeyId;
71
+ }
72
+ /** Response from the `b2_list_keys` API call. */
73
+ export interface ListKeysResponse {
74
+ /** Array of application keys (without secrets). */
75
+ readonly keys: readonly ApplicationKey[];
76
+ /** Next application key ID to use for pagination, or null if all keys have been listed. */
77
+ readonly nextApplicationKeyId: ApplicationKeyId | null;
78
+ }
79
+ /** Request parameters for the `b2_delete_key` API call. */
80
+ export interface DeleteKeyRequest {
81
+ /** ID of the application key to delete. */
82
+ readonly applicationKeyId: ApplicationKeyId;
83
+ }
84
+ //# sourceMappingURL=key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/types/key.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAErE,0FAA0F;AAC1F,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,EAAE,SAAS,UAAU,EAAE,CAAA;IAC5C,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IACxC,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAC5B,6GAA6G;IAC7G,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC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AAkC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,CAAA;CAClD;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,CAAA;IACxC,2FAA2F;IAC3F,QAAQ,CAAC,oBAAoB,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACvD;AAED,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAA;CAC5C"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const RetentionMode = {
4
+ /** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */
5
+ Compliance: "compliance",
6
+ /** Locked: can be shortened by callers holding the `bypassGovernance` capability. */
7
+ Governance: "governance"
8
+ };
9
+ const LegalHoldValue = {
10
+ /** Apply the legal hold. */
11
+ On: "on",
12
+ /** Remove the legal hold. */
13
+ Off: "off"
14
+ };
15
+ exports.LegalHoldValue = LegalHoldValue;
16
+ exports.RetentionMode = RetentionMode;
17
+ //# sourceMappingURL=lock.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.cjs","sources":["../../src/types/lock.ts"],"sourcesContent":["import type { FileId } from './ids.ts'\n\n/**\n * Named constants for the file-level Object Lock retention mode.\n *\n * @example\n * ```ts\n * await object.setRetention(fileId, {\n * mode: RetentionMode.Compliance,\n * retainUntilTimestamp: Date.now() + 86_400_000,\n * })\n * ```\n */\nexport const RetentionMode = {\n /** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */\n Compliance: 'compliance',\n /** Locked: can be shortened by callers holding the `bypassGovernance` capability. */\n Governance: 'governance',\n} as const\n\n/** File-level Object Lock retention mode. Derived from {@link RetentionMode}. */\nexport type RetentionMode = (typeof RetentionMode)[keyof typeof RetentionMode]\n\n/**\n * Named constants for the file legal-hold status.\n *\n * @example\n * ```ts\n * await object.setLegalHold(fileId, LegalHoldValue.On)\n * ```\n */\nexport const LegalHoldValue = {\n /** Apply the legal hold. */\n On: 'on',\n /** Remove the legal hold. */\n Off: 'off',\n} as const\n\n/** Legal hold status for a file. Derived from {@link LegalHoldValue}. */\nexport type LegalHoldValue = (typeof LegalHoldValue)[keyof typeof LegalHoldValue]\n\n/** Retention settings for a specific file version under Object Lock. */\nexport interface FileRetentionValue {\n /** Retention mode, or null if no retention is set. */\n readonly mode: RetentionMode | null\n /** UTC timestamp (milliseconds) until which the file is retained, or null if not set. */\n readonly retainUntilTimestamp: number | null\n}\n\n/**\n * Request parameters for the `b2_update_file_retention` API call.\n * Updates the Object Lock retention settings on a file version.\n */\nexport interface UpdateFileRetentionRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New retention settings for the file. */\n readonly fileRetention: FileRetentionValue\n /**\n * When `true`, allows shortening a governance-mode retention period. Requires\n * the `bypassGovernance` capability on the application key. Has no effect on\n * compliance-mode retention.\n */\n readonly bypassGovernance?: boolean\n}\n\n/**\n * Request parameters for the `b2_update_file_legal_hold` API call.\n * Updates the legal hold status on a file version.\n */\nexport interface UpdateFileLegalHoldRequest {\n /** Name of the file to update. */\n readonly fileName: string\n /** ID of the file version to update. */\n readonly fileId: FileId\n /** New legal hold status: `'on'` or `'off'`. */\n readonly legalHold: LegalHoldValue\n}\n\n/** Response from the `b2_update_file_retention` API call. */\nexport interface UpdateFileRetentionResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Retention settings as applied. */\n readonly fileRetention: FileRetentionValue\n}\n\n/** Response from the `b2_update_file_legal_hold` API call. */\nexport interface UpdateFileLegalHoldResponse {\n /** Name of the updated file. */\n readonly fileName: string\n /** ID of the updated file version. */\n readonly fileId: FileId\n /** Legal hold status as applied. */\n readonly legalHold: LegalHoldValue\n}\n"],"names":[],"mappings":";;AAaO,MAAM,gBAAgB;AAAA;AAAA,EAE3B,YAAY;AAAA;AAAA,EAEZ,YAAY;AACd;AAaO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,IAAI;AAAA;AAAA,EAEJ,KAAK;AACP;;;"}
@@ -0,0 +1,92 @@
1
+ import { FileId } from './ids.js';
2
+ /**
3
+ * Named constants for the file-level Object Lock retention mode.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * await object.setRetention(fileId, {
8
+ * mode: RetentionMode.Compliance,
9
+ * retainUntilTimestamp: Date.now() + 86_400_000,
10
+ * })
11
+ * ```
12
+ */
13
+ export declare const RetentionMode: {
14
+ /** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */
15
+ readonly Compliance: "compliance";
16
+ /** Locked: can be shortened by callers holding the `bypassGovernance` capability. */
17
+ readonly Governance: "governance";
18
+ };
19
+ /** File-level Object Lock retention mode. Derived from {@link RetentionMode}. */
20
+ export type RetentionMode = (typeof RetentionMode)[keyof typeof RetentionMode];
21
+ /**
22
+ * Named constants for the file legal-hold status.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * await object.setLegalHold(fileId, LegalHoldValue.On)
27
+ * ```
28
+ */
29
+ export declare const LegalHoldValue: {
30
+ /** Apply the legal hold. */
31
+ readonly On: "on";
32
+ /** Remove the legal hold. */
33
+ readonly Off: "off";
34
+ };
35
+ /** Legal hold status for a file. Derived from {@link LegalHoldValue}. */
36
+ export type LegalHoldValue = (typeof LegalHoldValue)[keyof typeof LegalHoldValue];
37
+ /** Retention settings for a specific file version under Object Lock. */
38
+ export interface FileRetentionValue {
39
+ /** Retention mode, or null if no retention is set. */
40
+ readonly mode: RetentionMode | null;
41
+ /** UTC timestamp (milliseconds) until which the file is retained, or null if not set. */
42
+ readonly retainUntilTimestamp: number | null;
43
+ }
44
+ /**
45
+ * Request parameters for the `b2_update_file_retention` API call.
46
+ * Updates the Object Lock retention settings on a file version.
47
+ */
48
+ export interface UpdateFileRetentionRequest {
49
+ /** Name of the file to update. */
50
+ readonly fileName: string;
51
+ /** ID of the file version to update. */
52
+ readonly fileId: FileId;
53
+ /** New retention settings for the file. */
54
+ readonly fileRetention: FileRetentionValue;
55
+ /**
56
+ * When `true`, allows shortening a governance-mode retention period. Requires
57
+ * the `bypassGovernance` capability on the application key. Has no effect on
58
+ * compliance-mode retention.
59
+ */
60
+ readonly bypassGovernance?: boolean;
61
+ }
62
+ /**
63
+ * Request parameters for the `b2_update_file_legal_hold` API call.
64
+ * Updates the legal hold status on a file version.
65
+ */
66
+ export interface UpdateFileLegalHoldRequest {
67
+ /** Name of the file to update. */
68
+ readonly fileName: string;
69
+ /** ID of the file version to update. */
70
+ readonly fileId: FileId;
71
+ /** New legal hold status: `'on'` or `'off'`. */
72
+ readonly legalHold: LegalHoldValue;
73
+ }
74
+ /** Response from the `b2_update_file_retention` API call. */
75
+ export interface UpdateFileRetentionResponse {
76
+ /** Name of the updated file. */
77
+ readonly fileName: string;
78
+ /** ID of the updated file version. */
79
+ readonly fileId: FileId;
80
+ /** Retention settings as applied. */
81
+ readonly fileRetention: FileRetentionValue;
82
+ }
83
+ /** Response from the `b2_update_file_legal_hold` API call. */
84
+ export interface UpdateFileLegalHoldResponse {
85
+ /** Name of the updated file. */
86
+ readonly fileName: string;
87
+ /** ID of the updated file version. */
88
+ readonly fileId: FileId;
89
+ /** Legal hold status as applied. */
90
+ readonly legalHold: LegalHoldValue;
91
+ }
92
+ //# sourceMappingURL=lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/types/lock.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC;;;;;;;;;;GAUG;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