@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
@@ -57,6 +57,7 @@ export declare class PartnerAuthCore {
57
57
  private readonly allowCustomAuthorizeRealm;
58
58
  private readonly additionalAllowedSuffixes;
59
59
  private readonly disableSsrfGuard;
60
+ private readonly reauthCoalescer;
60
61
  /**
61
62
  * Creates a shared Partner authorization core.
62
63
  *
@@ -105,7 +106,6 @@ export declare class PartnerAuthCore {
105
106
  activateEndpointSuffixes(auth: PartnerAuthorizeResponse): readonly string[];
106
107
  private validateCachedAuth;
107
108
  private reauthorize;
108
- private startReauthorize;
109
109
  private doReauthorize;
110
110
  }
111
111
  //# sourceMappingURL=auth-core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-core.d.ts","sourceRoot":"","sources":["../../src/partner/auth-core.js"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAEnE,OAAO,KAA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ACjC,iFAAiF;IACjF,QAAQ,CAAC,sBAAsB,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IAC9D,4CAA4C;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,mDAAmD;IACnD,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAS;IAGnD,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA+B;IACzE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyB;IAEzD;;;;OAIG;gBACS,OAAO,EAAE,sBAAsB;IAgD3C;;;;;;OAMG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAc7F;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,wBAAwB,GAAG,IAAI;IAIlD;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAWhC;;;;;;;;OAQG;IACH,OAAO,CAAC,wBAAwB;IAQhC;;;;;;;;OAQG;IACH,wBAAwB,CAAC,IAAI,EAAE,wBAAwB,GAAG,SAAS,MAAM,EAAE;IAM3E,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,WAAW;YAIL,aAAa;CAI5B"}
@@ -57,6 +57,7 @@ export declare class PartnerAuthCore {
57
57
  private readonly allowCustomAuthorizeRealm;
58
58
  private readonly additionalAllowedSuffixes;
59
59
  private readonly disableSsrfGuard;
60
+ private readonly reauthCoalescer;
60
61
  /**
61
62
  * Creates a shared Partner authorization core.
62
63
  *
@@ -105,7 +106,6 @@ export declare class PartnerAuthCore {
105
106
  activateEndpointSuffixes(auth: PartnerAuthorizeResponse): readonly string[];
106
107
  private validateCachedAuth;
107
108
  private reauthorize;
108
- private startReauthorize;
109
109
  private doReauthorize;
110
110
  }
111
111
  //# sourceMappingURL=auth-core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-core.d.ts","sourceRoot":"","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G;AACH,qBAAa,eAAe;;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAA;IAC9B,2CAA2C;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAA;IAC/C,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IAClC,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC,iFAAiF;IACjF,QAAQ,CAAC,sBAAsB,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IAC9D,4CAA4C;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,mDAAmD;IACnD,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAS;IAGnD,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA+B;IACzE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyB;IAEzD;;;;OAIG;gBACS,OAAO,EAAE,sBAAsB;IAgD3C;;;;;;OAMG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAc7F;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,wBAAwB,GAAG,IAAI;IAIlD;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAWhC;;;;;;;;OAQG;IACH,OAAO,CAAC,wBAAwB;IAQhC;;;;;;;;OAQG;IACH,wBAAwB,CAAC,IAAI,EAAE,wBAAwB,GAAG,SAAS,MAAM,EAAE;IAM3E,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,WAAW;YAIL,aAAa;CAI5B"}
@@ -1,6 +1,7 @@
1
- import { abortReason, raceWithAbort, throwIfSignalAborted } from "../util/abort.js";
1
+ import { throwIfSignalAborted } from "../util/abort.js";
2
2
  import { DEFAULT_RETRY_OPTIONS } from "../http/retry.js";
3
3
  import { getRealmUrl } from "../auth/realms.js";
4
+ import { ReauthCoalescer } from "../auth/reauth-coalescer.js";
4
5
  import { UrlGuard } from "../http/url-guard.js";
5
6
  import { FetchTransport, RetryTransport } from "../http/transport.js";
6
7
  import { InMemoryPartnerAccountInfo } from "./in-memory.js";
@@ -30,7 +31,7 @@ var PartnerAuthCore = class {
30
31
  #masterKey;
31
32
  additionalAllowedSuffixes;
32
33
  disableSsrfGuard;
33
- #inflightReauth = null;
34
+ reauthCoalescer;
34
35
  /**
35
36
  * Creates a shared Partner authorization core.
36
37
  *
@@ -44,6 +45,7 @@ var PartnerAuthCore = class {
44
45
  this.additionalAllowedSuffixes = options.additionalAllowedHostSuffixes;
45
46
  this.disableSsrfGuard = options.disableSsrfGuard ?? false;
46
47
  this.allowCustomAuthorizeRealm = options.allowCustomAuthorizeRealm ?? false;
48
+ this.reauthCoalescer = new ReauthCoalescer((signal) => this.doReauthorize(signal));
47
49
  let baseTransport;
48
50
  if (options.transport !== void 0) {
49
51
  baseTransport = options.transport;
@@ -142,28 +144,7 @@ var PartnerAuthCore = class {
142
144
  }
143
145
  }
144
146
  reauthorize(signal) {
145
- throwIfSignalAborted(signal);
146
- const inflight = this.#inflightReauth ?? this.startReauthorize();
147
- inflight.waiters += 1;
148
- return raceWithAbort(inflight.promise, signal).finally(() => {
149
- inflight.waiters -= 1;
150
- if (inflight.waiters === 0 && !inflight.settled && !inflight.controller.signal.aborted) inflight.controller.abort(signal?.aborted === true ? abortReason(signal) : void 0);
151
- });
152
- }
153
- startReauthorize() {
154
- const controller = new AbortController();
155
- const inflight = {
156
- controller,
157
- promise: raceWithAbort(this.doReauthorize(controller.signal), controller.signal).finally(() => {
158
- if (this.#inflightReauth?.controller !== controller) return;
159
- this.#inflightReauth.settled = true;
160
- this.#inflightReauth = null;
161
- }),
162
- waiters: 0,
163
- settled: false
164
- };
165
- this.#inflightReauth = inflight;
166
- return inflight;
147
+ return this.reauthCoalescer.run(signal);
167
148
  }
168
149
  async doReauthorize(signal) {
169
150
  return (await this.authorize({ signal })).authorizationToken;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-core.js","names":["#masterKeyId","#masterKey","#inflightReauth"],"sources":["../../src/partner/auth-core.ts"],"sourcesContent":["import { getRealmUrl } from '../auth/realms.ts'\nimport { DEFAULT_RETRY_OPTIONS, type RetryOptions } from '../http/retry.ts'\nimport type { HttpTransport } from '../http/transport.ts'\nimport { FetchTransport, RetryTransport } from '../http/transport.ts'\nimport { UrlGuard } from '../http/url-guard.ts'\nimport type { PartnerAuthorizeResponse } from '../types/partner.ts'\nimport { abortReason, raceWithAbort, throwIfSignalAborted } from '../util/abort.ts'\nimport type { PartnerAccountInfo } from './account-info.ts'\nimport { InMemoryPartnerAccountInfo } from './in-memory.ts'\nimport {\n derivePartnerAllowedSuffixes,\n PartnerRawClient,\n validatePartnerAuthorizeResponseEndpoints,\n} from './raw.ts'\n\n/** Shared Partner authorization options used by Partner and Backup facades. */\nexport interface PartnerAuthCoreOptions {\n /** The Master Application Key ID for the partner administrator account. */\n readonly masterKeyId: string\n /** The Master Application Key secret. */\n readonly masterKey: string\n /** B2 realm alias or direct trusted realm URL. Defaults to `\"production\"`. */\n readonly realm?: string\n /** Storage backend for Partner authorization state. */\n readonly partnerAccountInfo?: PartnerAccountInfo\n /** Custom HTTP transport. Defaults to {@link FetchTransport}. */\n readonly transport?: HttpTransport\n /** Override retry behavior for retryable requests. */\n readonly retry?: Partial<RetryOptions>\n /** Custom user-agent string prepended to the SDK default. */\n readonly userAgent?: string\n /** Extra trusted host suffixes to merge into the default SSRF guard. */\n readonly additionalAllowedHostSuffixes?: readonly string[]\n /** Explicitly disable default SSRF guard suffix locking. */\n readonly disableSsrfGuard?: boolean\n /** Whether the default fetch transport may follow same-origin GET/HEAD redirects. */\n readonly followSameOriginRedirects?: boolean\n /** Allow direct custom authorize realms for tests or private proxies. */\n readonly allowCustomAuthorizeRealm?: boolean\n}\n\n/** Options for Partner authorization through {@link PartnerAuthCore}. */\nexport interface PartnerAuthCoreAuthorizeOptions {\n /** Abort signal for cancelling the authorize request. */\n readonly signal?: AbortSignal\n}\n\ninterface InflightPartnerReauth {\n readonly controller: AbortController\n readonly promise: Promise<string>\n waiters: number\n settled: boolean\n}\n\n/**\n * Internal Partner authorization state machine shared by public facades.\n *\n * @internal\n */\nexport class PartnerAuthCore {\n /** Low-level Partner raw client used for authorization and Partner endpoints. */\n readonly raw: PartnerRawClient\n /** Partner authorization state storage. */\n readonly partnerAccountInfo: PartnerAccountInfo\n /** Default transport URL guard, or null when a custom transport owns guarding. */\n readonly urlGuard: UrlGuard | null\n /** Retry-wrapped transport shared by facade-specific raw clients. */\n readonly transport: HttpTransport\n /** Endpoint suffixes validated from cached authorization during construction. */\n readonly cachedEndpointSuffixes: readonly string[] | undefined\n /** Resolved Partner authorize realm URL. */\n private readonly realmUrl: string\n /** Whether custom authorize realms are trusted. */\n private readonly allowCustomAuthorizeRealm: boolean\n readonly #masterKeyId: string\n readonly #masterKey: string\n private readonly additionalAllowedSuffixes: readonly string[] | undefined\n private readonly disableSsrfGuard: boolean\n #inflightReauth: InflightPartnerReauth | null = null\n\n /**\n * Creates a shared Partner authorization core.\n *\n * @param options - Credentials, state storage, transport, retry, and guard settings.\n */\n constructor(options: PartnerAuthCoreOptions) {\n this.#masterKeyId = options.masterKeyId\n this.#masterKey = options.masterKey\n this.realmUrl = getRealmUrl(options.realm ?? 'production')\n this.partnerAccountInfo = options.partnerAccountInfo ?? new InMemoryPartnerAccountInfo()\n this.additionalAllowedSuffixes = options.additionalAllowedHostSuffixes\n this.disableSsrfGuard = options.disableSsrfGuard ?? false\n this.allowCustomAuthorizeRealm = options.allowCustomAuthorizeRealm ?? false\n\n let baseTransport: HttpTransport\n if (options.transport !== undefined) {\n baseTransport = options.transport\n this.urlGuard = null\n } else {\n const urlGuard = new UrlGuard()\n baseTransport = new FetchTransport({\n urlGuard,\n ...(options.userAgent !== undefined ? { userAgent: options.userAgent } : {}),\n ...(options.followSameOriginRedirects !== undefined\n ? { followSameOriginRedirects: options.followSameOriginRedirects }\n : {}),\n })\n this.urlGuard = urlGuard\n }\n\n this.transport = new RetryTransport({\n transport: baseTransport,\n retry: { ...DEFAULT_RETRY_OPTIONS, ...options.retry },\n onReauth: (signal) => this.reauthorize(signal),\n })\n\n this.cachedEndpointSuffixes = this.validateCachedAuth()\n if (this.cachedEndpointSuffixes !== undefined) {\n this.lockUrlGuardFromSuffixes(this.cachedEndpointSuffixes)\n }\n\n this.raw = new PartnerRawClient({\n transport: this.transport,\n ...(this.cachedEndpointSuffixes !== undefined\n ? { authorizedPartnerEndpointSuffixes: this.cachedEndpointSuffixes }\n : {}),\n ...(options.allowCustomAuthorizeRealm !== undefined\n ? { allowCustomAuthorizeRealm: options.allowCustomAuthorizeRealm }\n : {}),\n })\n }\n\n /**\n * Authenticates with B2 Partner authorization and stores the authorization state.\n *\n * @param options - Optional abort signal.\n *\n * @returns The normalized Partner authorization response.\n */\n async authorize(options?: PartnerAuthCoreAuthorizeOptions): Promise<PartnerAuthorizeResponse> {\n throwIfSignalAborted(options?.signal)\n const auth = await this.raw.authorizePartner(\n this.#masterKeyId,\n this.#masterKey,\n this.realmUrl,\n options?.signal !== undefined ? { signal: options.signal } : undefined,\n )\n throwIfSignalAborted(options?.signal)\n this.partnerAccountInfo.setAuth(auth)\n this.lockUrlGuard(auth)\n return auth\n }\n\n /**\n * Locks the default transport URL guard to suffixes from a validated auth response.\n *\n * @param auth - Partner authorization response to derive suffixes from.\n */\n lockUrlGuard(auth: PartnerAuthorizeResponse): void {\n this.lockUrlGuardFromSuffixes(derivePartnerAllowedSuffixes(auth, this.realmUrl))\n }\n\n /**\n * Locks the default transport URL guard to previously validated endpoint suffixes.\n *\n * @param derived - Validated endpoint suffixes.\n */\n private lockUrlGuardFromSuffixes(derived: readonly string[]): void {\n if (this.urlGuard === null) return\n const merged =\n this.disableSsrfGuard === true\n ? []\n : this.additionalAllowedSuffixes !== undefined\n ? Array.from(new Set([...derived, ...this.additionalAllowedSuffixes]))\n : derived\n this.urlGuard.setAllowedSuffixes(merged)\n }\n\n /**\n * Validates a Partner authorization snapshot and returns endpoint suffixes.\n *\n * @param auth - Partner authorization response to validate.\n *\n * @returns Host suffixes safe for Partner-token endpoint requests.\n *\n * @internal\n */\n private validateEndpointSuffixes(auth: PartnerAuthorizeResponse): readonly string[] {\n return validatePartnerAuthorizeResponseEndpoints(\n auth,\n this.realmUrl,\n this.allowCustomAuthorizeRealm,\n )\n }\n\n /**\n * Validates an auth snapshot, locks the default URL guard, and returns endpoint suffixes.\n *\n * @param auth - Partner authorization response to validate and activate.\n *\n * @returns Host suffixes safe for Partner-token endpoint requests.\n *\n * @internal\n */\n activateEndpointSuffixes(auth: PartnerAuthorizeResponse): readonly string[] {\n const suffixes = this.validateEndpointSuffixes(auth)\n this.lockUrlGuardFromSuffixes(suffixes)\n return suffixes\n }\n\n private validateCachedAuth(): readonly string[] | undefined {\n const cachedAuth = this.partnerAccountInfo.getAuth()\n if (cachedAuth === null) return undefined\n try {\n return this.validateEndpointSuffixes(cachedAuth)\n } catch {\n // Do not mutate a shared PartnerAccountInfo during construction. The\n // facade will ignore this auth locally until authorize() replaces it.\n return undefined\n }\n }\n\n private reauthorize(signal: AbortSignal | undefined): Promise<string> {\n throwIfSignalAborted(signal)\n const inflight = this.#inflightReauth ?? this.startReauthorize()\n inflight.waiters += 1\n return raceWithAbort(inflight.promise, signal).finally(() => {\n inflight.waiters -= 1\n if (inflight.waiters === 0 && !inflight.settled && !inflight.controller.signal.aborted) {\n inflight.controller.abort(signal?.aborted === true ? abortReason(signal) : undefined)\n }\n })\n }\n\n private startReauthorize(): InflightPartnerReauth {\n const controller = new AbortController()\n const promise = raceWithAbort(this.doReauthorize(controller.signal), controller.signal).finally(\n () => {\n if (this.#inflightReauth?.controller !== controller) return\n this.#inflightReauth.settled = true\n this.#inflightReauth = null\n },\n )\n const inflight: InflightPartnerReauth = {\n controller,\n promise,\n waiters: 0,\n settled: false,\n }\n this.#inflightReauth = inflight\n return inflight\n }\n\n private async doReauthorize(signal: AbortSignal): Promise<string> {\n const auth = await this.authorize({ signal })\n return auth.authorizationToken\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA2DA,IAAa,kBAAb,MAA6B;;CAE3B;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;CACA;CACA;CACA;CACA;CACA,kBAAgD;;;;;;CAOhD,YAAY,SAAiC;EAC3C,KAAKA,eAAe,QAAQ;EAC5B,KAAKC,aAAa,QAAQ;EAC1B,KAAK,WAAW,YAAY,QAAQ,SAAS,YAAY;EACzD,KAAK,qBAAqB,QAAQ,sBAAsB,IAAI,2BAA2B;EACvF,KAAK,4BAA4B,QAAQ;EACzC,KAAK,mBAAmB,QAAQ,oBAAoB;EACpD,KAAK,4BAA4B,QAAQ,6BAA6B;EAEtE,IAAI;EACJ,IAAI,QAAQ,cAAc,KAAA,GAAW;GACnC,gBAAgB,QAAQ;GACxB,KAAK,WAAW;EAClB,OAAO;GACL,MAAM,WAAW,IAAI,SAAS;GAC9B,gBAAgB,IAAI,eAAe;IACjC;IACA,GAAI,QAAQ,cAAc,KAAA,IAAY,EAAE,WAAW,QAAQ,UAAU,IAAI,CAAC;IAC1E,GAAI,QAAQ,8BAA8B,KAAA,IACtC,EAAE,2BAA2B,QAAQ,0BAA0B,IAC/D,CAAC;GACP,CAAC;GACD,KAAK,WAAW;EAClB;EAEA,KAAK,YAAY,IAAI,eAAe;GAClC,WAAW;GACX,OAAO;IAAE,GAAG;IAAuB,GAAG,QAAQ;GAAM;GACpD,WAAW,WAAW,KAAK,YAAY,MAAM;EAC/C,CAAC;EAED,KAAK,yBAAyB,KAAK,mBAAmB;EACtD,IAAI,KAAK,2BAA2B,KAAA,GAClC,KAAK,yBAAyB,KAAK,sBAAsB;EAG3D,KAAK,MAAM,IAAI,iBAAiB;GAC9B,WAAW,KAAK;GAChB,GAAI,KAAK,2BAA2B,KAAA,IAChC,EAAE,mCAAmC,KAAK,uBAAu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;EACpB,OAAO,cAAc,SAAS,SAAS,MAAM,CAAC,CAAC,cAAc;GAC3D,SAAS,WAAW;GACpB,IAAI,SAAS,YAAY,KAAK,CAAC,SAAS,WAAW,CAAC,SAAS,WAAW,OAAO,SAC7E,SAAS,WAAW,MAAM,QAAQ,YAAY,OAAO,YAAY,MAAM,IAAI,KAAA,CAAS;EAExF,CAAC;CACH;CAEA,mBAAkD;EAChD,MAAM,aAAa,IAAI,gBAAgB;EAQvC,MAAM,WAAkC;GACtC;GACA,SATc,cAAc,KAAK,cAAc,WAAW,MAAM,GAAG,WAAW,MAAM,CAAC,CAAC,cAChF;IACJ,IAAI,KAAKA,iBAAiB,eAAe,YAAY;IACrD,KAAKA,gBAAgB,UAAU;IAC/B,KAAKA,kBAAkB;GACzB,CAIA;GACA,SAAS;GACT,SAAS;EACX;EACA,KAAKA,kBAAkB;EACvB,OAAO;CACT;CAEA,MAAc,cAAc,QAAsC;EAEhE,QAAO,MADY,KAAK,UAAU,EAAE,OAAO,CAAC,EAAA,CAChC;CACd;AACF"}
1
+ {"version":3,"file":"auth-core.js","names":[],"sources":["../../src/partner/auth-core.ts"],"sourcesContent":["import { getRealmUrl } from '../auth/realms.ts'\nimport { ReauthCoalescer } from '../auth/reauth-coalescer.ts'\nimport { DEFAULT_RETRY_OPTIONS, type RetryOptions } from '../http/retry.ts'\nimport type { HttpTransport } from '../http/transport.ts'\nimport { FetchTransport, RetryTransport } from '../http/transport.ts'\nimport { UrlGuard } from '../http/url-guard.ts'\nimport type { PartnerAuthorizeResponse } from '../types/partner.ts'\nimport { throwIfSignalAborted } from '../util/abort.ts'\nimport type { PartnerAccountInfo } from './account-info.ts'\nimport { InMemoryPartnerAccountInfo } from './in-memory.ts'\nimport {\n derivePartnerAllowedSuffixes,\n PartnerRawClient,\n validatePartnerAuthorizeResponseEndpoints,\n} from './raw.ts'\n\n/** Shared Partner authorization options used by Partner and Backup facades. */\nexport interface PartnerAuthCoreOptions {\n /** The Master Application Key ID for the partner administrator account. */\n readonly masterKeyId: string\n /** The Master Application Key secret. */\n readonly masterKey: string\n /** B2 realm alias or direct trusted realm URL. Defaults to `\"production\"`. */\n readonly realm?: string\n /** Storage backend for Partner authorization state. */\n readonly partnerAccountInfo?: PartnerAccountInfo\n /** Custom HTTP transport. Defaults to {@link FetchTransport}. */\n readonly transport?: HttpTransport\n /** Override retry behavior for retryable requests. */\n readonly retry?: Partial<RetryOptions>\n /** Custom user-agent string prepended to the SDK default. */\n readonly userAgent?: string\n /** Extra trusted host suffixes to merge into the default SSRF guard. */\n readonly additionalAllowedHostSuffixes?: readonly string[]\n /** Explicitly disable default SSRF guard suffix locking. */\n readonly disableSsrfGuard?: boolean\n /** Whether the default fetch transport may follow same-origin GET/HEAD redirects. */\n readonly followSameOriginRedirects?: boolean\n /** Allow direct custom authorize realms for tests or private proxies. */\n readonly allowCustomAuthorizeRealm?: boolean\n}\n\n/** Options for Partner authorization through {@link PartnerAuthCore}. */\nexport interface PartnerAuthCoreAuthorizeOptions {\n /** Abort signal for cancelling the authorize request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Internal Partner authorization state machine shared by public facades.\n *\n * @internal\n */\nexport class PartnerAuthCore {\n /** Low-level Partner raw client used for authorization and Partner endpoints. */\n readonly raw: PartnerRawClient\n /** Partner authorization state storage. */\n readonly partnerAccountInfo: PartnerAccountInfo\n /** Default transport URL guard, or null when a custom transport owns guarding. */\n readonly urlGuard: UrlGuard | null\n /** Retry-wrapped transport shared by facade-specific raw clients. */\n readonly transport: HttpTransport\n /** Endpoint suffixes validated from cached authorization during construction. */\n readonly cachedEndpointSuffixes: readonly string[] | undefined\n /** Resolved Partner authorize realm URL. */\n private readonly realmUrl: string\n /** Whether custom authorize realms are trusted. */\n private readonly allowCustomAuthorizeRealm: boolean\n readonly #masterKeyId: string\n readonly #masterKey: string\n private readonly additionalAllowedSuffixes: readonly string[] | undefined\n private readonly disableSsrfGuard: boolean\n private readonly reauthCoalescer: ReauthCoalescer<string>\n\n /**\n * Creates a shared Partner authorization core.\n *\n * @param options - Credentials, state storage, transport, retry, and guard settings.\n */\n constructor(options: PartnerAuthCoreOptions) {\n this.#masterKeyId = options.masterKeyId\n this.#masterKey = options.masterKey\n this.realmUrl = getRealmUrl(options.realm ?? 'production')\n this.partnerAccountInfo = options.partnerAccountInfo ?? new InMemoryPartnerAccountInfo()\n this.additionalAllowedSuffixes = options.additionalAllowedHostSuffixes\n this.disableSsrfGuard = options.disableSsrfGuard ?? false\n this.allowCustomAuthorizeRealm = options.allowCustomAuthorizeRealm ?? false\n this.reauthCoalescer = new ReauthCoalescer((signal) => this.doReauthorize(signal))\n\n let baseTransport: HttpTransport\n if (options.transport !== undefined) {\n baseTransport = options.transport\n this.urlGuard = null\n } else {\n const urlGuard = new UrlGuard()\n baseTransport = new FetchTransport({\n urlGuard,\n ...(options.userAgent !== undefined ? { userAgent: options.userAgent } : {}),\n ...(options.followSameOriginRedirects !== undefined\n ? { followSameOriginRedirects: options.followSameOriginRedirects }\n : {}),\n })\n this.urlGuard = urlGuard\n }\n\n this.transport = new RetryTransport({\n transport: baseTransport,\n retry: { ...DEFAULT_RETRY_OPTIONS, ...options.retry },\n onReauth: (signal) => this.reauthorize(signal),\n })\n\n this.cachedEndpointSuffixes = this.validateCachedAuth()\n if (this.cachedEndpointSuffixes !== undefined) {\n this.lockUrlGuardFromSuffixes(this.cachedEndpointSuffixes)\n }\n\n this.raw = new PartnerRawClient({\n transport: this.transport,\n ...(this.cachedEndpointSuffixes !== undefined\n ? { authorizedPartnerEndpointSuffixes: this.cachedEndpointSuffixes }\n : {}),\n ...(options.allowCustomAuthorizeRealm !== undefined\n ? { allowCustomAuthorizeRealm: options.allowCustomAuthorizeRealm }\n : {}),\n })\n }\n\n /**\n * Authenticates with B2 Partner authorization and stores the authorization state.\n *\n * @param options - Optional abort signal.\n *\n * @returns The normalized Partner authorization response.\n */\n async authorize(options?: PartnerAuthCoreAuthorizeOptions): Promise<PartnerAuthorizeResponse> {\n throwIfSignalAborted(options?.signal)\n const auth = await this.raw.authorizePartner(\n this.#masterKeyId,\n this.#masterKey,\n this.realmUrl,\n options?.signal !== undefined ? { signal: options.signal } : undefined,\n )\n throwIfSignalAborted(options?.signal)\n this.partnerAccountInfo.setAuth(auth)\n this.lockUrlGuard(auth)\n return auth\n }\n\n /**\n * Locks the default transport URL guard to suffixes from a validated auth response.\n *\n * @param auth - Partner authorization response to derive suffixes from.\n */\n lockUrlGuard(auth: PartnerAuthorizeResponse): void {\n this.lockUrlGuardFromSuffixes(derivePartnerAllowedSuffixes(auth, this.realmUrl))\n }\n\n /**\n * Locks the default transport URL guard to previously validated endpoint suffixes.\n *\n * @param derived - Validated endpoint suffixes.\n */\n private lockUrlGuardFromSuffixes(derived: readonly string[]): void {\n if (this.urlGuard === null) return\n const merged =\n this.disableSsrfGuard === true\n ? []\n : this.additionalAllowedSuffixes !== undefined\n ? Array.from(new Set([...derived, ...this.additionalAllowedSuffixes]))\n : derived\n this.urlGuard.setAllowedSuffixes(merged)\n }\n\n /**\n * Validates a Partner authorization snapshot and returns endpoint suffixes.\n *\n * @param auth - Partner authorization response to validate.\n *\n * @returns Host suffixes safe for Partner-token endpoint requests.\n *\n * @internal\n */\n private validateEndpointSuffixes(auth: PartnerAuthorizeResponse): readonly string[] {\n return validatePartnerAuthorizeResponseEndpoints(\n auth,\n this.realmUrl,\n this.allowCustomAuthorizeRealm,\n )\n }\n\n /**\n * Validates an auth snapshot, locks the default URL guard, and returns endpoint suffixes.\n *\n * @param auth - Partner authorization response to validate and activate.\n *\n * @returns Host suffixes safe for Partner-token endpoint requests.\n *\n * @internal\n */\n activateEndpointSuffixes(auth: PartnerAuthorizeResponse): readonly string[] {\n const suffixes = this.validateEndpointSuffixes(auth)\n this.lockUrlGuardFromSuffixes(suffixes)\n return suffixes\n }\n\n private validateCachedAuth(): readonly string[] | undefined {\n const cachedAuth = this.partnerAccountInfo.getAuth()\n if (cachedAuth === null) return undefined\n try {\n return this.validateEndpointSuffixes(cachedAuth)\n } catch {\n // Do not mutate a shared PartnerAccountInfo during construction. The\n // facade will ignore this auth locally until authorize() replaces it.\n return undefined\n }\n }\n\n private reauthorize(signal: AbortSignal | undefined): Promise<string> {\n return this.reauthCoalescer.run(signal)\n }\n\n private async doReauthorize(signal: AbortSignal): Promise<string> {\n const auth = await this.authorize({ signal })\n return auth.authorizationToken\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAqDA,IAAa,kBAAb,MAA6B;;CAE3B;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;CACA;CACA;CACA;CACA;CACA;;;;;;CAOA,YAAY,SAAiC;EAC3C,KAAK,eAAe,QAAQ;EAC5B,KAAK,aAAa,QAAQ;EAC1B,KAAK,WAAW,YAAY,QAAQ,SAAS,YAAY;EACzD,KAAK,qBAAqB,QAAQ,sBAAsB,IAAI,2BAA2B;EACvF,KAAK,4BAA4B,QAAQ;EACzC,KAAK,mBAAmB,QAAQ,oBAAoB;EACpD,KAAK,4BAA4B,QAAQ,6BAA6B;EACtE,KAAK,kBAAkB,IAAI,iBAAiB,WAAW,KAAK,cAAc,MAAM,CAAC;EAEjF,IAAI;EACJ,IAAI,QAAQ,cAAc,KAAA,GAAW;GACnC,gBAAgB,QAAQ;GACxB,KAAK,WAAW;EAClB,OAAO;GACL,MAAM,WAAW,IAAI,SAAS;GAC9B,gBAAgB,IAAI,eAAe;IACjC;IACA,GAAI,QAAQ,cAAc,KAAA,IAAY,EAAE,WAAW,QAAQ,UAAU,IAAI,CAAC;IAC1E,GAAI,QAAQ,8BAA8B,KAAA,IACtC,EAAE,2BAA2B,QAAQ,0BAA0B,IAC/D,CAAC;GACP,CAAC;GACD,KAAK,WAAW;EAClB;EAEA,KAAK,YAAY,IAAI,eAAe;GAClC,WAAW;GACX,OAAO;IAAE,GAAG;IAAuB,GAAG,QAAQ;GAAM;GACpD,WAAW,WAAW,KAAK,YAAY,MAAM;EAC/C,CAAC;EAED,KAAK,yBAAyB,KAAK,mBAAmB;EAC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EAChC,IAAI;GACF,OAAO,KAAK,yBAAyB,UAAU;EACjD,QAAQ;GAGN;EACF;CACF;CAEA,YAAoB,QAAkD;EACpE,OAAO,KAAK,gBAAgB,IAAI,MAAM;CACxC;CAEA,MAAc,cAAc,QAAsC;EAEhE,QAAO,MADY,KAAK,UAAU,EAAE,OAAO,CAAC,EAAA,CAChC;CACd;AACF"}
@@ -134,9 +134,9 @@ var PartnerClient = class {
134
134
  });
135
135
  return {
136
136
  page: resp,
137
- nextCursor: resp[0]?.nextEmail ?? void 0
137
+ nextCursor: resp.nextEmail ?? void 0
138
138
  };
139
- }, (page) => page.flatMap((result) => result.groupMembers), options.signal);
139
+ }, (page) => [...page.groupMembers], options.signal);
140
140
  }
