@backblaze-labs/b2-sdk 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +18 -5
  3. package/dist/_virtual/_b2-sdk-version-json.cjs +1 -1
  4. package/dist/_virtual/_b2-sdk-version-json.js +1 -1
  5. package/dist/auth/reauth-coalescer.cjs +65 -0
  6. package/dist/auth/reauth-coalescer.cjs.map +1 -0
  7. package/dist/auth/reauth-coalescer.d.cts +34 -0
  8. package/dist/auth/reauth-coalescer.d.cts.map +1 -0
  9. package/dist/auth/reauth-coalescer.d.ts +34 -0
  10. package/dist/auth/reauth-coalescer.d.ts.map +1 -0
  11. package/dist/auth/reauth-coalescer.js +65 -0
  12. package/dist/auth/reauth-coalescer.js.map +1 -0
  13. package/dist/backup/raw.cjs +37 -15
  14. package/dist/backup/raw.cjs.map +1 -1
  15. package/dist/backup/raw.d.cts +2 -2
  16. package/dist/backup/raw.d.cts.map +1 -1
  17. package/dist/backup/raw.d.ts +2 -2
  18. package/dist/backup/raw.d.ts.map +1 -1
  19. package/dist/backup/raw.js +37 -15
  20. package/dist/backup/raw.js.map +1 -1
  21. package/dist/bucket-validation.cjs +111 -0
  22. package/dist/bucket-validation.cjs.map +1 -0
  23. package/dist/bucket-validation.d.cts +27 -0
  24. package/dist/bucket-validation.d.cts.map +1 -0
  25. package/dist/bucket-validation.d.ts +27 -0
  26. package/dist/bucket-validation.d.ts.map +1 -0
  27. package/dist/bucket-validation.js +109 -0
  28. package/dist/bucket-validation.js.map +1 -0
  29. package/dist/bucket.cjs +123 -73
  30. package/dist/bucket.cjs.map +1 -1
  31. package/dist/bucket.d.cts +156 -61
  32. package/dist/bucket.d.cts.map +1 -1
  33. package/dist/bucket.d.ts +156 -61
  34. package/dist/bucket.d.ts.map +1 -1
  35. package/dist/bucket.js +123 -73
  36. package/dist/bucket.js.map +1 -1
  37. package/dist/client.cjs +29 -8
  38. package/dist/client.cjs.map +1 -1
  39. package/dist/client.d.cts +30 -9
  40. package/dist/client.d.cts.map +1 -1
  41. package/dist/client.d.ts +30 -9
  42. package/dist/client.d.ts.map +1 -1
  43. package/dist/client.js +29 -8
  44. package/dist/client.js.map +1 -1
  45. package/dist/download/single.cjs +38 -13
  46. package/dist/download/single.cjs.map +1 -1
  47. package/dist/download/single.d.cts +10 -4
  48. package/dist/download/single.d.cts.map +1 -1
  49. package/dist/download/single.d.ts +10 -4
  50. package/dist/download/single.d.ts.map +1 -1
  51. package/dist/download/single.js +38 -13
  52. package/dist/download/single.js.map +1 -1
  53. package/dist/errors/index.cjs +27 -4
  54. package/dist/errors/index.cjs.map +1 -1
  55. package/dist/errors/index.d.cts +15 -0
  56. package/dist/errors/index.d.cts.map +1 -1
  57. package/dist/errors/index.d.ts +15 -0
  58. package/dist/errors/index.d.ts.map +1 -1
  59. package/dist/errors/index.js +27 -5
  60. package/dist/errors/index.js.map +1 -1
  61. package/dist/http/non-idempotent-mutations.cjs +38 -0
  62. package/dist/http/non-idempotent-mutations.cjs.map +1 -0
  63. package/dist/http/non-idempotent-mutations.d.cts +25 -0
  64. package/dist/http/non-idempotent-mutations.d.cts.map +1 -0
  65. package/dist/http/non-idempotent-mutations.d.ts +25 -0
  66. package/dist/http/non-idempotent-mutations.d.ts.map +1 -0
  67. package/dist/http/non-idempotent-mutations.js +35 -0
  68. package/dist/http/non-idempotent-mutations.js.map +1 -0
  69. package/dist/http/transport.cjs +9 -8
  70. package/dist/http/transport.cjs.map +1 -1
  71. package/dist/http/transport.d.cts +5 -0
  72. package/dist/http/transport.d.cts.map +1 -1
  73. package/dist/http/transport.d.ts +5 -0
  74. package/dist/http/transport.d.ts.map +1 -1
  75. package/dist/http/transport.js +9 -8
  76. package/dist/http/transport.js.map +1 -1
  77. package/dist/http/user-agent.cjs +12 -1
  78. package/dist/http/user-agent.cjs.map +1 -1
  79. package/dist/http/user-agent.d.cts +8 -0
  80. package/dist/http/user-agent.d.cts.map +1 -1
  81. package/dist/http/user-agent.d.ts +8 -0
  82. package/dist/http/user-agent.d.ts.map +1 -1
  83. package/dist/http/user-agent.js +13 -3
  84. package/dist/http/user-agent.js.map +1 -1
  85. package/dist/index.cjs +25 -0
  86. package/dist/index.d.cts +10 -9
  87. package/dist/index.d.cts.map +1 -1
  88. package/dist/index.d.ts +10 -9
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js +7 -6
  91. package/dist/notifications/index.cjs +3 -0
  92. package/dist/notifications/index.d.cts +2 -0
  93. package/dist/notifications/index.d.cts.map +1 -1
  94. package/dist/notifications/index.d.ts +2 -0
  95. package/dist/notifications/index.d.ts.map +1 -1
  96. package/dist/notifications/index.js +2 -1
  97. package/dist/object.cjs +12 -1
  98. package/dist/object.cjs.map +1 -1
  99. package/dist/object.d.cts +7 -1
  100. package/dist/object.d.cts.map +1 -1
  101. package/dist/object.d.ts +7 -1
  102. package/dist/object.d.ts.map +1 -1
  103. package/dist/object.js +12 -1
  104. package/dist/object.js.map +1 -1
  105. package/dist/partner/auth-core.cjs +4 -23
  106. package/dist/partner/auth-core.cjs.map +1 -1
  107. package/dist/partner/auth-core.d.cts +1 -1
  108. package/dist/partner/auth-core.d.cts.map +1 -1
  109. package/dist/partner/auth-core.d.ts +1 -1
  110. package/dist/partner/auth-core.d.ts.map +1 -1
  111. package/dist/partner/auth-core.js +5 -24
  112. package/dist/partner/auth-core.js.map +1 -1
  113. package/dist/partner/client.cjs +25 -10
  114. package/dist/partner/client.cjs.map +1 -1
  115. package/dist/partner/client.d.cts +32 -10
  116. package/dist/partner/client.d.cts.map +1 -1
  117. package/dist/partner/client.d.ts +32 -10
  118. package/dist/partner/client.d.ts.map +1 -1
  119. package/dist/partner/client.js +25 -10
  120. package/dist/partner/client.js.map +1 -1
  121. package/dist/partner/endpoint-url.cjs +1 -0
  122. package/dist/partner/endpoint-url.cjs.map +1 -1
  123. package/dist/partner/endpoint-url.d.cts +2 -0
  124. package/dist/partner/endpoint-url.d.cts.map +1 -1
  125. package/dist/partner/endpoint-url.d.ts +2 -0
  126. package/dist/partner/endpoint-url.d.ts.map +1 -1
  127. package/dist/partner/endpoint-url.js +1 -0
  128. package/dist/partner/endpoint-url.js.map +1 -1
  129. package/dist/partner/in-memory.cjs.map +1 -1
  130. package/dist/partner/in-memory.js.map +1 -1
  131. package/dist/partner/index.cjs +9 -0
  132. package/dist/partner/index.d.cts +11 -2
  133. package/dist/partner/index.d.cts.map +1 -1
  134. package/dist/partner/index.d.ts +11 -2
  135. package/dist/partner/index.d.ts.map +1 -1
  136. package/dist/partner/index.js +3 -1
  137. package/dist/partner/raw.cjs +52 -44
  138. package/dist/partner/raw.cjs.map +1 -1
  139. package/dist/partner/raw.d.cts +16 -19
  140. package/dist/partner/raw.d.cts.map +1 -1
  141. package/dist/partner/raw.d.ts +16 -19
  142. package/dist/partner/raw.d.ts.map +1 -1
  143. package/dist/partner/raw.js +52 -44
  144. package/dist/partner/raw.js.map +1 -1
  145. package/dist/partner/redaction.cjs +133 -108
  146. package/dist/partner/redaction.cjs.map +1 -1
  147. package/dist/partner/redaction.d.cts +47 -13
  148. package/dist/partner/redaction.d.cts.map +1 -1
  149. package/dist/partner/redaction.d.ts +47 -13
  150. package/dist/partner/redaction.d.ts.map +1 -1
  151. package/dist/partner/redaction.js +133 -109
  152. package/dist/partner/redaction.js.map +1 -1
  153. package/dist/raw/encoding.cjs +29 -10
  154. package/dist/raw/encoding.cjs.map +1 -1
  155. package/dist/raw/encoding.d.cts +3 -2
  156. package/dist/raw/encoding.d.cts.map +1 -1
  157. package/dist/raw/encoding.d.ts +3 -2
  158. package/dist/raw/encoding.d.ts.map +1 -1
  159. package/dist/raw/encoding.js +29 -10
  160. package/dist/raw/encoding.js.map +1 -1
  161. package/dist/raw/index.cjs +64 -39
  162. package/dist/raw/index.cjs.map +1 -1
  163. package/dist/raw/index.d.cts +21 -19
  164. package/dist/raw/index.d.cts.map +1 -1
  165. package/dist/raw/index.d.ts +21 -19
  166. package/dist/raw/index.d.ts.map +1 -1
  167. package/dist/raw/index.js +47 -40
  168. package/dist/raw/index.js.map +1 -1
  169. package/dist/raw/url.cjs.map +1 -1
  170. package/dist/raw/url.d.cts +3 -3
  171. package/dist/raw/url.d.ts +3 -3
  172. package/dist/raw/url.js.map +1 -1
  173. package/dist/simulator/index.cjs +456 -125
  174. package/dist/simulator/index.cjs.map +1 -1
  175. package/dist/simulator/index.d.cts +16 -1
  176. package/dist/simulator/index.d.cts.map +1 -1
  177. package/dist/simulator/index.d.ts +16 -1
  178. package/dist/simulator/index.d.ts.map +1 -1
  179. package/dist/simulator/index.js +449 -130
  180. package/dist/simulator/index.js.map +1 -1
  181. package/dist/simulator/partner-capabilities.cjs +77 -0
  182. package/dist/simulator/partner-capabilities.cjs.map +1 -0
  183. package/dist/simulator/partner-capabilities.d.cts +53 -0
  184. package/dist/simulator/partner-capabilities.d.cts.map +1 -0
  185. package/dist/simulator/partner-capabilities.d.ts +53 -0
  186. package/dist/simulator/partner-capabilities.d.ts.map +1 -0
  187. package/dist/simulator/partner-capabilities.js +73 -0
  188. package/dist/simulator/partner-capabilities.js.map +1 -0
  189. package/dist/simulator/partner.cjs +55 -61
  190. package/dist/simulator/partner.cjs.map +1 -1
  191. package/dist/simulator/partner.d.cts +5 -2
  192. package/dist/simulator/partner.d.cts.map +1 -1
  193. package/dist/simulator/partner.d.ts +5 -2
  194. package/dist/simulator/partner.d.ts.map +1 -1
  195. package/dist/simulator/partner.js +56 -61
  196. package/dist/simulator/partner.js.map +1 -1
  197. package/dist/simulator/validation.cjs +160 -30
  198. package/dist/simulator/validation.cjs.map +1 -1
  199. package/dist/simulator/validation.d.cts +28 -6
  200. package/dist/simulator/validation.d.cts.map +1 -1
  201. package/dist/simulator/validation.d.ts +28 -6
  202. package/dist/simulator/validation.d.ts.map +1 -1
  203. package/dist/simulator/validation.js +148 -31
  204. package/dist/simulator/validation.js.map +1 -1
  205. package/dist/streams/file-source.cjs +1 -1
  206. package/dist/streams/file-source.cjs.map +1 -1
  207. package/dist/streams/file-source.js +1 -1
  208. package/dist/streams/file-source.js.map +1 -1
  209. package/dist/streams/hash.cjs +246 -13
  210. package/dist/streams/hash.cjs.map +1 -1
  211. package/dist/streams/hash.d.cts +37 -12
  212. package/dist/streams/hash.d.cts.map +1 -1
  213. package/dist/streams/hash.d.ts +37 -12
  214. package/dist/streams/hash.d.ts.map +1 -1
  215. package/dist/streams/hash.js +246 -15
  216. package/dist/streams/hash.js.map +1 -1
  217. package/dist/streams/index.cjs +2 -0
  218. package/dist/streams/index.d.cts +1 -1
  219. package/dist/streams/index.d.cts.map +1 -1
  220. package/dist/streams/index.d.ts +1 -1
  221. package/dist/streams/index.d.ts.map +1 -1
  222. package/dist/streams/index.js +2 -2
  223. package/dist/streams/progress.cjs +63 -4
  224. package/dist/streams/progress.cjs.map +1 -1
  225. package/dist/streams/progress.d.cts +28 -2
  226. package/dist/streams/progress.d.cts.map +1 -1
  227. package/dist/streams/progress.d.ts +28 -2
  228. package/dist/streams/progress.d.ts.map +1 -1
  229. package/dist/streams/progress.js +63 -4
  230. package/dist/streams/progress.js.map +1 -1
  231. package/dist/sync/download-staging.cjs +147 -35
  232. package/dist/sync/download-staging.cjs.map +1 -1
  233. package/dist/sync/download-staging.d.cts +25 -2
  234. package/dist/sync/download-staging.d.cts.map +1 -1
  235. package/dist/sync/download-staging.d.ts +25 -2
  236. package/dist/sync/download-staging.d.ts.map +1 -1
  237. package/dist/sync/download-staging.js +146 -36
  238. package/dist/sync/download-staging.js.map +1 -1
  239. package/dist/sync/index.d.cts +1 -1
  240. package/dist/sync/index.d.cts.map +1 -1
  241. package/dist/sync/index.d.ts +1 -1
  242. package/dist/sync/index.d.ts.map +1 -1
  243. package/dist/sync/local-file-io.cjs +5 -1
  244. package/dist/sync/local-file-io.cjs.map +1 -1
  245. package/dist/sync/local-file-io.d.cts +2 -0
  246. package/dist/sync/local-file-io.d.cts.map +1 -1
  247. package/dist/sync/local-file-io.d.ts +2 -0
  248. package/dist/sync/local-file-io.d.ts.map +1 -1
  249. package/dist/sync/local-file-io.js +5 -1
  250. package/dist/sync/local-file-io.js.map +1 -1
  251. package/dist/sync/pairing.cjs +1 -0
  252. package/dist/sync/pairing.cjs.map +1 -1
  253. package/dist/sync/pairing.js +1 -0
  254. package/dist/sync/pairing.js.map +1 -1
  255. package/dist/sync/scanners/b2.cjs +2 -0
  256. package/dist/sync/scanners/b2.cjs.map +1 -1
  257. package/dist/sync/scanners/b2.d.cts.map +1 -1
  258. package/dist/sync/scanners/b2.d.ts.map +1 -1
  259. package/dist/sync/scanners/b2.js +2 -0
  260. package/dist/sync/scanners/b2.js.map +1 -1
  261. package/dist/sync/scanners/local.cjs +150 -33
  262. package/dist/sync/scanners/local.cjs.map +1 -1
  263. package/dist/sync/scanners/local.d.cts +6 -0
  264. package/dist/sync/scanners/local.d.cts.map +1 -1
  265. package/dist/sync/scanners/local.d.ts +6 -0
  266. package/dist/sync/scanners/local.d.ts.map +1 -1
  267. package/dist/sync/scanners/local.js +150 -33
  268. package/dist/sync/scanners/local.js.map +1 -1
  269. package/dist/sync/synchronizer.cjs +76 -29
  270. package/dist/sync/synchronizer.cjs.map +1 -1
  271. package/dist/sync/synchronizer.d.cts +1 -0
  272. package/dist/sync/synchronizer.d.cts.map +1 -1
  273. package/dist/sync/synchronizer.d.ts +1 -0
  274. package/dist/sync/synchronizer.d.ts.map +1 -1
  275. package/dist/sync/synchronizer.js +76 -29
  276. package/dist/sync/synchronizer.js.map +1 -1
  277. package/dist/sync/types.d.cts +19 -3
  278. package/dist/sync/types.d.cts.map +1 -1
  279. package/dist/sync/types.d.ts +19 -3
  280. package/dist/sync/types.d.ts.map +1 -1
  281. package/dist/types/backup.d.cts +6 -1
  282. package/dist/types/backup.d.cts.map +1 -1
  283. package/dist/types/backup.d.ts +6 -1
  284. package/dist/types/backup.d.ts.map +1 -1
  285. package/dist/types/bucket.cjs +81 -11
  286. package/dist/types/bucket.cjs.map +1 -1
  287. package/dist/types/bucket.d.cts +190 -39
  288. package/dist/types/bucket.d.cts.map +1 -1
  289. package/dist/types/bucket.d.ts +190 -39
  290. package/dist/types/bucket.d.ts.map +1 -1
  291. package/dist/types/bucket.js +67 -12
  292. package/dist/types/bucket.js.map +1 -1
  293. package/dist/types/download.cjs.map +1 -1
  294. package/dist/types/download.d.cts +3 -17
  295. package/dist/types/download.d.cts.map +1 -1
  296. package/dist/types/download.d.ts +3 -17
  297. package/dist/types/download.d.ts.map +1 -1
  298. package/dist/types/download.js.map +1 -1
  299. package/dist/types/encryption.cjs +18 -0
  300. package/dist/types/encryption.cjs.map +1 -1
  301. package/dist/types/encryption.d.cts +21 -11
  302. package/dist/types/encryption.d.cts.map +1 -1
  303. package/dist/types/encryption.d.ts +21 -11
  304. package/dist/types/encryption.d.ts.map +1 -1
  305. package/dist/types/encryption.js +18 -0
  306. package/dist/types/encryption.js.map +1 -1
  307. package/dist/types/file.cjs +3 -0
  308. package/dist/types/file.cjs.map +1 -1
  309. package/dist/types/file.d.cts +125 -16
  310. package/dist/types/file.d.cts.map +1 -1
  311. package/dist/types/file.d.ts +125 -16
  312. package/dist/types/file.d.ts.map +1 -1
  313. package/dist/types/file.js +3 -1
  314. package/dist/types/file.js.map +1 -1
  315. package/dist/types/index.d.cts +7 -7
  316. package/dist/types/index.d.cts.map +1 -1
  317. package/dist/types/index.d.ts +7 -7
  318. package/dist/types/index.d.ts.map +1 -1
  319. package/dist/types/key.d.cts +4 -3
  320. package/dist/types/key.d.cts.map +1 -1
  321. package/dist/types/key.d.ts +4 -3
  322. package/dist/types/key.d.ts.map +1 -1
  323. package/dist/types/notifications.cjs +30 -0
  324. package/dist/types/notifications.cjs.map +1 -1
  325. package/dist/types/notifications.d.cts +26 -1
  326. package/dist/types/notifications.d.cts.map +1 -1
  327. package/dist/types/notifications.d.ts +26 -1
  328. package/dist/types/notifications.d.ts.map +1 -1
  329. package/dist/types/notifications.js +29 -1
  330. package/dist/types/notifications.js.map +1 -1
  331. package/dist/types/partner.cjs.map +1 -1
  332. package/dist/types/partner.d.cts +28 -36
  333. package/dist/types/partner.d.cts.map +1 -1
  334. package/dist/types/partner.d.ts +28 -36
  335. package/dist/types/partner.d.ts.map +1 -1
  336. package/dist/types/partner.js.map +1 -1
  337. package/dist/types/upload.d.cts +4 -0
  338. package/dist/types/upload.d.cts.map +1 -1
  339. package/dist/types/upload.d.ts +4 -0
  340. package/dist/types/upload.d.ts.map +1 -1
  341. package/dist/upload/large.cjs +10 -7
  342. package/dist/upload/large.cjs.map +1 -1
  343. package/dist/upload/large.d.cts +15 -6
  344. package/dist/upload/large.d.cts.map +1 -1
  345. package/dist/upload/large.d.ts +15 -6
  346. package/dist/upload/large.d.ts.map +1 -1
  347. package/dist/upload/large.js +10 -7
  348. package/dist/upload/large.js.map +1 -1
  349. package/dist/upload/options.cjs.map +1 -1
  350. package/dist/upload/options.d.cts +12 -0
  351. package/dist/upload/options.d.cts.map +1 -1
  352. package/dist/upload/options.d.ts +12 -0
  353. package/dist/upload/options.d.ts.map +1 -1
  354. package/dist/upload/options.js.map +1 -1
  355. package/dist/upload/resume.cjs +4 -3
  356. package/dist/upload/resume.cjs.map +1 -1
  357. package/dist/upload/resume.d.cts +6 -4
  358. package/dist/upload/resume.d.cts.map +1 -1
  359. package/dist/upload/resume.d.ts +6 -4
  360. package/dist/upload/resume.d.ts.map +1 -1
  361. package/dist/upload/resume.js +4 -3
  362. package/dist/upload/resume.js.map +1 -1
  363. package/dist/upload/retry.cjs +17 -10
  364. package/dist/upload/retry.cjs.map +1 -1
  365. package/dist/upload/retry.d.cts.map +1 -1
  366. package/dist/upload/retry.d.ts.map +1 -1
  367. package/dist/upload/retry.js +17 -10
  368. package/dist/upload/retry.js.map +1 -1
  369. package/dist/upload/single.cjs +35 -31
  370. package/dist/upload/single.cjs.map +1 -1
  371. package/dist/upload/single.d.cts +6 -0
  372. package/dist/upload/single.d.cts.map +1 -1
  373. package/dist/upload/single.d.ts +6 -0
  374. package/dist/upload/single.d.ts.map +1 -1
  375. package/dist/upload/single.js +35 -31
  376. package/dist/upload/single.js.map +1 -1
  377. package/dist/upload/stream.cjs +12 -1
  378. package/dist/upload/stream.cjs.map +1 -1
  379. package/dist/upload/stream.d.cts +6 -0
  380. package/dist/upload/stream.d.cts.map +1 -1
  381. package/dist/upload/stream.d.ts +6 -0
  382. package/dist/upload/stream.d.ts.map +1 -1
  383. package/dist/upload/stream.js +12 -1
  384. package/dist/upload/stream.js.map +1 -1
  385. package/dist/version.cjs +56 -4
  386. package/dist/version.cjs.map +1 -1
  387. package/dist/version.d.cts +53 -4
  388. package/dist/version.d.cts.map +1 -1
  389. package/dist/version.d.ts +53 -4
  390. package/dist/version.d.ts.map +1 -1
  391. package/dist/version.js +52 -5
  392. package/dist/version.js.map +1 -1
  393. package/package.json +11 -4
