@backblaze-labs/b2-sdk 0.1.0 → 0.2.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 (701) hide show
  1. package/CHANGELOG.md +110 -5
  2. package/README.md +144 -33
  3. package/dist/_virtual/_b2-sdk-version-json.cjs +4 -0
  4. package/dist/_virtual/_b2-sdk-version-json.js +4 -0
  5. package/dist/auth/account-info.d.cts +32 -0
  6. package/dist/auth/account-info.d.cts.map +1 -1
  7. package/dist/auth/account-info.d.ts +32 -0
  8. package/dist/auth/account-info.d.ts.map +1 -1
  9. package/dist/auth/file.cjs +408 -207
  10. package/dist/auth/file.cjs.map +1 -1
  11. package/dist/auth/file.d.cts +77 -3
  12. package/dist/auth/file.d.cts.map +1 -1
  13. package/dist/auth/file.d.ts +77 -3
  14. package/dist/auth/file.d.ts.map +1 -1
  15. package/dist/auth/file.js +407 -207
  16. package/dist/auth/file.js.map +1 -1
  17. package/dist/auth/in-memory.cjs +212 -183
  18. package/dist/auth/in-memory.cjs.map +1 -1
  19. package/dist/auth/in-memory.d.cts +8 -0
  20. package/dist/auth/in-memory.d.cts.map +1 -1
  21. package/dist/auth/in-memory.d.ts +8 -0
  22. package/dist/auth/in-memory.d.ts.map +1 -1
  23. package/dist/auth/in-memory.js +211 -182
  24. package/dist/auth/in-memory.js.map +1 -1
  25. package/dist/auth/index.cjs +7 -9
  26. package/dist/auth/index.d.cts +3 -2
  27. package/dist/auth/index.d.cts.map +1 -1
  28. package/dist/auth/index.d.ts +3 -2
  29. package/dist/auth/index.d.ts.map +1 -1
  30. package/dist/auth/index.js +2 -8
  31. package/dist/auth/realms.cjs +80 -7
  32. package/dist/auth/realms.cjs.map +1 -1
  33. package/dist/auth/realms.d.cts +27 -4
  34. package/dist/auth/realms.d.cts.map +1 -1
  35. package/dist/auth/realms.d.ts +27 -4
  36. package/dist/auth/realms.d.ts.map +1 -1
  37. package/dist/auth/realms.js +80 -9
  38. package/dist/auth/realms.js.map +1 -1
  39. package/dist/auth/upload-url-pool.cjs +55 -51
  40. package/dist/auth/upload-url-pool.cjs.map +1 -1
  41. package/dist/auth/upload-url-pool.js +55 -51
  42. package/dist/auth/upload-url-pool.js.map +1 -1
  43. package/dist/bucket.cjs +785 -787
  44. package/dist/bucket.cjs.map +1 -1
  45. package/dist/bucket.d.cts +35 -47
  46. package/dist/bucket.d.cts.map +1 -1
  47. package/dist/bucket.d.ts +35 -47
  48. package/dist/bucket.d.ts.map +1 -1
  49. package/dist/bucket.js +780 -782
  50. package/dist/bucket.js.map +1 -1
  51. package/dist/client.cjs +246 -228
  52. package/dist/client.cjs.map +1 -1
  53. package/dist/client.d.cts +25 -17
  54. package/dist/client.d.cts.map +1 -1
  55. package/dist/client.d.ts +25 -17
  56. package/dist/client.d.ts.map +1 -1
  57. package/dist/client.js +243 -225
  58. package/dist/client.js.map +1 -1
  59. package/dist/copy/large.cjs +114 -71
  60. package/dist/copy/large.cjs.map +1 -1
  61. package/dist/copy/large.d.cts +6 -0
  62. package/dist/copy/large.d.cts.map +1 -1
  63. package/dist/copy/large.d.ts +6 -0
  64. package/dist/copy/large.d.ts.map +1 -1
  65. package/dist/copy/large.js +112 -69
  66. package/dist/copy/large.js.map +1 -1
  67. package/dist/download/checksum.cjs +89 -0
  68. package/dist/download/checksum.cjs.map +1 -0
  69. package/dist/download/checksum.d.cts +40 -0
  70. package/dist/download/checksum.d.cts.map +1 -0
  71. package/dist/download/checksum.d.ts +40 -0
  72. package/dist/download/checksum.d.ts.map +1 -0
  73. package/dist/download/checksum.js +87 -0
  74. package/dist/download/checksum.js.map +1 -0
  75. package/dist/download/parallel.cjs +214 -118
  76. package/dist/download/parallel.cjs.map +1 -1
  77. package/dist/download/parallel.d.cts +5 -1
  78. package/dist/download/parallel.d.cts.map +1 -1
  79. package/dist/download/parallel.d.ts +5 -1
  80. package/dist/download/parallel.d.ts.map +1 -1
  81. package/dist/download/parallel.js +212 -116
  82. package/dist/download/parallel.js.map +1 -1
  83. package/dist/download/single.cjs +188 -97
  84. package/dist/download/single.cjs.map +1 -1
  85. package/dist/download/single.d.cts +6 -1
  86. package/dist/download/single.d.cts.map +1 -1
  87. package/dist/download/single.d.ts +6 -1
  88. package/dist/download/single.d.ts.map +1 -1
  89. package/dist/download/single.js +186 -98
  90. package/dist/download/single.js.map +1 -1
  91. package/dist/errors/index.cjs +699 -243
  92. package/dist/errors/index.cjs.map +1 -1
  93. package/dist/errors/index.d.cts +285 -82
  94. package/dist/errors/index.d.cts.map +1 -1
  95. package/dist/errors/index.d.ts +285 -82
  96. package/dist/errors/index.d.ts.map +1 -1
  97. package/dist/errors/index.js +678 -261
  98. package/dist/errors/index.js.map +1 -1
  99. package/dist/http/retry.cjs +45 -28
  100. package/dist/http/retry.cjs.map +1 -1
  101. package/dist/http/retry.d.cts +15 -2
  102. package/dist/http/retry.d.cts.map +1 -1
  103. package/dist/http/retry.d.ts +15 -2
  104. package/dist/http/retry.d.ts.map +1 -1
  105. package/dist/http/retry.js +46 -31
  106. package/dist/http/retry.js.map +1 -1
  107. package/dist/http/transport.cjs +438 -140
  108. package/dist/http/transport.cjs.map +1 -1
  109. package/dist/http/transport.d.cts +21 -2
  110. package/dist/http/transport.d.cts.map +1 -1
  111. package/dist/http/transport.d.ts +21 -2
  112. package/dist/http/transport.d.ts.map +1 -1
  113. package/dist/http/transport.js +437 -140
  114. package/dist/http/transport.js.map +1 -1
  115. package/dist/http/url-guard.cjs +154 -89
  116. package/dist/http/url-guard.cjs.map +1 -1
  117. package/dist/http/url-guard.d.cts +25 -3
  118. package/dist/http/url-guard.d.cts.map +1 -1
  119. package/dist/http/url-guard.d.ts +25 -3
  120. package/dist/http/url-guard.d.ts.map +1 -1
  121. package/dist/http/url-guard.js +152 -90
  122. package/dist/http/url-guard.js.map +1 -1
  123. package/dist/http/user-agent.cjs +84 -44
  124. package/dist/http/user-agent.cjs.map +1 -1
  125. package/dist/http/user-agent.js +84 -46
  126. package/dist/http/user-agent.js.map +1 -1
  127. package/dist/index.cjs +101 -77
  128. package/dist/index.d.cts +27 -21
  129. package/dist/index.d.cts.map +1 -1
  130. package/dist/index.d.ts +27 -21
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +15 -71
  133. package/dist/internal/b2-naming.cjs +66 -0
  134. package/dist/internal/b2-naming.cjs.map +1 -0
  135. package/dist/internal/b2-naming.d.cts +43 -0
  136. package/dist/internal/b2-naming.d.cts.map +1 -0
  137. package/dist/internal/b2-naming.d.ts +43 -0
  138. package/dist/internal/b2-naming.d.ts.map +1 -0
  139. package/dist/internal/b2-naming.js +60 -0
  140. package/dist/internal/b2-naming.js.map +1 -0
  141. package/dist/internal/upload-retry-options.cjs +21 -0
  142. package/dist/internal/upload-retry-options.cjs.map +1 -0
  143. package/dist/internal/upload-retry-options.d.cts +12 -0
  144. package/dist/internal/upload-retry-options.d.cts.map +1 -0
  145. package/dist/internal/upload-retry-options.d.ts +12 -0
  146. package/dist/internal/upload-retry-options.d.ts.map +1 -0
  147. package/dist/internal/upload-retry-options.js +21 -0
  148. package/dist/internal/upload-retry-options.js.map +1 -0
  149. package/dist/internal/url-redaction.cjs +31 -0
  150. package/dist/internal/url-redaction.cjs.map +1 -0
  151. package/dist/internal/url-redaction.d.cts +17 -0
  152. package/dist/internal/url-redaction.d.cts.map +1 -0
  153. package/dist/internal/url-redaction.d.ts +17 -0
  154. package/dist/internal/url-redaction.d.ts.map +1 -0
  155. package/dist/internal/url-redaction.js +31 -0
  156. package/dist/internal/url-redaction.js.map +1 -0
  157. package/dist/notifications/index.cjs +4 -6
  158. package/dist/notifications/index.d.cts +1 -1
  159. package/dist/notifications/index.d.cts.map +1 -1
  160. package/dist/notifications/index.d.ts +1 -1
  161. package/dist/notifications/index.d.ts.map +1 -1
  162. package/dist/notifications/index.js +1 -6
  163. package/dist/notifications/webhook.cjs +195 -85
  164. package/dist/notifications/webhook.cjs.map +1 -1
  165. package/dist/notifications/webhook.d.cts.map +1 -1
  166. package/dist/notifications/webhook.d.ts.map +1 -1
  167. package/dist/notifications/webhook.js +195 -87
  168. package/dist/notifications/webhook.js.map +1 -1
  169. package/dist/object.cjs +253 -210
  170. package/dist/object.cjs.map +1 -1
  171. package/dist/object.d.cts +9 -55
  172. package/dist/object.d.cts.map +1 -1
  173. package/dist/object.d.ts +9 -55
  174. package/dist/object.d.ts.map +1 -1
  175. package/dist/object.js +249 -206
  176. package/dist/object.js.map +1 -1
  177. package/dist/raw/encoding.cjs +74 -35
  178. package/dist/raw/encoding.cjs.map +1 -1
  179. package/dist/raw/encoding.js +74 -38
  180. package/dist/raw/encoding.js.map +1 -1
  181. package/dist/raw/index.cjs +678 -587
  182. package/dist/raw/index.cjs.map +1 -1
  183. package/dist/raw/index.d.cts +121 -18
  184. package/dist/raw/index.d.cts.map +1 -1
  185. package/dist/raw/index.d.ts +121 -18
  186. package/dist/raw/index.d.ts.map +1 -1
  187. package/dist/raw/index.js +674 -589
  188. package/dist/raw/index.js.map +1 -1
  189. package/dist/s3/index.cjs +355 -18
  190. package/dist/s3/index.cjs.map +1 -1
  191. package/dist/s3/index.d.cts +233 -5
  192. package/dist/s3/index.d.cts.map +1 -1
  193. package/dist/s3/index.d.ts +233 -5
  194. package/dist/s3/index.d.ts.map +1 -1
  195. package/dist/s3/index.js +351 -22
  196. package/dist/s3/index.js.map +1 -1
  197. package/dist/s3/sigv4.cjs +149 -0
  198. package/dist/s3/sigv4.cjs.map +1 -0
  199. package/dist/s3/sigv4.d.cts +43 -0
  200. package/dist/s3/sigv4.d.cts.map +1 -0
  201. package/dist/s3/sigv4.d.ts +43 -0
  202. package/dist/s3/sigv4.d.ts.map +1 -0
  203. package/dist/s3/sigv4.js +148 -0
  204. package/dist/s3/sigv4.js.map +1 -0
  205. package/dist/s3/validation.cjs +69 -0
  206. package/dist/s3/validation.cjs.map +1 -0
  207. package/dist/s3/validation.d.cts +43 -0
  208. package/dist/s3/validation.d.cts.map +1 -0
  209. package/dist/s3/validation.d.ts +43 -0
  210. package/dist/s3/validation.d.ts.map +1 -0
  211. package/dist/s3/validation.js +66 -0
  212. package/dist/s3/validation.js.map +1 -0
  213. package/dist/simulator/capabilities.cjs +63 -48
  214. package/dist/simulator/capabilities.cjs.map +1 -1
  215. package/dist/simulator/capabilities.js +63 -49
  216. package/dist/simulator/capabilities.js.map +1 -1
  217. package/dist/simulator/index.cjs +2124 -1548
  218. package/dist/simulator/index.cjs.map +1 -1
  219. package/dist/simulator/index.d.cts +79 -11
  220. package/dist/simulator/index.d.cts.map +1 -1
  221. package/dist/simulator/index.d.ts +79 -11
  222. package/dist/simulator/index.d.ts.map +1 -1
  223. package/dist/simulator/index.js +2112 -1546
  224. package/dist/simulator/index.js.map +1 -1
  225. package/dist/simulator/validation.cjs +191 -153
  226. package/dist/simulator/validation.cjs.map +1 -1
  227. package/dist/simulator/validation.d.cts +3 -21
  228. package/dist/simulator/validation.d.cts.map +1 -1
  229. package/dist/simulator/validation.d.ts +3 -21
  230. package/dist/simulator/validation.d.ts.map +1 -1
  231. package/dist/simulator/validation.js +188 -162
  232. package/dist/simulator/validation.js.map +1 -1
  233. package/dist/streams/collect.cjs +74 -24
  234. package/dist/streams/collect.cjs.map +1 -1
  235. package/dist/streams/collect.d.cts +14 -1
  236. package/dist/streams/collect.d.cts.map +1 -1
  237. package/dist/streams/collect.d.ts +14 -1
  238. package/dist/streams/collect.d.ts.map +1 -1
  239. package/dist/streams/collect.js +74 -25
  240. package/dist/streams/collect.js.map +1 -1
  241. package/dist/streams/file-source.cjs +287 -0
  242. package/dist/streams/file-source.cjs.map +1 -0
  243. package/dist/streams/file-source.d.cts +96 -0
  244. package/dist/streams/file-source.d.cts.map +1 -0
  245. package/dist/streams/file-source.d.ts +96 -0
  246. package/dist/streams/file-source.d.ts.map +1 -0
  247. package/dist/streams/file-source.js +286 -0
  248. package/dist/streams/file-source.js.map +1 -0
  249. package/dist/streams/hash.cjs +207 -115
  250. package/dist/streams/hash.cjs.map +1 -1
  251. package/dist/streams/hash.d.cts +5 -4
  252. package/dist/streams/hash.d.cts.map +1 -1
  253. package/dist/streams/hash.d.ts +5 -4
  254. package/dist/streams/hash.d.ts.map +1 -1
  255. package/dist/streams/hash.js +208 -95
  256. package/dist/streams/hash.js.map +1 -1
  257. package/dist/streams/index.cjs +12 -12
  258. package/dist/streams/index.d.cts +3 -3
  259. package/dist/streams/index.d.cts.map +1 -1
  260. package/dist/streams/index.d.ts +3 -3
  261. package/dist/streams/index.d.ts.map +1 -1
  262. package/dist/streams/index.js +2 -10
  263. package/dist/streams/progress.cjs +60 -46
  264. package/dist/streams/progress.cjs.map +1 -1
  265. package/dist/streams/progress.js +60 -46
  266. package/dist/streams/progress.js.map +1 -1
  267. package/dist/streams/source.cjs +316 -146
  268. package/dist/streams/source.cjs.map +1 -1
  269. package/dist/streams/source.d.cts +56 -18
  270. package/dist/streams/source.d.cts.map +1 -1
  271. package/dist/streams/source.d.ts +56 -18
  272. package/dist/streams/source.d.ts.map +1 -1
  273. package/dist/streams/source.js +312 -149
  274. package/dist/streams/source.js.map +1 -1
  275. package/dist/sync/actions/index.cjs +236 -184
  276. package/dist/sync/actions/index.cjs.map +1 -1
  277. package/dist/sync/actions/index.d.cts +29 -21
  278. package/dist/sync/actions/index.d.cts.map +1 -1
  279. package/dist/sync/actions/index.d.ts +29 -21
  280. package/dist/sync/actions/index.d.ts.map +1 -1
  281. package/dist/sync/actions/index.js +236 -190
  282. package/dist/sync/actions/index.js.map +1 -1
  283. package/dist/sync/b2-sha1-reader.cjs +148 -0
  284. package/dist/sync/b2-sha1-reader.cjs.map +1 -0
  285. package/dist/sync/b2-sha1-reader.d.cts +58 -0
  286. package/dist/sync/b2-sha1-reader.d.cts.map +1 -0
  287. package/dist/sync/b2-sha1-reader.d.ts +58 -0
  288. package/dist/sync/b2-sha1-reader.d.ts.map +1 -0
  289. package/dist/sync/b2-sha1-reader.js +145 -0
  290. package/dist/sync/b2-sha1-reader.js.map +1 -0
  291. package/dist/sync/download-staging.cjs +265 -0
  292. package/dist/sync/download-staging.cjs.map +1 -0
  293. package/dist/sync/download-staging.d.cts +54 -0
  294. package/dist/sync/download-staging.d.cts.map +1 -0
  295. package/dist/sync/download-staging.d.ts +54 -0
  296. package/dist/sync/download-staging.d.ts.map +1 -0
  297. package/dist/sync/download-staging.js +259 -0
  298. package/dist/sync/download-staging.js.map +1 -0
  299. package/dist/sync/filesystem-errors.cjs +32 -0
  300. package/dist/sync/filesystem-errors.cjs.map +1 -0
  301. package/dist/sync/filesystem-errors.d.cts +8 -0
  302. package/dist/sync/filesystem-errors.d.cts.map +1 -0
  303. package/dist/sync/filesystem-errors.d.ts +8 -0
  304. package/dist/sync/filesystem-errors.d.ts.map +1 -0
  305. package/dist/sync/filesystem-errors.js +32 -0
  306. package/dist/sync/filesystem-errors.js.map +1 -0
  307. package/dist/sync/filters.cjs +217 -0
  308. package/dist/sync/filters.cjs.map +1 -0
  309. package/dist/sync/filters.d.cts +51 -0
  310. package/dist/sync/filters.d.cts.map +1 -0
  311. package/dist/sync/filters.d.ts +51 -0
  312. package/dist/sync/filters.d.ts.map +1 -0
  313. package/dist/sync/filters.js +213 -0
  314. package/dist/sync/filters.js.map +1 -0
  315. package/dist/sync/index.cjs +39 -22
  316. package/dist/sync/index.d.cts +14 -9
  317. package/dist/sync/index.d.cts.map +1 -1
  318. package/dist/sync/index.d.ts +14 -9
  319. package/dist/sync/index.d.ts.map +1 -1
  320. package/dist/sync/index.js +9 -20
  321. package/dist/sync/local-file-identity.cjs +61 -0
  322. package/dist/sync/local-file-identity.cjs.map +1 -0
  323. package/dist/sync/local-file-identity.d.cts +37 -0
  324. package/dist/sync/local-file-identity.d.cts.map +1 -0
  325. package/dist/sync/local-file-identity.d.ts +37 -0
  326. package/dist/sync/local-file-identity.d.ts.map +1 -0
  327. package/dist/sync/local-file-identity.js +60 -0
  328. package/dist/sync/local-file-identity.js.map +1 -0
  329. package/dist/sync/local-file-io.cjs +364 -0
  330. package/dist/sync/local-file-io.cjs.map +1 -0
  331. package/dist/sync/local-file-io.d.cts +75 -0
  332. package/dist/sync/local-file-io.d.cts.map +1 -0
  333. package/dist/sync/local-file-io.d.ts +75 -0
  334. package/dist/sync/local-file-io.d.ts.map +1 -0
  335. package/dist/sync/local-file-io.js +360 -0
  336. package/dist/sync/local-file-io.js.map +1 -0
  337. package/dist/sync/local-filesystem-root.cjs +27 -0
  338. package/dist/sync/local-filesystem-root.cjs.map +1 -0
  339. package/dist/sync/local-filesystem-root.d.cts +18 -0
  340. package/dist/sync/local-filesystem-root.d.cts.map +1 -0
  341. package/dist/sync/local-filesystem-root.d.ts +18 -0
  342. package/dist/sync/local-filesystem-root.d.ts.map +1 -0
  343. package/dist/sync/local-filesystem-root.js +26 -0
  344. package/dist/sync/local-filesystem-root.js.map +1 -0
  345. package/dist/sync/local-sha1.cjs +119 -0
  346. package/dist/sync/local-sha1.cjs.map +1 -0
  347. package/dist/sync/local-sha1.d.cts +39 -0
  348. package/dist/sync/local-sha1.d.cts.map +1 -0
  349. package/dist/sync/local-sha1.d.ts +39 -0
  350. package/dist/sync/local-sha1.d.ts.map +1 -0
  351. package/dist/sync/local-sha1.js +117 -0
  352. package/dist/sync/local-sha1.js.map +1 -0
  353. package/dist/sync/pairing.cjs +118 -29
  354. package/dist/sync/pairing.cjs.map +1 -1
  355. package/dist/sync/pairing.d.cts +7 -2
  356. package/dist/sync/pairing.d.cts.map +1 -1
  357. package/dist/sync/pairing.d.ts +7 -2
  358. package/dist/sync/pairing.d.ts.map +1 -1
  359. package/dist/sync/pairing.js +120 -31
  360. package/dist/sync/pairing.js.map +1 -1
  361. package/dist/sync/path-order.cjs +30 -0
  362. package/dist/sync/path-order.cjs.map +1 -0
  363. package/dist/sync/path-order.d.cts +28 -0
  364. package/dist/sync/path-order.d.cts.map +1 -0
  365. package/dist/sync/path-order.d.ts +28 -0
  366. package/dist/sync/path-order.d.ts.map +1 -0
  367. package/dist/sync/path-order.js +29 -0
  368. package/dist/sync/path-order.js.map +1 -0
  369. package/dist/sync/path-safety.cjs +111 -0
  370. package/dist/sync/path-safety.cjs.map +1 -0
  371. package/dist/sync/path-safety.d.cts +78 -0
  372. package/dist/sync/path-safety.d.cts.map +1 -0
  373. package/dist/sync/path-safety.d.ts +78 -0
  374. package/dist/sync/path-safety.d.ts.map +1 -0
  375. package/dist/sync/path-safety.js +105 -0
  376. package/dist/sync/path-safety.js.map +1 -0
  377. package/dist/sync/paths.d.cts +19 -0
  378. package/dist/sync/paths.d.cts.map +1 -0
  379. package/dist/sync/paths.d.ts +19 -0
  380. package/dist/sync/paths.d.ts.map +1 -0
  381. package/dist/sync/policies/compare.cjs +389 -11
  382. package/dist/sync/policies/compare.cjs.map +1 -1
  383. package/dist/sync/policies/compare.d.cts +100 -2
  384. package/dist/sync/policies/compare.d.cts.map +1 -1
  385. package/dist/sync/policies/compare.d.ts +100 -2
  386. package/dist/sync/policies/compare.d.ts.map +1 -1
  387. package/dist/sync/policies/compare.js +387 -13
  388. package/dist/sync/policies/compare.js.map +1 -1
  389. package/dist/sync/policies/index.cjs +76 -65
  390. package/dist/sync/policies/index.cjs.map +1 -1
  391. package/dist/sync/policies/index.d.cts +35 -6
  392. package/dist/sync/policies/index.d.cts.map +1 -1
  393. package/dist/sync/policies/index.d.ts +35 -6
  394. package/dist/sync/policies/index.d.ts.map +1 -1
  395. package/dist/sync/policies/index.js +76 -65
  396. package/dist/sync/policies/index.js.map +1 -1
  397. package/dist/sync/prefix.cjs +96 -0
  398. package/dist/sync/prefix.cjs.map +1 -0
  399. package/dist/sync/prefix.d.cts +55 -0
  400. package/dist/sync/prefix.d.cts.map +1 -0
  401. package/dist/sync/prefix.d.ts +55 -0
  402. package/dist/sync/prefix.d.ts.map +1 -0
  403. package/dist/sync/prefix.js +92 -0
  404. package/dist/sync/prefix.js.map +1 -0
  405. package/dist/sync/regexp-safety.cjs +192 -0
  406. package/dist/sync/regexp-safety.cjs.map +1 -0
  407. package/dist/sync/regexp-safety.d.cts +29 -0
  408. package/dist/sync/regexp-safety.d.cts.map +1 -0
  409. package/dist/sync/regexp-safety.d.ts +29 -0
  410. package/dist/sync/regexp-safety.d.ts.map +1 -0
  411. package/dist/sync/regexp-safety.js +190 -0
  412. package/dist/sync/regexp-safety.js.map +1 -0
  413. package/dist/sync/scan-events.cjs +33 -0
  414. package/dist/sync/scan-events.cjs.map +1 -0
  415. package/dist/sync/scan-events.d.cts +17 -0
  416. package/dist/sync/scan-events.d.cts.map +1 -0
  417. package/dist/sync/scan-events.d.ts +17 -0
  418. package/dist/sync/scan-events.d.ts.map +1 -0
  419. package/dist/sync/scan-events.js +32 -0
  420. package/dist/sync/scan-events.js.map +1 -0
  421. package/dist/sync/scan-limit.cjs +33 -0
  422. package/dist/sync/scan-limit.cjs.map +1 -0
  423. package/dist/sync/scan-limit.d.cts +21 -0
  424. package/dist/sync/scan-limit.d.cts.map +1 -0
  425. package/dist/sync/scan-limit.d.ts +21 -0
  426. package/dist/sync/scan-limit.d.ts.map +1 -0
  427. package/dist/sync/scan-limit.js +31 -0
  428. package/dist/sync/scan-limit.js.map +1 -0
  429. package/dist/sync/scanners/b2.cjs +239 -55
  430. package/dist/sync/scanners/b2.cjs.map +1 -1
  431. package/dist/sync/scanners/b2.d.cts +26 -7
  432. package/dist/sync/scanners/b2.d.cts.map +1 -1
  433. package/dist/sync/scanners/b2.d.ts +26 -7
  434. package/dist/sync/scanners/b2.d.ts.map +1 -1
  435. package/dist/sync/scanners/b2.js +239 -55
  436. package/dist/sync/scanners/b2.js.map +1 -1
  437. package/dist/sync/scanners/local.cjs +215 -56
  438. package/dist/sync/scanners/local.cjs.map +1 -1
  439. package/dist/sync/scanners/local.d.cts +22 -7
  440. package/dist/sync/scanners/local.d.cts.map +1 -1
  441. package/dist/sync/scanners/local.d.ts +22 -7
  442. package/dist/sync/scanners/local.d.ts.map +1 -1
  443. package/dist/sync/scanners/local.js +216 -57
  444. package/dist/sync/scanners/local.js.map +1 -1
  445. package/dist/sync/sha1-metadata.cjs +94 -0
  446. package/dist/sync/sha1-metadata.cjs.map +1 -0
  447. package/dist/sync/sha1-metadata.d.cts +82 -0
  448. package/dist/sync/sha1-metadata.d.cts.map +1 -0
  449. package/dist/sync/sha1-metadata.d.ts +82 -0
  450. package/dist/sync/sha1-metadata.d.ts.map +1 -0
  451. package/dist/sync/sha1-metadata.js +89 -0
  452. package/dist/sync/sha1-metadata.js.map +1 -0
  453. package/dist/sync/sha1-options.cjs +23 -0
  454. package/dist/sync/sha1-options.cjs.map +1 -0
  455. package/dist/sync/sha1-options.d.cts +14 -0
  456. package/dist/sync/sha1-options.d.cts.map +1 -0
  457. package/dist/sync/sha1-options.d.ts +14 -0
  458. package/dist/sync/sha1-options.d.ts.map +1 -0
  459. package/dist/sync/sha1-options.js +21 -0
  460. package/dist/sync/sha1-options.js.map +1 -0
  461. package/dist/sync/synchronizer.cjs +782 -197
  462. package/dist/sync/synchronizer.cjs.map +1 -1
  463. package/dist/sync/synchronizer.d.cts +47 -1
  464. package/dist/sync/synchronizer.d.cts.map +1 -1
  465. package/dist/sync/synchronizer.d.ts +47 -1
  466. package/dist/sync/synchronizer.d.ts.map +1 -1
  467. package/dist/sync/synchronizer.js +779 -173
  468. package/dist/sync/synchronizer.js.map +1 -1
  469. package/dist/sync/types.d.cts +208 -16
  470. package/dist/sync/types.d.cts.map +1 -1
  471. package/dist/sync/types.d.ts +208 -16
  472. package/dist/sync/types.d.ts.map +1 -1
  473. package/dist/types/auth.cjs +76 -56
  474. package/dist/types/auth.cjs.map +1 -1
  475. package/dist/types/auth.d.cts +67 -9
  476. package/dist/types/auth.d.cts.map +1 -1
  477. package/dist/types/auth.d.ts +67 -9
  478. package/dist/types/auth.d.ts.map +1 -1
  479. package/dist/types/auth.js +77 -57
  480. package/dist/types/auth.js.map +1 -1
  481. package/dist/types/bucket.cjs +74 -38
  482. package/dist/types/bucket.cjs.map +1 -1
  483. package/dist/types/bucket.js +75 -41
  484. package/dist/types/bucket.js.map +1 -1
  485. package/dist/types/encryption.cjs +364 -327
  486. package/dist/types/encryption.cjs.map +1 -1
  487. package/dist/types/encryption.d.cts +16 -0
  488. package/dist/types/encryption.d.cts.map +1 -1
  489. package/dist/types/encryption.d.ts +16 -0
  490. package/dist/types/encryption.d.ts.map +1 -1
  491. package/dist/types/encryption.js +364 -310
  492. package/dist/types/encryption.js.map +1 -1
  493. package/dist/types/errors.cjs +47 -0
  494. package/dist/types/errors.cjs.map +1 -0
  495. package/dist/types/errors.d.cts +13 -4
  496. package/dist/types/errors.d.cts.map +1 -1
  497. package/dist/types/errors.d.ts +13 -4
  498. package/dist/types/errors.d.ts.map +1 -1
  499. package/dist/types/errors.js +47 -0
  500. package/dist/types/errors.js.map +1 -0
  501. package/dist/types/file.cjs +36 -19
  502. package/dist/types/file.cjs.map +1 -1
  503. package/dist/types/file.d.cts +2 -2
  504. package/dist/types/file.d.cts.map +1 -1
  505. package/dist/types/file.d.ts +2 -2
  506. package/dist/types/file.d.ts.map +1 -1
  507. package/dist/types/file.js +37 -21
  508. package/dist/types/file.js.map +1 -1
  509. package/dist/types/ids.cjs +53 -9
  510. package/dist/types/ids.cjs.map +1 -1
  511. package/dist/types/ids.js +54 -15
  512. package/dist/types/ids.js.map +1 -1
  513. package/dist/types/index.d.cts +12 -11
  514. package/dist/types/index.d.cts.map +1 -1
  515. package/dist/types/index.d.ts +12 -11
  516. package/dist/types/index.d.ts.map +1 -1
  517. package/dist/types/key.d.cts +44 -8
  518. package/dist/types/key.d.cts.map +1 -1
  519. package/dist/types/key.d.ts +44 -8
  520. package/dist/types/key.d.ts.map +1 -1
  521. package/dist/types/lock.cjs +33 -13
  522. package/dist/types/lock.cjs.map +1 -1
  523. package/dist/types/lock.js +34 -15
  524. package/dist/types/lock.js.map +1 -1
  525. package/dist/types/notifications.cjs +44 -22
  526. package/dist/types/notifications.cjs.map +1 -1
  527. package/dist/types/notifications.js +45 -23
  528. package/dist/types/notifications.js.map +1 -1
  529. package/dist/types/upload.d.cts +39 -5
  530. package/dist/types/upload.d.cts.map +1 -1
  531. package/dist/types/upload.d.ts +39 -5
  532. package/dist/types/upload.d.ts.map +1 -1
  533. package/dist/upload/abort-scope.cjs +91 -0
  534. package/dist/upload/abort-scope.cjs.map +1 -0
  535. package/dist/upload/abort-scope.d.cts +48 -0
  536. package/dist/upload/abort-scope.d.cts.map +1 -0
  537. package/dist/upload/abort-scope.d.ts +48 -0
  538. package/dist/upload/abort-scope.d.ts.map +1 -0
  539. package/dist/upload/abort-scope.js +88 -0
  540. package/dist/upload/abort-scope.js.map +1 -0
  541. package/dist/upload/cancel.cjs +183 -8
  542. package/dist/upload/cancel.cjs.map +1 -1
  543. package/dist/upload/cancel.d.cts +110 -2
  544. package/dist/upload/cancel.d.cts.map +1 -1
  545. package/dist/upload/cancel.d.ts +110 -2
  546. package/dist/upload/cancel.d.ts.map +1 -1
  547. package/dist/upload/cancel.js +178 -9
  548. package/dist/upload/cancel.js.map +1 -1
  549. package/dist/upload/concurrency.cjs +79 -52
  550. package/dist/upload/concurrency.cjs.map +1 -1
  551. package/dist/upload/concurrency.js +79 -53
  552. package/dist/upload/concurrency.js.map +1 -1
  553. package/dist/upload/finish.cjs +59 -0
  554. package/dist/upload/finish.cjs.map +1 -0
  555. package/dist/upload/finish.d.cts +26 -0
  556. package/dist/upload/finish.d.cts.map +1 -0
  557. package/dist/upload/finish.d.ts +26 -0
  558. package/dist/upload/finish.d.ts.map +1 -0
  559. package/dist/upload/finish.js +59 -0
  560. package/dist/upload/finish.js.map +1 -0
  561. package/dist/upload/large.cjs +301 -218
  562. package/dist/upload/large.cjs.map +1 -1
  563. package/dist/upload/large.d.cts +76 -9
  564. package/dist/upload/large.d.cts.map +1 -1
  565. package/dist/upload/large.d.ts +76 -9
  566. package/dist/upload/large.d.ts.map +1 -1
  567. package/dist/upload/large.js +301 -218
  568. package/dist/upload/large.js.map +1 -1
  569. package/dist/upload/options.cjs +28 -0
  570. package/dist/upload/options.cjs.map +1 -0
  571. package/dist/upload/options.d.cts +104 -0
  572. package/dist/upload/options.d.cts.map +1 -0
  573. package/dist/upload/options.d.ts +104 -0
  574. package/dist/upload/options.d.ts.map +1 -0
  575. package/dist/upload/options.js +27 -0
  576. package/dist/upload/options.js.map +1 -0
  577. package/dist/upload/resume.cjs +333 -33
  578. package/dist/upload/resume.cjs.map +1 -1
  579. package/dist/upload/resume.d.cts +82 -12
  580. package/dist/upload/resume.d.cts.map +1 -1
  581. package/dist/upload/resume.d.ts +82 -12
  582. package/dist/upload/resume.d.ts.map +1 -1
  583. package/dist/upload/resume.js +330 -33
  584. package/dist/upload/resume.js.map +1 -1
  585. package/dist/upload/retry.cjs +186 -0
  586. package/dist/upload/retry.cjs.map +1 -0
  587. package/dist/upload/retry.d.cts +127 -0
  588. package/dist/upload/retry.d.cts.map +1 -0
  589. package/dist/upload/retry.d.ts +127 -0
  590. package/dist/upload/retry.d.ts.map +1 -0
  591. package/dist/upload/retry.js +182 -0
  592. package/dist/upload/retry.js.map +1 -0
  593. package/dist/upload/single.cjs +68 -44
  594. package/dist/upload/single.cjs.map +1 -1
  595. package/dist/upload/single.d.cts +2 -1
  596. package/dist/upload/single.d.cts.map +1 -1
  597. package/dist/upload/single.d.ts +2 -1
  598. package/dist/upload/single.d.ts.map +1 -1
  599. package/dist/upload/single.js +68 -44
  600. package/dist/upload/single.js.map +1 -1
  601. package/dist/upload/stream.cjs +317 -193
  602. package/dist/upload/stream.cjs.map +1 -1
  603. package/dist/upload/stream.d.cts +3 -1
  604. package/dist/upload/stream.d.cts.map +1 -1
  605. package/dist/upload/stream.d.ts +3 -1
  606. package/dist/upload/stream.d.ts.map +1 -1
  607. package/dist/upload/stream.js +316 -192
  608. package/dist/upload/stream.js.map +1 -1
  609. package/dist/util/best-effort.cjs +42 -8
  610. package/dist/util/best-effort.cjs.map +1 -1
  611. package/dist/util/best-effort.d.cts +2 -1
  612. package/dist/util/best-effort.d.cts.map +1 -1
  613. package/dist/util/best-effort.d.ts +2 -1
  614. package/dist/util/best-effort.d.ts.map +1 -1
  615. package/dist/util/best-effort.js +43 -9
  616. package/dist/util/best-effort.js.map +1 -1
  617. package/dist/util/bytes.cjs +23 -0
  618. package/dist/util/bytes.cjs.map +1 -0
  619. package/dist/util/bytes.d.cts +15 -0
  620. package/dist/util/bytes.d.cts.map +1 -0
  621. package/dist/util/bytes.d.ts +15 -0
  622. package/dist/util/bytes.d.ts.map +1 -0
  623. package/dist/util/bytes.js +23 -0
  624. package/dist/util/bytes.js.map +1 -0
  625. package/dist/util/crypto.cjs +68 -0
  626. package/dist/util/crypto.cjs.map +1 -0
  627. package/dist/util/crypto.d.cts +26 -0
  628. package/dist/util/crypto.d.cts.map +1 -0
  629. package/dist/util/crypto.d.ts +26 -0
  630. package/dist/util/crypto.d.ts.map +1 -0
  631. package/dist/util/crypto.js +66 -0
  632. package/dist/util/crypto.js.map +1 -0
  633. package/dist/util/defaults.cjs +25 -9
  634. package/dist/util/defaults.cjs.map +1 -1
  635. package/dist/util/defaults.js +26 -11
  636. package/dist/util/defaults.js.map +1 -1
  637. package/dist/util/error-reason.cjs +41 -0
  638. package/dist/util/error-reason.cjs.map +1 -0
  639. package/dist/util/error-reason.d.cts +9 -0
  640. package/dist/util/error-reason.d.cts.map +1 -0
  641. package/dist/util/error-reason.d.ts +9 -0
  642. package/dist/util/error-reason.d.ts.map +1 -0
  643. package/dist/util/error-reason.js +41 -0
  644. package/dist/util/error-reason.js.map +1 -0
  645. package/dist/util/http.cjs +23 -0
  646. package/dist/util/http.cjs.map +1 -0
  647. package/dist/util/http.d.cts +13 -0
  648. package/dist/util/http.d.cts.map +1 -0
  649. package/dist/util/http.d.ts +13 -0
  650. package/dist/util/http.d.ts.map +1 -0
  651. package/dist/util/http.js +23 -0
  652. package/dist/util/http.js.map +1 -0
  653. package/dist/util/normalize.cjs +66 -7
  654. package/dist/util/normalize.cjs.map +1 -1
  655. package/dist/util/normalize.js +67 -10
  656. package/dist/util/normalize.js.map +1 -1
  657. package/dist/util/paginator.cjs +63 -14
  658. package/dist/util/paginator.cjs.map +1 -1
  659. package/dist/util/paginator.js +64 -16
  660. package/dist/util/paginator.js.map +1 -1
  661. package/dist/util/plan-ranges.cjs +47 -22
  662. package/dist/util/plan-ranges.cjs.map +1 -1
  663. package/dist/util/plan-ranges.js +48 -24
  664. package/dist/util/plan-ranges.js.map +1 -1
  665. package/dist/util/sha1.cjs +27 -0
  666. package/dist/util/sha1.cjs.map +1 -0
  667. package/dist/util/sha1.d.cts +17 -0
  668. package/dist/util/sha1.d.cts.map +1 -0
  669. package/dist/util/sha1.d.ts +17 -0
  670. package/dist/util/sha1.d.ts.map +1 -0
  671. package/dist/util/sha1.js +26 -0
  672. package/dist/util/sha1.js.map +1 -0
  673. package/dist/util/text-codec.cjs +29 -5
  674. package/dist/util/text-codec.cjs.map +1 -1
  675. package/dist/util/text-codec.js +30 -7
  676. package/dist/util/text-codec.js.map +1 -1
  677. package/dist/util/to-error.cjs +18 -4
  678. package/dist/util/to-error.cjs.map +1 -1
  679. package/dist/util/to-error.js +19 -5
  680. package/dist/util/to-error.js.map +1 -1
  681. package/dist/version.cjs +17 -5
  682. package/dist/version.cjs.map +1 -1
  683. package/dist/version.d.cts +3 -3
  684. package/dist/version.d.ts +3 -3
  685. package/dist/version.js +19 -6
  686. package/dist/version.js.map +1 -1
  687. package/package.json +19 -16
  688. package/dist/auth/index.cjs.map +0 -1
  689. package/dist/auth/index.js.map +0 -1
  690. package/dist/index.cjs.map +0 -1
  691. package/dist/index.js.map +0 -1
  692. package/dist/notifications/index.cjs.map +0 -1
  693. package/dist/notifications/index.js.map +0 -1
  694. package/dist/package.json.cjs +0 -9
  695. package/dist/package.json.cjs.map +0 -1
  696. package/dist/package.json.js +0 -9
  697. package/dist/package.json.js.map +0 -1
  698. package/dist/streams/index.cjs.map +0 -1
  699. package/dist/streams/index.js.map +0 -1
  700. package/dist/sync/index.cjs.map +0 -1
  701. package/dist/sync/index.js.map +0 -1
