@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/dist/version.cjs CHANGED
@@ -1,18 +1,70 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
1
2
  //#region src/version.ts
2
3
  /**
3
4
  * Current SDK version. Read directly from package.json so there is no
4
5
  * second-source-of-truth to keep in sync — bumping `version` in package.json
5
- * automatically propagates here, into the SDK's User-Agent header, and into
6
- * the published artifact.
6
+ * automatically propagates here and into the published artifact. The outbound
7
+ * SDK User-Agent uses the resolved product version segment so source, CI,
8
+ * `npm pack`, and prerelease builds advertise `dev` instead of a real-looking
9
+ * release number.
7
10
  *
8
11
  * Works in every runtime the SDK targets:
9
12
  * - Node 22.3+, Bun, Deno: native JSON import attributes.
10
- * - Vite builds: the JSON import is replaced with a version-only shim so
11
- * published runtime chunks do not carry unrelated package metadata.
13
+ * - Vite builds: the JSON import is replaced with a version-only shim, and
14
+ * the publish path injects the release-channel define as `published`.
15
+ * Other builds leave the define absent, so runtime chunks do not carry
16
+ * unrelated package metadata.
12
17
  * - Vitest browser mode: Vite handles the import the same way as build.
13
18
  */
14
19
  var VERSION = require("./_virtual/_b2-sdk-version-json.cjs").default.version;
20
+ var configuredReleaseSignal = "published";
21
+ function isStableSemver(version) {
22
+ return !(version.split("+", 1)[0] ?? version).includes("-");
23
+ }
24
+ /**
25
+ * Resolve build version metadata from a version and positive release signal.
26
+ *
27
+ * @param version - Build semver read from package.json.
28
+ * @param releaseSignal - Build-time release signal. Only `published` enables
29
+ * the published channel, and prerelease semvers still resolve to `dev`.
30
+ *
31
+ * @returns The release-channel decision and User-Agent version segment.
32
+ */
33
+ function resolveVersion(version, releaseSignal = "dev") {
34
+ const isStableVersion = isStableSemver(version);
35
+ const isRelease = releaseSignal === "published" && isStableVersion;
36
+ return {
37
+ version,
38
+ releaseChannel: isRelease ? "published" : "dev",
39
+ isPublishedRelease: isRelease,
40
+ productVersion: isRelease ? version : "dev"
41
+ };
42
+ }
43
+ var resolvedVersion = resolveVersion(VERSION, configuredReleaseSignal);
44
+ /**
45
+ * Current release channel. Defaults to `dev` unless the publish path injected
46
+ * the positive release signal for a stable semver.
47
+ */
48
+ var RELEASE_CHANNEL = resolvedVersion.releaseChannel;
49
+ /**
50
+ * Whether the current artifact is a stable package built through the publish path.
51
+ */
52
+ var isPublishedRelease = resolvedVersion.isPublishedRelease;
53
+ /**
54
+ * Version segment for the SDK User-Agent product token.
55
+ * Kept as a function because it is derived resolver output consumed by the
56
+ * User-Agent builder, not a second version constant for callers to maintain.
57
+ *
58
+ * @returns The package semver for stable published releases, otherwise `dev`.
59
+ */
60
+ function productVersion() {
61
+ return resolvedVersion.productVersion;
62
+ }
15
63
  //#endregion
64
+ exports.RELEASE_CHANNEL = RELEASE_CHANNEL;
16
65
  exports.VERSION = VERSION;
66
+ exports.isPublishedRelease = isPublishedRelease;
67
+ exports.productVersion = productVersion;
68
+ exports.resolveVersion = resolveVersion;
17
69
 
18
70
  //# sourceMappingURL=version.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.cjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Current SDK version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync — bumping `version` in package.json\n * automatically propagates here, into the SDK's User-Agent header, and into\n * the published artifact.\n *\n * Works in every runtime the SDK targets:\n * - Node 22.3+, Bun, Deno: native JSON import attributes.\n * - Vite builds: the JSON import is replaced with a version-only shim so\n * published runtime chunks do not carry unrelated package metadata.\n * - Vitest browser mode: Vite handles the import the same way as build.\n */\nexport const VERSION: string = pkg.version\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,uDAAkB,CAAA,CAAA,QAAI"}