package/CHANGELOG.md CHANGED
@@ -7,6 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] - 2026-09-01
11
+
12
+ > Upgrading across the v4 native-API changes below? See [MIGRATION.md](./MIGRATION.md) for per-change migration steps.
13
+
14
+ ### Added
15
+
16
+ - **Streaming and SSE-C polish helpers.** `IncrementalSha256` and the streams `sha256Hex()` helper are now available for SHA-256 checksum workflows, `SseCKeyMaterial` is the shared SSE-C key shape, and `EncryptionKey.generate()` mints random SSE-C keys with the existing redacted key wrapper.
17
+ - **Named bucket/key option constants.** `BucketKeyOption.S3` and `KnownBucketKeyOption` document the currently known B2 bucket/application-key option while the response fields remain open to future B2-added option strings.
18
+ - **Local sync symlink policy.** Built-in local scans and `synchronize()` now accept `localSymlinks: 'skip' | 'follow'`; follow mode only follows child symlink targets that resolve inside the configured local root and deduplicates repeated followed directory targets.
19
+ - **Transfer progress cadence control.** Upload and single-request download options now accept `progressIntervalMillis`; set it to `0` to restore per-chunk byte progress callbacks.
20
+ - **B2Simulator v4 route and GET/query compatibility.** The public simulator now accepts canonical `/b2api/v4` JSON routes while continuing to support `/b2api/v3`, rejects unsupported future version segments explicitly, and parses documented GET query forms for supported storage read/list and copy endpoints while preserving POST JSON compatibility. Closes #111.
21
+ - **Partner redaction helpers are public.** The `@backblaze-labs/b2-sdk/partner` subpath now exports `PARTNER_TOKEN_REDACTED`, `APPLICATION_KEY_REDACTED`, and the pure `*ToRedactedJson` projection helpers and JSON result types for secret-scrubbed Partner authorization, group-member creation, and B2 Reserve trial-account responses. Closes #225.
22
+
23
+ ### Changed
24
+
25
+ - **User-Agent release channel now distinguishes published SDK builds from development traffic.** `VERSION` remains the package semver string, while the outbound SDK product token reports `b2-sdk-typescript/<version>` only for stable publish-path builds and `b2-sdk-typescript/dev` for source, CI, `npm pack`, and prerelease builds. Closes #257.
26
+ - **Partner group `b2Stats` counters are numbers, not strings.** BREAKING: `PartnerB2Stats.b2BytesStoredCount`, `b2FilesStoredCount`, and `bucketCount` are now `number` — matching what live B2 `b2_list_groups` / `b2_list_group_members` actually return — instead of the previously-assumed quoted decimal `string`. Callers that coerced these with `Number(...)` / `parseInt(...)` should drop the conversion. The Partner stats timestamps (`b2StatsAsOfTimestamp`, `groupStats.createdTimestamp`, `groupStats.groupStatsAsOfTimestamp`) are documented and modeled as B2's `dYYYYMMDD_mHHMMSS` string format rather than ISO 8601, and the `B2Simulator` now emits that shape (and `B2_GOOD_STANDING`) to match live B2. Confirmed against live B2. Closes #214.
27
+ - **`b2_list_group_members` returns a single object, not an array.** BREAKING: `ListGroupMembersResponse` is now the single `ListGroupMembersResult` object (`{ groupId, groupName, groupMembers, nextEmail }`) that live B2 returns, matching `b2_list_groups`, rather than a one-element array. `PartnerClient.listGroupMembers()` and `PartnerRawClient.listGroupMembers()` resolve to that object — read `response.groupMembers` / `response.nextEmail` directly instead of `response[0]`. `PartnerClient.paginateGroupMembers()` is unchanged, and the `B2Simulator` now emits the object shape. Confirmed against live B2.
28
+ - **Repository Node.js 22 CI and toolchain checks now use the JSDoc lint floor.**
29
+ CI and contributor docs now use Node 22.22.2+ for full project checks while
30
+ the published SDK runtime contract remains Node.js 22.3+. Closes #282.
31
+ - **Progress byte callbacks are coalesced by default.** Transfer `onProgress` byte-only callbacks are throttled to the SDK's 100 ms default interval, while part-completion and final progress callbacks still emit immediately. Use `progressIntervalMillis: 0` when per-chunk progress sampling is required.
32
+ - **Bucket default retention metadata now matches B2's nested wire shape.** BREAKING: `BucketInfo.defaultRetention` was removed because B2 does not return a top-level default-retention field; read `bucket.info.fileLockConfiguration.value?.defaultRetention` instead. `Bucket.getDefaultRetention()` now reads that nested field and can return `undefined` when file-lock configuration is unreadable. The nested default retention type also includes B2's unset response shape `{ mode: null, period: null }`; callers that checked `BucketRetentionMode.None` for unset bucket defaults should handle `null` mode on response metadata.
33
+ - **Bucket replication configuration is now capability-filtered.** BREAKING: `BucketInfo.replicationConfiguration` changed from a bare `ReplicationConfiguration` to the wrapped `{ isClientAuthorizedToRead: boolean; value: ReplicationConfiguration | null }` shape B2 returns, and `Bucket.getReplication()` returns that wrapper. Callers accessing `.replicationConfiguration.asReplicationSource` must move to `.replicationConfiguration.value?.asReplicationSource`; `value` is `null` when replication is not configured or the caller is not authorized to read it (fail-closed). Request shapes (`CreateBucketRequest` / `UpdateBucketRequest`) keep the bare `ReplicationConfiguration`.
34
+ - **Bucket default server-side encryption is now capability-filtered.** BREAKING: `BucketInfo.defaultServerSideEncryption` changed from a bare `EncryptionSetting` to the wrapped `{ isClientAuthorizedToRead: boolean; value: BucketDefaultServerSideEncryption | null }` shape B2 returns; check `bucket.info.defaultServerSideEncryption.isClientAuthorizedToRead` before reading `.value`, which is `null` only when the caller is not authorized to read it (fail-closed). When readable, an unset bucket default is represented as B2's `{ mode: null, algorithm: null }` no-encryption wire shape. The readable value type `BucketDefaultServerSideEncryption` is `PublicEncryptionSetting`, matching the public SSE response union used for file and part metadata; B2 only sets SSE-B2 or none as a bucket default and never exposes SSE-C key material. Request shapes (`CreateBucketRequest` / `UpdateBucketRequest` and the `B2Client.createBucket` / `updateBucket` options) now accept `BucketDefaultServerSideEncryptionSetting` (`SseB2Setting | NoEncryption`) and reject SSE-C, which B2 cannot use as a bucket default. Closes #210.
35
+ - **Event notification custom headers match the B2 wire shape.** BREAKING: `EventNotificationRule.targetConfiguration.customHeaders` is now the documented array of `{ name, value }` objects instead of a lookup record, with simulator validation and round-trip behavior aligned to `b2_get_bucket_notification_rules` / `b2_set_bucket_notification_rules`. Existing record-shaped caller data can be migrated with `recordToNotificationCustomHeaders()`, and responses can be converted back to a lookup with `notificationCustomHeadersToRecord()`. Closes #189.
36
+ - **List endpoints model folder and hide entries as a discriminated union.** BREAKING: `FileVersion.action` narrowed from `FileAction` to `ConcreteFileAction` because a virtual folder row is no longer a `FileVersion`. `ListFileNamesResponse.files` is now `readonly ListedFileVersion[]` and never includes hide markers; `ListFileNamesWithDelimiterResponse.files` is now `readonly FileNameListEntry[]` (`ListedFileVersion | FolderFileVersion`). `ListFileVersionsResponse.files` is now `readonly ListedConcreteFileVersion[]` (`ListedFileVersion | ListedHideFileVersion`), and `ListFileVersionsWithDelimiterResponse.files` is now `readonly FileVersionListEntry[]` (`ListedConcreteFileVersion | FolderFileVersion`). `b2_list_file_versions` hide markers use the listed hide-row shape with omitted Object Lock/encryption metadata and `contentType: "application/x-bz-hide-marker"`; `Bucket.unhideFile()` now returns that `ListedHideFileVersion | null` shape. `B2SyncPath.allVersions` changed from `FileVersion[]` to `ListedConcreteFileVersion[]`, so hidden sync version history now uses the listed hide-row shape rather than full `FileVersion` metadata. New literal and dynamic `delimiter?: string` overloads on `RawClient.listFileNames` / `listFileVersions` and the `Bucket.listFileNames` / `listFileVersions` / `paginateFileNames` / `paginateFileVersions` facades surface folder unions only when delimiter may be present; `FolderFileVersion` virtual-folder rows have `fileId: null` and `contentType: null`, and non-delimiter facade calls reject folder/null-ID rows before returning them. The simulator now honors the `delimiter` (and its `prefix` interaction), emits folder entries only for visible file-name listings, and keeps hide markers in file-version listings. Closes #191.
37
+ - **Raw native storage endpoints now use the published `/b2api/v4` route.** All SDK-owned B2 native storage URLs are built from a single centralized v4 policy in the raw URL builder, replacing the previous mix of `/b2api/v3` and `/b2api/v4` per-endpoint segments. The version is no longer a per-call parameter, so endpoint/version drift is structurally prevented. This is runtime-compatible (B2 accepts both routes and the auth token is version-agnostic) and `RawClient` public method signatures are unchanged; read/list endpoints remain POST JSON as the docs permit. Closes #104.
38
+ - **Bucket type request and response contracts are now separate.** BREAKING: `BucketInfo.bucketType` is now the open `BucketResponseType` (`KnownBucketResponseType | (string & {})`), which adds the response-only `'shared'` value (`KnownBucketResponseType.Shared`) and tolerates future B2-added types, so exhaustive switches over the old closed `BucketType` on a response now need a default case. Create/update requests still accept only the settable `BucketType` (`allPublic` / `allPrivate` / `snapshot` / `restricted`). `ListBucketsRequest.bucketTypes` (and the `B2Client.listBuckets` filter option) changed from `BucketType[]` to `BucketTypesFilter` (`readonly ['all'] | readonly BucketListType[]`), which accepts `'shared'`, future type strings, and the special `['all']`; the simulator now rejects empty filters, `'all'` mixed with other values, and non-string entries at runtime, matching B2. Closes #107.
39
+
40
+ ### Fixed
41
+
42
+ - **B2-to-local sync removes the managed download staging root on completion.** Completed downloads now clean the SDK-owned `.b2sdk-download-staging` directory after per-run staging entries are gone, including no-op follow-up syncs that only find an older marker-only staging root. Closes #156.
43
+ - **Progress throttling drains part-boundary bytes safely.** A pending coalesced byte-progress update is emitted before the part-completion update, delayed progress listener errors no longer escape detached timers, and pending progress timers are cleared on transfer cleanup.
44
+ - **Followed local symlinks stay inside the sync root.** `localSymlinks: 'follow'` skips file and directory symlink targets outside the local root, avoids repeated traversal of the same followed directory identity, and `synchronize()` now honors followed in-root file targets before upload actions.
45
+ - **B2 content file-info upload headers are now percent-encoded.** `contentDisposition`, `contentLanguage`, `expires`, `cacheControl`, and `contentEncoding` values sent as `X-Bz-Info-b2-*` upload headers are now encoded with B2 file-info encoding, matching the custom `fileInfo` path, so values with `%`, non-ASCII, or other unsafe characters round-trip correctly. These values must now be passed raw (unencoded). Closes #213.
46
+ - **Partner and Computer Backup API paths pin their wire version per method.** Partner group-management endpoints (`b2_list_groups`, `b2_list_group_members`, `b2_create_group_member`, `b2_eject_group_member`, `b2_reserve_trial_create_account`) now target `/b2api/v4`, matching the Partner API docs' code samples, while Partner `b2_authorize_account` stays on `/b2api/v3` (the version B2 documents for the suite-grouped `apiInfo` response) and Computer Backup stays on `api/backup/v1`. Each version comes from a single per-suite URL builder instead of a per-call segment, and request-construction guardrails assert the pinned version per method so the routes cannot silently drift. A gated live smoke (`tests/integration/partner-backup-contracts.test.ts`, master-key credentials) is included to confirm, when run, that live B2 accepts the read-only routes at their pinned versions. Closes #228.
47
+ - **Partner and Computer Backup mutations no longer replay on 401 reauth.** Non-idempotent Partner/Backup mutations (`b2_create_group_member`, `b2_eject_group_member`, `b2_reserve_trial_create_account`, `bz_delete_computer`) are tagged `idempotent: false`, and `RetryTransport` now blocks both transient retries and expired-token reauth-replay for them from a single shared endpoint registry. Previously the retry-suppression (raw client `maxRetries: 0`) and the transport's reauth-replay guard were separate lists that could drift, risking a double account-create or delete if a new mutation was added to one but not the other; a known mutation URL now also fails closed if a transport wrapper strips the marker. The exported `HttpRequest` type gains an optional `idempotent?: false` field for custom transports. Closes #215.
48
+ - **Storage reauthorization coalesces concurrent 401s into a single refresh.** Expired-token reauth on `B2Client` now shares one in-flight `authorizeAccount` across all waiting requests through a shared coalescer (the Partner client's bespoke in-flight state machine was lifted into the same helper), instead of firing one authorize per concurrent 401. A failed or aborted refresh no longer clears the existing token first, so the client stays recoverable, and per-request `AbortSignal`s are honored (one waiter aborting does not cancel the shared refresh for the others). New `B2ClientAuthorizeOptions` / `AuthorizeAccountOptions` exports expose the abort signal on authorize and reauthorize. Closes #216.
49
+ - **B2Simulator large-file lock echo fidelity.** `b2_start_large_file` and `b2_list_unfinished_large_files` now redact the `fileRetention` / `legalHold` echoes for callers lacking `readFileRetentions` / `readFileLegalHolds`, matching B2's capability-filtered response shape; previously the simulator always reported `isClientAuthorizedToRead: true`. The `StartLargeFileResponse` / `UnfinishedLargeFile` DTOs already expose the `fileRetention` / `legalHold` / `serverSideEncryption` echo fields and no longer carry a phantom top-level bucket `defaultRetention`. Closes #41.
50
+ - **Upload retries no longer replay spoofable post-start network errors.** High-level uploads still retry network failures before an upload POST is attempted, but a post-start `NetworkError` with nested `ECONNREFUSED` no longer bypasses the default protection against ambiguous single-request replay. Set `retryResponseBodyFailures: true` only when duplicate versions or replayed parts are acceptable.
51
+ - **SSE-B2 large-file uploads no longer repeat encryption headers on each part.** SSE-B2 (B2-managed) encryption is configured once on `b2_start_large_file`; `b2_upload_part` only accepts customer-key headers, so the SDK no longer sends the SSE-B2 `serverSideEncryption` setting on each part upload. SSE-C customer keys are still applied per part.
52
+
10
53
  ## [0.3.0] - 2026-08-18
11
54
 
12
55
  ### Added
@@ -261,7 +304,8 @@ First public release of `@backblaze-labs/b2-sdk`. Everything below is new in thi
261
304
  - TypeDoc for API documentation
262
305
  - Vitest test suite with 486 tests across 20 files at ≥ 95% statement coverage. Tests run cleanly under both vitest (Node) and Bun's vitest-compat (no module-level mocking required)
263
306
 
264
- [Unreleased]: git+https://github.com/backblaze-labs/b2-sdk-typescript/compare/v0.3.0...HEAD
307
+ [Unreleased]: git+https://github.com/backblaze-labs/b2-sdk-typescript/compare/v0.4.0...HEAD
308
+ [0.4.0]: git+https://github.com/backblaze-labs/b2-sdk-typescript/compare/v0.3.0...v0.4.0
265
309
  [0.3.0]: git+https://github.com/backblaze-labs/b2-sdk-typescript/compare/v0.2.0...v0.3.0
266
310
  [0.2.0]: https://github.com/backblaze-labs/b2-sdk-typescript/compare/v0.1.0...v0.2.0
267
311
  [0.1.0]: https://github.com/backblaze-labs/b2-sdk-typescript/releases/tag/v0.1.0
package/README.md CHANGED
@@ -401,6 +401,7 @@ await bucket.setNotificationRules([
401
401
  targetType: 'webhook',
402
402
  url: 'https://my-app.com/webhooks/b2',
403
403
  hmacSha256SigningSecret: process.env.B2_WEBHOOK_SECRET,
404
+ customHeaders: [{ name: 'X-B2-Source', value: 'uploads' }],
404
405
  },
405
406
  },
406
407
  ])