package/dist/raw/index.js CHANGED
@@ -1,601 +1,686 @@
1
- import { normalizeFileVersionSha1, normalizeFileVersionListSha1 } from "../util/normalize.js";
2
- import { buildFileInfoHeaders, encodeFileName } from "./encoding.js";
3
- import { decodeFileName, parseFileInfoHeaders } from "./encoding.js";
4
- import { EncryptionMode, EncryptionAlgorithm } from "../types/encryption.js";
5
- class RawClient {
6
- /** @internal */
7
- transport;
8
- /**
9
- * Creates a new RawClient with the given transport.
10
- * @param options - The constructor configuration.
11
- */
12
- constructor(options) {
13
- this.transport = options.transport;
14
- }
15
- // --- Auth ---
16
- /**
17
- * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.
18
- * @param applicationKeyId - The application key ID for authentication.
19
- * @param applicationKey - The application key secret.
20
- * @param realmUrl - The B2 realm URL to authenticate against.
21
- *
22
- * @returns The authorization response with API URLs and credentials.
23
- */
24
- async authorizeAccount(applicationKeyId, applicationKey, realmUrl = "https://api.backblazeb2.com") {
25
- const response = await this.transport.send({
26
- url: `${realmUrl}/b2api/v3/b2_authorize_account`,
27
- method: "GET",
28
- headers: {
29
- Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}`
30
- }
31
- });
32
- return response.json();
33
- }
34
- // --- Buckets ---
35
- /**
36
- * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.
37
- * @param apiUrl - The B2 API base URL.
38
- * @param authToken - The authorization token.
39
- * @param request - The API request parameters.
40
- *
41
- * @returns The created bucket metadata.
42
- */
43
- async createBucket(apiUrl, authToken, request) {
44
- return this.postJson(apiUrl, authToken, "b2_create_bucket", request);
45
- }
46
- /**
47
- * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.
48
- * @param apiUrl - The B2 API base URL.
49
- * @param authToken - The authorization token.
50
- * @param request - The API request parameters.
51
- *
52
- * @returns The deleted bucket metadata.
53
- */
54
- async deleteBucket(apiUrl, authToken, request) {
55
- return this.postJson(apiUrl, authToken, "b2_delete_bucket", request);
56
- }
57
- /**
58
- * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.
59
- * @param apiUrl - The B2 API base URL.
60
- * @param authToken - The authorization token.
61
- * @param request - The API request parameters.
62
- *
63
- * @returns The list of matching buckets.
64
- */
65
- async listBuckets(apiUrl, authToken, request) {
66
- return this.postJson(apiUrl, authToken, "b2_list_buckets", request);
67
- }
68
- /**
69
- * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.
70
- * @param apiUrl - The B2 API base URL.
71
- * @param authToken - The authorization token.
72
- * @param request - The API request parameters.
73
- *
74
- * @returns The updated bucket metadata.
75
- */
76
- async updateBucket(apiUrl, authToken, request) {
77
- return this.postJson(apiUrl, authToken, "b2_update_bucket", request);
78
- }
79
- // --- Files ---
80
- /**
81
- * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-url | b2_get_upload_url}.
82
- * @param apiUrl - The B2 API base URL.
83
- * @param authToken - The authorization token.
84
- * @param request - The API request parameters.
85
- *
86
- * @returns The upload URL and authorization token.
87
- */
88
- async getUploadUrl(apiUrl, authToken, request) {
89
- return this.postJson(apiUrl, authToken, "b2_get_upload_url", request);
90
- }
91
- /**
92
- * Calls {@link https://www.backblaze.com/apidocs/b2-upload-file | b2_upload_file}.
93
- *
94
- * Unlike most methods, this posts directly to the `uploadUrl` obtained
95
- * from {@link getUploadUrl} rather than the API URL.
96
- * @param uploadUrl - The upload endpoint URL.
97
- * @param headers - The request headers including authorization and content metadata.
98
- * @param body - The file data to upload.
99
- * @param signal - An optional abort signal for cancellation.
100
- *
101
- * @returns The uploaded file version metadata.
102
- */
103
- async uploadFile(uploadUrl, headers, body, signal) {
104
- const reqHeaders = {
105
- Authorization: headers.authorization,
106
- "X-Bz-File-Name": encodeFileName(headers.fileName),
107
- "Content-Type": headers.contentType,
108
- "Content-Length": String(headers.contentLength),
109
- "X-Bz-Content-Sha1": headers.contentSha1,
110
- ...buildFileInfoHeaders(headers.fileInfo)
111
- };
112
- if (headers.lastModifiedMillis !== void 0) {
113
- reqHeaders["X-Bz-Info-src_last_modified_millis"] = String(headers.lastModifiedMillis);
114
- }
115
- if (headers.contentDisposition) {
116
- reqHeaders["X-Bz-Info-b2-content-disposition"] = headers.contentDisposition;
117
- }
118
- if (headers.contentLanguage) {
119
- reqHeaders["X-Bz-Info-b2-content-language"] = headers.contentLanguage;
120
- }
121
- if (headers.expires) {
122
- reqHeaders["X-Bz-Info-b2-expires"] = headers.expires;
123
- }
124
- if (headers.cacheControl) {
125
- reqHeaders["X-Bz-Info-b2-cache-control"] = headers.cacheControl;
126
- }
127
- if (headers.contentEncoding) {
128
- reqHeaders["X-Bz-Info-b2-content-encoding"] = headers.contentEncoding;
129
- }
130
- applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);
131
- applyRetentionHeaders(reqHeaders, headers.fileRetention);
132
- applyLegalHoldHeader(reqHeaders, headers.legalHold);
133
- const response = await this.transport.send({
134
- url: uploadUrl,
135
- method: "POST",
136
- headers: reqHeaders,
137
- body,
138
- ...signal !== void 0 ? { signal } : {}
139
- });
140
- return normalizeFileVersionSha1(await response.json());
141
- }
142
- /**
143
- * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.
144
- * @param apiUrl - The B2 API base URL.
145
- * @param authToken - The authorization token.
146
- * @param request - The API request parameters.
147
- *
148
- * @returns The list of file names and optional continuation token.
149
- */
150
- async listFileNames(apiUrl, authToken, request) {
151
- return normalizeFileVersionListSha1(
152
- await this.postJson(apiUrl, authToken, "b2_list_file_names", request)
153
- );
154
- }
155
- /**
156
- * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.
157
- * @param apiUrl - The B2 API base URL.
158
- * @param authToken - The authorization token.
159
- * @param request - The API request parameters.
160
- *
161
- * @returns The list of file versions and optional continuation token.
162
- */
163
- async listFileVersions(apiUrl, authToken, request) {
164
- return normalizeFileVersionListSha1(
165
- await this.postJson(
166
- apiUrl,
167
- authToken,
168
- "b2_list_file_versions",
169
- request
170
- )
171
- );
172
- }
173
- /**
174
- * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.
175
- * @param apiUrl - The B2 API base URL.
176
- * @param authToken - The authorization token.
177
- * @param request - The API request parameters.
178
- *
179
- * @returns The file version metadata.
180
- */
181
- async getFileInfo(apiUrl, authToken, request) {
182
- return normalizeFileVersionSha1(
183
- await this.postJson(apiUrl, authToken, "b2_get_file_info", request)
184
- );
185
- }
186
- /**
187
- * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.
188
- * @param apiUrl - The B2 API base URL.
189
- * @param authToken - The authorization token.
190
- * @param request - The API request parameters.
191
- *
192
- * @returns The hidden file version metadata.
193
- */
194
- async hideFile(apiUrl, authToken, request) {
195
- return normalizeFileVersionSha1(
196
- await this.postJson(apiUrl, authToken, "b2_hide_file", request)
197
- );
198
- }
199
- /**
200
- * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.
201
- * @param apiUrl - The B2 API base URL.
202
- * @param authToken - The authorization token.
203
- * @param request - The API request parameters.
204
- *
205
- * @returns The deleted file version identifier.
206
- */
207
- async deleteFileVersion(apiUrl, authToken, request) {
208
- return this.postJson(
209
- apiUrl,
210
- authToken,
211
- "b2_delete_file_version",
212
- request
213
- );
214
- }
215
- /**
216
- * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.
217
- * @param apiUrl - The B2 API base URL.
218
- * @param authToken - The authorization token.
219
- * @param request - The API request parameters.
220
- *
221
- * @returns The copied file version metadata.
222
- */
223
- async copyFile(apiUrl, authToken, request) {
224
- return normalizeFileVersionSha1(
225
- await this.postJson(apiUrl, authToken, "b2_copy_file", request)
226
- );
227
- }
228
- /**
229
- * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.
230
- * @param apiUrl - The B2 API base URL.
231
- * @param authToken - The authorization token.
232
- * @param request - The API request parameters.
233
- *
234
- * @returns The copied part metadata.
235
- */
236
- async copyPart(apiUrl, authToken, request) {
237
- return this.postJson(apiUrl, authToken, "b2_copy_part", request);
238
- }
239
- // --- Large Files ---
240
- /**
241
- * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.
242
- * @param apiUrl - The B2 API base URL.
243
- * @param authToken - The authorization token.
244
- * @param request - The API request parameters.
245
- *
246
- * @returns The started large file metadata with file ID.
247
- */
248
- async startLargeFile(apiUrl, authToken, request) {
249
- return this.postJson(apiUrl, authToken, "b2_start_large_file", request);
250
- }
251
- /**
252
- * Calls {@link https://www.backblaze.com/apidocs/b2-get-upload-part-url | b2_get_upload_part_url}.
253
- * @param apiUrl - The B2 API base URL.
254
- * @param authToken - The authorization token.
255
- * @param request - The API request parameters.
256
- *
257
- * @returns The upload part URL and authorization token.
258
- */
259
- async getUploadPartUrl(apiUrl, authToken, request) {
260
- return this.postJson(
261
- apiUrl,
262
- authToken,
263
- "b2_get_upload_part_url",
264
- request
265
- );
266
- }
267
- /**
268
- * Calls {@link https://www.backblaze.com/apidocs/b2-upload-part | b2_upload_part}.
269
- *
270
- * Posts directly to the `uploadUrl` obtained from {@link getUploadPartUrl}
271
- * rather than the API URL.
272
- * @param uploadUrl - The upload endpoint URL.
273
- * @param headers - The request headers including authorization and content metadata.
274
- * @param body - The file data to upload.
275
- * @param signal - An optional abort signal for cancellation.
276
- *
277
- * @returns The uploaded part metadata.
278
- */
279
- async uploadPart(uploadUrl, headers, body, signal) {
280
- const reqHeaders = {
281
- Authorization: headers.authorization,
282
- "X-Bz-Part-Number": String(headers.partNumber),
283
- "Content-Length": String(headers.contentLength),
284
- "X-Bz-Content-Sha1": headers.contentSha1
285
- };
286
- applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);
287
- const response = await this.transport.send({
288
- url: uploadUrl,
289
- method: "POST",
290
- headers: reqHeaders,
291
- body,
292
- ...signal !== void 0 ? { signal } : {}
293
- });
294
- return response.json();
295
- }
296
- /**
297
- * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.
298
- * @param apiUrl - The B2 API base URL.
299
- * @param authToken - The authorization token.
300
- * @param request - The API request parameters.
301
- *
302
- * @returns The completed file version metadata.
303
- */
304
- async finishLargeFile(apiUrl, authToken, request) {
305
- return normalizeFileVersionSha1(
306
- await this.postJson(apiUrl, authToken, "b2_finish_large_file", request)
307
- );
308
- }
309
- /**
310
- * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.
311
- * @param apiUrl - The B2 API base URL.
312
- * @param authToken - The authorization token.
313
- * @param request - The API request parameters.
314
- *
315
- * @returns The cancelled large file metadata.
316
- */
317
- async cancelLargeFile(apiUrl, authToken, request) {
318
- return this.postJson(
319
- apiUrl,
320
- authToken,
321
- "b2_cancel_large_file",
322
- request
323
- );
324
- }
325
- /**
326
- * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.
327
- * @param apiUrl - The B2 API base URL.
328
- * @param authToken - The authorization token.
329
- * @param request - The API request parameters.
330
- *
331
- * @returns The list of unfinished large files and optional continuation token.
332
- */
333
- async listUnfinishedLargeFiles(apiUrl, authToken, request) {
334
- return this.postJson(
335
- apiUrl,
336
- authToken,
337
- "b2_list_unfinished_large_files",
338
- request
339
- );
340
- }
341
- /**
342
- * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.
343
- * @param apiUrl - The B2 API base URL.
344
- * @param authToken - The authorization token.
345
- * @param request - The API request parameters.
346
- *
347
- * @returns The list of uploaded parts and optional continuation token.
348
- */
349
- async listParts(apiUrl, authToken, request) {
350
- return this.postJson(apiUrl, authToken, "b2_list_parts", request);
351
- }
352
- // --- Downloads ---
353
- /**
354
- * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.
355
- * @param downloadUrl - The B2 download base URL.
356
- * @param authToken - The authorization token.
357
- * @param fileId - The unique identifier of the file to download.
358
- * @param options - Optional download parameters for range requests and cancellation.
359
- *
360
- * @returns The response headers, streaming body, and HTTP status code.
361
- */
362
- async downloadFileById(downloadUrl, authToken, fileId, options) {
363
- const headers = buildDownloadRequestHeaders(authToken, options);
364
- const url = appendDownloadOverrides(
365
- `${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`,
366
- options
367
- );
368
- const response = await this.transport.send({
369
- url,
370
- method: options?.method ?? "GET",
371
- headers,
372
- ...options?.signal !== void 0 ? { signal: options.signal } : {}
373
- });
374
- return { headers: response.headers, body: response.body, status: response.status };
375
- }
376
- /**
377
- * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.
378
- * @param downloadUrl - The B2 download base URL.
379
- * @param authToken - The authorization token.
380
- * @param bucketName - The name of the bucket containing the file.
381
- * @param fileName - The name of the file to download.
382
- * @param options - Optional download parameters for range requests and cancellation.
383
- *
384
- * @returns The response headers, streaming body, and HTTP status code.
385
- */
386
- async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {
387
- const headers = buildDownloadRequestHeaders(authToken, options);
388
- const url = appendDownloadOverrides(
389
- `${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`,
390
- options
391
- );
392
- const response = await this.transport.send({
393
- url,
394
- method: options?.method ?? "GET",
395
- headers,
396
- ...options?.signal !== void 0 ? { signal: options.signal } : {}
397
- });
398
- return { headers: response.headers, body: response.body, status: response.status };
399
- }
400
- /**
401
- * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.
402
- * @param apiUrl - The B2 API base URL.
403
- * @param authToken - The current session authorization token.
404
- * @param request - The API request parameters.
405
- *
406
- * @returns The download authorization token for the specified file prefix.
407
- */
408
- async getDownloadAuthorization(apiUrl, authToken, request) {
409
- return this.postJson(
410
- apiUrl,
411
- authToken,
412
- "b2_get_download_authorization",
413
- request
414
- );
415
- }
416
- // --- Keys ---
417
- /**
418
- * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.
419
- * @param apiUrl - The B2 API base URL.
420
- * @param authToken - The authorization token.
421
- * @param request - The API request parameters.
422
- *
423
- * @returns The newly created application key with secret.
424
- */
425
- async createKey(apiUrl, authToken, request) {
426
- return this.postJson(apiUrl, authToken, "b2_create_key", request);
427
- }
428
- /**
429
- * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.
430
- * @param apiUrl - The B2 API base URL.
431
- * @param authToken - The authorization token.
432
- * @param request - The API request parameters.
433
- *
434
- * @returns The list of application keys and optional continuation token.
435
- */
436
- async listKeys(apiUrl, authToken, request) {
437
- return this.postJson(apiUrl, authToken, "b2_list_keys", request);
438
- }
439
- /**
440
- * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.
441
- * @param apiUrl - The B2 API base URL.
442
- * @param authToken - The authorization token.
443
- * @param request - The API request parameters.
444
- *
445
- * @returns The deleted application key metadata.
446
- */
447
- async deleteKey(apiUrl, authToken, request) {
448
- return this.postJson(apiUrl, authToken, "b2_delete_key", request);
449
- }
450
- // --- Retention / Legal Hold ---
451
- /**
452
- * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.
453
- * @param apiUrl - The B2 API base URL.
454
- * @param authToken - The authorization token.
455
- * @param request - The API request parameters.
456
- *
457
- * @returns The updated file retention settings.
458
- */
459
- async updateFileRetention(apiUrl, authToken, request) {
460
- return this.postJson(
461
- apiUrl,
462
- authToken,
463
- "b2_update_file_retention",
464
- request
465
- );
466
- }
467
- /**
468
- * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.
469
- * @param apiUrl - The B2 API base URL.
470
- * @param authToken - The authorization token.
471
- * @param request - The API request parameters.
472
- *
473
- * @returns The updated file legal hold status.
474
- */
475
- async updateFileLegalHold(apiUrl, authToken, request) {
476
- return this.postJson(
477
- apiUrl,
478
- authToken,
479
- "b2_update_file_legal_hold",
480
- request
481
- );
482
- }
483
- // --- Notifications ---
484
- /**
485
- * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.
486
- * @param apiUrl - The B2 API base URL.
487
- * @param authToken - The authorization token.
488
- * @param request - The API request parameters.
489
- *
490
- * @returns The configured event notification rules for the specified bucket.
491
- */
492
- async getBucketNotificationRules(apiUrl, authToken, request) {
493
- return this.postJson(
494
- apiUrl,
495
- authToken,
496
- "b2_get_bucket_notification_rules",
497
- request
498
- );
499
- }
500
- /**
501
- * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.
502
- * @param apiUrl - The B2 API base URL.
503
- * @param authToken - The authorization token.
504
- * @param request - The API request parameters.
505
- *
506
- * @returns The updated bucket notification rules.
507
- */
508
- async setBucketNotificationRules(apiUrl, authToken, request) {
509
- return this.postJson(
510
- apiUrl,
511
- authToken,
512
- "b2_set_bucket_notification_rules",
513
- request
514
- );
515
- }
516
- // --- Internal ---
517
- /**
518
- * Sends a JSON POST request to the specified B2 API endpoint.
519
- * @param apiUrl - The B2 API base URL.
520
- * @param authToken - The authorization token.
521
- * @param endpoint - The B2 API endpoint name.
522
- * @param body - The JSON request body.
523
- *
524
- * @returns The parsed JSON response.
525
- */
526
- async postJson(apiUrl, authToken, endpoint, body) {
527
- const response = await this.transport.send({
528
- url: `${apiUrl}/b2api/v3/${endpoint}`,
529
- method: "POST",
530
- headers: {
531
- Authorization: authToken,
532
- "Content-Type": "application/json"
533
- },
534
- body: JSON.stringify(body)
535
- });
536
- return response.json();
537
- }
1
+ import { FinishLargeFileResponseBodyError, UploadResponseBodyError } from "../errors/index.js";
2
+ import { buildFileInfoHeaders, decodeFileName, encodeFileName, parseFileInfoHeaders } from "./encoding.js";
3
+ import { normalizeFileVersionListSha1, normalizeFileVersionSha1 } from "../util/normalize.js";
4
+ import { EncryptionAlgorithm, EncryptionMode } from "../types/encryption.js";
5
+ import { assertSecureRealmUrl } from "../auth/realms.js";
6
+ //#region src/raw/index.ts
7
+ /**
8
+ * Low-level 1:1 bindings for every B2 native API endpoint.
9
+ *
10
+ * Each method on {@link RawClient} maps directly to a single `b2_*` HTTP call
11
+ * with fully typed request and response objects. No retry logic, no URL pooling,
12
+ * no automatic reauthorization. Use this when you need precise control over
13
+ * individual API calls; for most use cases prefer the high-level `B2Client`.
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+ function normalizeRawRequestOptions(optionsOrSignal, retry) {
18
+ if (optionsOrSignal === void 0) return retry === void 0 ? void 0 : { retry };
19
+ if (isAbortSignal(optionsOrSignal)) return {
20
+ signal: optionsOrSignal,
21
+ ...retry !== void 0 ? { retry } : {}
22
+ };
23
+ return retry === void 0 ? optionsOrSignal : {
24
+ ...optionsOrSignal,
25
+ retry
26
+ };
538
27
  }
28
+ function isAbortSignal(value) {
29
+ return typeof value === "object" && value !== null && "aborted" in value && typeof value.addEventListener === "function";
30
+ }
31
+ function normalizeCreateKeyRequest(request) {
32
+ const { bucketId, ...withoutDeprecatedBucketId } = request;
33
+ if (bucketId !== void 0 && withoutDeprecatedBucketId.bucketIds !== void 0) throw new TypeError("createKey accepts either bucketIds or deprecated bucketId, not both");
34
+ if (bucketId === void 0) return withoutDeprecatedBucketId;
35
+ return {
36
+ ...withoutDeprecatedBucketId,
37
+ bucketIds: [bucketId]
38
+ };
39
+ }
40
+ function singleBucketId(bucketIds) {
41
+ return bucketIds?.length === 1 ? bucketIds[0] ?? null : null;
42
+ }
43
+ function normalizeKeyResponse(key) {
44
+ return {
45
+ ...key,
46
+ bucketId: singleBucketId(key.bucketIds)
47
+ };
48
+ }
49
+ function normalizeAllowedBuckets(storageApi) {
50
+ const allowed = storageApi.allowed;
51
+ if (allowed?.buckets !== void 0) return allowed.buckets === null ? null : allowed.buckets.map((bucket) => ({ ...bucket }));
52
+ const bucketId = allowed?.bucketId ?? storageApi.bucketId ?? null;
53
+ if (bucketId === null) return null;
54
+ return [{
55
+ id: bucketId,
56
+ name: allowed?.bucketName ?? storageApi.bucketName ?? null
57
+ }];
58
+ }
59
+ function normalizeAuthorizeAccountResponse(response) {
60
+ const storageApi = response.apiInfo.storageApi;
61
+ const allowed = storageApi.allowed;
62
+ const buckets = normalizeAllowedBuckets(storageApi);
63
+ const singleBucket = buckets?.length === 1 ? buckets[0] : void 0;
64
+ const bucketId = singleBucket?.id ?? null;
65
+ const bucketName = singleBucket?.name ?? null;
66
+ const namePrefix = allowed?.namePrefix ?? storageApi.namePrefix ?? null;
67
+ const capabilities = allowed?.capabilities ?? storageApi.capabilities ?? [];
68
+ const { allowed: _wireAllowed, capabilities: _legacyCapabilities, ...storageApiBase } = storageApi;
69
+ return {
70
+ ...response,
71
+ apiInfo: {
72
+ ...response.apiInfo,
73
+ storageApi: {
74
+ ...storageApiBase,
75
+ bucketId,
76
+ bucketName,
77
+ downloadUrl: storageApi.downloadUrl,
78
+ infoType: "storageApi",
79
+ namePrefix,
80
+ allowed: {
81
+ ...allowed ?? {},
82
+ capabilities,
83
+ buckets,
84
+ bucketId,
85
+ bucketName,
86
+ namePrefix
87
+ }
88
+ }
89
+ }
90
+ };
91
+ }
92
+ function uploadResponseBodyError(err, signal) {
93
+ if (signal?.aborted === true) throw signal.reason ?? new DOMException("Aborted", "AbortError");
94
+ return new UploadResponseBodyError(err instanceof Error ? err.message : "Upload response body could not be read", { cause: err });
95
+ }
96
+ /**
97
+ * Low-level client providing 1:1 bindings to all B2 native API endpoints.
98
+ *
99
+ * Each method maps directly to a single B2 API call. Most methods accept
100
+ * `(apiUrl, authToken, request)` and return the JSON response. Upload and
101
+ * download methods accept endpoint-specific parameters instead.
102
+ */
103
+ var RawClient = class {
104
+ /** @internal */
105
+ transport;
106
+ /**
107
+ * Creates a new RawClient with the given transport.
108
+ * @param options - The constructor configuration.
109
+ */
110
+ constructor(options) {
111
+ this.transport = options.transport;
112
+ }
113
+ /**
114
+ * Calls {@link https://www.backblaze.com/apidocs/b2-authorize-account | b2_authorize_account}.
115
+ * @param applicationKeyId - The application key ID for authentication.
116
+ * @param applicationKey - The application key secret.
117
+ * @param realmUrl - The B2 realm URL to authenticate against.
118
+ *
119
+ * @returns The authorization response with API URLs and credentials.
120
+ */
121
+ async authorizeAccount(applicationKeyId, applicationKey, realmUrl = "https://api.backblazeb2.com") {
122
+ assertSecureRealmUrl(realmUrl);
123
+ return normalizeAuthorizeAccountResponse(await (await this.transport.send({
124
+ url: `${realmUrl}/b2api/v4/b2_authorize_account`,
125
+ method: "GET",
126
+ headers: { Authorization: `Basic ${btoa(`${applicationKeyId}:${applicationKey}`)}` }
127
+ })).json());
128
+ }
129
+ /**
130
+ * Calls {@link https://www.backblaze.com/apidocs/b2-create-bucket | b2_create_bucket}.
131
+ * @param apiUrl - The B2 API base URL.
132
+ * @param authToken - The authorization token.
133
+ * @param request - The API request parameters.
134
+ *
135
+ * @returns The created bucket metadata.
136
+ */
137
+ async createBucket(apiUrl, authToken, request) {
138
+ return this.postJson(apiUrl, authToken, "b2_create_bucket", request);
139
+ }
140
+ /**
141
+ * Calls {@link https://www.backblaze.com/apidocs/b2-delete-bucket | b2_delete_bucket}.
142
+ * @param apiUrl - The B2 API base URL.
143
+ * @param authToken - The authorization token.
144
+ * @param request - The API request parameters.
145
+ *
146
+ * @returns The deleted bucket metadata.
147
+ */
148
+ async deleteBucket(apiUrl, authToken, request) {
149
+ return this.postJson(apiUrl, authToken, "b2_delete_bucket", request);
150
+ }
151
+ /**
152
+ * Calls {@link https://www.backblaze.com/apidocs/b2-list-buckets | b2_list_buckets}.
153
+ * @param apiUrl - The B2 API base URL.
154
+ * @param authToken - The authorization token.
155
+ * @param request - The API request parameters.
156
+ *
157
+ * @returns The list of matching buckets.
158
+ */
159
+ async listBuckets(apiUrl, authToken, request) {
160
+ return this.postJson(apiUrl, authToken, "b2_list_buckets", request);
161
+ }
162
+ /**
163
+ * Calls {@link https://www.backblaze.com/apidocs/b2-update-bucket | b2_update_bucket}.
164
+ * @param apiUrl - The B2 API base URL.
165
+ * @param authToken - The authorization token.
166
+ * @param request - The API request parameters.
167
+ *
168
+ * @returns The updated bucket metadata.
169
+ */
170
+ async updateBucket(apiUrl, authToken, request) {
171
+ return this.postJson(apiUrl, authToken, "b2_update_bucket", request);
172
+ }
173
+ /**
174
+ * Implementation for both upload URL request-control signatures.
175
+ * @param apiUrl - The B2 API base URL.
176
+ * @param authToken - The authorization token.
177
+ * @param request - The API request parameters.
178
+ * @param optionsOrSignal - Options bag or legacy abort signal.
179
+ * @param retry - Optional legacy per-request retry override.
180
+ *
181
+ * @returns The upload URL and authorization token.
182
+ */
183
+ async getUploadUrl(apiUrl, authToken, request, optionsOrSignal, retry) {
184
+ return this.postJson(apiUrl, authToken, "b2_get_upload_url", request, normalizeRawRequestOptions(optionsOrSignal, retry));
185
+ }
186
+ /**
187
+ * Implementation for both upload-file request-control signatures.
188
+ * @param uploadUrl - The upload endpoint URL.
189
+ * @param headers - The request headers including authorization and content metadata.
190
+ * @param body - The file data to upload.
191
+ * @param optionsOrSignal - Options bag or legacy abort signal.
192
+ * @param retry - Optional legacy per-request retry override.
193
+ *
194
+ * @returns The uploaded file version metadata.
195
+ */
196
+ async uploadFile(uploadUrl, headers, body, optionsOrSignal, retry) {
197
+ const options = normalizeRawRequestOptions(optionsOrSignal, retry);
198
+ const reqHeaders = {
199
+ Authorization: headers.authorization,
200
+ "X-Bz-File-Name": encodeFileName(headers.fileName),
201
+ "Content-Type": headers.contentType,
202
+ "Content-Length": String(headers.contentLength),
203
+ "X-Bz-Content-Sha1": headers.contentSha1,
204
+ ...buildFileInfoHeaders(headers.fileInfo)
205
+ };
206
+ if (headers.lastModifiedMillis !== void 0) reqHeaders["X-Bz-Info-src_last_modified_millis"] = String(headers.lastModifiedMillis);
207
+ if (headers.contentDisposition) reqHeaders["X-Bz-Info-b2-content-disposition"] = headers.contentDisposition;
208
+ if (headers.contentLanguage) reqHeaders["X-Bz-Info-b2-content-language"] = headers.contentLanguage;
209
+ if (headers.expires) reqHeaders["X-Bz-Info-b2-expires"] = headers.expires;
210
+ if (headers.cacheControl) reqHeaders["X-Bz-Info-b2-cache-control"] = headers.cacheControl;
211
+ if (headers.contentEncoding) reqHeaders["X-Bz-Info-b2-content-encoding"] = headers.contentEncoding;
212
+ applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);
213
+ applyRetentionHeaders(reqHeaders, headers.fileRetention);
214
+ applyLegalHoldHeader(reqHeaders, headers.legalHold);
215
+ const response = await this.transport.send({
216
+ url: uploadUrl,
217
+ method: "POST",
218
+ headers: reqHeaders,
219
+ body,
220
+ ...options?.signal !== void 0 ? { signal: options.signal } : {},
221
+ ...options?.retry !== void 0 ? { retry: options.retry } : {}
222
+ });
223
+ try {
224
+ return normalizeFileVersionSha1(await response.json());
225
+ } catch (err) {
226
+ throw uploadResponseBodyError(err, options?.signal);
227
+ }
228
+ }
229
+ /**
230
+ * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-names | b2_list_file_names}.
231
+ * @param apiUrl - The B2 API base URL.
232
+ * @param authToken - The authorization token.
233
+ * @param request - The API request parameters.
234
+ * @param options - Optional request controls such as an abort signal.
235
+ *
236
+ * @returns The list of file names and optional continuation token.
237
+ */
238
+ async listFileNames(apiUrl, authToken, request, options) {
239
+ return normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, "b2_list_file_names", request, options));
240
+ }
241
+ /**
242
+ * Calls {@link https://www.backblaze.com/apidocs/b2-list-file-versions | b2_list_file_versions}.
243
+ * @param apiUrl - The B2 API base URL.
244
+ * @param authToken - The authorization token.
245
+ * @param request - The API request parameters.
246
+ * @param options - Optional request controls such as an abort signal.
247
+ *
248
+ * @returns The list of file versions and optional continuation token.
249
+ */
250
+ async listFileVersions(apiUrl, authToken, request, options) {
251
+ return normalizeFileVersionListSha1(await this.postJson(apiUrl, authToken, "b2_list_file_versions", request, options));
252
+ }
253
+ /**
254
+ * Calls {@link https://www.backblaze.com/apidocs/b2-get-file-info | b2_get_file_info}.
255
+ * @param apiUrl - The B2 API base URL.
256
+ * @param authToken - The authorization token.
257
+ * @param request - The API request parameters.
258
+ *
259
+ * @returns The file version metadata.
260
+ */
261
+ async getFileInfo(apiUrl, authToken, request) {
262
+ return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_get_file_info", request));
263
+ }
264
+ /**
265
+ * Calls {@link https://www.backblaze.com/apidocs/b2-hide-file | b2_hide_file}.
266
+ * @param apiUrl - The B2 API base URL.
267
+ * @param authToken - The authorization token.
268
+ * @param request - The API request parameters.
269
+ * @param options - Optional request controls such as an abort signal.
270
+ *
271
+ * @returns The hidden file version metadata.
272
+ */
273
+ async hideFile(apiUrl, authToken, request, options) {
274
+ return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_hide_file", request, options));
275
+ }
276
+ /**
277
+ * Calls {@link https://www.backblaze.com/apidocs/b2-delete-file-version | b2_delete_file_version}.
278
+ * @param apiUrl - The B2 API base URL.
279
+ * @param authToken - The authorization token.
280
+ * @param request - The API request parameters.
281
+ * @param options - Optional request controls such as an abort signal.
282
+ *
283
+ * @returns The deleted file version identifier.
284
+ */
285
+ async deleteFileVersion(apiUrl, authToken, request, options) {
286
+ return this.postJson(apiUrl, authToken, "b2_delete_file_version", request, options);
287
+ }
288
+ /**
289
+ * Calls {@link https://www.backblaze.com/apidocs/b2-copy-file | b2_copy_file}.
290
+ * @param apiUrl - The B2 API base URL.
291
+ * @param authToken - The authorization token.
292
+ * @param request - The API request parameters.
293
+ * @param options - Optional request controls such as an abort signal.
294
+ *
295
+ * @returns The copied file version metadata.
296
+ */
297
+ async copyFile(apiUrl, authToken, request, options) {
298
+ return normalizeFileVersionSha1(await this.postJson(apiUrl, authToken, "b2_copy_file", request, options));
299
+ }
300
+ /**
301
+ * Calls {@link https://www.backblaze.com/apidocs/b2-copy-part | b2_copy_part}.
302
+ * @param apiUrl - The B2 API base URL.
303
+ * @param authToken - The authorization token.
304
+ * @param request - The API request parameters.
305
+ * @param options - Optional abort and retry controls.
306
+ *
307
+ * @returns The copied part metadata.
308
+ */
309
+ async copyPart(apiUrl, authToken, request, options) {
310
+ return this.postJson(apiUrl, authToken, "b2_copy_part", request, options);
311
+ }
312
+ /**
313
+ * Calls {@link https://www.backblaze.com/apidocs/b2-start-large-file | b2_start_large_file}.
314
+ * @param apiUrl - The B2 API base URL.
315
+ * @param authToken - The authorization token.
316
+ * @param request - The API request parameters.
317
+ * @param options - Optional abort and retry controls.
318
+ *
319
+ * @returns The started large file metadata with file ID.
320
+ */
321
+ async startLargeFile(apiUrl, authToken, request, options) {
322
+ return this.postJson(apiUrl, authToken, "b2_start_large_file", request, options);
323
+ }
324
+ /**
325
+ * Implementation for both upload part URL request-control signatures.
326
+ * @param apiUrl - The B2 API base URL.
327
+ * @param authToken - The authorization token.
328
+ * @param request - The API request parameters.
329
+ * @param optionsOrSignal - Options bag or legacy abort signal.
330
+ * @param retry - Optional legacy per-request retry override.
331
+ *
332
+ * @returns The upload part URL and authorization token.
333
+ */
334
+ async getUploadPartUrl(apiUrl, authToken, request, optionsOrSignal, retry) {
335
+ return this.postJson(apiUrl, authToken, "b2_get_upload_part_url", request, normalizeRawRequestOptions(optionsOrSignal, retry));
336
+ }
337
+ /**
338
+ * Implementation for both upload-part request-control signatures.
339
+ * @param uploadUrl - The upload endpoint URL.
340
+ * @param headers - The request headers including authorization and content metadata.
341
+ * @param body - The file data to upload.
342
+ * @param optionsOrSignal - Options bag or legacy abort signal.
343
+ * @param retry - Optional legacy per-request retry override.
344
+ *
345
+ * @returns The uploaded part metadata.
346
+ */
347
+ async uploadPart(uploadUrl, headers, body, optionsOrSignal, retry) {
348
+ const options = normalizeRawRequestOptions(optionsOrSignal, retry);
349
+ const reqHeaders = {
350
+ Authorization: headers.authorization,
351
+ "X-Bz-Part-Number": String(headers.partNumber),
352
+ "Content-Length": String(headers.contentLength),
353
+ "X-Bz-Content-Sha1": headers.contentSha1
354
+ };
355
+ applyEncryptionHeaders(reqHeaders, headers.serverSideEncryption);
356
+ const response = await this.transport.send({
357
+ url: uploadUrl,
358
+ method: "POST",
359
+ headers: reqHeaders,
360
+ body,
361
+ ...options?.signal !== void 0 ? { signal: options.signal } : {},
362
+ ...options?.retry !== void 0 ? { retry: options.retry } : {}
363
+ });
364
+ try {
365
+ return await response.json();
366
+ } catch (err) {
367
+ throw uploadResponseBodyError(err, options?.signal);
368
+ }
369
+ }
370
+ /**
371
+ * Calls {@link https://www.backblaze.com/apidocs/b2-finish-large-file | b2_finish_large_file}.
372
+ * @param apiUrl - The B2 API base URL.
373
+ * @param authToken - The authorization token.
374
+ * @param request - The API request parameters.
375
+ * @param options - Optional abort and retry controls.
376
+ *
377
+ * @returns The completed file version metadata.
378
+ */
379
+ async finishLargeFile(apiUrl, authToken, request, options) {
380
+ const response = await this.transport.send({
381
+ url: `${apiUrl}/b2api/v3/b2_finish_large_file`,
382
+ method: "POST",
383
+ headers: {
384
+ Authorization: authToken,
385
+ "Content-Type": "application/json"
386
+ },
387
+ body: JSON.stringify(request),
388
+ ...options?.signal !== void 0 ? { signal: options.signal } : {},
389
+ ...options?.retry !== void 0 ? { retry: options.retry } : {}
390
+ });
391
+ let fileVersion;
392
+ try {
393
+ fileVersion = await response.json();
394
+ } catch (err) {
395
+ throw new FinishLargeFileResponseBodyError(err instanceof Error ? err.message : "Finish large file response body could not be read", {
396
+ cause: err,
397
+ fileId: request.fileId
398
+ });
399
+ }
400
+ return normalizeFileVersionSha1(fileVersion);
401
+ }
402
+ /**
403
+ * Calls {@link https://www.backblaze.com/apidocs/b2-cancel-large-file | b2_cancel_large_file}.
404
+ * @param apiUrl - The B2 API base URL.
405
+ * @param authToken - The authorization token.
406
+ * @param request - The API request parameters.
407
+ * @param options - Optional request controls such as cancellation and retry overrides.
408
+ *
409
+ * @returns The cancelled large file metadata.
410
+ */
411
+ async cancelLargeFile(apiUrl, authToken, request, options) {
412
+ return this.postJson(apiUrl, authToken, "b2_cancel_large_file", request, options);
413
+ }
414
+ /**
415
+ * Calls {@link https://www.backblaze.com/apidocs/b2-list-unfinished-large-files | b2_list_unfinished_large_files}.
416
+ * @param apiUrl - The B2 API base URL.
417
+ * @param authToken - The authorization token.
418
+ * @param request - The API request parameters.
419
+ * @param options - Optional request controls such as cancellation and retry.
420
+ *
421
+ * @returns The list of unfinished large files and optional continuation token.
422
+ */
423
+ async listUnfinishedLargeFiles(apiUrl, authToken, request, options) {
424
+ return this.postJson(apiUrl, authToken, "b2_list_unfinished_large_files", request, options);
425
+ }
426
+ /**
427
+ * Calls {@link https://www.backblaze.com/apidocs/b2-list-parts | b2_list_parts}.
428
+ * @param apiUrl - The B2 API base URL.
429
+ * @param authToken - The authorization token.
430
+ * @param request - The API request parameters.
431
+ * @param options - Optional request controls such as cancellation and retry.
432
+ *
433
+ * @returns The list of uploaded parts and optional continuation token.
434
+ */
435
+ async listParts(apiUrl, authToken, request, options) {
436
+ return this.postJson(apiUrl, authToken, "b2_list_parts", request, options);
437
+ }
438
+ /**
439
+ * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-id | b2_download_file_by_id}.
440
+ * @param downloadUrl - The B2 download base URL.
441
+ * @param authToken - The authorization token.
442
+ * @param fileId - The unique identifier of the file to download.
443
+ * @param options - Optional download parameters for range requests and cancellation.
444
+ *
445
+ * @returns The response headers, streaming body, and HTTP status code.
446
+ */
447
+ async downloadFileById(downloadUrl, authToken, fileId, options) {
448
+ const headers = buildDownloadRequestHeaders(authToken, options);
449
+ const url = appendDownloadOverrides(`${downloadUrl}/b2api/v3/b2_download_file_by_id?fileId=${encodeURIComponent(fileId)}`, options);
450
+ const response = await this.transport.send({
451
+ url,
452
+ method: options?.method ?? "GET",
453
+ headers,
454
+ ...options?.signal !== void 0 ? { signal: options.signal } : {}
455
+ });
456
+ return {
457
+ headers: response.headers,
458
+ body: response.body,
459
+ status: response.status
460
+ };
461
+ }
462
+ /**
463
+ * Calls {@link https://www.backblaze.com/apidocs/b2-download-file-by-name | b2_download_file_by_name}.
464
+ * @param downloadUrl - The B2 download base URL.
465
+ * @param authToken - The authorization token.
466
+ * @param bucketName - The name of the bucket containing the file.
467
+ * @param fileName - The name of the file to download.
468
+ * @param options - Optional download parameters for range requests and cancellation.
469
+ *
470
+ * @returns The response headers, streaming body, and HTTP status code.
471
+ */
472
+ async downloadFileByName(downloadUrl, authToken, bucketName, fileName, options) {
473
+ const headers = buildDownloadRequestHeaders(authToken, options);
474
+ const url = appendDownloadOverrides(`${downloadUrl}/file/${encodeURIComponent(bucketName)}/${encodeFileName(fileName)}`, options);
475
+ const response = await this.transport.send({
476
+ url,
477
+ method: options?.method ?? "GET",
478
+ headers,
479
+ ...options?.signal !== void 0 ? { signal: options.signal } : {}
480
+ });
481
+ return {
482
+ headers: response.headers,
483
+ body: response.body,
484
+ status: response.status
485
+ };
486
+ }
487
+ /**
488
+ * Calls {@link https://www.backblaze.com/apidocs/b2-get-download-authorization | b2_get_download_authorization}.
489
+ * @param apiUrl - The B2 API base URL.
490
+ * @param authToken - The current session authorization token.
491
+ * @param request - The API request parameters.
492
+ *
493
+ * @returns The download authorization token for the specified file prefix.
494
+ */
495
+ async getDownloadAuthorization(apiUrl, authToken, request) {
496
+ return this.postJson(apiUrl, authToken, "b2_get_download_authorization", request);
497
+ }
498
+ /**
499
+ * Calls {@link https://www.backblaze.com/apidocs/b2-create-key | b2_create_key}.
500
+ * @param apiUrl - The B2 API base URL.
501
+ * @param authToken - The authorization token.
502
+ * @param request - The API request parameters.
503
+ *
504
+ * @returns The newly created application key with secret.
505
+ */
506
+ async createKey(apiUrl, authToken, request) {
507
+ return normalizeKeyResponse(await this.postJson(apiUrl, authToken, "b2_create_key", normalizeCreateKeyRequest(request), void 0, "v4"));
508
+ }
509
+ /**
510
+ * Calls {@link https://www.backblaze.com/apidocs/b2-list-keys | b2_list_keys}.
511
+ * @param apiUrl - The B2 API base URL.
512
+ * @param authToken - The authorization token.
513
+ * @param request - The API request parameters.
514
+ *
515
+ * @returns The list of application keys and optional continuation token.
516
+ */
517
+ async listKeys(apiUrl, authToken, request) {
518
+ const response = await this.postJson(apiUrl, authToken, "b2_list_keys", request, void 0, "v4");
519
+ return {
520
+ ...response,
521
+ keys: response.keys.map((key) => normalizeKeyResponse(key))
522
+ };
523
+ }
524
+ /**
525
+ * Calls {@link https://www.backblaze.com/apidocs/b2-delete-key | b2_delete_key}.
526
+ * @param apiUrl - The B2 API base URL.
527
+ * @param authToken - The authorization token.
528
+ * @param request - The API request parameters.
529
+ *
530
+ * @returns The deleted application key metadata.
531
+ */
532
+ async deleteKey(apiUrl, authToken, request) {
533
+ return normalizeKeyResponse(await this.postJson(apiUrl, authToken, "b2_delete_key", request, void 0, "v4"));
534
+ }
535
+ /**
536
+ * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-retention | b2_update_file_retention}.
537
+ * @param apiUrl - The B2 API base URL.
538
+ * @param authToken - The authorization token.
539
+ * @param request - The API request parameters.
540
+ *
541
+ * @returns The updated file retention settings.
542
+ */
543
+ async updateFileRetention(apiUrl, authToken, request) {
544
+ return this.postJson(apiUrl, authToken, "b2_update_file_retention", request);
545
+ }
546
+ /**
547
+ * Calls {@link https://www.backblaze.com/apidocs/b2-update-file-legal-hold | b2_update_file_legal_hold}.
548
+ * @param apiUrl - The B2 API base URL.
549
+ * @param authToken - The authorization token.
550
+ * @param request - The API request parameters.
551
+ *
552
+ * @returns The updated file legal hold status.
553
+ */
554
+ async updateFileLegalHold(apiUrl, authToken, request) {
555
+ return this.postJson(apiUrl, authToken, "b2_update_file_legal_hold", request);
556
+ }
557
+ /**
558
+ * Calls {@link https://www.backblaze.com/apidocs/b2-get-bucket-notification-rules | b2_get_bucket_notification_rules}.
559
+ * @param apiUrl - The B2 API base URL.
560
+ * @param authToken - The authorization token.
561
+ * @param request - The API request parameters.
562
+ *
563
+ * @returns The configured event notification rules for the specified bucket.
564
+ */
565
+ async getBucketNotificationRules(apiUrl, authToken, request) {
566
+ return this.postJson(apiUrl, authToken, "b2_get_bucket_notification_rules", request);
567
+ }
568
+ /**
569
+ * Calls {@link https://www.backblaze.com/apidocs/b2-set-bucket-notification-rules | b2_set_bucket_notification_rules}.
570
+ * @param apiUrl - The B2 API base URL.
571
+ * @param authToken - The authorization token.
572
+ * @param request - The API request parameters.
573
+ *
574
+ * @returns The updated bucket notification rules.
575
+ */
576
+ async setBucketNotificationRules(apiUrl, authToken, request) {
577
+ return this.postJson(apiUrl, authToken, "b2_set_bucket_notification_rules", request);
578
+ }
579
+ /**
580
+ * Sends a JSON POST request to the specified B2 API endpoint.
581
+ * @param apiUrl - The B2 API base URL.
582
+ * @param authToken - The authorization token.
583
+ * @param endpoint - The B2 API endpoint name.
584
+ * @param body - The JSON request body.
585
+ * @param options - Optional abort and per-request retry settings.
586
+ * @param apiVersion - B2 Native API version segment for this endpoint.
587
+ *
588
+ * @returns The parsed JSON response.
589
+ */
590
+ async postJson(apiUrl, authToken, endpoint, body, options, apiVersion = "v3") {
591
+ return (await this.transport.send({
592
+ url: `${apiUrl}/b2api/${apiVersion}/${endpoint}`,
593
+ method: "POST",
594
+ headers: {
595
+ Authorization: authToken,
596
+ "Content-Type": "application/json"
597
+ },
598
+ body: JSON.stringify(body),
599
+ ...options?.signal !== void 0 ? { signal: options.signal } : {},
600
+ ...options?.retry !== void 0 ? { retry: options.retry } : {}
601
+ })).json();
602
+ }
603
+ };
604
+ /**
605
+ * Applies server-side encryption headers to the request.
606
+ * @param headers - The mutable headers object to populate.
607
+ * @param encryption - The encryption settings, or undefined to skip.
608
+ */
539
609
  function applyEncryptionHeaders(headers, encryption) {
540
- if (!encryption || encryption.mode === EncryptionMode.None) return;
541
- if (encryption.mode === EncryptionMode.SseB2) {
542
- headers["X-Bz-Server-Side-Encryption"] = EncryptionAlgorithm.Aes256;
543
- } else if (encryption.mode === EncryptionMode.SseC) {
544
- headers["X-Bz-Server-Side-Encryption-Customer-Algorithm"] = EncryptionAlgorithm.Aes256;
545
- headers["X-Bz-Server-Side-Encryption-Customer-Key"] = encryption.customerKey;
546
- headers["X-Bz-Server-Side-Encryption-Customer-Key-Md5"] = encryption.customerKeyMd5;
547
- }
610
+ if (!encryption || encryption.mode === EncryptionMode.None) return;
611
+ if (encryption.mode === EncryptionMode.SseB2) headers["X-Bz-Server-Side-Encryption"] = EncryptionAlgorithm.Aes256;
612
+ else if (encryption.mode === EncryptionMode.SseC) {
613
+ headers["X-Bz-Server-Side-Encryption-Customer-Algorithm"] = EncryptionAlgorithm.Aes256;
614
+ headers["X-Bz-Server-Side-Encryption-Customer-Key"] = encryption.customerKey;
615
+ headers["X-Bz-Server-Side-Encryption-Customer-Key-Md5"] = encryption.customerKeyMd5;
616
+ }
548
617
  }
549
- const DOWNLOAD_OVERRIDE_PARAMS = [
550
- "b2ContentDisposition",
551
- "b2ContentLanguage",
552
- "b2ContentEncoding",
553
- "b2ContentType",
554
- "b2CacheControl",
555
- "b2Expires"
618
+ var DOWNLOAD_OVERRIDE_PARAMS = [
619
+ "b2ContentDisposition",
620
+ "b2ContentLanguage",
621
+ "b2ContentEncoding",
622
+ "b2ContentType",
623
+ "b2CacheControl",
624
+ "b2Expires"
556
625
  ];
626
+ /**
627
+ * Builds the HTTP request headers for a download: Authorization, optional
628
+ * Range, and optional SSE-C decryption headers.
629
+ *
630
+ * @param authToken - The B2 session authorization token.
631
+ * @param options - Caller-supplied download options.
632
+ *
633
+ * @returns The header map to send with the request.
634
+ */
557
635
  function buildDownloadRequestHeaders(authToken, options) {
558
- const headers = { Authorization: authToken };
559
- if (options?.range) headers["Range"] = options.range;
560
- if (options?.serverSideEncryption) {
561
- applyEncryptionHeaders(headers, {
562
- mode: EncryptionMode.SseC,
563
- ...options.serverSideEncryption
564
- });
565
- }
566
- return headers;
636
+ const headers = { Authorization: authToken };
637
+ if (options?.range) headers["Range"] = options.range;
638
+ if (options?.serverSideEncryption) applyEncryptionHeaders(headers, {
639
+ mode: EncryptionMode.SseC,
640
+ ...options.serverSideEncryption
641
+ });
642
+ return headers;
567
643
  }
644
+ /**
645
+ * Appends the documented `b2Content*` response-header overrides to a download
646
+ * URL as query-string parameters. B2 echoes the values into the response
647
+ * headers so callers can control content type, disposition, and caching.
648
+ *
649
+ * @param url - The base download URL.
650
+ * @param options - Caller-supplied download options.
651
+ *
652
+ * @returns The URL with any override parameters appended.
653
+ */
568
654
  function appendDownloadOverrides(url, options) {
569
- if (!options) return url;
570
- const params = [];
571
- for (const key of DOWNLOAD_OVERRIDE_PARAMS) {
572
- const value = options[key];
573
- if (value !== void 0) {
574
- params.push(`${key}=${encodeURIComponent(value)}`);
575
- }
576
- }
577
- if (params.length === 0) return url;
578
- const separator = url.includes("?") ? "&" : "?";
579
- return `${url}${separator}${params.join("&")}`;
655
+ if (!options) return url;
656
+ const params = [];
657
+ for (const key of DOWNLOAD_OVERRIDE_PARAMS) {
658
+ const value = options[key];
659
+ if (value !== void 0) params.push(`${key}=${encodeURIComponent(value)}`);
660
+ }
661
+ if (params.length === 0) return url;
662
+ return `${url}${url.includes("?") ? "&" : "?"}${params.join("&")}`;
580
663
  }
664
+ /**
665
+ * Applies file retention headers to the request.
666
+ * @param headers - The mutable headers object to populate.
667
+ * @param retention - The retention settings, or undefined to skip.
668
+ */
581
669
  function applyRetentionHeaders(headers, retention) {
582
- if (!retention) return;
583
- if (retention.mode) {
584
- headers["X-Bz-File-Retention-Mode"] = retention.mode;
585
- }
586
- if (retention.retainUntilTimestamp) {
587
- headers["X-Bz-File-Retention-Retain-Until-Timestamp"] = String(retention.retainUntilTimestamp);
588
- }
670
+ if (!retention) return;
671
+ if (retention.mode) headers["X-Bz-File-Retention-Mode"] = retention.mode;
672
+ if (retention.retainUntilTimestamp) headers["X-Bz-File-Retention-Retain-Until-Timestamp"] = String(retention.retainUntilTimestamp);
589
673
  }
674
+ /**
675
+ * Applies the legal hold header to the request.
676
+ * @param headers - The mutable headers object to populate.
677
+ * @param legalHold - The legal hold value, or undefined to skip.
678
+ */
590
679
  function applyLegalHoldHeader(headers, legalHold) {
591
- if (!legalHold) return;
592
- headers["X-Bz-File-Legal-Hold"] = legalHold;
680
+ if (!legalHold) return;
681
+ headers["X-Bz-File-Legal-Hold"] = legalHold;
593
682
  }
594
- export {
595
- RawClient,
596
- buildFileInfoHeaders,
597
- decodeFileName,
598
- encodeFileName,
599
- parseFileInfoHeaders
600
- };
601
- //# sourceMappingURL=index.js.map
683
+ //#endregion
684
+ export { RawClient, buildFileInfoHeaders, decodeFileName, encodeFileName, parseFileInfoHeaders };
685
+
686
+ //# sourceMappingURL=index.js.map