141
141
  /**
142
142
  * Creates a new Backblaze account and adds it to a Partner group.
@@ -147,7 +147,7 @@ var PartnerClient = class {
147
147
  *
148
148
  * @param options - Group ID, member email, and optional region.
149
149
  *
150
- * @returns The created member result array, including the member application key.
150
+ * @returns The created member result, including the member application key.
151
151
  *
152
152
  * @experimental Partner API surface; shape may change as the Partner API docs evolve.
153
153
  */
@@ -183,26 +183,41 @@ var PartnerClient = class {
183
183
  }, options.signal !== void 0 ? { signal: options.signal } : void 0);
184
184
  }
185
185
  /**
186
- * Reserves one or more new B2 Reserve trial accounts.
186
+ * Reserves a new B2 Reserve trial account.
187
187
  *
188
188
  * This operation is non-idempotent and automatic retries/expired-token
189
189
  * reauthorization are disabled at the raw layer. If the request fails after
190
- * the server processes it, the returned application keys may be
191
- * unrecoverable; reconcile account state before reissuing a batch.
190
+ * the server processes it, the returned application key may be unrecoverable;
191
+ * reconcile account state before reissuing a request for the same email.
192
192
  *
193
- * @param request - A single trial account request or a non-empty request array.
193
+ * @param request - Email, trial duration, storage, and optional region for the account to create.
194
194
  * @param options - Optional abort signal.
195
195
  *
196
- * @returns The created reserve-trial account result array.
196
+ * @returns The created reserve-trial account result.
197
197
  *
198
198
  * @experimental Partner API surface; shape may change as the Partner API docs evolve.
199
199
  */