@@ -524,6 +525,18 @@ and per-request retry overrides: pass `{ signal, retry }` to `getUploadUrl`,
524
525
  `getUploadPartUrl`, `uploadFile`, and `uploadPart`. The older positional
525
526
  `signal, retry` form remains available only for source compatibility.
526
527
 
528
+ ### Raw native API version policy
529
+
530
+ `RawClient` builds SDK-owned B2 native storage URLs with `/b2api/v4`, matching the
531
+ current published native API docs. The version is centralized in the raw URL
532
+ builder path; upload and download URLs returned by B2 are used as returned.
533
+
534
+ Raw JSON endpoints use POST bodies, including read/list operations whose docs
535
+ also show GET query examples such as `b2_get_upload_url`, `b2_get_file_info`,
536
+ `b2_list_file_names`, and `b2_list_keys`. B2 documents POST JSON compatibility
537
+ for these operations, so the SDK keeps the long-standing POST shape while moving
538
+ the path version to v4.
539
+
527
540
  Every export is documented with full type signatures in the [API reference](https://backblaze-labs.github.io/b2-sdk-typescript/).
528
541
 
529
542
  ## Sync filters
@@ -580,12 +593,12 @@ const client = new B2Client({
580
593
  Every request the SDK issues carries a User-Agent header that Backblaze can grep server logs by:
581
594
 
582
595
  ```
583
- b2-sdk-typescript/<version> (typescript; @backblaze-labs/b2-sdk; node/<node-version>; linux; x64)
596
+ b2-sdk-typescript/<version-or-dev> (typescript; @backblaze-labs/b2-sdk; node/<node-version>; linux; x64)
584
597
  ```
585
598
 
586
599
  Both `b2-sdk-typescript/` (stable product token) and `@backblaze-labs/b2-sdk` (npm package name) are part of the documented contract — log queries that match either one find every request issued by this SDK. The comment block also reports the runtime (`node/<version>`, `bun/<version>`, `deno/<version>`, or `browser`) plus the OS and architecture on non-browser runtimes.
587
600
 
588
- The version is read straight from `package.json` via a JSON import attribute, so bumping the package version automatically propagates to the UA, the published artifact, and the runtime constant. There is no second source of truth to keep in sync.
601
+ The public `VERSION` constant is always the package semver string. The User-Agent product token reports that semver only from a stable published package; source, CI, `npm pack`, and prerelease builds report `b2-sdk-typescript/dev` so development traffic stays distinguishable.
589
602
 
590
603
  To prepend your own application identifier:
591
604
 
@@ -595,7 +608,7 @@ const client = new B2Client({
595
608
  applicationKey,
596
609
  userAgent: 'my-app/1.0',
597
610
  })
598
- // → "my-app/1.0 b2-sdk-typescript/<version> (typescript; @backblaze-labs/b2-sdk; node/<node-version>; linux; x64)"
611
+ // → "my-app/1.0 b2-sdk-typescript/<version-or-dev> (typescript; @backblaze-labs/b2-sdk; node/<node-version>; linux; x64)"
599
612
  ```
600
613
 
601
614
  ## SSRF guard
@@ -773,14 +786,14 @@ So you get both: an `npm install`-ready `dist/` (ESM + CJS + DTS), *and* a `src/
773
786
 
774
787
  | Runtime | Version | Status |
775
788
  |---|---|---|
776
- | Node.js | 22.3+ | Primary target. CI runs the fast suite on Linux, Windows, and macOS for Node 22.18 + 24; slow and coverage jobs run on Linux. `FileSource` uses weaker size/mtime validation on Windows because portable dev/inode and ctime fields are unreliable there. |
789
+ | Node.js | 22.3+ | Primary target. CI runs the fast suite on Linux, Windows, and macOS for Node 22.22.2 + 24; slow and coverage jobs run on Linux. `FileSource` uses weaker size/mtime validation on Windows because portable dev/inode and ctime fields are unreliable there. |
777
790
  | Bun | latest | Tested in CI via `bun test src/` + example typecheck. |
778
791
  | Deno | 2.x | Source isomorphism verified in CI via `deno check` against `src/`. |
779
792
  | Browsers | Chromium, Firefox, WebKit (last 2 evergreen) | Tested in CI via Playwright. |
780
793
  | Cloudflare Workers | - | Compatible target when the standard Web APIs above are available; not yet smoke-tested in CI with a Workers runtime. |
781
794
  | Vercel Edge | - | Compatible target when the standard Web APIs above are available; not yet smoke-tested in CI with Vercel Edge. |
782
795
 
783
- Requires: `fetch`, Web Streams, `crypto.subtle`, `AbortSignal`. Node < 22.3 is not supported (Node 20 reached EOL April 2026). `FileSource(path)` throws on older Node 22.x runtimes that lack synchronous `process.getBuiltinModule()`; `FileSource.fromPath(path)` remains the async construction path for supported Node filesystem platforms. On Windows, `FileSource` is supported with weaker size/mtime validation because portable dev/inode and ctime fields are unreliable there.
796
+ Requires: `fetch`, Web Streams, `crypto.subtle`, `AbortSignal`. Node < 22.3 is not supported (Node 20 reached EOL April 2026). `FileSource(path)` throws on runtimes that lack `process.getBuiltinModule('node:fs')`; `FileSource.fromPath(path)` remains the async construction path for supported Node filesystem platforms. On Windows, `FileSource` is supported with weaker size/mtime validation because portable dev/inode and ctime fields are unreliable there.
784
797
 
785
798
  The browser test suite (`pnpm test:browser`) runs the same source against real Chromium, Firefox, and WebKit instances. Only Node-specific tests (filename pattern `*.node.test.ts`, covering `node:fs`, `node:os`, `node:util.inspect`) are skipped.
786
799
 
@@ -1,4 +1,4 @@
1
1
  //#region \0b2-sdk-version-json
2
- var _b2_sdk_version_json_default = { "version": "0.3.0" };
2
+ var _b2_sdk_version_json_default = { "version": "0.4.0" };
3
3
  //#endregion
4
4
  exports.default = _b2_sdk_version_json_default;
@@ -1,4 +1,4 @@
1
1
  //#region \0b2-sdk-version-json
2
- var _b2_sdk_version_json_default = { "version": "0.3.0" };
2
+ var _b2_sdk_version_json_default = { "version": "0.4.0" };
3
3
  //#endregion
4
4
  export { _b2_sdk_version_json_default as default };
@@ -0,0 +1,65 @@
1
+ const require_abort = require("../util/abort.cjs");
2
+ //#region src/auth/reauth-coalescer.ts
3
+ /**
4
+ * Coalesces concurrent reauthorization requests into one in-flight refresh.
5
+ * Each caller waits independently with its own abort signal. The shared
6
+ * refresh receives a coalescer-owned signal and is aborted only when every
7
+ * active waiter has stopped waiting before the refresh settles. A successful,
8
+ * failed, or aborted refresh clears the in-flight slot so the next call can
9
+ * start a new refresh.
10
+ *
11
+ * @internal
12
+ */
13
+ var ReauthCoalescer = class {
14
+ #refresh;
15
+ #inflight = null;
16
+ /**
17
+ * Creates a new reauthorization coalescer.
18
+ *
19
+ * @param refresh - The callback that performs one shared refresh.
20
+ */
21
+ constructor(refresh) {
22
+ this.#refresh = refresh;
23
+ }
24
+ /**
25
+ * Runs or joins the current refresh. If `signal` is already aborted, the
26
+ * refresh callback is not called. If this waiter aborts while other waiters
27
+ * remain, only this call rejects; the shared refresh continues for the
28
+ * remaining waiters.
29
+ *
30
+ * @param signal - Optional abort signal for this waiter.
31
+ *
32
+ * @returns The shared refresh result.
33
+ */
34
+ run(signal) {
35
+ require_abort.throwIfSignalAborted(signal);
36
+ const inflight = this.#inflight ?? this.start();
37
+ inflight.waiters += 1;
38
+ return require_abort.raceWithAbort(inflight.promise, signal).finally(() => {
39
+ inflight.waiters -= 1;
40
+ if (inflight.waiters === 0 && !inflight.settled && !inflight.controller.signal.aborted)
41
+ /* v8 ignore next -- waiters can only leave an unsettled refresh by aborting their signal */
42
+ inflight.controller.abort(signal?.aborted === true ? require_abort.abortReason(signal) : void 0);
43
+ });
44
+ }
45
+ start() {
46
+ const controller = new AbortController();
47
+ const inflight = {
48
+ controller,
49
+ promise: require_abort.raceWithAbort(this.#refresh(controller.signal), controller.signal).finally(() => {
50
+ /* v8 ignore next -- defensive: callers cannot start a replacement while this is current */
51
+ if (this.#inflight?.controller !== controller) return;
52
+ this.#inflight.settled = true;
53
+ this.#inflight = null;
54
+ }),
55
+ waiters: 0,
56
+ settled: false
57
+ };
58
+ this.#inflight = inflight;
59
+ return inflight;
60
+ }
61
+ };
62
+ //#endregion
63
+ exports.ReauthCoalescer = ReauthCoalescer;
64
+
65
+ //# sourceMappingURL=reauth-coalescer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reauth-coalescer.cjs","names":[],"sources":["../../src/auth/reauth-coalescer.ts"],"sourcesContent":["import { abortReason, raceWithAbort, throwIfSignalAborted } from '../util/abort.ts'\n\n/** Callback that performs the shared reauthorization work. */\nexport type ReauthRefresh<T> = (signal: AbortSignal) => Promise<T>\n\ninterface InflightReauth<T> {\n readonly controller: AbortController\n readonly promise: Promise<T>\n waiters: number\n settled: boolean\n}\n\n/**\n * Coalesces concurrent reauthorization requests into one in-flight refresh.\n * Each caller waits independently with its own abort signal. The shared\n * refresh receives a coalescer-owned signal and is aborted only when every\n * active waiter has stopped waiting before the refresh settles. A successful,\n * failed, or aborted refresh clears the in-flight slot so the next call can\n * start a new refresh.\n *\n * @internal\n */\nexport class ReauthCoalescer<T> {\n readonly #refresh: ReauthRefresh<T>\n #inflight: InflightReauth<T> | null = null\n\n /**\n * Creates a new reauthorization coalescer.\n *\n * @param refresh - The callback that performs one shared refresh.\n */\n constructor(refresh: ReauthRefresh<T>) {\n this.#refresh = refresh\n }\n\n /**\n * Runs or joins the current refresh. If `signal` is already aborted, the\n * refresh callback is not called. If this waiter aborts while other waiters\n * remain, only this call rejects; the shared refresh continues for the\n * remaining waiters.\n *\n * @param signal - Optional abort signal for this waiter.\n *\n * @returns The shared refresh result.\n */\n run(signal?: AbortSignal): Promise<T> {\n throwIfSignalAborted(signal)\n const inflight = this.#inflight ?? this.start()\n inflight.waiters += 1\n return raceWithAbort(inflight.promise, signal).finally(() => {\n inflight.waiters -= 1\n if (inflight.waiters === 0 && !inflight.settled && !inflight.controller.signal.aborted) {\n /* v8 ignore next -- waiters can only leave an unsettled refresh by aborting their signal */\n inflight.controller.abort(signal?.aborted === true ? abortReason(signal) : undefined)\n }\n })\n }\n\n private start(): InflightReauth<T> {\n const controller = new AbortController()\n const promise = raceWithAbort(this.#refresh(controller.signal), controller.signal).finally(\n () => {\n /* v8 ignore next -- defensive: callers cannot start a replacement while this is current */\n if (this.#inflight?.controller !== controller) return\n this.#inflight.settled = true\n this.#inflight = null\n },\n )\n const inflight: InflightReauth<T> = {\n controller,\n promise,\n waiters: 0,\n settled: false,\n }\n this.#inflight = inflight\n return inflight\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,IAAa,kBAAb,MAAgC;CAC9B;CACA,YAAsC;;;;;;CAOtC,YAAY,SAA2B;EACrC,KAAK,WAAW;CAClB;;;;;;;;;;;CAYA,IAAI,QAAkC;EACpC,cAAA,qBAAqB,MAAM;EAC3B,MAAM,WAAW,KAAK,aAAa,KAAK,MAAM;EAC9C,SAAS,WAAW;EACpB,OAAO,cAAA,cAAc,SAAS,SAAS,MAAM,CAAC,CAAC,cAAc;GAC3D,SAAS,WAAW;GACpB,IAAI,SAAS,YAAY,KAAK,CAAC,SAAS,WAAW,CAAC,SAAS,WAAW,OAAO;;GAE7E,SAAS,WAAW,MAAM,QAAQ,YAAY,OAAO,cAAA,YAAY,MAAM,IAAI,KAAA,CAAS;EAExF,CAAC;CACH;CAEA,QAAmC;EACjC,MAAM,aAAa,IAAI,gBAAgB;EASvC,MAAM,WAA8B;GAClC;GACA,SAVc,cAAA,cAAc,KAAK,SAAS,WAAW,MAAM,GAAG,WAAW,MAAM,CAAC,CAAC,cAC3E;;IAEJ,IAAI,KAAK,WAAW,eAAe,YAAY;IAC/C,KAAK,UAAU,UAAU;IACzB,KAAK,YAAY;GACnB,CAIA;GACA,SAAS;GACT,SAAS;EACX;EACA,KAAK,YAAY;EACjB,OAAO;CACT;AACF"}
@@ -0,0 +1,34 @@
1
+ /** Callback that performs the shared reauthorization work. */
2
+ export type ReauthRefresh<T> = (signal: AbortSignal) => Promise<T>;
3
+ /**
4
+ * Coalesces concurrent reauthorization requests into one in-flight refresh.
5
+ * Each caller waits independently with its own abort signal. The shared
6
+ * refresh receives a coalescer-owned signal and is aborted only when every
7
+ * active waiter has stopped waiting before the refresh settles. A successful,
8
+ * failed, or aborted refresh clears the in-flight slot so the next call can
9
+ * start a new refresh.
10
+ *
11
+ * @internal
12
+ */
13
+ export declare class ReauthCoalescer<T> {
14
+ #private;
15
+ /**
16
+ * Creates a new reauthorization coalescer.
17
+ *
18
+ * @param refresh - The callback that performs one shared refresh.
19
+ */
20
+ constructor(refresh: ReauthRefresh<T>);
21
+ /**
22
+ * Runs or joins the current refresh. If `signal` is already aborted, the
23
+ * refresh callback is not called. If this waiter aborts while other waiters
24
+ * remain, only this call rejects; the shared refresh continues for the
25
+ * remaining waiters.
26
+ *
27
+ * @param signal - Optional abort signal for this waiter.
28
+ *
29
+ * @returns The shared refresh result.
30
+ */
31
+ run(signal?: AbortSignal): Promise<T>;
32
+ private start;
33
+ }
34
+ //# sourceMappingURL=reauth-coalescer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reauth-coalescer.d.ts","sourceRoot":"","sources":["../../src/auth/reauth-coalescer.js"],"names":[],"mappings":"AAEA,8DAA8D;AAC9D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AASlE;;;;;;;;;GASG;AACH,qBAAa,eAAe,CAAC,CAAC;;IAI5B;;;;OAIG;gBACS,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAIrC;;;;;;;;;OASG;IACH,GAAG,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAarC,OAAO,CAAC,KAAK;CAmBd"}
@@ -0,0 +1,34 @@
1
+ /** Callback that performs the shared reauthorization work. */
2
+ export type ReauthRefresh<T> = (signal: AbortSignal) => Promise<T>;
3
+ /**
4
+ * Coalesces concurrent reauthorization requests into one in-flight refresh.
5
+ * Each caller waits independently with its own abort signal. The shared
6
+ * refresh receives a coalescer-owned signal and is aborted only when every
7
+ * active waiter has stopped waiting before the refresh settles. A successful,
8
+ * failed, or aborted refresh clears the in-flight slot so the next call can
9
+ * start a new refresh.
10
+ *
11
+ * @internal
12
+ */
13
+ export declare class ReauthCoalescer<T> {
14
+ #private;
15
+ /**
16
+ * Creates a new reauthorization coalescer.
17
+ *
18
+ * @param refresh - The callback that performs one shared refresh.
19
+ */
20
+ constructor(refresh: ReauthRefresh<T>);
21
+ /**
22
+ * Runs or joins the current refresh. If `signal` is already aborted, the
23
+ * refresh callback is not called. If this waiter aborts while other waiters
24
+ * remain, only this call rejects; the shared refresh continues for the
25
+ * remaining waiters.
26
+ *
27
+ * @param signal - Optional abort signal for this waiter.
28
+ *
29
+ * @returns The shared refresh result.
30
+ */
31
+ run(signal?: AbortSignal): Promise<T>;
32
+ private start;
33
+ }
34
+ //# sourceMappingURL=reauth-coalescer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reauth-coalescer.d.ts","sourceRoot":"","sources":["../../src/auth/reauth-coalescer.js"],"names":[],"mappings":"AAEA,8DAA8D;AAC9D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AASlE;;;;;;;;;GASG;AACH,qBAAa,eAAe,CAAC,CAAC;;IAI5B;;;;OAIG;gBACS,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAIrC;;;;;;;;;OASG;IACH,GAAG,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAarC,OAAO,CAAC,KAAK;CAmBd"}
@@ -0,0 +1,65 @@
1
+ import { abortReason, raceWithAbort, throwIfSignalAborted } from "../util/abort.js";
2
+ //#region src/auth/reauth-coalescer.ts
3
+ /**
4
+ * Coalesces concurrent reauthorization requests into one in-flight refresh.
5
+ * Each caller waits independently with its own abort signal. The shared
6
+ * refresh receives a coalescer-owned signal and is aborted only when every
7
+ * active waiter has stopped waiting before the refresh settles. A successful,
8
+ * failed, or aborted refresh clears the in-flight slot so the next call can
9
+ * start a new refresh.
10
+ *
11
+ * @internal
12
+ */
13
+ var ReauthCoalescer = class {
14
+ #refresh;
15
+ #inflight = null;
16
+ /**
17
+ * Creates a new reauthorization coalescer.
18
+ *
19
+ * @param refresh - The callback that performs one shared refresh.
20
+ */
21
+ constructor(refresh) {
22
+ this.#refresh = refresh;
23
+ }
24
+ /**
25
+ * Runs or joins the current refresh. If `signal` is already aborted, the
26
+ * refresh callback is not called. If this waiter aborts while other waiters
27
+ * remain, only this call rejects; the shared refresh continues for the
28
+ * remaining waiters.
29
+ *
30
+ * @param signal - Optional abort signal for this waiter.
31
+ *
32
+ * @returns The shared refresh result.
33
+ */
34
+ run(signal) {
35
+ throwIfSignalAborted(signal);
36
+ const inflight = this.#inflight ?? this.start();
37
+ inflight.waiters += 1;
38
+ return raceWithAbort(inflight.promise, signal).finally(() => {
39
+ inflight.waiters -= 1;
40
+ if (inflight.waiters === 0 && !inflight.settled && !inflight.controller.signal.aborted)
41
+ /* v8 ignore next -- waiters can only leave an unsettled refresh by aborting their signal */
42
+ inflight.controller.abort(signal?.aborted === true ? abortReason(signal) : void 0);
43
+ });
44
+ }
45
+ start() {
46
+ const controller = new AbortController();
47
+ const inflight = {
48
+ controller,
49
+ promise: raceWithAbort(this.#refresh(controller.signal), controller.signal).finally(() => {
50
+ /* v8 ignore next -- defensive: callers cannot start a replacement while this is current */
51
+ if (this.#inflight?.controller !== controller) return;
52
+ this.#inflight.settled = true;
53
+ this.#inflight = null;
54
+ }),
55
+ waiters: 0,
56
+ settled: false
57
+ };
58
+ this.#inflight = inflight;
59
+ return inflight;
60
+ }
61
+ };
62
+ //#endregion
63
+ export { ReauthCoalescer };
64
+
65
+ //# sourceMappingURL=reauth-coalescer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reauth-coalescer.js","names":[],"sources":["../../src/auth/reauth-coalescer.ts"],"sourcesContent":["import { abortReason, raceWithAbort, throwIfSignalAborted } from '../util/abort.ts'\n\n/** Callback that performs the shared reauthorization work. */\nexport type ReauthRefresh<T> = (signal: AbortSignal) => Promise<T>\n\ninterface InflightReauth<T> {\n readonly controller: AbortController\n readonly promise: Promise<T>\n waiters: number\n settled: boolean\n}\n\n/**\n * Coalesces concurrent reauthorization requests into one in-flight refresh.\n * Each caller waits independently with its own abort signal. The shared\n * refresh receives a coalescer-owned signal and is aborted only when every\n * active waiter has stopped waiting before the refresh settles. A successful,\n * failed, or aborted refresh clears the in-flight slot so the next call can\n * start a new refresh.\n *\n * @internal\n */\nexport class ReauthCoalescer<T> {\n readonly #refresh: ReauthRefresh<T>\n #inflight: InflightReauth<T> | null = null\n\n /**\n * Creates a new reauthorization coalescer.\n *\n * @param refresh - The callback that performs one shared refresh.\n */\n constructor(refresh: ReauthRefresh<T>) {\n this.#refresh = refresh\n }\n\n /**\n * Runs or joins the current refresh. If `signal` is already aborted, the\n * refresh callback is not called. If this waiter aborts while other waiters\n * remain, only this call rejects; the shared refresh continues for the\n * remaining waiters.\n *\n * @param signal - Optional abort signal for this waiter.\n *\n * @returns The shared refresh result.\n */\n run(signal?: AbortSignal): Promise<T> {\n throwIfSignalAborted(signal)\n const inflight = this.#inflight ?? this.start()\n inflight.waiters += 1\n return raceWithAbort(inflight.promise, signal).finally(() => {\n inflight.waiters -= 1\n if (inflight.waiters === 0 && !inflight.settled && !inflight.controller.signal.aborted) {\n /* v8 ignore next -- waiters can only leave an unsettled refresh by aborting their signal */\n inflight.controller.abort(signal?.aborted === true ? abortReason(signal) : undefined)\n }\n })\n }\n\n private start(): InflightReauth<T> {\n const controller = new AbortController()\n const promise = raceWithAbort(this.#refresh(controller.signal), controller.signal).finally(\n () => {\n /* v8 ignore next -- defensive: callers cannot start a replacement while this is current */\n if (this.#inflight?.controller !== controller) return\n this.#inflight.settled = true\n this.#inflight = null\n },\n )\n const inflight: InflightReauth<T> = {\n controller,\n promise,\n waiters: 0,\n settled: false,\n }\n this.#inflight = inflight\n return inflight\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,IAAa,kBAAb,MAAgC;CAC9B;CACA,YAAsC;;;;;;CAOtC,YAAY,SAA2B;EACrC,KAAK,WAAW;CAClB;;;;;;;;;;;CAYA,IAAI,QAAkC;EACpC,qBAAqB,MAAM;EAC3B,MAAM,WAAW,KAAK,aAAa,KAAK,MAAM;EAC9C,SAAS,WAAW;EACpB,OAAO,cAAc,SAAS,SAAS,MAAM,CAAC,CAAC,cAAc;GAC3D,SAAS,WAAW;GACpB,IAAI,SAAS,YAAY,KAAK,CAAC,SAAS,WAAW,CAAC,SAAS,WAAW,OAAO;;GAE7E,SAAS,WAAW,MAAM,QAAQ,YAAY,OAAO,YAAY,MAAM,IAAI,KAAA,CAAS;EAExF,CAAC;CACH;CAEA,QAAmC;EACjC,MAAM,aAAa,IAAI,gBAAgB;EASvC,MAAM,WAA8B;GAClC;GACA,SAVc,cAAc,KAAK,SAAS,WAAW,MAAM,GAAG,WAAW,MAAM,CAAC,CAAC,cAC3E;;IAEJ,IAAI,KAAK,WAAW,eAAe,YAAY;IAC/C,KAAK,UAAU,UAAU;IACzB,KAAK,YAAY;GACnB,CAIA;GACA,SAAS;GACT,SAAS;EACX;EACA,KAAK,YAAY;EACjB,OAAO;CACT;AACF"}
@@ -1,16 +1,42 @@
1
1
  const require_url = require("../raw/url.cjs");
2
2
  const require_endpoint_url = require("../partner/endpoint-url.cjs");
3
3
  //#region src/backup/raw.ts
4
- var BACKUP_API_V1 = {
4
+ var BACKUP_API = {
5
5
  prefix: "api/backup",
6
6
  version: "v1"
7
7
  };
8
+ /**
9
+ * Normalizes the `bz_delete_computer` wire response to the array-shaped schema.
10
+ *
11
+ * The Backblaze apidocs response *schema* declares a JSON array, but the
12
+ * accompanying *example* shows a single bare object. This tolerates both: an
13
+ * array passes through unchanged, and a lone object is wrapped in a
14
+ * single-element array, so callers always receive a {@link DeleteComputerResponse}
15
+ * regardless of which shape live B2 returns.
16
+ *
17
+ * @param raw - The parsed `bz_delete_computer` JSON body.
18
+ *
19
+ * @returns The response as the canonical array shape.
20
+ *
21
+ * @throws TypeError When the body is neither an array nor an object.
22
+ */
23
+ function normalizeDeleteComputerResponse(raw) {
24
+ if (Array.isArray(raw)) return raw;
25
+ if (raw !== null && typeof raw === "object") return [raw];
26
+ throw new TypeError("bz_delete_computer returned an unexpected response body shape");
27
+ }
8
28
  function backupEndpointAllowedSuffixes(transport, authorizedSuffixes) {
9
29
  return require_endpoint_url.endpointAllowedSuffixes(transport, authorizedSuffixes, {
10
30
  missingGuard: "Computer Backup endpoint requests require BackupClient.authorize() or a locked URL guard before sending Partner tokens",
11
31
  unlockedGuard: "Computer Backup endpoint requests require a locked URL guard before sending Partner tokens"
12
32
  });
13
33
  }
34
+ function backupEndpointUrl(backupApiUrl, endpoint) {
35
+ return require_url.b2Url(backupApiUrl, {
36
+ ...BACKUP_API,
37
+ endpoint
38
+ });
39
+ }
14
40
  /**
15
41
  * Low-level client for Computer Backup API endpoint bindings.
16
42
  *
@@ -81,10 +107,10 @@ var BackupRawClient = class {
81
107
  * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.
82
108
  */
83
109
  async deleteComputer(backupApiUrl, authToken, request, options) {
84
- return this.postJson(backupApiUrl, authToken, "bz_delete_computer", {
110
+ return normalizeDeleteComputerResponse(await this.postNonRetryingMutationJson(backupApiUrl, authToken, "bz_delete_computer", {
85
111
  accountId: request.accountId,
86
112
  computerId: request.computerId
87
- }, require_endpoint_url.nonRetryingMutationRequestOptions(options));
113
+ }, options));
88
114
  }
89
115
  safeBackupApiUrl(backupApiUrl) {
90
116
  return require_endpoint_url.validatePartnerEndpointUrl(backupApiUrl, "backupApiUrl", backupEndpointAllowedSuffixes(this.transport, this.authorizedEndpointSuffixes));
@@ -102,10 +128,7 @@ var BackupRawClient = class {
102
128
  */
103
129
  async getJson(backupApiUrl, authToken, endpoint, query, options) {
104
130
  return (await this.transport.send({
105
- url: require_endpoint_url.withQueryString(require_url.b2Url(this.safeBackupApiUrl(backupApiUrl), {
106
- ...BACKUP_API_V1,
107
- endpoint
108
- }), query),
131
+ url: require_endpoint_url.withQueryString(backupEndpointUrl(this.safeBackupApiUrl(backupApiUrl), endpoint), query),
109
132
  method: "GET",
110
133
  headers: { Authorization: authToken },
111
134
  ...options?.signal !== void 0 ? { signal: options.signal } : {},
@@ -113,7 +136,7 @@ var BackupRawClient = class {
113
136
  })).json();
114
137
  }
115
138
  /**
116
- * Sends a JSON POST request to the specified Computer Backup API endpoint.
139
+ * Sends a non-retrying JSON mutation POST request to the specified Computer Backup API endpoint.
117
140
  *
118
141
  * @param backupApiUrl - The Computer Backup API base URL.
119
142
  * @param authToken - The Partner authorization token.
@@ -123,20 +146,19 @@ var BackupRawClient = class {
123
146
  *
124
147
  * @returns The parsed JSON response.
125
148
  */
126
- async postJson(backupApiUrl, authToken, endpoint, body, options) {
149
+ async postNonRetryingMutationJson(backupApiUrl, authToken, endpoint, body, options) {
150
+ const requestOptions = require_endpoint_url.nonRetryingMutationRequestOptions(options);
127
151
  return (await this.transport.send({
128
- url: require_url.b2Url(this.safeBackupApiUrl(backupApiUrl), {
129
- ...BACKUP_API_V1,
130
- endpoint
131
- }),
152
+ url: backupEndpointUrl(this.safeBackupApiUrl(backupApiUrl), endpoint),
132
153
  method: "POST",
133
154
  headers: {
134
155
  Authorization: authToken,
135
156
  "Content-Type": "application/json"
136
157
  },
137
158
  body: JSON.stringify(body),
138
- ...options?.signal !== void 0 ? { signal: options.signal } : {},
139
- ...options?.retry !== void 0 ? { retry: options.retry } : {}
159
+ ...requestOptions.signal !== void 0 ? { signal: requestOptions.signal } : {},
160
+ ...requestOptions.idempotent !== void 0 ? { idempotent: requestOptions.idempotent } : {},
161
+ ...requestOptions.retry !== void 0 ? { retry: requestOptions.retry } : {}
140
162
  })).json();
141
163
  }
142
164
  };
@@ -1 +1 @@
1
- {"version":3,"file":"raw.cjs","names":[],"sources":["../../src/backup/raw.ts"],"sourcesContent":["import type { RetryOptions } from '../http/retry.ts'\nimport type { HttpTransport } from '../http/transport.ts'\nimport {\n endpointAllowedSuffixes,\n nonRetryingMutationRequestOptions,\n type QueryParams,\n validatePartnerEndpointUrl,\n withQueryString,\n} from '../partner/endpoint-url.ts'\nimport { type B2EndpointUrlOptions, b2Url } from '../raw/url.ts'\nimport type {\n DeleteComputerRequest,\n DeleteComputerResponse,\n ListComputersRequest,\n ListComputersResponse,\n} from '../types/backup.ts'\n\nconst BACKUP_API_V1: B2EndpointUrlOptions = { prefix: 'api/backup', version: 'v1' }\n\n/** Configuration for constructing a {@link BackupRawClient}. */\nexport interface BackupRawClientOptions {\n /**\n * The HTTP transport used to send requests.\n *\n * Computer Backup endpoint calls validate URLs against suffixes recorded by\n * Partner authorization. A rehydrated client that skips authorization must\n * use `authorizedBackupEndpointSuffixes` or a transport with a locked\n * `urlGuard`. Because Partner authorize responses redact\n * `authorizationToken` under `JSON.stringify`, durable caches should persist\n * `partnerAuthorizeResponseForPersistence(auth)` only to encrypted or\n * otherwise credential-grade storage, or use another secure token-preserving\n * representation.\n */\n readonly transport: HttpTransport\n /**\n * Validated Computer Backup endpoint host suffixes restored from cached\n * Partner authorization. Facades normally manage this after authorization;\n * direct raw clients can pass trusted suffixes derived from\n * `derivePartnerAllowedSuffixes()`. Do not derive this cache with\n * `JSON.stringify(authorizePartner())`, which intentionally stores a redacted\n * token placeholder instead of a usable Partner token. Rehydrating that\n * placeholder fails fast.\n */\n readonly authorizedBackupEndpointSuffixes?: readonly string[]\n}\n\n/** Optional controls for raw Computer Backup API requests. */\nexport interface BackupRawRequestOptions {\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n /** Per-request retry override. */\n readonly retry?: Partial<RetryOptions>\n}\n\nfunction backupEndpointAllowedSuffixes(\n transport: HttpTransport,\n authorizedSuffixes: readonly string[],\n): readonly string[] {\n return endpointAllowedSuffixes(transport, authorizedSuffixes, {\n missingGuard:\n 'Computer Backup endpoint requests require BackupClient.authorize() or a locked URL guard before sending Partner tokens',\n unlockedGuard:\n 'Computer Backup endpoint requests require a locked URL guard before sending Partner tokens',\n })\n}\n\n/**\n * Low-level client for Computer Backup API endpoint bindings.\n *\n * Each method maps directly to one `bz_*` HTTP call under the\n * `/api/backup/v1/` route using the `backupApiUrl` returned by Partner\n * authorization.\n *\n * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.\n */\nexport class BackupRawClient {\n /** @internal */\n private readonly transport: HttpTransport\n private authorizedEndpointSuffixes: readonly string[]\n\n /**\n * Creates a new BackupRawClient with the given transport.\n *\n * @param options - The constructor configuration.\n */\n constructor(options: BackupRawClientOptions) {\n this.transport = options.transport\n this.authorizedEndpointSuffixes = Array.from(options.authorizedBackupEndpointSuffixes ?? [])\n }\n\n /**\n * Replaces the validated Computer Backup endpoint host suffixes.\n *\n * @param suffixes - Host suffixes derived from Partner authorization.\n *\n * @internal\n */\n setAuthorizedEndpointSuffixes(suffixes: readonly string[]): void {\n this.authorizedEndpointSuffixes = Array.from(suffixes)\n }\n\n /**\n * Calls `bz_list_computers`.\n *\n * Uses the documented GET form. The wire response is a single JSON object\n * with a `nextComputerId` cursor and active computer backup records.\n *\n * @param backupApiUrl - The Computer Backup API base URL from `authorizePartner`.\n * @param authToken - The Partner authorization token.\n * @param request - The computer listing query parameters.\n * @param options - Optional abort and per-request retry settings.\n *\n * @returns The single-object computer backup wire response.\n *\n * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.\n */\n async listComputers(\n backupApiUrl: string,\n authToken: string,\n request: ListComputersRequest,\n options?: BackupRawRequestOptions,\n ): Promise<ListComputersResponse> {\n return this.getJson<ListComputersResponse>(\n backupApiUrl,\n authToken,\n 'bz_list_computers',\n {\n accountId: request.accountId,\n ...(request.startComputerId !== undefined\n ? { startComputerId: request.startComputerId }\n : {}),\n ...(request.maxComputerCount !== undefined\n ? { maxComputerCount: request.maxComputerCount }\n : {}),\n },\n options,\n )\n }\n\n /**\n * Calls `bz_delete_computer`.\n *\n * The documented wire response is a JSON array of deletion records. This\n * destructive mutation is not automatically retried or reauthorized in place.\n *\n * @param backupApiUrl - The Computer Backup API base URL from `authorizePartner`.\n * @param authToken - The Partner authorization token.\n * @param request - The computer deletion request body.\n * @param options - Optional abort and per-request retry settings.\n *\n * @returns The deleted computer backup record array.\n *\n * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.\n */\n async deleteComputer(\n backupApiUrl: string,\n authToken: string,\n request: DeleteComputerRequest,\n options?: BackupRawRequestOptions,\n ): Promise<DeleteComputerResponse> {\n return this.postJson<DeleteComputerResponse>(\n backupApiUrl,\n authToken,\n 'bz_delete_computer',\n {\n accountId: request.accountId,\n computerId: request.computerId,\n },\n nonRetryingMutationRequestOptions(options),\n )\n }\n\n private safeBackupApiUrl(backupApiUrl: string): string {\n return validatePartnerEndpointUrl(\n backupApiUrl,\n 'backupApiUrl',\n backupEndpointAllowedSuffixes(this.transport, this.authorizedEndpointSuffixes),\n )\n }\n\n /**\n * Sends a JSON GET request to the specified Computer Backup API endpoint.\n *\n * @param backupApiUrl - The Computer Backup API base URL.\n * @param authToken - The Partner authorization token.\n * @param endpoint - The Computer Backup API endpoint name.\n * @param query - The query-string parameters.\n * @param options - Optional abort and per-request retry settings.\n *\n * @returns The parsed JSON response.\n */\n private async getJson<T>(\n backupApiUrl: string,\n authToken: string,\n endpoint: string,\n query: QueryParams,\n options?: BackupRawRequestOptions,\n ): Promise<T> {\n const response = await this.transport.send({\n url: withQueryString(\n b2Url(this.safeBackupApiUrl(backupApiUrl), { ...BACKUP_API_V1, endpoint }),\n query,\n ),\n method: 'GET',\n headers: {\n Authorization: authToken,\n },\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n ...(options?.retry !== undefined ? { retry: options.retry } : {}),\n })\n return response.json<T>()\n }\n\n /**\n * Sends a JSON POST request to the specified Computer Backup API endpoint.\n *\n * @param backupApiUrl - The Computer Backup API base URL.\n * @param authToken - The Partner authorization token.\n * @param endpoint - The Computer Backup API endpoint name.\n * @param body - The JSON request body.\n * @param options - Optional abort and per-request retry settings.\n *\n * @returns The parsed JSON response.\n */\n private async postJson<T>(\n backupApiUrl: string,\n authToken: string,\n endpoint: string,\n body: unknown,\n options?: BackupRawRequestOptions,\n ): Promise<T> {\n const response = await this.transport.send({\n url: b2Url(this.safeBackupApiUrl(backupApiUrl), { ...BACKUP_API_V1, endpoint }),\n method: 'POST',\n headers: {\n Authorization: authToken,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n ...(options?.retry !== undefined ? { retry: options.retry } : {}),\n })\n return response.json<T>()\n }\n}\n"],"mappings":";;;AAiBA,IAAM,gBAAsC;CAAE,QAAQ;CAAc,SAAS;AAAK;AAqClF,SAAS,8BACP,WACA,oBACmB;CACnB,OAAO,qBAAA,wBAAwB,WAAW,oBAAoB;EAC5D,cACE;EACF,eACE;CACJ,CAAC;AACH;;;;;;;;;;AAWA,IAAa,kBAAb,MAA6B;;CAE3B;CACA;;;;;;CAOA,YAAY,SAAiC;EAC3C,KAAK,YAAY,QAAQ;EACzB,KAAK,6BAA6B,MAAM,KAAK,QAAQ,oCAAoC,CAAC,CAAC;CAC7F;;;;;;;;CASA,8BAA8B,UAAmC;EAC/D,KAAK,6BAA6B,MAAM,KAAK,QAAQ;CACvD;;;;;;;;;;;;;;;;CAiBA,MAAM,cACJ,cACA,WACA,SACA,SACgC;EAChC,OAAO,KAAK,QACV,cACA,WACA,qBACA;GACE,WAAW,QAAQ;GACnB,GAAI,QAAQ,oBAAoB,KAAA,IAC5B,EAAE,iBAAiB,QAAQ,gBAAgB,IAC3C,CAAC;GACL,GAAI,QAAQ,qBAAqB,KAAA,IAC7B,EAAE,kBAAkB,QAAQ,iBAAiB,IAC7C,CAAC;EACP,GACA,OACF;CACF;;;;;;;;;;;;;;;;CAiBA,MAAM,eACJ,cACA,WACA,SACA,SACiC;EACjC,OAAO,KAAK,SACV,cACA,WACA,sBACA;GACE,WAAW,QAAQ;GACnB,YAAY,QAAQ;EACtB,GACA,qBAAA,kCAAkC,OAAO,CAC3C;CACF;CAEA,iBAAyB,cAA8B;EACrD,OAAO,qBAAA,2BACL,cACA,gBACA,8BAA8B,KAAK,WAAW,KAAK,0BAA0B,CAC/E;CACF;;;;;;;;;;;;CAaA,MAAc,QACZ,cACA,WACA,UACA,OACA,SACY;EAaZ,QAAO,MAZgB,KAAK,UAAU,KAAK;GACzC,KAAK,qBAAA,gBACH,YAAA,MAAM,KAAK,iBAAiB,YAAY,GAAG;IAAE,GAAG;IAAe;GAAS,CAAC,GACzE,KACF;GACA,QAAQ;GACR,SAAS,EACP,eAAe,UACjB;GACA,GAAI,SAAS,WAAW,KAAA,IAAY,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;GAClE,GAAI,SAAS,UAAU,KAAA,IAAY,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;EACjE,CAAC,EAAA,CACe,KAAQ;CAC1B;;;;;;;;;;;;CAaA,MAAc,SACZ,cACA,WACA,UACA,MACA,SACY;EAYZ,QAAO,MAXgB,KAAK,UAAU,KAAK;GACzC,KAAK,YAAA,MAAM,KAAK,iBAAiB,YAAY,GAAG;IAAE,GAAG;IAAe;GAAS,CAAC;GAC9E,QAAQ;GACR,SAAS;IACP,eAAe;IACf,gBAAgB;GAClB;GACA,MAAM,KAAK,UAAU,IAAI;GACzB,GAAI,SAAS,WAAW,KAAA,IAAY,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;GAClE,GAAI,SAAS,UAAU,KAAA,IAAY,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;EACjE,CAAC,EAAA,CACe,KAAQ;CAC1B;AACF"}
1
+ {"version":3,"file":"raw.cjs","names":[],"sources":["../../src/backup/raw.ts"],"sourcesContent":["import type { BackupNonIdempotentMutationEndpoint } from '../http/non-idempotent-mutations.ts'\nimport type { RetryOptions } from '../http/retry.ts'\nimport type { HttpTransport } from '../http/transport.ts'\nimport {\n endpointAllowedSuffixes,\n nonRetryingMutationRequestOptions,\n type QueryParams,\n validatePartnerEndpointUrl,\n withQueryString,\n} from '../partner/endpoint-url.ts'\nimport { type B2EndpointUrlOptions, b2Url } from '../raw/url.ts'\nimport type {\n DeleteComputerRequest,\n DeleteComputerResponse,\n DeleteComputerResult,\n ListComputersRequest,\n ListComputersResponse,\n} from '../types/backup.ts'\n\nconst BACKUP_API: B2EndpointUrlOptions = { prefix: 'api/backup', version: 'v1' }\n\n/**\n * Normalizes the `bz_delete_computer` wire response to the array-shaped schema.\n *\n * The Backblaze apidocs response *schema* declares a JSON array, but the\n * accompanying *example* shows a single bare object. This tolerates both: an\n * array passes through unchanged, and a lone object is wrapped in a\n * single-element array, so callers always receive a {@link DeleteComputerResponse}\n * regardless of which shape live B2 returns.\n *\n * @param raw - The parsed `bz_delete_computer` JSON body.\n *\n * @returns The response as the canonical array shape.\n *\n * @throws TypeError When the body is neither an array nor an object.\n */\nfunction normalizeDeleteComputerResponse(raw: unknown): DeleteComputerResponse {\n if (Array.isArray(raw)) return raw as DeleteComputerResponse\n if (raw !== null && typeof raw === 'object') return [raw as DeleteComputerResult]\n throw new TypeError('bz_delete_computer returned an unexpected response body shape')\n}\n\n/** Configuration for constructing a {@link BackupRawClient}. */\nexport interface BackupRawClientOptions {\n /**\n * The HTTP transport used to send requests.\n *\n * Computer Backup endpoint calls validate URLs against suffixes recorded by\n * Partner authorization. A rehydrated client that skips authorization must\n * use `authorizedBackupEndpointSuffixes` or a transport with a locked\n * `urlGuard`. Because Partner authorize responses redact\n * `authorizationToken` under `JSON.stringify`, durable caches should persist\n * `partnerAuthorizeResponseForPersistence(auth)` only to encrypted or\n * otherwise credential-grade storage, or use another secure token-preserving\n * representation.\n */\n readonly transport: HttpTransport\n /**\n * Validated Computer Backup endpoint host suffixes restored from cached\n * Partner authorization. Facades normally manage this after authorization;\n * direct raw clients can pass trusted suffixes derived from\n * `derivePartnerAllowedSuffixes()`. Do not derive this cache with\n * `JSON.stringify(authorizePartner())`, which intentionally stores a redacted\n * token placeholder instead of a usable Partner token. Rehydrating that\n * placeholder fails fast.\n */\n readonly authorizedBackupEndpointSuffixes?: readonly string[]\n}\n\n/** Optional controls for raw Computer Backup API requests. */\nexport interface BackupRawRequestOptions {\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n /** Per-request retry override. */\n readonly retry?: Partial<RetryOptions>\n}\n\nfunction backupEndpointAllowedSuffixes(\n transport: HttpTransport,\n authorizedSuffixes: readonly string[],\n): readonly string[] {\n return endpointAllowedSuffixes(transport, authorizedSuffixes, {\n missingGuard:\n 'Computer Backup endpoint requests require BackupClient.authorize() or a locked URL guard before sending Partner tokens',\n unlockedGuard:\n 'Computer Backup endpoint requests require a locked URL guard before sending Partner tokens',\n })\n}\n\nfunction backupEndpointUrl(backupApiUrl: string, endpoint: string): string {\n return b2Url(backupApiUrl, { ...BACKUP_API, endpoint })\n}\n\n/**\n * Low-level client for Computer Backup API endpoint bindings.\n *\n * Each method maps directly to one `bz_*` HTTP call under the\n * `/api/backup/v1/` route using the `backupApiUrl` returned by Partner\n * authorization.\n *\n * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.\n */\nexport class BackupRawClient {\n /** @internal */\n private readonly transport: HttpTransport\n private authorizedEndpointSuffixes: readonly string[]\n\n /**\n * Creates a new BackupRawClient with the given transport.\n *\n * @param options - The constructor configuration.\n */\n constructor(options: BackupRawClientOptions) {\n this.transport = options.transport\n this.authorizedEndpointSuffixes = Array.from(options.authorizedBackupEndpointSuffixes ?? [])\n }\n\n /**\n * Replaces the validated Computer Backup endpoint host suffixes.\n *\n * @param suffixes - Host suffixes derived from Partner authorization.\n *\n * @internal\n */\n setAuthorizedEndpointSuffixes(suffixes: readonly string[]): void {\n this.authorizedEndpointSuffixes = Array.from(suffixes)\n }\n\n /**\n * Calls `bz_list_computers`.\n *\n * Uses the documented GET form. The wire response is a single JSON object\n * with a `nextComputerId` cursor and active computer backup records.\n *\n * @param backupApiUrl - The Computer Backup API base URL from `authorizePartner`.\n * @param authToken - The Partner authorization token.\n * @param request - The computer listing query parameters.\n * @param options - Optional abort and per-request retry settings.\n *\n * @returns The single-object computer backup wire response.\n *\n * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.\n */\n async listComputers(\n backupApiUrl: string,\n authToken: string,\n request: ListComputersRequest,\n options?: BackupRawRequestOptions,\n ): Promise<ListComputersResponse> {\n return this.getJson<ListComputersResponse>(\n backupApiUrl,\n authToken,\n 'bz_list_computers',\n {\n accountId: request.accountId,\n ...(request.startComputerId !== undefined\n ? { startComputerId: request.startComputerId }\n : {}),\n ...(request.maxComputerCount !== undefined\n ? { maxComputerCount: request.maxComputerCount }\n : {}),\n },\n options,\n )\n }\n\n /**\n * Calls `bz_delete_computer`.\n *\n * The documented wire response is a JSON array of deletion records. This\n * destructive mutation is not automatically retried or reauthorized in place.\n *\n * @param backupApiUrl - The Computer Backup API base URL from `authorizePartner`.\n * @param authToken - The Partner authorization token.\n * @param request - The computer deletion request body.\n * @param options - Optional abort and per-request retry settings.\n *\n * @returns The deleted computer backup record array.\n *\n * @experimental Computer Backup API surface; shape may change as the Backup API docs evolve.\n */\n async deleteComputer(\n backupApiUrl: string,\n authToken: string,\n request: DeleteComputerRequest,\n options?: BackupRawRequestOptions,\n ): Promise<DeleteComputerResponse> {\n const response = await this.postNonRetryingMutationJson<unknown>(\n backupApiUrl,\n authToken,\n 'bz_delete_computer',\n {\n accountId: request.accountId,\n computerId: request.computerId,\n },\n options,\n )\n return normalizeDeleteComputerResponse(response)\n }\n\n private safeBackupApiUrl(backupApiUrl: string): string {\n return validatePartnerEndpointUrl(\n backupApiUrl,\n 'backupApiUrl',\n backupEndpointAllowedSuffixes(this.transport, this.authorizedEndpointSuffixes),\n )\n }\n\n /**\n * Sends a JSON GET request to the specified Computer Backup API endpoint.\n *\n * @param backupApiUrl - The Computer Backup API base URL.\n * @param authToken - The Partner authorization token.\n * @param endpoint - The Computer Backup API endpoint name.\n * @param query - The query-string parameters.\n * @param options - Optional abort and per-request retry settings.\n *\n * @returns The parsed JSON response.\n */\n private async getJson<T>(\n backupApiUrl: string,\n authToken: string,\n endpoint: string,\n query: QueryParams,\n options?: BackupRawRequestOptions,\n ): Promise<T> {\n const response = await this.transport.send({\n url: withQueryString(backupEndpointUrl(this.safeBackupApiUrl(backupApiUrl), endpoint), query),\n method: 'GET',\n headers: {\n Authorization: authToken,\n },\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n ...(options?.retry !== undefined ? { retry: options.retry } : {}),\n })\n return response.json<T>()\n }\n\n /**\n * Sends a non-retrying JSON mutation POST request to the specified Computer Backup API endpoint.\n *\n * @param backupApiUrl - The Computer Backup API base URL.\n * @param authToken - The Partner authorization token.\n * @param endpoint - The Computer Backup API endpoint name.\n * @param body - The JSON request body.\n * @param options - Optional abort and per-request retry settings.\n *\n * @returns The parsed JSON response.\n */\n private async postNonRetryingMutationJson<T>(\n backupApiUrl: string,\n authToken: string,\n endpoint: BackupNonIdempotentMutationEndpoint,\n body: unknown,\n options?: BackupRawRequestOptions,\n ): Promise<T> {\n const requestOptions = nonRetryingMutationRequestOptions(options)\n const response = await this.transport.send({\n url: backupEndpointUrl(this.safeBackupApiUrl(backupApiUrl), endpoint),\n method: 'POST',\n headers: {\n Authorization: authToken,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n ...(requestOptions.signal !== undefined ? { signal: requestOptions.signal } : {}),\n ...(requestOptions.idempotent !== undefined ? { idempotent: requestOptions.idempotent } : {}),\n ...(requestOptions.retry !== undefined ? { retry: requestOptions.retry } : {}),\n })\n return response.json<T>()\n }\n}\n"],"mappings":";;;AAmBA,IAAM,aAAmC;CAAE,QAAQ;CAAc,SAAS;AAAK;;;;;;;;;;;;;;;;AAiB/E,SAAS,gCAAgC,KAAsC;CAC7E,IAAI,MAAM,QAAQ,GAAG,GAAG,OAAO;CAC/B,IAAI,QAAQ,QAAQ,OAAO,QAAQ,UAAU,OAAO,CAAC,GAA2B;CAChF,MAAM,IAAI,UAAU,+DAA+D;AACrF;AAqCA,SAAS,8BACP,WACA,oBACmB;CACnB,OAAO,qBAAA,wBAAwB,WAAW,oBAAoB;EAC5D,cACE;EACF,eACE;CACJ,CAAC;AACH;AAEA,SAAS,kBAAkB,cAAsB,UAA0B;CACzE,OAAO,YAAA,MAAM,cAAc;EAAE,GAAG;EAAY;CAAS,CAAC;AACxD;;;;;;;;;;AAWA,IAAa,kBAAb,MAA6B;;CAE3B;CACA;;;;;;CAOA,YAAY,SAAiC;EAC3C,KAAK,YAAY,QAAQ;EACzB,KAAK,6BAA6B,MAAM,KAAK,QAAQ,oCAAoC,CAAC,CAAC;CAC7F;;;;;;;;CASA,8BAA8B,UAAmC;EAC/D,KAAK,6BAA6B,MAAM,KAAK,QAAQ;CACvD;;;;;;;;;;;;;;;;CAiBA,MAAM,cACJ,cACA,WACA,SACA,SACgC;EAChC,OAAO,KAAK,QACV,cACA,WACA,qBACA;GACE,WAAW,QAAQ;GACnB,GAAI,QAAQ,oBAAoB,KAAA,IAC5B,EAAE,iBAAiB,QAAQ,gBAAgB,IAC3C,CAAC;GACL,GAAI,QAAQ,qBAAqB,KAAA,IAC7B,EAAE,kBAAkB,QAAQ,iBAAiB,IAC7C,CAAC;EACP,GACA,OACF;CACF;;;;;;;;;;;;;;;;CAiBA,MAAM,eACJ,cACA,WACA,SACA,SACiC;EAWjC,OAAO,gCAAgC,MAVhB,KAAK,4BAC1B,cACA,WACA,sBACA;GACE,WAAW,QAAQ;GACnB,YAAY,QAAQ;EACtB,GACA,OACF,CAC+C;CACjD;CAEA,iBAAyB,cAA8B;EACrD,OAAO,qBAAA,2BACL,cACA,gBACA,8BAA8B,KAAK,WAAW,KAAK,0BAA0B,CAC/E;CACF;;;;;;;;;;;;CAaA,MAAc,QACZ,cACA,WACA,UACA,OACA,SACY;EAUZ,QAAO,MATgB,KAAK,UAAU,KAAK;GACzC,KAAK,qBAAA,gBAAgB,kBAAkB,KAAK,iBAAiB,YAAY,GAAG,QAAQ,GAAG,KAAK;GAC5F,QAAQ;GACR,SAAS,EACP,eAAe,UACjB;GACA,GAAI,SAAS,WAAW,KAAA,IAAY,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;GAClE,GAAI,SAAS,UAAU,KAAA,IAAY,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;EACjE,CAAC,EAAA,CACe,KAAQ;CAC1B;;;;;;;;;;;;CAaA,MAAc,4BACZ,cACA,WACA,UACA,MACA,SACY;EACZ,MAAM,iBAAiB,qBAAA,kCAAkC,OAAO;EAahE,QAAO,MAZgB,KAAK,UAAU,KAAK;GACzC,KAAK,kBAAkB,KAAK,iBAAiB,YAAY,GAAG,QAAQ;GACpE,QAAQ;GACR,SAAS;IACP,eAAe;IACf,gBAAgB;GAClB;GACA,MAAM,KAAK,UAAU,IAAI;GACzB,GAAI,eAAe,WAAW,KAAA,IAAY,EAAE,QAAQ,eAAe,OAAO,IAAI,CAAC;GAC/E,GAAI,eAAe,eAAe,KAAA,IAAY,EAAE,YAAY,eAAe,WAAW,IAAI,CAAC;GAC3F,GAAI,eAAe,UAAU,KAAA,IAAY,EAAE,OAAO,eAAe,MAAM,IAAI,CAAC;EAC9E,CAAC,EAAA,CACe,KAAQ;CAC1B;AACF"}
@@ -107,7 +107,7 @@ export declare class BackupRawClient {
107
107
  */
108
108
  private getJson;
109
109
  /**
110
- * Sends a JSON POST request to the specified Computer Backup API endpoint.
110
+ * Sends a non-retrying JSON mutation POST request to the specified Computer Backup API endpoint.
111
111
  *
112
112
  * @param backupApiUrl - The Computer Backup API base URL.
113
113
  * @param authToken - The Partner authorization token.
@@ -117,6 +117,6 @@ export declare class BackupRawClient {
117
117
  *
118
118
  * @returns The parsed JSON response.
119
119
  */
120
- private postJson;
120
+ private postNonRetryingMutationJson;
121
121
  }
122
122
  //# sourceMappingURL=raw.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/backup/raw.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AASzD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,oBAAoB,CAAA;AAI3B,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9D;AAED,8DAA8D;AAC9D,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CACvC;AAcD;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC1B,gBAAgB;IAChB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,0BAA0B,CAAmB;IAErD;;;;OAIG;gBACS,OAAO,EAAE,sBAAsB;IAK3C;;;;;;OAMG;IACH,6BAA6B,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAIhE;;;;;;;;;;;;;;OAcG;IACG,aAAa,CACjB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,qBAAqB,CAAC;IAkBjC;;;;;;;;;;;;;;OAcG;IACG,cAAc,CAClB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAalC,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;;OAUG;YACW,OAAO;IAsBrB;;;;;;;;;;OAUG;YACW,QAAQ;CAoBvB"}
1
+ {"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/backup/raw.js"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AASzD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EAEtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,oBAAoB,CAAA;AAyB3B,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9D;AAED,8DAA8D;AAC9D,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CACvC;AAkBD;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC1B,gBAAgB;IAChB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,0BAA0B,CAAmB;IAErD;;;;OAIG;gBACS,OAAO,EAAE,sBAAsB;IAK3C;;;;;;OAMG;IACH,6BAA6B,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAIhE;;;;;;;;;;;;;;OAcG;IACG,aAAa,CACjB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,qBAAqB,CAAC;IAkBjC;;;;;;;;;;;;;;OAcG;IACG,cAAc,CAClB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAclC,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;;OAUG;YACW,OAAO;IAmBrB;;;;;;;;;;OAUG;YACW,2BAA2B;CAsB1C"}
@@ -107,7 +107,7 @@ export declare class BackupRawClient {
107
107
  */
108
108
  private getJson;
109
109
  /**
110
- * Sends a JSON POST request to the specified Computer Backup API endpoint.
110
+ * Sends a non-retrying JSON mutation POST request to the specified Computer Backup API endpoint.
111
111
  *
112
112
  * @param backupApiUrl - The Computer Backup API base URL.
113
113
  * @param authToken - The Partner authorization token.
@@ -117,6 +117,6 @@ export declare class BackupRawClient {
117
117
  *
118
118
  * @returns The parsed JSON response.
119
119
  */
120
- private postJson;
120
+ private postNonRetryingMutationJson;
121
121
  }
122
122
  //# sourceMappingURL=raw.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/backup/raw.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AASzD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,oBAAoB,CAAA;AAI3B,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9D;AAED,8DAA8D;AAC9D,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CACvC;AAcD;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC1B,gBAAgB;IAChB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,0BAA0B,CAAmB;IAErD;;;;OAIG;gBACS,OAAO,EAAE,sBAAsB;IAK3C;;;;;;OAMG;IACH,6BAA6B,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAIhE;;;;;;;;;;;;;;OAcG;IACG,aAAa,CACjB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,qBAAqB,CAAC;IAkBjC;;;;;;;;;;;;;;OAcG;IACG,cAAc,CAClB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAalC,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;;OAUG;YACW,OAAO;IAsBrB;;;;;;;;;;OAUG;YACW,QAAQ;CAoBvB"}
1
+ {"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/backup/raw.js"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AASzD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EAEtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,oBAAoB,CAAA;AAyB3B,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9D;AAED,8DAA8D;AAC9D,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CACvC;AAkBD;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC1B,gBAAgB;IAChB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,0BAA0B,CAAmB;IAErD;;;;OAIG;gBACS,OAAO,EAAE,sBAAsB;IAK3C;;;;;;OAMG;IACH,6BAA6B,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAIhE;;;;;;;;;;;;;;OAcG;IACG,aAAa,CACjB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,qBAAqB,CAAC;IAkBjC;;;;;;;;;;;;;;OAcG;IACG,cAAc,CAClB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAclC,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;;OAUG;YACW,OAAO;IAmBrB;;;;;;;;;;OAUG;YACW,2BAA2B;CAsB1C"}