@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,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;AACH,eAAO,MAAM,aAAa;IACxB,qGAAqG;;IAErG,qFAAqF;;CAE7E,CAAA;AAEV,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAA;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;IACzB,4BAA4B;;IAE5B,6BAA6B;;CAErB,CAAA;AAEV,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAA;AAEjF,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,sDAAsD;IACtD,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAA;IACnC,yFAAyF;IACzF,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,kCAAkC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAA;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,kCAAkC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,gDAAgD;IAChD,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;CACnC;AAED,6DAA6D;AAC7D,MAAM,WAAW,2BAA2B;IAC1C,gCAAgC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,qCAAqC;IACrC,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAA;CAC3C;AAED,8DAA8D;AAC9D,MAAM,WAAW,2BAA2B;IAC1C,gCAAgC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oCAAoC;IACpC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;CACnC"}
@@ -0,0 +1,17 @@
1
+ const RetentionMode = {
2
+ /** Locked: cannot be deleted or modified until `retainUntilTimestamp`, even by the account owner. */
3
+ Compliance: "compliance",
4
+ /** Locked: can be shortened by callers holding the `bypassGovernance` capability. */
5
+ Governance: "governance"
6
+ };
7
+ const LegalHoldValue = {
8
+ /** Apply the legal hold. */
9
+ On: "on",
10
+ /** Remove the legal hold. */
11
+ Off: "off"
12
+ };
13
+ export {
14
+ LegalHoldValue,
15
+ RetentionMode
16
+ };
17
+ //# sourceMappingURL=lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.js","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,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const EventType = {
4
+ /** Wildcard: any `b2:ObjectCreated:*` sub-event. */
5
+ ObjectCreatedAll: "b2:ObjectCreated:*",
6
+ /** A small-file upload (`b2_upload_file`). */
7
+ ObjectCreatedUpload: "b2:ObjectCreated:Upload",
8
+ /** A multipart upload completed (`b2_finish_large_file`). */
9
+ ObjectCreatedMultipartUpload: "b2:ObjectCreated:MultipartUpload",
10
+ /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */
11
+ ObjectCreatedCopy: "b2:ObjectCreated:Copy",
12
+ /** A replica delivered via cross-region replication. */
13
+ ObjectCreatedReplica: "b2:ObjectCreated:Replica",
14
+ /** A hide marker was created (`b2_hide_file`). */
15
+ ObjectCreatedHide: "b2:ObjectCreated:Hide",
16
+ /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */
17
+ ObjectDeletedAll: "b2:ObjectDeleted:*",
18
+ /** A version was permanently deleted (`b2_delete_file_version`). */
19
+ ObjectDeletedDelete: "b2:ObjectDeleted:Delete",
20
+ /** A version was removed by a lifecycle rule. */
21
+ ObjectDeletedLifecycleRule: "b2:ObjectDeleted:LifecycleRule"
22
+ };
23
+ exports.EventType = EventType;
24
+ //# sourceMappingURL=notifications.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.cjs","sources":["../../src/types/notifications.ts"],"sourcesContent":["import type { BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 event types that can trigger notifications.\n *\n * Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to\n * every sub-event in their category.\n *\n * @example\n * ```ts\n * await bucket.setNotificationRules([\n * {\n * name: 'all-uploads',\n * eventTypes: [EventType.ObjectCreatedAll],\n * isEnabled: true,\n * isSuspended: false,\n * objectNamePrefix: '',\n * suspensionReason: '',\n * targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },\n * },\n * ])\n * ```\n */\nexport const EventType = {\n /** Wildcard: any `b2:ObjectCreated:*` sub-event. */\n ObjectCreatedAll: 'b2:ObjectCreated:*',\n /** A small-file upload (`b2_upload_file`). */\n ObjectCreatedUpload: 'b2:ObjectCreated:Upload',\n /** A multipart upload completed (`b2_finish_large_file`). */\n ObjectCreatedMultipartUpload: 'b2:ObjectCreated:MultipartUpload',\n /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */\n ObjectCreatedCopy: 'b2:ObjectCreated:Copy',\n /** A replica delivered via cross-region replication. */\n ObjectCreatedReplica: 'b2:ObjectCreated:Replica',\n /** A hide marker was created (`b2_hide_file`). */\n ObjectCreatedHide: 'b2:ObjectCreated:Hide',\n /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */\n ObjectDeletedAll: 'b2:ObjectDeleted:*',\n /** A version was permanently deleted (`b2_delete_file_version`). */\n ObjectDeletedDelete: 'b2:ObjectDeleted:Delete',\n /** A version was removed by a lifecycle rule. */\n ObjectDeletedLifecycleRule: 'b2:ObjectDeleted:LifecycleRule',\n} as const\n\n/**\n * B2 event types that can trigger notifications. Derived from {@link EventType}.\n */\nexport type EventType = (typeof EventType)[keyof typeof EventType]\n\n/** A rule that defines which bucket events trigger webhook notifications and where they are sent. */\nexport interface EventNotificationRule {\n /** Event types that trigger this notification rule. */\n readonly eventTypes: readonly EventType[]\n /** Whether this rule is actively sending notifications. */\n readonly isEnabled: boolean\n /** Whether B2 has suspended this rule due to delivery failures. */\n readonly isSuspended: boolean\n /** Unique name identifying this rule within the bucket. */\n readonly name: string\n /** Only events for objects with this name prefix trigger the rule. Empty string matches all objects. */\n readonly objectNamePrefix: string\n /** Reason for suspension, or empty string if not suspended. */\n readonly suspensionReason: string\n /** Webhook target configuration. */\n readonly targetConfiguration: {\n /** Target type (e.g., `'url'` for webhook delivery). */\n readonly targetType: string\n /** Webhook URL that receives the event notifications. */\n readonly url: string\n /** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */\n readonly hmacSha256SigningSecret?: string\n /** Optional custom headers included in webhook requests. */\n readonly customHeaders?: Record<string, string>\n }\n}\n\n/** Request parameters for the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesRequest {\n /** Bucket to get notification rules for. */\n readonly bucketId: BucketId\n}\n\n/** Response from the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesResponse {\n /** Bucket these rules belong to. */\n readonly bucketId: BucketId\n /** Array of event notification rules configured on the bucket. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/**\n * Request parameters for the `b2_set_bucket_notification_rules` API call.\n * Replaces all existing notification rules on the bucket.\n */\nexport interface SetBucketNotificationRulesRequest {\n /** Bucket to set notification rules on. */\n readonly bucketId: BucketId\n /** Notification rules to apply. Replaces all existing rules. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/** Response from the `b2_set_bucket_notification_rules` API call. Same shape as the get response. */\nexport type SetBucketNotificationRulesResponse = GetBucketNotificationRulesResponse\n"],"names":[],"mappings":";;AAuBO,MAAM,YAAY;AAAA;AAAA,EAEvB,kBAAkB;AAAA;AAAA,EAElB,qBAAqB;AAAA;AAAA,EAErB,8BAA8B;AAAA;AAAA,EAE9B,mBAAmB;AAAA;AAAA,EAEnB,sBAAsB;AAAA;AAAA,EAEtB,mBAAmB;AAAA;AAAA,EAEnB,kBAAkB;AAAA;AAAA,EAElB,qBAAqB;AAAA;AAAA,EAErB,4BAA4B;AAC9B;;"}
@@ -0,0 +1,97 @@
1
+ import { BucketId } from './ids.js';
2
+ /**
3
+ * Named constants for the B2 event types that can trigger notifications.
4
+ *
5
+ * Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to
6
+ * every sub-event in their category.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * await bucket.setNotificationRules([
11
+ * {
12
+ * name: 'all-uploads',
13
+ * eventTypes: [EventType.ObjectCreatedAll],
14
+ * isEnabled: true,
15
+ * isSuspended: false,
16
+ * objectNamePrefix: '',
17
+ * suspensionReason: '',
18
+ * targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },
19
+ * },
20
+ * ])
21
+ * ```
22
+ */
23
+ export declare const EventType: {
24
+ /** Wildcard: any `b2:ObjectCreated:*` sub-event. */
25
+ readonly ObjectCreatedAll: "b2:ObjectCreated:*";
26
+ /** A small-file upload (`b2_upload_file`). */
27
+ readonly ObjectCreatedUpload: "b2:ObjectCreated:Upload";
28
+ /** A multipart upload completed (`b2_finish_large_file`). */
29
+ readonly ObjectCreatedMultipartUpload: "b2:ObjectCreated:MultipartUpload";
30
+ /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */
31
+ readonly ObjectCreatedCopy: "b2:ObjectCreated:Copy";
32
+ /** A replica delivered via cross-region replication. */
33
+ readonly ObjectCreatedReplica: "b2:ObjectCreated:Replica";
34
+ /** A hide marker was created (`b2_hide_file`). */
35
+ readonly ObjectCreatedHide: "b2:ObjectCreated:Hide";
36
+ /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */
37
+ readonly ObjectDeletedAll: "b2:ObjectDeleted:*";
38
+ /** A version was permanently deleted (`b2_delete_file_version`). */
39
+ readonly ObjectDeletedDelete: "b2:ObjectDeleted:Delete";
40
+ /** A version was removed by a lifecycle rule. */
41
+ readonly ObjectDeletedLifecycleRule: "b2:ObjectDeleted:LifecycleRule";
42
+ };
43
+ /**
44
+ * B2 event types that can trigger notifications. Derived from {@link EventType}.
45
+ */
46
+ export type EventType = (typeof EventType)[keyof typeof EventType];
47
+ /** A rule that defines which bucket events trigger webhook notifications and where they are sent. */
48
+ export interface EventNotificationRule {
49
+ /** Event types that trigger this notification rule. */
50
+ readonly eventTypes: readonly EventType[];
51
+ /** Whether this rule is actively sending notifications. */
52
+ readonly isEnabled: boolean;
53
+ /** Whether B2 has suspended this rule due to delivery failures. */
54
+ readonly isSuspended: boolean;
55
+ /** Unique name identifying this rule within the bucket. */
56
+ readonly name: string;
57
+ /** Only events for objects with this name prefix trigger the rule. Empty string matches all objects. */
58
+ readonly objectNamePrefix: string;
59
+ /** Reason for suspension, or empty string if not suspended. */
60
+ readonly suspensionReason: string;
61
+ /** Webhook target configuration. */
62
+ readonly targetConfiguration: {
63
+ /** Target type (e.g., `'url'` for webhook delivery). */
64
+ readonly targetType: string;
65
+ /** Webhook URL that receives the event notifications. */
66
+ readonly url: string;
67
+ /** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */
68
+ readonly hmacSha256SigningSecret?: string;
69
+ /** Optional custom headers included in webhook requests. */
70
+ readonly customHeaders?: Record<string, string>;
71
+ };
72
+ }
73
+ /** Request parameters for the `b2_get_bucket_notification_rules` API call. */
74
+ export interface GetBucketNotificationRulesRequest {
75
+ /** Bucket to get notification rules for. */
76
+ readonly bucketId: BucketId;
77
+ }
78
+ /** Response from the `b2_get_bucket_notification_rules` API call. */
79
+ export interface GetBucketNotificationRulesResponse {
80
+ /** Bucket these rules belong to. */
81
+ readonly bucketId: BucketId;
82
+ /** Array of event notification rules configured on the bucket. */
83
+ readonly eventNotificationRules: readonly EventNotificationRule[];
84
+ }
85
+ /**
86
+ * Request parameters for the `b2_set_bucket_notification_rules` API call.
87
+ * Replaces all existing notification rules on the bucket.
88
+ */
89
+ export interface SetBucketNotificationRulesRequest {
90
+ /** Bucket to set notification rules on. */
91
+ readonly bucketId: BucketId;
92
+ /** Notification rules to apply. Replaces all existing rules. */
93
+ readonly eventNotificationRules: readonly EventNotificationRule[];
94
+ }
95
+ /** Response from the `b2_set_bucket_notification_rules` API call. Same shape as the get response. */
96
+ export type SetBucketNotificationRulesResponse = GetBucketNotificationRulesResponse;
97
+ //# sourceMappingURL=notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/types/notifications.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS;IACpB,oDAAoD;;IAEpD,8CAA8C;;IAE9C,6DAA6D;;IAE7D,6DAA6D;;IAE7D,wDAAwD;;IAExD,kDAAkD;;IAElD,oDAAoD;;IAEpD,oEAAoE;;IAEpE,iDAAiD;;CAEzC,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAA;AAElE,qGAAqG;AACrG,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wGAAwG;IACxG,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,oCAAoC;IACpC,QAAQ,CAAC,mBAAmB,EAAE;QAC5B,wDAAwD;QACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;QAC3B,yDAAyD;QACzD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;QACpB,uFAAuF;QACvF,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAA;QACzC,4DAA4D;QAC5D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAChD,CAAA;CACF;AAED,8EAA8E;AAC9E,MAAM,WAAW,iCAAiC;IAChD,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAC5B;AAED,qEAAqE;AACrE,MAAM,WAAW,kCAAkC;IACjD,oCAAoC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,sBAAsB,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAClE;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAiC;IAChD,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,sBAAsB,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAClE;AAED,qGAAqG;AACrG,MAAM,MAAM,kCAAkC,GAAG,kCAAkC,CAAA"}
@@ -0,0 +1,97 @@
1
+ import { BucketId } from './ids.js';
2
+ /**
3
+ * Named constants for the B2 event types that can trigger notifications.
4
+ *
5
+ * Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to
6
+ * every sub-event in their category.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * await bucket.setNotificationRules([
11
+ * {
12
+ * name: 'all-uploads',
13
+ * eventTypes: [EventType.ObjectCreatedAll],
14
+ * isEnabled: true,
15
+ * isSuspended: false,
16
+ * objectNamePrefix: '',
17
+ * suspensionReason: '',
18
+ * targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },
19
+ * },
20
+ * ])
21
+ * ```
22
+ */
23
+ export declare const EventType: {
24
+ /** Wildcard: any `b2:ObjectCreated:*` sub-event. */
25
+ readonly ObjectCreatedAll: "b2:ObjectCreated:*";
26
+ /** A small-file upload (`b2_upload_file`). */
27
+ readonly ObjectCreatedUpload: "b2:ObjectCreated:Upload";
28
+ /** A multipart upload completed (`b2_finish_large_file`). */
29
+ readonly ObjectCreatedMultipartUpload: "b2:ObjectCreated:MultipartUpload";
30
+ /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */
31
+ readonly ObjectCreatedCopy: "b2:ObjectCreated:Copy";
32
+ /** A replica delivered via cross-region replication. */
33
+ readonly ObjectCreatedReplica: "b2:ObjectCreated:Replica";
34
+ /** A hide marker was created (`b2_hide_file`). */
35
+ readonly ObjectCreatedHide: "b2:ObjectCreated:Hide";
36
+ /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */
37
+ readonly ObjectDeletedAll: "b2:ObjectDeleted:*";
38
+ /** A version was permanently deleted (`b2_delete_file_version`). */
39
+ readonly ObjectDeletedDelete: "b2:ObjectDeleted:Delete";
40
+ /** A version was removed by a lifecycle rule. */
41
+ readonly ObjectDeletedLifecycleRule: "b2:ObjectDeleted:LifecycleRule";
42
+ };
43
+ /**
44
+ * B2 event types that can trigger notifications. Derived from {@link EventType}.
45
+ */
46
+ export type EventType = (typeof EventType)[keyof typeof EventType];
47
+ /** A rule that defines which bucket events trigger webhook notifications and where they are sent. */
48
+ export interface EventNotificationRule {
49
+ /** Event types that trigger this notification rule. */
50
+ readonly eventTypes: readonly EventType[];
51
+ /** Whether this rule is actively sending notifications. */
52
+ readonly isEnabled: boolean;
53
+ /** Whether B2 has suspended this rule due to delivery failures. */
54
+ readonly isSuspended: boolean;
55
+ /** Unique name identifying this rule within the bucket. */
56
+ readonly name: string;
57
+ /** Only events for objects with this name prefix trigger the rule. Empty string matches all objects. */
58
+ readonly objectNamePrefix: string;
59
+ /** Reason for suspension, or empty string if not suspended. */
60
+ readonly suspensionReason: string;
61
+ /** Webhook target configuration. */
62
+ readonly targetConfiguration: {
63
+ /** Target type (e.g., `'url'` for webhook delivery). */
64
+ readonly targetType: string;
65
+ /** Webhook URL that receives the event notifications. */
66
+ readonly url: string;
67
+ /** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */
68
+ readonly hmacSha256SigningSecret?: string;
69
+ /** Optional custom headers included in webhook requests. */
70
+ readonly customHeaders?: Record<string, string>;
71
+ };
72
+ }
73
+ /** Request parameters for the `b2_get_bucket_notification_rules` API call. */
74
+ export interface GetBucketNotificationRulesRequest {
75
+ /** Bucket to get notification rules for. */
76
+ readonly bucketId: BucketId;
77
+ }
78
+ /** Response from the `b2_get_bucket_notification_rules` API call. */
79
+ export interface GetBucketNotificationRulesResponse {
80
+ /** Bucket these rules belong to. */
81
+ readonly bucketId: BucketId;
82
+ /** Array of event notification rules configured on the bucket. */
83
+ readonly eventNotificationRules: readonly EventNotificationRule[];
84
+ }
85
+ /**
86
+ * Request parameters for the `b2_set_bucket_notification_rules` API call.
87
+ * Replaces all existing notification rules on the bucket.
88
+ */
89
+ export interface SetBucketNotificationRulesRequest {
90
+ /** Bucket to set notification rules on. */
91
+ readonly bucketId: BucketId;
92
+ /** Notification rules to apply. Replaces all existing rules. */
93
+ readonly eventNotificationRules: readonly EventNotificationRule[];
94
+ }
95
+ /** Response from the `b2_set_bucket_notification_rules` API call. Same shape as the get response. */
96
+ export type SetBucketNotificationRulesResponse = GetBucketNotificationRulesResponse;
97
+ //# sourceMappingURL=notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/types/notifications.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS;IACpB,oDAAoD;;IAEpD,8CAA8C;;IAE9C,6DAA6D;;IAE7D,6DAA6D;;IAE7D,wDAAwD;;IAExD,kDAAkD;;IAElD,oDAAoD;;IAEpD,oEAAoE;;IAEpE,iDAAiD;;CAEzC,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAA;AAElE,qGAAqG;AACrG,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wGAAwG;IACxG,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,oCAAoC;IACpC,QAAQ,CAAC,mBAAmB,EAAE;QAC5B,wDAAwD;QACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;QAC3B,yDAAyD;QACzD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;QACpB,uFAAuF;QACvF,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAA;QACzC,4DAA4D;QAC5D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAChD,CAAA;CACF;AAED,8EAA8E;AAC9E,MAAM,WAAW,iCAAiC;IAChD,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAC5B;AAED,qEAAqE;AACrE,MAAM,WAAW,kCAAkC;IACjD,oCAAoC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,sBAAsB,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAClE;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAiC;IAChD,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,sBAAsB,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAClE;AAED,qGAAqG;AACrG,MAAM,MAAM,kCAAkC,GAAG,kCAAkC,CAAA"}
@@ -0,0 +1,24 @@
1
+ const EventType = {
2
+ /** Wildcard: any `b2:ObjectCreated:*` sub-event. */
3
+ ObjectCreatedAll: "b2:ObjectCreated:*",
4
+ /** A small-file upload (`b2_upload_file`). */
5
+ ObjectCreatedUpload: "b2:ObjectCreated:Upload",
6
+ /** A multipart upload completed (`b2_finish_large_file`). */
7
+ ObjectCreatedMultipartUpload: "b2:ObjectCreated:MultipartUpload",
8
+ /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */
9
+ ObjectCreatedCopy: "b2:ObjectCreated:Copy",
10
+ /** A replica delivered via cross-region replication. */
11
+ ObjectCreatedReplica: "b2:ObjectCreated:Replica",
12
+ /** A hide marker was created (`b2_hide_file`). */
13
+ ObjectCreatedHide: "b2:ObjectCreated:Hide",
14
+ /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */
15
+ ObjectDeletedAll: "b2:ObjectDeleted:*",
16
+ /** A version was permanently deleted (`b2_delete_file_version`). */
17
+ ObjectDeletedDelete: "b2:ObjectDeleted:Delete",
18
+ /** A version was removed by a lifecycle rule. */
19
+ ObjectDeletedLifecycleRule: "b2:ObjectDeleted:LifecycleRule"
20
+ };
21
+ export {
22
+ EventType
23
+ };
24
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","sources":["../../src/types/notifications.ts"],"sourcesContent":["import type { BucketId } from './ids.ts'\n\n/**\n * Named constants for the B2 event types that can trigger notifications.\n *\n * Wildcard variants (`ObjectCreatedAll`, `ObjectDeletedAll`) subscribe to\n * every sub-event in their category.\n *\n * @example\n * ```ts\n * await bucket.setNotificationRules([\n * {\n * name: 'all-uploads',\n * eventTypes: [EventType.ObjectCreatedAll],\n * isEnabled: true,\n * isSuspended: false,\n * objectNamePrefix: '',\n * suspensionReason: '',\n * targetConfiguration: { targetType: 'url', url: 'https://example.com/webhook' },\n * },\n * ])\n * ```\n */\nexport const EventType = {\n /** Wildcard: any `b2:ObjectCreated:*` sub-event. */\n ObjectCreatedAll: 'b2:ObjectCreated:*',\n /** A small-file upload (`b2_upload_file`). */\n ObjectCreatedUpload: 'b2:ObjectCreated:Upload',\n /** A multipart upload completed (`b2_finish_large_file`). */\n ObjectCreatedMultipartUpload: 'b2:ObjectCreated:MultipartUpload',\n /** A server-side copy (`b2_copy_file` or `b2_copy_part`). */\n ObjectCreatedCopy: 'b2:ObjectCreated:Copy',\n /** A replica delivered via cross-region replication. */\n ObjectCreatedReplica: 'b2:ObjectCreated:Replica',\n /** A hide marker was created (`b2_hide_file`). */\n ObjectCreatedHide: 'b2:ObjectCreated:Hide',\n /** Wildcard: any `b2:ObjectDeleted:*` sub-event. */\n ObjectDeletedAll: 'b2:ObjectDeleted:*',\n /** A version was permanently deleted (`b2_delete_file_version`). */\n ObjectDeletedDelete: 'b2:ObjectDeleted:Delete',\n /** A version was removed by a lifecycle rule. */\n ObjectDeletedLifecycleRule: 'b2:ObjectDeleted:LifecycleRule',\n} as const\n\n/**\n * B2 event types that can trigger notifications. Derived from {@link EventType}.\n */\nexport type EventType = (typeof EventType)[keyof typeof EventType]\n\n/** A rule that defines which bucket events trigger webhook notifications and where they are sent. */\nexport interface EventNotificationRule {\n /** Event types that trigger this notification rule. */\n readonly eventTypes: readonly EventType[]\n /** Whether this rule is actively sending notifications. */\n readonly isEnabled: boolean\n /** Whether B2 has suspended this rule due to delivery failures. */\n readonly isSuspended: boolean\n /** Unique name identifying this rule within the bucket. */\n readonly name: string\n /** Only events for objects with this name prefix trigger the rule. Empty string matches all objects. */\n readonly objectNamePrefix: string\n /** Reason for suspension, or empty string if not suspended. */\n readonly suspensionReason: string\n /** Webhook target configuration. */\n readonly targetConfiguration: {\n /** Target type (e.g., `'url'` for webhook delivery). */\n readonly targetType: string\n /** Webhook URL that receives the event notifications. */\n readonly url: string\n /** Optional HMAC-SHA256 secret used to sign notification payloads for verification. */\n readonly hmacSha256SigningSecret?: string\n /** Optional custom headers included in webhook requests. */\n readonly customHeaders?: Record<string, string>\n }\n}\n\n/** Request parameters for the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesRequest {\n /** Bucket to get notification rules for. */\n readonly bucketId: BucketId\n}\n\n/** Response from the `b2_get_bucket_notification_rules` API call. */\nexport interface GetBucketNotificationRulesResponse {\n /** Bucket these rules belong to. */\n readonly bucketId: BucketId\n /** Array of event notification rules configured on the bucket. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/**\n * Request parameters for the `b2_set_bucket_notification_rules` API call.\n * Replaces all existing notification rules on the bucket.\n */\nexport interface SetBucketNotificationRulesRequest {\n /** Bucket to set notification rules on. */\n readonly bucketId: BucketId\n /** Notification rules to apply. Replaces all existing rules. */\n readonly eventNotificationRules: readonly EventNotificationRule[]\n}\n\n/** Response from the `b2_set_bucket_notification_rules` API call. Same shape as the get response. */\nexport type SetBucketNotificationRulesResponse = GetBucketNotificationRulesResponse\n"],"names":[],"mappings":"AAuBO,MAAM,YAAY;AAAA;AAAA,EAEvB,kBAAkB;AAAA;AAAA,EAElB,qBAAqB;AAAA;AAAA,EAErB,8BAA8B;AAAA;AAAA,EAE9B,mBAAmB;AAAA;AAAA,EAEnB,sBAAsB;AAAA;AAAA,EAEtB,mBAAmB;AAAA;AAAA,EAEnB,kBAAkB;AAAA;AAAA,EAElB,qBAAqB;AAAA;AAAA,EAErB,4BAA4B;AAC9B;"}
@@ -0,0 +1,42 @@
1
+ import { ApplicationKeyId, BucketId } from './ids.js';
2
+ /** A single replication rule defining how files are replicated to a destination bucket. */
3
+ export interface ReplicationRule {
4
+ /** Destination bucket ID where replicated files are stored. */
5
+ readonly destinationBucketId: BucketId;
6
+ /** Only files with this prefix are replicated. Empty string means all files. */
7
+ readonly fileNamePrefix: string;
8
+ /** Whether to replicate files that existed before this rule was created. */
9
+ readonly includeExistingFiles: boolean;
10
+ /** Whether this replication rule is currently active. */
11
+ readonly isEnabled: boolean;
12
+ /** Priority of this rule relative to other rules. Lower numbers take precedence. */
13
+ readonly priority: number;
14
+ /** Human-readable name for this replication rule. */
15
+ readonly replicationRuleName: string;
16
+ }
17
+ /** Configuration for a bucket acting as a replication destination. */
18
+ export interface ReplicationDestination {
19
+ /** Mapping from source application key IDs to destination application key IDs. */
20
+ readonly sourceToDestinationKeyMapping: Record<string, ApplicationKeyId>;
21
+ }
22
+ /** Configuration for a bucket acting as a replication source. */
23
+ export interface ReplicationSource {
24
+ /** Application key ID authorized to read from the source bucket. */
25
+ readonly sourceApplicationKeyId: ApplicationKeyId;
26
+ }
27
+ /** Complete replication configuration for a bucket, covering both source and destination roles. */
28
+ export interface ReplicationConfiguration {
29
+ /** Source-side configuration with replication rules, or null if not a source. */
30
+ readonly asReplicationSource: {
31
+ /** Rules governing which files are replicated and where. */
32
+ readonly replicationRules: readonly ReplicationRule[];
33
+ /** Application key ID authorized to read from this source bucket. */
34
+ readonly sourceApplicationKeyId: ApplicationKeyId;
35
+ } | null;
36
+ /** Destination-side configuration with key mappings, or null if not a destination. */
37
+ readonly asReplicationDestination: {
38
+ /** Mapping from source application key IDs to destination application key IDs. */
39
+ readonly sourceToDestinationKeyMapping: Record<string, ApplicationKeyId>;
40
+ } | null;
41
+ }
42
+ //# sourceMappingURL=replication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replication.d.ts","sourceRoot":"","sources":["../../src/types/replication.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE1D,2FAA2F;AAC3F,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,CAAA;IACtC,gFAAgF;IAChF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAA;IACtC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,qDAAqD;IACrD,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;CACrC;AAED,sEAAsE;AACtE,MAAM,WAAW,sBAAsB;IACrC,kFAAkF;IAClF,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CACzE;AAED,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,QAAQ,CAAC,sBAAsB,EAAE,gBAAgB,CAAA;CAClD;AAED,mGAAmG;AACnG,MAAM,WAAW,wBAAwB;IACvC,iFAAiF;IACjF,QAAQ,CAAC,mBAAmB,EAAE;QAC5B,4DAA4D;QAC5D,QAAQ,CAAC,gBAAgB,EAAE,SAAS,eAAe,EAAE,CAAA;QACrD,qEAAqE;QACrE,QAAQ,CAAC,sBAAsB,EAAE,gBAAgB,CAAA;KAClD,GAAG,IAAI,CAAA;IACR,sFAAsF;IACtF,QAAQ,CAAC,wBAAwB,EAAE;QACjC,kFAAkF;QAClF,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;KACzE,GAAG,IAAI,CAAA;CACT"}
@@ -0,0 +1,42 @@
1
+ import { ApplicationKeyId, BucketId } from './ids.js';
2
+ /** A single replication rule defining how files are replicated to a destination bucket. */
3
+ export interface ReplicationRule {
4
+ /** Destination bucket ID where replicated files are stored. */
5
+ readonly destinationBucketId: BucketId;
6
+ /** Only files with this prefix are replicated. Empty string means all files. */
7
+ readonly fileNamePrefix: string;
8
+ /** Whether to replicate files that existed before this rule was created. */
9
+ readonly includeExistingFiles: boolean;
10
+ /** Whether this replication rule is currently active. */
11
+ readonly isEnabled: boolean;
12
+ /** Priority of this rule relative to other rules. Lower numbers take precedence. */
13
+ readonly priority: number;
14
+ /** Human-readable name for this replication rule. */
15
+ readonly replicationRuleName: string;
16
+ }
17
+ /** Configuration for a bucket acting as a replication destination. */
18
+ export interface ReplicationDestination {
19
+ /** Mapping from source application key IDs to destination application key IDs. */
20
+ readonly sourceToDestinationKeyMapping: Record<string, ApplicationKeyId>;
21
+ }
22
+ /** Configuration for a bucket acting as a replication source. */
23
+ export interface ReplicationSource {
24
+ /** Application key ID authorized to read from the source bucket. */
25
+ readonly sourceApplicationKeyId: ApplicationKeyId;
26
+ }
27
+ /** Complete replication configuration for a bucket, covering both source and destination roles. */
28
+ export interface ReplicationConfiguration {
29
+ /** Source-side configuration with replication rules, or null if not a source. */
30
+ readonly asReplicationSource: {
31
+ /** Rules governing which files are replicated and where. */
32
+ readonly replicationRules: readonly ReplicationRule[];
33
+ /** Application key ID authorized to read from this source bucket. */
34
+ readonly sourceApplicationKeyId: ApplicationKeyId;
35
+ } | null;
36
+ /** Destination-side configuration with key mappings, or null if not a destination. */
37
+ readonly asReplicationDestination: {
38
+ /** Mapping from source application key IDs to destination application key IDs. */
39
+ readonly sourceToDestinationKeyMapping: Record<string, ApplicationKeyId>;
40
+ } | null;
41
+ }
42
+ //# sourceMappingURL=replication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replication.d.ts","sourceRoot":"","sources":["../../src/types/replication.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE1D,2FAA2F;AAC3F,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,CAAA;IACtC,gFAAgF;IAChF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAA;IACtC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,qDAAqD;IACrD,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;CACrC;AAED,sEAAsE;AACtE,MAAM,WAAW,sBAAsB;IACrC,kFAAkF;IAClF,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CACzE;AAED,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,QAAQ,CAAC,sBAAsB,EAAE,gBAAgB,CAAA;CAClD;AAED,mGAAmG;AACnG,MAAM,WAAW,wBAAwB;IACvC,iFAAiF;IACjF,QAAQ,CAAC,mBAAmB,EAAE;QAC5B,4DAA4D;QAC5D,QAAQ,CAAC,gBAAgB,EAAE,SAAS,eAAe,EAAE,CAAA;QACrD,qEAAqE;QACrE,QAAQ,CAAC,sBAAsB,EAAE,gBAAgB,CAAA;KAClD,GAAG,IAAI,CAAA;IACR,sFAAsF;IACtF,QAAQ,CAAC,wBAAwB,EAAE;QACjC,kFAAkF;QAClF,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;KACzE,GAAG,IAAI,CAAA;CACT"}