200
- async reserveTrialAccounts(request, options) {
201
- if (Array.isArray(request) && request.length === 0) throw new TypeError("reserveTrialAccounts request array must include at least one account request.");
200
+ async reserveTrialAccount(request, options) {
202
201
  const { groupsApiUrl, authToken } = this.groupsCoordinates(this.ensureGroupsAuthorization());
203
202
  return this.raw.reserveTrialCreateAccount(groupsApiUrl, authToken, request, options?.signal !== void 0 ? { signal: options.signal } : void 0);
204
203
  }
205
204
  /**
205
+ * Reserves a new B2 Reserve trial account.
206
+ *
207
+ * @param request - Email, trial duration, storage, and optional region for the account to create.
208
+ * @param options - Optional abort signal.
209
+ *
210
+ * @returns The created reserve-trial account result.
211
+ *
212
+ * @deprecated Use {@link reserveTrialAccount}. This plural alias is kept for
213
+ * callers that picked up the original experimental facade name.
214
+ *
215
+ * @experimental Partner API surface; shape may change as the Partner API docs evolve.
216
+ */
217
+ async reserveTrialAccounts(request, options) {
218
+ return this.reserveTrialAccount(request, options);
219
+ }
220
+ /**
206
221
  * Hides credentials and Partner tokens from `JSON.stringify(client)`.
207
222
  *
208
223
  * @returns A redacted diagnostic object.
@@ -1 +1 @@
1
- {"version":3,"file":"client.cjs","names":[],"sources":["../../src/partner/client.ts"],"sourcesContent":["import { B2PartnerAuthorizationError } from '../errors/index.ts'\nimport type { RetryOptions } from '../http/retry.ts'\nimport type { HttpTransport } from '../http/transport.ts'\nimport type { UrlGuard } from '../http/url-guard.ts'\nimport type { AccountId, GroupId, PartnerToken } from '../types/ids.ts'\nimport type {\n CreateGroupMemberResponse,\n EjectGroupMemberResponse,\n ListedGroupMember,\n ListGroupMembersResponse,\n ListGroupsResponse,\n PartnerAuthorizeResponse,\n PartnerGroup,\n Region,\n ReserveTrialCreateAccountRequest,\n ReserveTrialCreateAccountRequestEntry,\n ReserveTrialCreateAccountResponse,\n} from '../types/partner.ts'\nimport { paginateItems } from '../util/paginator.ts'\nimport type { PartnerAccountInfo } from './account-info.ts'\nimport { PartnerAuthCore } from './auth-core.ts'\nimport type { PartnerRawClient } from './raw.ts'\nimport { PARTNER_TOKEN_REDACTED } from './redaction.ts'\n\nconst MASTER_KEY_REDACTED = '[redacted Master Application Key]'\n\n/**\n * Configuration options for creating a {@link PartnerClient}.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerClientOptions {\n /** The Master Application Key ID for the partner administrator account. */\n readonly masterKeyId: string\n /** The Master Application Key secret. */\n readonly masterKey: string\n /**\n * B2 realm to authenticate against. Accepts a known realm-map key\n * (`\"production\"` or `\"staging\"`) or a direct base URL. Custom HTTPS hosts\n * are trusted with the Master Application Key during authorize, so never\n * derive `realm` from untrusted input. URL values must use HTTPS, or\n * loopback IP literal HTTP for local testing only; Master Application Key\n * credentials are sent unencrypted over loopback HTTP. Unsupported schemes,\n * malformed URLs, non-URL strings, plaintext HTTP hostnames such as\n * `localhost`, and non-loopback plaintext HTTP are rejected before\n * credentials are sent. URL values must not include userinfo, query strings,\n * or fragments. Defaults to `\"production\"`.\n */\n readonly realm?: string\n /**\n * Storage backend for Partner authorization state. Defaults to\n * {@link InMemoryPartnerAccountInfo}. Cached authorization whose endpoint\n * URLs fail the configured realm policy is ignored by this client until\n * `authorize()` replaces it; shared stores are not cleared during\n * construction.\n */\n readonly partnerAccountInfo?: PartnerAccountInfo\n /** Custom HTTP transport. Defaults to `FetchTransport`. Wrapped by `RetryTransport`. */\n readonly transport?: HttpTransport\n /** Override retry behavior (max retries, backoff, and per-attempt timeout). */\n readonly retry?: Partial<RetryOptions>\n /** Custom user-agent string prepended to the SDK default. */\n readonly userAgent?: string\n /**\n * Additional SSRF allow-list host suffixes. By default the SDK locks the\n * default transport to host suffixes derived from the Partner authorize\n * response. Pass an explicit list to add trusted hosts, for example a test\n * proxy. An empty array adds no hosts and leaves the default guard enabled.\n *\n * Only consulted when {@link PartnerClientOptions.transport} is unset; a\n * custom transport is the user's responsibility to harden.\n */\n readonly additionalAllowedHostSuffixes?: readonly string[]\n /**\n * Explicitly disable the default SSRF guard after authorize.\n *\n * This is intended only for controlled simulator/private-proxy tests. Never\n * enable it for URLs derived from untrusted input or production credentials.\n * Only consulted when {@link PartnerClientOptions.transport} is unset.\n */\n readonly disableSsrfGuard?: boolean\n /**\n * Follow same-origin GET/HEAD redirects in the default fetch transport after\n * checking each target with the SSRF guard. POST redirects remain blocked.\n * Defaults to true.\n */\n readonly followSameOriginRedirects?: boolean\n /**\n * Allow direct custom authorize realms for tests or private proxies.\n * Leave disabled unless the configured host is trusted with the Master\n * Application Key.\n */\n readonly allowCustomAuthorizeRealm?: boolean\n}\n\n/**\n * Options for Partner authorization.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerAuthorizeOptions {\n /** Abort signal for cancelling the authorize request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for listing Partner groups.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupsOptions {\n /** Optional group name filter. Multiple groups may share the same name. */\n readonly groupName?: string\n /** Group ID to start listing from for pagination. */\n readonly startGroupId?: GroupId\n /** Maximum groups to return in this page. Forwarded to `maxGroupCount`. */\n readonly pageSize?: number\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for paginating Partner groups.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PaginateGroupsOptions extends Omit<ListGroupsOptions, 'startGroupId'> {\n /**\n * Aborts the iteration between page fetches. The signal is also forwarded to\n * each underlying list request.\n */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for listing Partner group members.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupMembersOptions {\n /** Group ID whose active members should be listed. */\n readonly groupId: GroupId\n /** First member email address to return for pagination. */\n readonly startEmail?: string\n /** Maximum members to return in this page. Forwarded to `maxMemberCount`. */\n readonly pageSize?: number\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for paginating Partner group members.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PaginateGroupMembersOptions extends Omit<ListGroupMembersOptions, 'startEmail'> {\n /**\n * Aborts the iteration between page fetches. The signal is also forwarded to\n * each underlying list request.\n */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for creating a Partner group member.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface CreateGroupMemberOptions {\n /** Group ID that the new Backblaze account will join. */\n readonly groupId: GroupId\n /** Email address for the new group member account. */\n readonly memberEmail: string\n /** Region for the new account's data, or null to use the current default region. */\n readonly region?: Region | null\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for ejecting a Partner group member.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface EjectGroupMemberOptions {\n /** Group ID that currently contains the member. */\n readonly groupId: GroupId\n /** Account ID of the group member being ejected. */\n readonly memberAccountId: AccountId\n /** Replacement email for the ejected account, or null to keep the current email address. */\n readonly email?: string | null\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for reserving B2 Reserve trial accounts.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ReserveTrialAccountsOptions {\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/** Coordinates needed for Partner groups API requests. */\ninterface PartnerGroupsCoordinates {\n readonly groupsApiUrl: string\n readonly authToken: PartnerToken\n readonly adminAccountId: AccountId\n}\n\n/** Redacted JSON diagnostic shape emitted by {@link PartnerClient.toJSON}. */\nexport interface PartnerClientJson {\n /** Object kind for log consumers. */\n readonly type: 'PartnerClient'\n /** Redacted Master Application Key credential placeholder. */\n readonly credentials: string\n /** Redacted Partner token placeholder, or unauthorized state. */\n readonly authorization: string\n /** Whether this client currently has Partner authorization state. */\n readonly authorized: boolean\n /** Current default URL guard suffixes, or null when a custom transport owns guarding. */\n readonly urlGuardAllowedSuffixes: readonly string[] | null\n}\n\n/**\n * High-level Partner API client for groups, members, and B2 Reserve trials.\n *\n * @example\n * ```ts\n * const partner = new PartnerClient({\n * masterKeyId: process.env.B2_MASTER_KEY_ID,\n * masterKey: process.env.B2_MASTER_KEY,\n * })\n * await partner.authorize()\n * for await (const group of partner.paginateGroups()) {\n * console.log(group.groupName)\n * }\n * ```\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport class PartnerClient {\n /** Low-level client for direct Partner API calls. */\n readonly raw: PartnerRawClient\n /** Partner authorization state storage (tokens, URLs, capabilities). */\n readonly partnerAccountInfo: PartnerAccountInfo\n /**\n * SSRF allow-list applied by the default transport. `null` when\n * a custom transport was supplied; in that case the SDK does not own the\n * guard.\n */\n readonly urlGuard: UrlGuard | null\n private readonly authCore: PartnerAuthCore\n\n /**\n * Creates a new PartnerClient. Call {@link authorize} before making API requests.\n *\n * @param options - Configuration including credentials, realm, and transport settings.\n */\n constructor(options: PartnerClientOptions) {\n this.authCore = new PartnerAuthCore(options)\n this.raw = this.authCore.raw\n this.partnerAccountInfo = this.authCore.partnerAccountInfo\n this.urlGuard = this.authCore.urlGuard\n }\n\n /**\n * Authenticates with B2 Partner authorization and stores the authorization state.\n *\n * @param options - Optional abort signal.\n *\n * @returns The Partner authorization response containing tokens, URLs, and capabilities.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async authorize(options?: PartnerAuthorizeOptions): Promise<PartnerAuthorizeResponse> {\n return this.authCore.authorize(options)\n }\n\n /**\n * Lists Partner groups for the authorized partner administrator account.\n *\n * @param options - Optional group filter and pagination settings.\n *\n * @returns A page of Partner groups with an optional continuation cursor.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async listGroups(options?: ListGroupsOptions): Promise<ListGroupsResponse> {\n const { groupsApiUrl, authToken, adminAccountId } = this.groupsCoordinates(\n this.ensureGroupsAuthorization(),\n )\n return this.raw.listGroups(\n groupsApiUrl,\n authToken,\n {\n adminAccountId,\n ...(options?.groupName !== undefined ? { groupName: options.groupName } : {}),\n ...(options?.startGroupId !== undefined ? { startGroupId: options.startGroupId } : {}),\n ...(options?.pageSize !== undefined ? { maxGroupCount: options.pageSize } : {}),\n },\n options?.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Async iterator that yields every Partner group for the authorized account.\n *\n * @param options - Optional group filter, page size, and abort signal.\n *\n * @returns An async iterable of {@link PartnerGroup} entries.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n paginateGroups(options?: PaginateGroupsOptions): AsyncIterableIterator<PartnerGroup> {\n return paginateItems(\n async (cursor: GroupId | undefined) => {\n const resp = await this.listGroups({\n ...(options?.groupName !== undefined ? { groupName: options.groupName } : {}),\n ...(options?.pageSize !== undefined ? { pageSize: options.pageSize } : {}),\n ...(cursor !== undefined ? { startGroupId: cursor } : {}),\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n })\n return { page: resp, nextCursor: resp.nextGroupId ?? undefined }\n },\n (page) => page.groups,\n options?.signal,\n )\n }\n\n /**\n * Lists active members for a Partner group.\n *\n * @param options - Group ID plus optional pagination settings.\n *\n * @returns A page of group-member results with an optional continuation cursor.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async listGroupMembers(options: ListGroupMembersOptions): Promise<ListGroupMembersResponse> {\n const { groupsApiUrl, authToken, adminAccountId } = this.groupsCoordinates(\n this.ensureGroupsAuthorization(),\n )\n return this.raw.listGroupMembers(\n groupsApiUrl,\n authToken,\n {\n adminAccountId,\n groupId: options.groupId,\n ...(options.startEmail !== undefined ? { startEmail: options.startEmail } : {}),\n ...(options.pageSize !== undefined ? { maxMemberCount: options.pageSize } : {}),\n },\n options.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Async iterator that yields every active member for a Partner group.\n *\n * @param options - Group ID plus optional page size and abort signal.\n *\n * @returns An async iterable of {@link ListedGroupMember} entries.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n paginateGroupMembers(\n options: PaginateGroupMembersOptions,\n ): AsyncIterableIterator<ListedGroupMember> {\n return paginateItems(\n async (cursor: string | undefined) => {\n const resp = await this.listGroupMembers({\n groupId: options.groupId,\n ...(options.pageSize !== undefined ? { pageSize: options.pageSize } : {}),\n ...(cursor !== undefined ? { startEmail: cursor } : {}),\n ...(options.signal !== undefined ? { signal: options.signal } : {}),\n })\n // The API returns an array for consistency with batch-capable Partner\n // surfaces, but this request is scoped to one group ID.\n const result = resp[0]\n return {\n page: resp,\n nextCursor: result?.nextEmail ?? undefined,\n }\n },\n (page) => page.flatMap((result) => result.groupMembers),\n options.signal,\n )\n }\n\n /**\n * Creates a new Backblaze account and adds it to a Partner group.\n *\n * This mutation is non-idempotent. Automatic retries and expired-token\n * reauthorization are disabled; long-running batch callers must catch token\n * expiry, call {@link authorize}, and decide whether to issue a new request.\n *\n * @param options - Group ID, member email, and optional region.\n *\n * @returns The created member result array, including the member application key.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async createGroupMember(options: CreateGroupMemberOptions): Promise<CreateGroupMemberResponse> {\n const { groupsApiUrl, authToken, adminAccountId } = this.groupsCoordinates(\n this.ensureGroupsAuthorization(),\n )\n return this.raw.createGroupMember(\n groupsApiUrl,\n authToken,\n {\n adminAccountId,\n groupId: options.groupId,\n memberEmail: options.memberEmail,\n ...(options.region !== undefined ? { region: options.region } : {}),\n },\n options.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Ejects an active member from a Partner group without deleting the account.\n *\n * This mutation is non-idempotent. Automatic retries and expired-token\n * reauthorization are disabled; long-running batch callers must catch token\n * expiry, call {@link authorize}, and decide whether to issue a new request.\n *\n * @param options - Group ID, member account ID, and optional replacement email.\n *\n * @returns The ejected member object.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async ejectGroupMember(options: EjectGroupMemberOptions): Promise<EjectGroupMemberResponse> {\n const { groupsApiUrl, authToken, adminAccountId } = this.groupsCoordinates(\n this.ensureGroupsAuthorization(),\n )\n return this.raw.ejectGroupMember(\n groupsApiUrl,\n authToken,\n {\n adminAccountId,\n groupId: options.groupId,\n memberAccountId: options.memberAccountId,\n ...(options.email !== undefined ? { email: options.email } : {}),\n },\n options.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Reserves one or more new B2 Reserve trial accounts.\n *\n * This operation is non-idempotent and automatic retries/expired-token\n * reauthorization are disabled at the raw layer. If the request fails after\n * the server processes it, the returned application keys may be\n * unrecoverable; reconcile account state before reissuing a batch.\n *\n * @param request - A single trial account request or a non-empty request array.\n * @param options - Optional abort signal.\n *\n * @returns The created reserve-trial account result array.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async reserveTrialAccounts(\n request: ReserveTrialCreateAccountRequestEntry | ReserveTrialCreateAccountRequest,\n options?: ReserveTrialAccountsOptions,\n ): Promise<ReserveTrialCreateAccountResponse> {\n if (Array.isArray(request) && request.length === 0) {\n throw new TypeError(\n 'reserveTrialAccounts request array must include at least one account request.',\n )\n }\n const { groupsApiUrl, authToken } = this.groupsCoordinates(this.ensureGroupsAuthorization())\n return this.raw.reserveTrialCreateAccount(\n groupsApiUrl,\n authToken,\n request,\n options?.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Hides credentials and Partner tokens from `JSON.stringify(client)`.\n *\n * @returns A redacted diagnostic object.\n */\n toJSON(): PartnerClientJson {\n return {\n type: 'PartnerClient',\n credentials: MASTER_KEY_REDACTED,\n authorization:\n this.partnerAccountInfo.getAuth() === null ? '[unauthorized]' : PARTNER_TOKEN_REDACTED,\n authorized: this.partnerAccountInfo.getAuth() !== null,\n urlGuardAllowedSuffixes: this.urlGuard?.getAllowedSuffixes() ?? null,\n }\n }\n\n /**\n * Hides credentials and Partner tokens from default stringification.\n *\n * @returns A short redacted label.\n */\n toString(): string {\n return `[PartnerClient ${MASTER_KEY_REDACTED}]`\n }\n\n /**\n * Hides credentials and Partner tokens from Node's `util.inspect`.\n *\n * @returns A short redacted label.\n */\n [Symbol.for('nodejs.util.inspect.custom')](): string {\n return this.toString()\n }\n\n private ensureGroupsAuthorization(): PartnerAuthorizeResponse {\n const auth = this.partnerAccountInfo.getAuth()\n if (auth === null) {\n throw new B2PartnerAuthorizationError('Not authorized. Call PartnerClient.authorize() first.')\n }\n const suffixes = this.authCore.activateEndpointSuffixes(auth)\n this.raw.setAuthorizedEndpointSuffixes(suffixes)\n return auth\n }\n\n private groupsCoordinates(auth: PartnerAuthorizeResponse): PartnerGroupsCoordinates {\n const groupsApiUrl = auth.apiInfo.groupsApi?.groupsApiUrl\n if (groupsApiUrl === undefined) {\n throw new B2PartnerAuthorizationError(\n 'Partner API is not available; PartnerClient.authorize() did not return apiInfo.groupsApi.',\n )\n }\n return {\n groupsApiUrl,\n authToken: auth.authorizationToken,\n adminAccountId: auth.accountId,\n }\n }\n}\n"],"mappings":";;;;;AAwBA,IAAM,sBAAsB;;;;;;;;;;;;;;;;;;AA2N5B,IAAa,gBAAb,MAA2B;;CAEzB;;CAEA;;;;;;CAMA;CACA;;;;;;CAOA,YAAY,SAA+B;EACzC,KAAK,WAAW,IAAI,kBAAA,gBAAgB,OAAO;EAC3C,KAAK,MAAM,KAAK,SAAS;EACzB,KAAK,qBAAqB,KAAK,SAAS;EACxC,KAAK,WAAW,KAAK,SAAS;CAChC;;;;;;;;;;CAWA,MAAM,UAAU,SAAsE;EACpF,OAAO,KAAK,SAAS,UAAU,OAAO;CACxC;;;;;;;;;;CAWA,MAAM,WAAW,SAA0D;EACzE,MAAM,EAAE,cAAc,WAAW,mBAAmB,KAAK,kBACvD,KAAK,0BAA0B,CACjC;EACA,OAAO,KAAK,IAAI,WACd,cACA,WACA;GACE;GACA,GAAI,SAAS,cAAc,KAAA,IAAY,EAAE,WAAW,QAAQ,UAAU,IAAI,CAAC;GAC3E,GAAI,SAAS,iBAAiB,KAAA,IAAY,EAAE,cAAc,QAAQ,aAAa,IAAI,CAA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AK,0BAA0B,CAAC;EAC3F,OAAO,KAAK,IAAI,0BACd,cACA,WACA,SACA,SAAS,WAAW,KAAA,IAAY,EAAE,QAAQ,QAAQ,OAAO,IAAI,KAAA,CAC/D;CACF;;;;;;CAOA,SAA4B;EAC1B,OAAO;GACL,MAAM;GACN,aAAa;GACb,eACE,KAAK,mBAAmB,QAAQ,MAAM,OAAO,mBAAmB,+BAAA;GAClE,YAAY,KAAK,mBAAmB,QAAQ,MAAM;GAClD,yBAAyB,KAAK,UAAU,mBAAmB,KAAK;EAClE;CACF;;;;;;CAOA,WAAmB;EACjB,OAAO,kBAAkB,oBAAoB;CAC/C;;;;;;CAOA,CAAC,OAAO,IAAI,4BAA4B,KAAa;EACnD,OAAO,KAAK,SAAS;CACvB;CAEA,4BAA8D;EAC5D,MAAM,OAAO,KAAK,mBAAmB,QAAQ;EAC7C,IAAI,SAAS,MACX,MAAM,IAAI,qBAAA,4BAA4B,uDAAuD;EAE/F,MAAM,WAAW,KAAK,SAAS,yBAAyB,IAAI;EAC5D,KAAK,IAAI,8BAA8B,QAAQ;EAC/C,OAAO;CACT;CAEA,kBAA0B,MAA0D;EAClF,MAAM,eAAe,KAAK,QAAQ,WAAW;EAC7C,IAAI,iBAAiB,KAAA,GACnB,MAAM,IAAI,qBAAA,4BACR,2FACF;EAEF,OAAO;GACL;GACA,WAAW,KAAK;GAChB,gBAAgB,KAAK;EACvB;CACF;AACF"}
1
+ {"version":3,"file":"client.cjs","names":[],"sources":["../../src/partner/client.ts"],"sourcesContent":["import { B2PartnerAuthorizationError } from '../errors/index.ts'\nimport type { RetryOptions } from '../http/retry.ts'\nimport type { HttpTransport } from '../http/transport.ts'\nimport type { UrlGuard } from '../http/url-guard.ts'\nimport type { AccountId, GroupId, PartnerToken } from '../types/ids.ts'\nimport type {\n CreateGroupMemberResponse,\n EjectGroupMemberResponse,\n ListedGroupMember,\n ListGroupMembersResponse,\n ListGroupsResponse,\n PartnerAuthorizeResponse,\n PartnerGroup,\n Region,\n ReserveTrialCreateAccountRequest,\n ReserveTrialCreateAccountResponse,\n} from '../types/partner.ts'\nimport { paginateItems } from '../util/paginator.ts'\nimport type { PartnerAccountInfo } from './account-info.ts'\nimport { PartnerAuthCore } from './auth-core.ts'\nimport type { PartnerRawClient } from './raw.ts'\nimport { PARTNER_TOKEN_REDACTED } from './redaction.ts'\n\nconst MASTER_KEY_REDACTED = '[redacted Master Application Key]'\n\n/**\n * Configuration options for creating a {@link PartnerClient}.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerClientOptions {\n /** The Master Application Key ID for the partner administrator account. */\n readonly masterKeyId: string\n /** The Master Application Key secret. */\n readonly masterKey: string\n /**\n * B2 realm to authenticate against. Accepts a known realm-map key\n * (`\"production\"` or `\"staging\"`) or a direct base URL. Custom HTTPS hosts\n * are trusted with the Master Application Key during authorize, so never\n * derive `realm` from untrusted input. URL values must use HTTPS, or\n * loopback IP literal HTTP for local testing only; Master Application Key\n * credentials are sent unencrypted over loopback HTTP. Unsupported schemes,\n * malformed URLs, non-URL strings, plaintext HTTP hostnames such as\n * `localhost`, and non-loopback plaintext HTTP are rejected before\n * credentials are sent. URL values must not include userinfo, query strings,\n * or fragments. Defaults to `\"production\"`.\n */\n readonly realm?: string\n /**\n * Storage backend for Partner authorization state. Defaults to\n * {@link InMemoryPartnerAccountInfo}. Cached authorization whose endpoint\n * URLs fail the configured realm policy is ignored by this client until\n * `authorize()` replaces it; shared stores are not cleared during\n * construction.\n */\n readonly partnerAccountInfo?: PartnerAccountInfo\n /** Custom HTTP transport. Defaults to `FetchTransport`. Wrapped by `RetryTransport`. */\n readonly transport?: HttpTransport\n /** Override retry behavior (max retries, backoff, and per-attempt timeout). */\n readonly retry?: Partial<RetryOptions>\n /** Custom user-agent string prepended to the SDK default. */\n readonly userAgent?: string\n /**\n * Additional SSRF allow-list host suffixes. By default the SDK locks the\n * default transport to host suffixes derived from the Partner authorize\n * response. Pass an explicit list to add trusted hosts, for example a test\n * proxy. An empty array adds no hosts and leaves the default guard enabled.\n *\n * Only consulted when {@link PartnerClientOptions.transport} is unset; a\n * custom transport is the user's responsibility to harden.\n */\n readonly additionalAllowedHostSuffixes?: readonly string[]\n /**\n * Explicitly disable the default SSRF guard after authorize.\n *\n * This is intended only for controlled simulator/private-proxy tests. Never\n * enable it for URLs derived from untrusted input or production credentials.\n * Only consulted when {@link PartnerClientOptions.transport} is unset.\n */\n readonly disableSsrfGuard?: boolean\n /**\n * Follow same-origin GET/HEAD redirects in the default fetch transport after\n * checking each target with the SSRF guard. POST redirects remain blocked.\n * Defaults to true.\n */\n readonly followSameOriginRedirects?: boolean\n /**\n * Allow direct custom authorize realms for tests or private proxies.\n * Leave disabled unless the configured host is trusted with the Master\n * Application Key.\n */\n readonly allowCustomAuthorizeRealm?: boolean\n}\n\n/**\n * Options for Partner authorization.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PartnerAuthorizeOptions {\n /** Abort signal for cancelling the authorize request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for listing Partner groups.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupsOptions {\n /** Optional group name filter. Multiple groups may share the same name. */\n readonly groupName?: string\n /** Group ID to start listing from for pagination. */\n readonly startGroupId?: GroupId\n /** Maximum groups to return in this page. Forwarded to `maxGroupCount`. */\n readonly pageSize?: number\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for paginating Partner groups.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PaginateGroupsOptions extends Omit<ListGroupsOptions, 'startGroupId'> {\n /**\n * Aborts the iteration between page fetches. The signal is also forwarded to\n * each underlying list request.\n */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for listing Partner group members.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ListGroupMembersOptions {\n /** Group ID whose active members should be listed. */\n readonly groupId: GroupId\n /** First member email address to return for pagination. */\n readonly startEmail?: string\n /** Maximum members to return in this page. Forwarded to `maxMemberCount`. */\n readonly pageSize?: number\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for paginating Partner group members.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface PaginateGroupMembersOptions extends Omit<ListGroupMembersOptions, 'startEmail'> {\n /**\n * Aborts the iteration between page fetches. The signal is also forwarded to\n * each underlying list request.\n */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for creating a Partner group member.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface CreateGroupMemberOptions {\n /** Group ID that the new Backblaze account will join. */\n readonly groupId: GroupId\n /** Email address for the new group member account. */\n readonly memberEmail: string\n /** Region for the new account's data, or null to use the current default region. */\n readonly region?: Region | null\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for ejecting a Partner group member.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface EjectGroupMemberOptions {\n /** Group ID that currently contains the member. */\n readonly groupId: GroupId\n /** Account ID of the group member being ejected. */\n readonly memberAccountId: AccountId\n /** Replacement email for the ejected account, or null to keep the current email address. */\n readonly email?: string | null\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for reserving a B2 Reserve trial account.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport interface ReserveTrialAccountOptions {\n /** Abort signal for cancelling the request. */\n readonly signal?: AbortSignal\n}\n\n/**\n * Options for reserving a B2 Reserve trial account.\n *\n * @deprecated Use {@link ReserveTrialAccountOptions}.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport type ReserveTrialAccountsOptions = ReserveTrialAccountOptions\n\n/** Coordinates needed for Partner groups API requests. */\ninterface PartnerGroupsCoordinates {\n readonly groupsApiUrl: string\n readonly authToken: PartnerToken\n readonly adminAccountId: AccountId\n}\n\n/** Redacted JSON diagnostic shape emitted by {@link PartnerClient.toJSON}. */\nexport interface PartnerClientJson {\n /** Object kind for log consumers. */\n readonly type: 'PartnerClient'\n /** Redacted Master Application Key credential placeholder. */\n readonly credentials: string\n /** Redacted Partner token placeholder, or unauthorized state. */\n readonly authorization: string\n /** Whether this client currently has Partner authorization state. */\n readonly authorized: boolean\n /** Current default URL guard suffixes, or null when a custom transport owns guarding. */\n readonly urlGuardAllowedSuffixes: readonly string[] | null\n}\n\n/**\n * High-level Partner API client for groups, members, and B2 Reserve trials.\n *\n * @example\n * ```ts\n * const partner = new PartnerClient({\n * masterKeyId: process.env.B2_MASTER_KEY_ID,\n * masterKey: process.env.B2_MASTER_KEY,\n * })\n * await partner.authorize()\n * for await (const group of partner.paginateGroups()) {\n * console.log(group.groupName)\n * }\n * ```\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\nexport class PartnerClient {\n /** Low-level client for direct Partner API calls. */\n readonly raw: PartnerRawClient\n /** Partner authorization state storage (tokens, URLs, capabilities). */\n readonly partnerAccountInfo: PartnerAccountInfo\n /**\n * SSRF allow-list applied by the default transport. `null` when\n * a custom transport was supplied; in that case the SDK does not own the\n * guard.\n */\n readonly urlGuard: UrlGuard | null\n private readonly authCore: PartnerAuthCore\n\n /**\n * Creates a new PartnerClient. Call {@link authorize} before making API requests.\n *\n * @param options - Configuration including credentials, realm, and transport settings.\n */\n constructor(options: PartnerClientOptions) {\n this.authCore = new PartnerAuthCore(options)\n this.raw = this.authCore.raw\n this.partnerAccountInfo = this.authCore.partnerAccountInfo\n this.urlGuard = this.authCore.urlGuard\n }\n\n /**\n * Authenticates with B2 Partner authorization and stores the authorization state.\n *\n * @param options - Optional abort signal.\n *\n * @returns The Partner authorization response containing tokens, URLs, and capabilities.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async authorize(options?: PartnerAuthorizeOptions): Promise<PartnerAuthorizeResponse> {\n return this.authCore.authorize(options)\n }\n\n /**\n * Lists Partner groups for the authorized partner administrator account.\n *\n * @param options - Optional group filter and pagination settings.\n *\n * @returns A page of Partner groups with an optional continuation cursor.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async listGroups(options?: ListGroupsOptions): Promise<ListGroupsResponse> {\n const { groupsApiUrl, authToken, adminAccountId } = this.groupsCoordinates(\n this.ensureGroupsAuthorization(),\n )\n return this.raw.listGroups(\n groupsApiUrl,\n authToken,\n {\n adminAccountId,\n ...(options?.groupName !== undefined ? { groupName: options.groupName } : {}),\n ...(options?.startGroupId !== undefined ? { startGroupId: options.startGroupId } : {}),\n ...(options?.pageSize !== undefined ? { maxGroupCount: options.pageSize } : {}),\n },\n options?.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Async iterator that yields every Partner group for the authorized account.\n *\n * @param options - Optional group filter, page size, and abort signal.\n *\n * @returns An async iterable of {@link PartnerGroup} entries.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n paginateGroups(options?: PaginateGroupsOptions): AsyncIterableIterator<PartnerGroup> {\n return paginateItems(\n async (cursor: GroupId | undefined) => {\n const resp = await this.listGroups({\n ...(options?.groupName !== undefined ? { groupName: options.groupName } : {}),\n ...(options?.pageSize !== undefined ? { pageSize: options.pageSize } : {}),\n ...(cursor !== undefined ? { startGroupId: cursor } : {}),\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n })\n return { page: resp, nextCursor: resp.nextGroupId ?? undefined }\n },\n (page) => page.groups,\n options?.signal,\n )\n }\n\n /**\n * Lists active members for a Partner group.\n *\n * @param options - Group ID plus optional pagination settings.\n *\n * @returns A page of group-member results with an optional continuation cursor.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async listGroupMembers(options: ListGroupMembersOptions): Promise<ListGroupMembersResponse> {\n const { groupsApiUrl, authToken, adminAccountId } = this.groupsCoordinates(\n this.ensureGroupsAuthorization(),\n )\n return this.raw.listGroupMembers(\n groupsApiUrl,\n authToken,\n {\n adminAccountId,\n groupId: options.groupId,\n ...(options.startEmail !== undefined ? { startEmail: options.startEmail } : {}),\n ...(options.pageSize !== undefined ? { maxMemberCount: options.pageSize } : {}),\n },\n options.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Async iterator that yields every active member for a Partner group.\n *\n * @param options - Group ID plus optional page size and abort signal.\n *\n * @returns An async iterable of {@link ListedGroupMember} entries.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n paginateGroupMembers(\n options: PaginateGroupMembersOptions,\n ): AsyncIterableIterator<ListedGroupMember> {\n return paginateItems(\n async (cursor: string | undefined) => {\n const resp = await this.listGroupMembers({\n groupId: options.groupId,\n ...(options.pageSize !== undefined ? { pageSize: options.pageSize } : {}),\n ...(cursor !== undefined ? { startEmail: cursor } : {}),\n ...(options.signal !== undefined ? { signal: options.signal } : {}),\n })\n return {\n page: resp,\n nextCursor: resp.nextEmail ?? undefined,\n }\n },\n (page) => [...page.groupMembers],\n options.signal,\n )\n }\n\n /**\n * Creates a new Backblaze account and adds it to a Partner group.\n *\n * This mutation is non-idempotent. Automatic retries and expired-token\n * reauthorization are disabled; long-running batch callers must catch token\n * expiry, call {@link authorize}, and decide whether to issue a new request.\n *\n * @param options - Group ID, member email, and optional region.\n *\n * @returns The created member result, including the member application key.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async createGroupMember(options: CreateGroupMemberOptions): Promise<CreateGroupMemberResponse> {\n const { groupsApiUrl, authToken, adminAccountId } = this.groupsCoordinates(\n this.ensureGroupsAuthorization(),\n )\n return this.raw.createGroupMember(\n groupsApiUrl,\n authToken,\n {\n adminAccountId,\n groupId: options.groupId,\n memberEmail: options.memberEmail,\n ...(options.region !== undefined ? { region: options.region } : {}),\n },\n options.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Ejects an active member from a Partner group without deleting the account.\n *\n * This mutation is non-idempotent. Automatic retries and expired-token\n * reauthorization are disabled; long-running batch callers must catch token\n * expiry, call {@link authorize}, and decide whether to issue a new request.\n *\n * @param options - Group ID, member account ID, and optional replacement email.\n *\n * @returns The ejected member object.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async ejectGroupMember(options: EjectGroupMemberOptions): Promise<EjectGroupMemberResponse> {\n const { groupsApiUrl, authToken, adminAccountId } = this.groupsCoordinates(\n this.ensureGroupsAuthorization(),\n )\n return this.raw.ejectGroupMember(\n groupsApiUrl,\n authToken,\n {\n adminAccountId,\n groupId: options.groupId,\n memberAccountId: options.memberAccountId,\n ...(options.email !== undefined ? { email: options.email } : {}),\n },\n options.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Reserves a new B2 Reserve trial account.\n *\n * This operation is non-idempotent and automatic retries/expired-token\n * reauthorization are disabled at the raw layer. If the request fails after\n * the server processes it, the returned application key may be unrecoverable;\n * reconcile account state before reissuing a request for the same email.\n *\n * @param request - Email, trial duration, storage, and optional region for the account to create.\n * @param options - Optional abort signal.\n *\n * @returns The created reserve-trial account result.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async reserveTrialAccount(\n request: ReserveTrialCreateAccountRequest,\n options?: ReserveTrialAccountOptions,\n ): Promise<ReserveTrialCreateAccountResponse> {\n const { groupsApiUrl, authToken } = this.groupsCoordinates(this.ensureGroupsAuthorization())\n return this.raw.reserveTrialCreateAccount(\n groupsApiUrl,\n authToken,\n request,\n options?.signal !== undefined ? { signal: options.signal } : undefined,\n )\n }\n\n /**\n * Reserves a new B2 Reserve trial account.\n *\n * @param request - Email, trial duration, storage, and optional region for the account to create.\n * @param options - Optional abort signal.\n *\n * @returns The created reserve-trial account result.\n *\n * @deprecated Use {@link reserveTrialAccount}. This plural alias is kept for\n * callers that picked up the original experimental facade name.\n *\n * @experimental Partner API surface; shape may change as the Partner API docs evolve.\n */\n async reserveTrialAccounts(\n request: ReserveTrialCreateAccountRequest,\n options?: ReserveTrialAccountsOptions,\n ): Promise<ReserveTrialCreateAccountResponse> {\n return this.reserveTrialAccount(request, options)\n }\n\n /**\n * Hides credentials and Partner tokens from `JSON.stringify(client)`.\n *\n * @returns A redacted diagnostic object.\n */\n toJSON(): PartnerClientJson {\n return {\n type: 'PartnerClient',\n credentials: MASTER_KEY_REDACTED,\n authorization:\n this.partnerAccountInfo.getAuth() === null ? '[unauthorized]' : PARTNER_TOKEN_REDACTED,\n authorized: this.partnerAccountInfo.getAuth() !== null,\n urlGuardAllowedSuffixes: this.urlGuard?.getAllowedSuffixes() ?? null,\n }\n }\n\n /**\n * Hides credentials and Partner tokens from default stringification.\n *\n * @returns A short redacted label.\n */\n toString(): string {\n return `[PartnerClient ${MASTER_KEY_REDACTED}]`\n }\n\n /**\n * Hides credentials and Partner tokens from Node's `util.inspect`.\n *\n * @returns A short redacted label.\n */\n [Symbol.for('nodejs.util.inspect.custom')](): string {\n return this.toString()\n }\n\n private ensureGroupsAuthorization(): PartnerAuthorizeResponse {\n const auth = this.partnerAccountInfo.getAuth()\n if (auth === null) {\n throw new B2PartnerAuthorizationError('Not authorized. Call PartnerClient.authorize() first.')\n }\n const suffixes = this.authCore.activateEndpointSuffixes(auth)\n this.raw.setAuthorizedEndpointSuffixes(suffixes)\n return auth\n }\n\n private groupsCoordinates(auth: PartnerAuthorizeResponse): PartnerGroupsCoordinates {\n const groupsApiUrl = auth.apiInfo.groupsApi?.groupsApiUrl\n if (groupsApiUrl === undefined) {\n throw new B2PartnerAuthorizationError(\n 'Partner API is not available; PartnerClient.authorize() did not return apiInfo.groupsApi.',\n )\n }\n return {\n groupsApiUrl,\n authToken: auth.authorizationToken,\n adminAccountId: auth.accountId,\n }\n }\n}\n"],"mappings":";;;;;AAuBA,IAAM,sBAAsB;;;;;;;;;;;;;;;;;;AAoO5B,IAAa,gBAAb,MAA2B;;CAEzB;;CAEA;;;;;;CAMA;CACA;;;;;;CAOA,YAAY,SAA+B;EACzC,KAAK,WAAW,IAAI,kB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W;EAC7C,IAAI,iBAAiB,KAAA,GACnB,MAAM,IAAI,qBAAA,4BACR,2FACF;EAEF,OAAO;GACL;GACA,WAAW,KAAK;GAChB,gBAAgB,KAAK;EACvB;CACF;AACF"}
@@ -2,7 +2,7 @@ import { RetryOptions } from '../http/retry.js';
2
2
  import { HttpTransport } from '../http/transport.js';
3
3
  import { UrlGuard } from '../http/url-guard.js';
4
4
  import { AccountId, GroupId } from '../types/ids.js';
5
- import { CreateGroupMemberResponse, EjectGroupMemberResponse, ListedGroupMember, ListGroupMembersResponse, ListGroupsResponse, PartnerAuthorizeResponse, PartnerGroup, Region, ReserveTrialCreateAccountRequest, ReserveTrialCreateAccountRequestEntry, ReserveTrialCreateAccountResponse } from '../types/partner.js';
5
+ import { CreateGroupMemberResponse, EjectGroupMemberResponse, ListedGroupMember, ListGroupMembersResponse, ListGroupsResponse, PartnerAuthorizeResponse, PartnerGroup, Region, ReserveTrialCreateAccountRequest, ReserveTrialCreateAccountResponse } from '../types/partner.js';
6
6
  import { PartnerAccountInfo } from './account-info.js';
7
7
  import { PartnerRawClient } from './raw.js';
8
8
  /**
@@ -167,14 +167,22 @@ export interface EjectGroupMemberOptions {
167
167
  readonly signal?: AbortSignal;
168
168
  }
169
169
  /**
170
- * Options for reserving B2 Reserve trial accounts.
170
+ * Options for reserving a B2 Reserve trial account.
171
171
  *
172
172
  * @experimental Partner API surface; shape may change as the Partner API docs evolve.
173
173
  */
174
- export interface ReserveTrialAccountsOptions {
174
+ export interface ReserveTrialAccountOptions {
175
175
  /** Abort signal for cancelling the request. */
176
176
  readonly signal?: AbortSignal;
177
177
  }
178
+ /**
179
+ * Options for reserving a B2 Reserve trial account.
180
+ *
181
+ * @deprecated Use {@link ReserveTrialAccountOptions}.
182
+ *
183
+ * @experimental Partner API surface; shape may change as the Partner API docs evolve.
184
+ */
185
+ export type ReserveTrialAccountsOptions = ReserveTrialAccountOptions;
178
186
  /** Redacted JSON diagnostic shape emitted by {@link PartnerClient.toJSON}. */
179
187
  export interface PartnerClientJson {
180
188
  /** Object kind for log consumers. */
@@ -282,7 +290,7 @@ export declare class PartnerClient {
282
290
  *
283
291
  * @param options - Group ID, member email, and optional region.
284
292
  *
285
- * @returns The created member result array, including the member application key.
293
+ * @returns The created member result, including the member application key.
286
294
  *
287
295
  * @experimental Partner API surface; shape may change as the Partner API docs evolve.
288
296
  */
@@ -302,21 +310,35 @@ export declare class PartnerClient {
302
310
  */
303
311
  ejectGroupMember(options: EjectGroupMemberOptions): Promise<EjectGroupMemberResponse>;
304
312
  /**
305
- * Reserves one or more new B2 Reserve trial accounts.
313
+ * Reserves a new B2 Reserve trial account.
306
314
  *
307
315
  * This operation is non-idempotent and automatic retries/expired-token
308
316
  * reauthorization are disabled at the raw layer. If the request fails after
309
- * the server processes it, the returned application keys may be
310
- * unrecoverable; reconcile account state before reissuing a batch.
317
+ * the server processes it, the returned application key may be unrecoverable;
318
+ * reconcile account state before reissuing a request for the same email.
311
319
  *
312
- * @param request - A single trial account request or a non-empty request array.
320
+ * @param request - Email, trial duration, storage, and optional region for the account to create.
313
321
  * @param options - Optional abort signal.
314
322
  *
315
- * @returns The created reserve-trial account result array.
323
+ * @returns The created reserve-trial account result.
324
+ *
325
+ * @experimental Partner API surface; shape may change as the Partner API docs evolve.
326
+ */
327
+ reserveTrialAccount(request: ReserveTrialCreateAccountRequest, options?: ReserveTrialAccountOptions): Promise<ReserveTrialCreateAccountResponse>;
328
+ /**
329
+ * Reserves a new B2 Reserve trial account.
330
+ *
331
+ * @param request - Email, trial duration, storage, and optional region for the account to create.
332
+ * @param options - Optional abort signal.
333
+ *
334
+ * @returns The created reserve-trial account result.
335
+ *
336
+ * @deprecated Use {@link reserveTrialAccount}. This plural alias is kept for
337
+ * callers that picked up the original experimental facade name.
316
338
  *
317
339
  * @experimental Partner API surface; shape may change as the Partner API docs evolve.
318
340
  */
319
- reserveTrialAccounts(request: ReserveTrialCreateAccountRequestEntry | ReserveTrialCreateAccountRequest, options?: ReserveTrialAccountsOptions): Promise<ReserveTrialCreateAccountResponse>;
341
+ reserveTrialAccounts(request: ReserveTrialCreateAccountRequest, options?: ReserveTrialAccountsOptions): Promise<ReserveTrialCreateAccountResponse>;
320
342
  /**
321
343
  * Hides credentials and Partner tokens from `JSON.stringify(client)`.
322
344
  *
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/partner/client.js"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAgB,MAAM,iBAAiB,CAAA;AACvE,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,MAAM,EACN,gCAAgC,EAChC,qCAAqC,EACrC,iCAAiC,EAClC,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAKhD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IAChD,wFAAwF;IACxF,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAA;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,CA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;;;;;;OAYG;IACG,oBAAoB,CACxB,OAAO,EAAE,gCAAgC,EACzC,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,iCAAiC,CAAC;IAI7C;;;;OAIG;IACH,MAAM,IAAI,iBAAiB;IAW3B;;;;OAIG;IACH,QAAQ,IAAI,MAAM;IAalB,OAAO,CAAC,yBAAyB;IAUjC,OAAO,CAAC,iBAAiB;CAa1B"}
@@ -2,7 +2,7 @@ import { RetryOptions } from '../http/retry.js';
2
2
  import { HttpTransport } from '../http/transport.js';
3
3
  import { UrlGuard } from '../http/url-guard.js';
4
4
  import { AccountId, GroupId } from '../types/ids.js';
5
- import { CreateGroupMemberResponse, EjectGroupMemberResponse, ListedGroupMember, ListGroupMembersResponse, ListGroupsResponse, PartnerAuthorizeResponse, PartnerGroup, Region, ReserveTrialCreateAccountRequest, ReserveTrialCreateAccountRequestEntry, ReserveTrialCreateAccountResponse } from '../types/partner.js';
5
+ import { CreateGroupMemberResponse, EjectGroupMemberResponse, ListedGroupMember, ListGroupMembersResponse, ListGroupsResponse, PartnerAuthorizeResponse, PartnerGroup, Region, ReserveTrialCreateAccountRequest, ReserveTrialCreateAccountResponse } from '../types/partner.js';
6
6
  import { PartnerAccountInfo } from './account-info.js';
7
7
  import { PartnerRawClient } from './raw.js';
8
8
  /**
@@ -167,14 +167,22 @@ export interface EjectGroupMemberOptions {
167
167
  readonly signal?: AbortSignal;
168
168
  }
169
169
  /**
170
- * Options for reserving B2 Reserve trial accounts.
170
+ * Options for reserving a B2 Reserve trial account.
171
171
  *
172
172
  * @experimental Partner API surface; shape may change as the Partner API docs evolve.
173
173
  */
174
- export interface ReserveTrialAccountsOptions {
174
+ export interface ReserveTrialAccountOptions {
175
175
  /** Abort signal for cancelling the request. */
176
176
  readonly signal?: AbortSignal;
177
177
  }
178
+ /**
179
+ * Options for reserving a B2 Reserve trial account.
180
+ *
181
+ * @deprecated Use {@link ReserveTrialAccountOptions}.
182
+ *
183
+ * @experimental Partner API surface; shape may change as the Partner API docs evolve.
184
+ */
185
+ export type ReserveTrialAccountsOptions = ReserveTrialAccountOptions;
178
186
  /** Redacted JSON diagnostic shape emitted by {@link PartnerClient.toJSON}. */
179
187
  export interface PartnerClientJson {
180
188
  /** Object kind for log consumers. */
@@ -282,7 +290,7 @@ export declare class PartnerClient {
282
290
  *
283
291
  * @param options - Group ID, member email, and optional region.
284
292
  *
285
- * @returns The created member result array, including the member application key.
293
+ * @returns The created member result, including the member application key.
286
294
  *
287
295
  * @experimental Partner API surface; shape may change as the Partner API docs evolve.
288
296
  */
@@ -302,21 +310,35 @@ export declare class PartnerClient {
302
310
  */
303
311
  ejectGroupMember(options: EjectGroupMemberOptions): Promise<EjectGroupMemberResponse>;
304
312
  /**
305
- * Reserves one or more new B2 Reserve trial accounts.
313
+ * Reserves a new B2 Reserve trial account.
306
314
  *
307
315
  * This operation is non-idempotent and automatic retries/expired-token
308
316
  * reauthorization are disabled at the raw layer. If the request fails after
309
- * the server processes it, the returned application keys may be
310
- * unrecoverable; reconcile account state before reissuing a batch.
317
+ * the server processes it, the returned application key may be unrecoverable;
318
+ * reconcile account state before reissuing a request for the same email.
311
319
  *
312
- * @param request - A single trial account request or a non-empty request array.
320
+ * @param request - Email, trial duration, storage, and optional region for the account to create.
313
321
  * @param options - Optional abort signal.
314
322
  *
315
- * @returns The created reserve-trial account result array.
323
+ * @returns The created reserve-trial account result.
324
+ *
325
+ * @experimental Partner API surface; shape may change as the Partner API docs evolve.
326
+ */
327
+ reserveTrialAccount(request: ReserveTrialCreateAccountRequest, options?: ReserveTrialAccountOptions): Promise<ReserveTrialCreateAccountResponse>;
328
+ /**
329
+ * Reserves a new B2 Reserve trial account.
330
+ *
331
+ * @param request - Email, trial duration, storage, and optional region for the account to create.
332
+ * @param options - Optional abort signal.
333
+ *
334
+ * @returns The created reserve-trial account result.
335
+ *
336
+ * @deprecated Use {@link reserveTrialAccount}. This plural alias is kept for
337
+ * callers that picked up the original experimental facade name.
316
338
  *
317
339
  * @experimental Partner API surface; shape may change as the Partner API docs evolve.
318
340
  */
319
- reserveTrialAccounts(request: ReserveTrialCreateAccountRequestEntry | ReserveTrialCreateAccountRequest, options?: ReserveTrialAccountsOptions): Promise<ReserveTrialCreateAccountResponse>;
341
+ reserveTrialAccounts(request: ReserveTrialCreateAccountRequest, options?: ReserveTrialAccountsOptions): Promise<ReserveTrialCreateAccountResponse>;
320
342
  /**
321
343
  * Hides credentials and Partner tokens from `JSON.stringify(client)`.
322
344
  *
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/partner/client.js"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAgB,MAAM,iBAAiB,CAAA;AACvE,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,MAAM,EACN,gCAAgC,EAChC,qCAAqC,EACrC,iCAAiC,EAClC,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAKhD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EA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