1
+ {"version":3,"file":"version.cjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["import pkg from '../package.json' with { type: 'json' }\n\ndeclare const __B2_SDK_RELEASE_CHANNEL__: string | undefined\n\n/**\n * Release channel used to decide what the SDK advertises in its User-Agent\n * product token.\n */\nexport type ReleaseChannel = 'dev' | 'published'\n\n/**\n * Resolved version metadata for the current build.\n */\nexport interface VersionResolution {\n /** Build semver read from package.json. */\n readonly version: string\n /** Release channel after applying the positive release signal. */\n readonly releaseChannel: ReleaseChannel\n /** Whether this build is a stable package published through the release path. */\n readonly isPublishedRelease: boolean\n /** Version segment for the SDK User-Agent product token. */\n readonly productVersion: string\n}\n\n/**\n * Current SDK version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync — bumping `version` in package.json\n * automatically propagates here and into the published artifact. The outbound\n * SDK User-Agent uses the resolved product version segment so source, CI,\n * `npm pack`, and prerelease builds advertise `dev` instead of a real-looking\n * release number.\n *\n * Works in every runtime the SDK targets:\n * - Node 22.3+, Bun, Deno: native JSON import attributes.\n * - Vite builds: the JSON import is replaced with a version-only shim, and\n * the publish path injects the release-channel define as `published`.\n * Other builds leave the define absent, so runtime chunks do not carry\n * unrelated package metadata.\n * - Vitest browser mode: Vite handles the import the same way as build.\n */\nexport const VERSION: string = pkg.version\n\nconst configuredReleaseSignal =\n typeof __B2_SDK_RELEASE_CHANNEL__ === 'string' ? __B2_SDK_RELEASE_CHANNEL__ : 'dev'\n\nfunction isStableSemver(version: string): boolean {\n const versionWithoutBuildMetadata = version.split('+', 1)[0] ?? version\n return !versionWithoutBuildMetadata.includes('-')\n}\n\n/**\n * Resolve build version metadata from a version and positive release signal.\n *\n * @param version - Build semver read from package.json.\n * @param releaseSignal - Build-time release signal. Only `published` enables\n * the published channel, and prerelease semvers still resolve to `dev`.\n *\n * @returns The release-channel decision and User-Agent version segment.\n */\nexport function resolveVersion(\n version: string,\n releaseSignal: string | undefined = 'dev',\n): VersionResolution {\n const isStableVersion = isStableSemver(version)\n const isRelease = releaseSignal === 'published' && isStableVersion\n const releaseChannel = isRelease ? 'published' : 'dev'\n\n return {\n version,\n releaseChannel,\n isPublishedRelease: isRelease,\n productVersion: isRelease ? version : 'dev',\n }\n}\n\nconst resolvedVersion = resolveVersion(VERSION, configuredReleaseSignal)\n\n/**\n * Current release channel. Defaults to `dev` unless the publish path injected\n * the positive release signal for a stable semver.\n */\nexport const RELEASE_CHANNEL: ReleaseChannel = resolvedVersion.releaseChannel\n\n/**\n * Whether the current artifact is a stable package built through the publish path.\n */\nexport const isPublishedRelease: boolean = resolvedVersion.isPublishedRelease\n\n/**\n * Version segment for the SDK User-Agent product token.\n * Kept as a function because it is derived resolver output consumed by the\n * User-Agent builder, not a second version constant for callers to maintain.\n *\n * @returns The package semver for stable published releases, otherwise `dev`.\n */\nexport function productVersion(): string {\n return resolvedVersion.productVersion\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwCA,IAAa,uDAAkB,CAAA,CAAA,QAAI;AAEnC,IAAM,0BAAA;AAGN,SAAS,eAAe,SAA0B;CAEhD,OAAO,EAD6B,QAAQ,MAAM,KAAK,CAAC,CAAC,CAAC,MAAM,QAAA,CAC5B,SAAS,GAAG;AAClD;;;;;;;;;;AAWA,SAAgB,eACd,SACA,gBAAoC,OACjB;CACnB,MAAM,kBAAkB,eAAe,OAAO;CAC9C,MAAM,YAAY,kBAAkB,eAAe;CAGnD,OAAO;EACL;EACA,gBAJqB,YAAY,cAAc;EAK/C,oBAAoB;EACpB,gBAAgB,YAAY,UAAU;CACxC;AACF;AAEA,IAAM,kBAAkB,eAAe,SAAS,uBAAuB;;;;;AAMvE,IAAa,kBAAkC,gBAAgB;;;;AAK/D,IAAa,qBAA8B,gBAAgB;;;;;;;;AAS3D,SAAgB,iBAAyB;CACvC,OAAO,gBAAgB;AACzB"}
@@ -1,14 +1,63 @@
1
+ /**
2
+ * Release channel used to decide what the SDK advertises in its User-Agent
3
+ * product token.
4
+ */
5
+ export type ReleaseChannel = 'dev' | 'published';
6
+ /**
7
+ * Resolved version metadata for the current build.
8
+ */
9
+ export interface VersionResolution {
10
+ /** Build semver read from package.json. */
11
+ readonly version: string;
12
+ /** Release channel after applying the positive release signal. */
13
+ readonly releaseChannel: ReleaseChannel;
14
+ /** Whether this build is a stable package published through the release path. */
15
+ readonly isPublishedRelease: boolean;
16
+ /** Version segment for the SDK User-Agent product token. */
17
+ readonly productVersion: string;
18
+ }
1
19
  /**
2
20
  * Current SDK version. Read directly from package.json so there is no
3
21
  * second-source-of-truth to keep in sync — bumping `version` in package.json
4
- * automatically propagates here, into the SDK's User-Agent header, and into
5
- * the published artifact.
22
+ * automatically propagates here and into the published artifact. The outbound
23
+ * SDK User-Agent uses the resolved product version segment so source, CI,
24
+ * `npm pack`, and prerelease builds advertise `dev` instead of a real-looking
25
+ * release number.
6
26
  *
7
27
  * Works in every runtime the SDK targets:
8
28
  * - Node 22.3+, Bun, Deno: native JSON import attributes.
9
- * - Vite builds: the JSON import is replaced with a version-only shim so
10
- * published runtime chunks do not carry unrelated package metadata.
29
+ * - Vite builds: the JSON import is replaced with a version-only shim, and
30
+ * the publish path injects the release-channel define as `published`.
31
+ * Other builds leave the define absent, so runtime chunks do not carry
32
+ * unrelated package metadata.
11
33
  * - Vitest browser mode: Vite handles the import the same way as build.
12
34
  */
13
35
  export declare const VERSION: string;
36
+ /**
37
+ * Resolve build version metadata from a version and positive release signal.
38
+ *
39
+ * @param version - Build semver read from package.json.
40
+ * @param releaseSignal - Build-time release signal. Only `published` enables
41
+ * the published channel, and prerelease semvers still resolve to `dev`.
42
+ *
43
+ * @returns The release-channel decision and User-Agent version segment.
44
+ */
45
+ export declare function resolveVersion(version: string, releaseSignal?: string | undefined): VersionResolution;
46
+ /**
47
+ * Current release channel. Defaults to `dev` unless the publish path injected
48
+ * the positive release signal for a stable semver.
49
+ */
50
+ export declare const RELEASE_CHANNEL: ReleaseChannel;
51
+ /**
52
+ * Whether the current artifact is a stable package built through the publish path.
53
+ */
54
+ export declare const isPublishedRelease: boolean;
55
+ /**
56
+ * Version segment for the SDK User-Agent product token.
57
+ * Kept as a function because it is derived resolver output consumed by the
58
+ * User-Agent builder, not a second version constant for callers to maintain.
59
+ *
60
+ * @returns The package semver for stable published releases, otherwise `dev`.
61
+ */
62
+ export declare function productVersion(): string;
14
63
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAA"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,WAAW,CAAA;AAEhD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,kEAAkE;IAClE,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,iFAAiF;IACjF,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAA;IACpC,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAA;AAU1C;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,aAAa,GAAE,MAAM,GAAG,SAAiB,GACxC,iBAAiB,CAWnB;AAID;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,cAA+C,CAAA;AAE7E;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAA4C,CAAA;AAE7E;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
package/dist/version.d.ts CHANGED
@@ -1,14 +1,63 @@
1
+ /**
2
+ * Release channel used to decide what the SDK advertises in its User-Agent
3
+ * product token.
4
+ */
5
+ export type ReleaseChannel = 'dev' | 'published';
6
+ /**
7
+ * Resolved version metadata for the current build.
8
+ */
9
+ export interface VersionResolution {
10
+ /** Build semver read from package.json. */
11
+ readonly version: string;
12
+ /** Release channel after applying the positive release signal. */
13
+ readonly releaseChannel: ReleaseChannel;
14
+ /** Whether this build is a stable package published through the release path. */
15
+ readonly isPublishedRelease: boolean;
16
+ /** Version segment for the SDK User-Agent product token. */
17
+ readonly productVersion: string;
18
+ }
1
19
  /**
2
20
  * Current SDK version. Read directly from package.json so there is no
3
21
  * second-source-of-truth to keep in sync — bumping `version` in package.json
4
- * automatically propagates here, into the SDK's User-Agent header, and into
5
- * the published artifact.
22
+ * automatically propagates here and into the published artifact. The outbound
23
+ * SDK User-Agent uses the resolved product version segment so source, CI,
24
+ * `npm pack`, and prerelease builds advertise `dev` instead of a real-looking
25
+ * release number.
6
26
  *
7
27
  * Works in every runtime the SDK targets:
8
28
  * - Node 22.3+, Bun, Deno: native JSON import attributes.
9
- * - Vite builds: the JSON import is replaced with a version-only shim so
10
- * published runtime chunks do not carry unrelated package metadata.
29
+ * - Vite builds: the JSON import is replaced with a version-only shim, and
30
+ * the publish path injects the release-channel define as `published`.
31
+ * Other builds leave the define absent, so runtime chunks do not carry
32
+ * unrelated package metadata.
11
33
  * - Vitest browser mode: Vite handles the import the same way as build.
12
34
  */
13
35
  export declare const VERSION: string;
36
+ /**
37
+ * Resolve build version metadata from a version and positive release signal.
38
+ *
39
+ * @param version - Build semver read from package.json.
40
+ * @param releaseSignal - Build-time release signal. Only `published` enables
41
+ * the published channel, and prerelease semvers still resolve to `dev`.
42
+ *
43
+ * @returns The release-channel decision and User-Agent version segment.
44
+ */
45
+ export declare function resolveVersion(version: string, releaseSignal?: string | undefined): VersionResolution;
46
+ /**
47
+ * Current release channel. Defaults to `dev` unless the publish path injected
48
+ * the positive release signal for a stable semver.
49
+ */
50
+ export declare const RELEASE_CHANNEL: ReleaseChannel;
51
+ /**
52
+ * Whether the current artifact is a stable package built through the publish path.
53
+ */
54
+ export declare const isPublishedRelease: boolean;
55
+ /**
56
+ * Version segment for the SDK User-Agent product token.
57
+ * Kept as a function because it is derived resolver output consumed by the
58
+ * User-Agent builder, not a second version constant for callers to maintain.
59
+ *
60
+ * @returns The package semver for stable published releases, otherwise `dev`.
61
+ */
62
+ export declare function productVersion(): string;
14
63
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAA"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,WAAW,CAAA;AAEhD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,kEAAkE;IAClE,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,iFAAiF;IACjF,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAA;IACpC,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAA;AAU1C;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,aAAa,GAAE,MAAM,GAAG,SAAiB,GACxC,iBAAiB,CAWnB;AAID;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,cAA+C,CAAA;AAE7E;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAA4C,CAAA;AAE7E;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
package/dist/version.js CHANGED
@@ -3,17 +3,64 @@ import _b2_sdk_version_json_default from "./_virtual/_b2-sdk-version-json.js";
3
3
  /**
4
4
  * Current SDK version. Read directly from package.json so there is no
5
5
  * second-source-of-truth to keep in sync — bumping `version` in package.json
6
- * automatically propagates here, into the SDK's User-Agent header, and into
7
- * the published artifact.
6
+ * automatically propagates here and into the published artifact. The outbound
7
+ * SDK User-Agent uses the resolved product version segment so source, CI,
8
+ * `npm pack`, and prerelease builds advertise `dev` instead of a real-looking
9
+ * release number.
8
10
  *
9
11
  * Works in every runtime the SDK targets:
10
12
  * - Node 22.3+, Bun, Deno: native JSON import attributes.
11
- * - Vite builds: the JSON import is replaced with a version-only shim so
12
- * published runtime chunks do not carry unrelated package metadata.
13
+ * - Vite builds: the JSON import is replaced with a version-only shim, and
14
+ * the publish path injects the release-channel define as `published`.
15
+ * Other builds leave the define absent, so runtime chunks do not carry
16
+ * unrelated package metadata.
13
17
  * - Vitest browser mode: Vite handles the import the same way as build.
14
18
  */
15
19
  var VERSION = _b2_sdk_version_json_default.version;
20
+ var configuredReleaseSignal = "published";
21
+ function isStableSemver(version) {
22
+ return !(version.split("+", 1)[0] ?? version).includes("-");
23
+ }
24
+ /**
25
+ * Resolve build version metadata from a version and positive release signal.
26
+ *
27
+ * @param version - Build semver read from package.json.
28
+ * @param releaseSignal - Build-time release signal. Only `published` enables
29
+ * the published channel, and prerelease semvers still resolve to `dev`.
30
+ *
31
+ * @returns The release-channel decision and User-Agent version segment.
32
+ */
33
+ function resolveVersion(version, releaseSignal = "dev") {
34
+ const isStableVersion = isStableSemver(version);
35
+ const isRelease = releaseSignal === "published" && isStableVersion;
36
+ return {
37
+ version,
38
+ releaseChannel: isRelease ? "published" : "dev",
39
+ isPublishedRelease: isRelease,
40
+ productVersion: isRelease ? version : "dev"
41
+ };
42
+ }
43
+ var resolvedVersion = resolveVersion(VERSION, configuredReleaseSignal);
44
+ /**
45
+ * Current release channel. Defaults to `dev` unless the publish path injected
46
+ * the positive release signal for a stable semver.
47
+ */
48
+ var RELEASE_CHANNEL = resolvedVersion.releaseChannel;
49
+ /**
50
+ * Whether the current artifact is a stable package built through the publish path.
51
+ */
52
+ var isPublishedRelease = resolvedVersion.isPublishedRelease;
53
+ /**
54
+ * Version segment for the SDK User-Agent product token.
55
+ * Kept as a function because it is derived resolver output consumed by the
56
+ * User-Agent builder, not a second version constant for callers to maintain.
57
+ *
58
+ * @returns The package semver for stable published releases, otherwise `dev`.
59
+ */
60
+ function productVersion() {
61
+ return resolvedVersion.productVersion;
62
+ }
16
63
  //#endregion
17
- export { VERSION };
64
+ export { RELEASE_CHANNEL, VERSION, isPublishedRelease, productVersion, resolveVersion };
18
65
 
19
66
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["import pkg from '../package.json' with { type: 'json' }\n\n/**\n * Current SDK version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync — bumping `version` in package.json\n * automatically propagates here, into the SDK's User-Agent header, and into\n * the published artifact.\n *\n * Works in every runtime the SDK targets:\n * - Node 22.3+, Bun, Deno: native JSON import attributes.\n * - Vite builds: the JSON import is replaced with a version-only shim so\n * published runtime chunks do not carry unrelated package metadata.\n * - Vitest browser mode: Vite handles the import the same way as build.\n */\nexport const VERSION: string = pkg.version\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAa,UAAkB,6BAAI"}
1
+ {"version":3,"file":"version.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["import pkg from '../package.json' with { type: 'json' }\n\ndeclare const __B2_SDK_RELEASE_CHANNEL__: string | undefined\n\n/**\n * Release channel used to decide what the SDK advertises in its User-Agent\n * product token.\n */\nexport type ReleaseChannel = 'dev' | 'published'\n\n/**\n * Resolved version metadata for the current build.\n */\nexport interface VersionResolution {\n /** Build semver read from package.json. */\n readonly version: string\n /** Release channel after applying the positive release signal. */\n readonly releaseChannel: ReleaseChannel\n /** Whether this build is a stable package published through the release path. */\n readonly isPublishedRelease: boolean\n /** Version segment for the SDK User-Agent product token. */\n readonly productVersion: string\n}\n\n/**\n * Current SDK version. Read directly from package.json so there is no\n * second-source-of-truth to keep in sync — bumping `version` in package.json\n * automatically propagates here and into the published artifact. The outbound\n * SDK User-Agent uses the resolved product version segment so source, CI,\n * `npm pack`, and prerelease builds advertise `dev` instead of a real-looking\n * release number.\n *\n * Works in every runtime the SDK targets:\n * - Node 22.3+, Bun, Deno: native JSON import attributes.\n * - Vite builds: the JSON import is replaced with a version-only shim, and\n * the publish path injects the release-channel define as `published`.\n * Other builds leave the define absent, so runtime chunks do not carry\n * unrelated package metadata.\n * - Vitest browser mode: Vite handles the import the same way as build.\n */\nexport const VERSION: string = pkg.version\n\nconst configuredReleaseSignal =\n typeof __B2_SDK_RELEASE_CHANNEL__ === 'string' ? __B2_SDK_RELEASE_CHANNEL__ : 'dev'\n\nfunction isStableSemver(version: string): boolean {\n const versionWithoutBuildMetadata = version.split('+', 1)[0] ?? version\n return !versionWithoutBuildMetadata.includes('-')\n}\n\n/**\n * Resolve build version metadata from a version and positive release signal.\n *\n * @param version - Build semver read from package.json.\n * @param releaseSignal - Build-time release signal. Only `published` enables\n * the published channel, and prerelease semvers still resolve to `dev`.\n *\n * @returns The release-channel decision and User-Agent version segment.\n */\nexport function resolveVersion(\n version: string,\n releaseSignal: string | undefined = 'dev',\n): VersionResolution {\n const isStableVersion = isStableSemver(version)\n const isRelease = releaseSignal === 'published' && isStableVersion\n const releaseChannel = isRelease ? 'published' : 'dev'\n\n return {\n version,\n releaseChannel,\n isPublishedRelease: isRelease,\n productVersion: isRelease ? version : 'dev',\n }\n}\n\nconst resolvedVersion = resolveVersion(VERSION, configuredReleaseSignal)\n\n/**\n * Current release channel. Defaults to `dev` unless the publish path injected\n * the positive release signal for a stable semver.\n */\nexport const RELEASE_CHANNEL: ReleaseChannel = resolvedVersion.releaseChannel\n\n/**\n * Whether the current artifact is a stable package built through the publish path.\n */\nexport const isPublishedRelease: boolean = resolvedVersion.isPublishedRelease\n\n/**\n * Version segment for the SDK User-Agent product token.\n * Kept as a function because it is derived resolver output consumed by the\n * User-Agent builder, not a second version constant for callers to maintain.\n *\n * @returns The package semver for stable published releases, otherwise `dev`.\n */\nexport function productVersion(): string {\n return resolvedVersion.productVersion\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwCA,IAAa,UAAkB,6BAAI;AAEnC,IAAM,0BAAA;AAGN,SAAS,eAAe,SAA0B;CAEhD,OAAO,EAD6B,QAAQ,MAAM,KAAK,CAAC,CAAC,CAAC,MAAM,QAAA,CAC5B,SAAS,GAAG;AAClD;;;;;;;;;;AAWA,SAAgB,eACd,SACA,gBAAoC,OACjB;CACnB,MAAM,kBAAkB,eAAe,OAAO;CAC9C,MAAM,YAAY,kBAAkB,eAAe;CAGnD,OAAO;EACL;EACA,gBAJqB,YAAY,cAAc;EAK/C,oBAAoB;EACpB,gBAAgB,YAAY,UAAU;CACxC;AACF;AAEA,IAAM,kBAAkB,eAAe,SAAS,uBAAuB;;;;;AAMvE,IAAa,kBAAkC,gBAAgB;;;;AAK/D,IAAa,qBAA8B,gBAAgB;;;;;;;;AAS3D,SAAgB,iBAAyB;CACvC,OAAO,gBAAgB;AACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backblaze-labs/b2-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "The official Backblaze B2 Cloud Storage SDK for TypeScript and JavaScript",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -194,6 +194,7 @@
194
194
  },
195
195
  "scripts": {
196
196
  "build": "vite build && node scripts/build-cts-types.mjs",
197
+ "build:release": "node scripts/build-release-artifact.mjs",
197
198
  "test": "vitest run",
198
199
  "test:slow": "vitest run --config vitest.slow.config.ts",
199
200
  "test:all": "vitest run && vitest run --config vitest.slow.config.ts",
@@ -205,19 +206,25 @@
205
206
  "lint:fix": "biome check --write .",
206
207
  "lint:docs": "eslint src/ --no-warn-ignored",
207
208
  "lint:docs:fix": "eslint src/ --fix --no-warn-ignored",
208
- "lint:spelling": "cspell --no-progress --gitignore \"src/**/*.ts\" \"examples/**/*.ts\" \"examples/**/*.md\" \"adr/**/*.md\" \"*.md\" \"CLAUDE.md\"",
209
+ "lint:spelling": "cspell --no-progress --gitignore \"src/**/*.ts\" \"examples/**/*.ts\" \"examples/**/*.md\" \"docs/**/*.md\" \"*.md\"",
210
+ "audit:deps": "node scripts/audit-dependencies.mjs",
211
+ "test:audit:deps": "node --test scripts/audit-dependencies.test.mjs",
212
+ "test:release-channel": "node --test scripts/verify-release-channel.test.mjs",
209
213
  "typecheck": "tsc --noEmit",
210
214
  "typecheck:examples": "tsc --noEmit -p examples/tsconfig.json",
211
215
  "docs": "typedoc",
212
216
  "docs:watch": "typedoc --watch",
213
- "clean": "rm -rf dist docs",
217
+ "clean": "rm -rf dist api-docs",
214
218
  "version": "node scripts/cut-changelog.mjs && git add CHANGELOG.md",
215
219
  "verify:metadata": "node --test scripts/verify-package-metadata.test.mjs && node scripts/verify-package-metadata.mjs",
216
220
  "verify:release": "node scripts/verify-release-workflow.mjs",
221
+ "verify:release-channel": "node scripts/verify-release-channel.mjs",
222
+ "verify:ci-docs-filter": "node --test scripts/verify-docs-only-classifier.test.mjs",
223
+ "verify:docs-consistency": "node --test scripts/verify-docs-consistency.test.mjs",
217
224
  "verify:exports": "node scripts/verify-package-exports.mjs",
218
225
  "verify:release-workflow": "node scripts/verify-release-workflow.mjs",
219
226
  "smoke:published": "node scripts/smoke-published-package.mjs",
220
227
  "test:smoke-published": "node --test scripts/smoke-published-package.test.mjs",
221
- "verify": "pnpm run lint && pnpm run lint:docs && pnpm run lint:spelling && pnpm run typecheck && pnpm run typecheck:examples && pnpm run test && pnpm run build && pnpm run docs && pnpm run verify:metadata && pnpm run verify:release && pnpm run verify:exports"
228
+ "verify": "pnpm run lint && pnpm run lint:docs && pnpm run lint:spelling && pnpm run typecheck && pnpm run typecheck:examples && pnpm run test:audit:deps && pnpm run test && pnpm run test:release-channel && pnpm run build && pnpm run verify:release-channel && pnpm run docs && pnpm run verify:metadata && pnpm run verify:release && pnpm run verify:ci-docs-filter && pnpm run verify:docs-consistency && pnpm run verify:exports"
222
229
  }
223
230
  }