@keboola/api-client 32.0.0 → 34.0.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 (447) hide show
  1. package/AGENTS.md +82 -4
  2. package/API-SURFACE.md +19 -2
  3. package/CHANGELOG.md +465 -0
  4. package/dist/{ManagementClientAuthError-B-tyPlyG.cjs → ManagementClientAuthError-DD4u0EU7.cjs} +2 -2
  5. package/dist/{ManagementClientAuthError-B-tyPlyG.cjs.map → ManagementClientAuthError-DD4u0EU7.cjs.map} +1 -1
  6. package/dist/{ManagementClientAuthError-BAFNvOdf.js → ManagementClientAuthError-ey-f03vy.js} +2 -2
  7. package/dist/{ManagementClientAuthError-BAFNvOdf.js.map → ManagementClientAuthError-ey-f03vy.js.map} +1 -1
  8. package/dist/{ValidationError-CzPWydEb.js → ValidationError-BekhphAq.js} +11 -7
  9. package/dist/ValidationError-BekhphAq.js.map +1 -0
  10. package/dist/{ValidationError-h5qvwahi.cjs → ValidationError-CLVJCCwH.cjs} +16 -6
  11. package/dist/ValidationError-CLVJCCwH.cjs.map +1 -0
  12. package/dist/ai/index.cjs +2 -2
  13. package/dist/ai/index.d.cts +2 -2
  14. package/dist/ai/index.d.ts +2 -2
  15. package/dist/ai/index.js +2 -2
  16. package/dist/ai/types.d.cts +1 -1
  17. package/dist/ai/types.d.ts +1 -1
  18. package/dist/{appLogs-NIEDTDHf.cjs → appLogs-BjfUoWzs.cjs} +2 -2
  19. package/dist/{appLogs-NIEDTDHf.cjs.map → appLogs-BjfUoWzs.cjs.map} +1 -1
  20. package/dist/{appLogs-DX_WTBCa.d.ts → appLogs-Ch7DYpzx.d.ts} +2 -2
  21. package/dist/{appLogs-BAaaGYKg.d.cts → appLogs-D5A13Y0y.d.cts} +2 -2
  22. package/dist/{appLogs-DTLE6HTy.js → appLogs-xsVkTriU.js} +2 -2
  23. package/dist/{appLogs-DTLE6HTy.js.map → appLogs-xsVkTriU.js.map} +1 -1
  24. package/dist/apps/index.cjs +3 -3
  25. package/dist/apps/index.d.cts +3 -3
  26. package/dist/apps/index.d.ts +3 -3
  27. package/dist/apps/index.js +3 -3
  28. package/dist/apps/types.d.cts +2 -2
  29. package/dist/apps/types.d.ts +2 -2
  30. package/dist/assets/index.cjs +1 -1
  31. package/dist/assets/index.d.cts +1 -1
  32. package/dist/assets/index.d.ts +1 -1
  33. package/dist/assets/index.js +1 -1
  34. package/dist/auth/index.cjs +1 -1
  35. package/dist/auth/index.d.cts +1 -1
  36. package/dist/auth/index.d.ts +1 -1
  37. package/dist/auth/index.js +1 -1
  38. package/dist/auth/types.d.cts +2 -2
  39. package/dist/auth/types.d.ts +2 -2
  40. package/dist/{auth-DP-6TFiM.cjs → auth-JQ33o3nU.cjs} +2 -2
  41. package/dist/{auth-DP-6TFiM.cjs.map → auth-JQ33o3nU.cjs.map} +1 -1
  42. package/dist/{auth-DtbQaeDj.js → auth-aItmDu45.js} +2 -2
  43. package/dist/{auth-DtbQaeDj.js.map → auth-aItmDu45.js.map} +1 -1
  44. package/dist/{authClient-DhfzOUaa.d.cts → authClient-CTHNs6Tq.d.cts} +6 -6
  45. package/dist/{authClient--BtZgjIc.js → authClient-D7W9vWPR.js} +43 -9
  46. package/dist/authClient-D7W9vWPR.js.map +1 -0
  47. package/dist/{authClient-CtfyVHRD.d.ts → authClient-D8i3JTM-.d.ts} +6 -6
  48. package/dist/{authClient-b7uec7sw.cjs → authClient-_PpvGgZJ.cjs} +43 -9
  49. package/dist/authClient-_PpvGgZJ.cjs.map +1 -0
  50. package/dist/billing/index.cjs +46 -0
  51. package/dist/billing/index.cjs.map +1 -0
  52. package/dist/billing/index.d.cts +48 -0
  53. package/dist/billing/index.d.ts +48 -0
  54. package/dist/billing/index.js +45 -0
  55. package/dist/billing/index.js.map +1 -0
  56. package/dist/billing/types.cjs +0 -0
  57. package/dist/billing/types.d.cts +635 -0
  58. package/dist/billing/types.d.ts +635 -0
  59. package/dist/billing/types.js +1 -0
  60. package/dist/chat/index.cjs +3 -3
  61. package/dist/chat/index.d.cts +2 -2
  62. package/dist/chat/index.d.ts +2 -2
  63. package/dist/chat/index.js +3 -3
  64. package/dist/chat/types.cjs +18 -0
  65. package/dist/chat/types.cjs.map +1 -1
  66. package/dist/chat/types.d.cts +2 -2
  67. package/dist/chat/types.d.ts +2 -2
  68. package/dist/chat/types.js +18 -1
  69. package/dist/chat/types.js.map +1 -1
  70. package/dist/{configurations-d7SZmw69.js → configurations-BVvcimzo.js} +17 -2
  71. package/dist/configurations-BVvcimzo.js.map +1 -0
  72. package/dist/{configurations-CqwAxiQL.cjs → configurations-CyFF9Dtu.cjs} +22 -1
  73. package/dist/configurations-CyFF9Dtu.cjs.map +1 -0
  74. package/dist/{configurations-ZwBXilW-.js → configurations-VtNE0nrT.js} +2 -2
  75. package/dist/{configurations-ZwBXilW-.js.map → configurations-VtNE0nrT.js.map} +1 -1
  76. package/dist/{configurations-Ck-mNB_E.cjs → configurations-zkNjr73Q.cjs} +2 -2
  77. package/dist/{configurations-Ck-mNB_E.cjs.map → configurations-zkNjr73Q.cjs.map} +1 -1
  78. package/dist/constants/index.cjs +1 -1
  79. package/dist/constants/index.d.cts +1 -1
  80. package/dist/constants/index.d.ts +1 -1
  81. package/dist/constants/index.js +1 -1
  82. package/dist/{constants-lIfSdTzS.cjs → constants-C4DlsF_M.cjs} +3 -2
  83. package/dist/constants-C4DlsF_M.cjs.map +1 -0
  84. package/dist/{constants-ByEwVtGf.js → constants-wfbFsqqN.js} +3 -2
  85. package/dist/constants-wfbFsqqN.js.map +1 -0
  86. package/dist/{createFetchClient-BRfTjBLV.cjs → createFetchClient-DgMiqTJ8.cjs} +26 -4
  87. package/dist/createFetchClient-DgMiqTJ8.cjs.map +1 -0
  88. package/dist/{createFetchClient-BbG46bL0.js → createFetchClient-U-ZrwPl2.js} +15 -5
  89. package/dist/createFetchClient-U-ZrwPl2.js.map +1 -0
  90. package/dist/{createGenericFetchClient-DHs-i7_O.cjs → createGenericFetchClient-o3cPJeRn.cjs} +2 -2
  91. package/dist/{createGenericFetchClient-DHs-i7_O.cjs.map → createGenericFetchClient-o3cPJeRn.cjs.map} +1 -1
  92. package/dist/{createGenericFetchClient-BHYQLZhe.js → createGenericFetchClient-rxvUUbap.js} +2 -2
  93. package/dist/{createGenericFetchClient-BHYQLZhe.js.map → createGenericFetchClient-rxvUUbap.js.map} +1 -1
  94. package/dist/{createOpenapiFetchClient-Bn6_Pn0H.js → createOpenapiFetchClient-BVSc9ibR.js} +2 -2
  95. package/dist/{createOpenapiFetchClient-Bn6_Pn0H.js.map → createOpenapiFetchClient-BVSc9ibR.js.map} +1 -1
  96. package/dist/{createOpenapiFetchClient-CyDUFxHB.cjs → createOpenapiFetchClient-DhUU3M1W.cjs} +2 -2
  97. package/dist/{createOpenapiFetchClient-CyDUFxHB.cjs.map → createOpenapiFetchClient-DhUU3M1W.cjs.map} +1 -1
  98. package/dist/{credential-d2RDcXRB.js → credential-CihSf_xs.js} +7 -4
  99. package/dist/credential-CihSf_xs.js.map +1 -0
  100. package/dist/{credential-DOXH7XRS.cjs → credential-DVWvJFJs.cjs} +7 -4
  101. package/dist/credential-DVWvJFJs.cjs.map +1 -0
  102. package/dist/dataScience/index.cjs +2 -2
  103. package/dist/dataScience/index.d.cts +2 -2
  104. package/dist/dataScience/index.d.ts +2 -2
  105. package/dist/dataScience/index.js +2 -2
  106. package/dist/dataScience/types.d.cts +2 -2
  107. package/dist/dataScience/types.d.ts +2 -2
  108. package/dist/{dataScience-wexHEIue.cjs → dataScience-0Rl_EuV_.cjs} +5 -5
  109. package/dist/{dataScience-wexHEIue.cjs.map → dataScience-0Rl_EuV_.cjs.map} +1 -1
  110. package/dist/{dataScience-Sm8iONhP.js → dataScience-C1gO5zUn.js} +5 -5
  111. package/dist/{dataScience-Sm8iONhP.js.map → dataScience-C1gO5zUn.js.map} +1 -1
  112. package/dist/developerPortal/index.cjs +1 -1
  113. package/dist/developerPortal/index.d.cts +2 -2
  114. package/dist/developerPortal/index.d.ts +2 -2
  115. package/dist/developerPortal/index.js +1 -1
  116. package/dist/developerPortal/types.d.cts +1 -1
  117. package/dist/developerPortal/types.d.ts +1 -1
  118. package/dist/{developerPortalClient-DywKpDlW.js → developerPortalClient-C_48z8BN.js} +3 -3
  119. package/dist/{developerPortalClient-DywKpDlW.js.map → developerPortalClient-C_48z8BN.js.map} +1 -1
  120. package/dist/{developerPortalClient-CgTSzLoG.cjs → developerPortalClient-ki0XS_OD.cjs} +3 -3
  121. package/dist/{developerPortalClient-CgTSzLoG.cjs.map → developerPortalClient-ki0XS_OD.cjs.map} +1 -1
  122. package/dist/domain/permissions/index.cjs +2 -1
  123. package/dist/domain/permissions/index.d.cts +18 -3
  124. package/dist/domain/permissions/index.d.ts +18 -3
  125. package/dist/domain/permissions/index.js +2 -2
  126. package/dist/editor/index.cjs +2 -2
  127. package/dist/editor/index.d.cts +2 -2
  128. package/dist/editor/index.d.ts +2 -2
  129. package/dist/editor/index.js +2 -2
  130. package/dist/editor/types.d.cts +1 -1
  131. package/dist/editor/types.d.ts +1 -1
  132. package/dist/emitter-dLF1Fyfg.d.cts +11 -0
  133. package/dist/emitter-dLF1Fyfg.d.ts +11 -0
  134. package/dist/encryption/index.cjs +1 -1
  135. package/dist/encryption/index.d.cts +1 -1
  136. package/dist/encryption/index.d.ts +1 -1
  137. package/dist/encryption/index.js +1 -1
  138. package/dist/encryption/types.d.cts +1 -1
  139. package/dist/encryption/types.d.ts +1 -1
  140. package/dist/import/index.cjs +1 -1
  141. package/dist/import/index.d.cts +3 -3
  142. package/dist/import/index.d.ts +3 -3
  143. package/dist/import/index.js +1 -1
  144. package/dist/{import-C0-y1GQK.cjs → import-C83w7BKz.cjs} +3 -3
  145. package/dist/{import-C0-y1GQK.cjs.map → import-C83w7BKz.cjs.map} +1 -1
  146. package/dist/{import-SQuurg1G.js → import-CROEK82b.js} +3 -3
  147. package/dist/{import-SQuurg1G.js.map → import-CROEK82b.js.map} +1 -1
  148. package/dist/{index-fHfc_VqS.d.ts → index-3LUk2rpD.d.ts} +4 -4
  149. package/dist/{index-Dbzjvy5h.d.ts → index-6Xe81qN3.d.ts} +5 -5
  150. package/dist/{index-Bjk-tCpG.d.cts → index-BLx14ZI4.d.cts} +306 -205
  151. package/dist/{index-DiHHyMEo.d.cts → index-BgLnWTZU.d.cts} +6 -6
  152. package/dist/{index-Bc_hXWae.d.ts → index-BuegqrS1.d.ts} +3 -3
  153. package/dist/{index-GDdFZCXp.d.ts → index-C77vTm2K.d.ts} +4 -4
  154. package/dist/{index-CXtdQ7be.d.cts → index-CW3Pj7DY.d.cts} +4 -4
  155. package/dist/{index-Bg1P6Bb2.d.ts → index-CqgtL2NU.d.ts} +6 -6
  156. package/dist/{index-DeKPpYQy.d.ts → index-D8rcUbnk.d.ts} +3 -3
  157. package/dist/{index-FhKX7Cv1.d.ts → index-DFBFa3SS.d.ts} +306 -205
  158. package/dist/{index-eAlN694c.d.cts → index-DR4QqItd.d.cts} +3 -3
  159. package/dist/{index-Gn1H63Hk.d.cts → index-DXSmFkol.d.cts} +4 -4
  160. package/dist/{index-D_7yCRKy.d.cts → index-Dodwl64k.d.cts} +69 -36
  161. package/dist/{index-DqOAjqxN.d.cts → index-DppA4k3b.d.cts} +5 -5
  162. package/dist/{index-C7e3wBt9.d.cts → index-Dx52hNLP.d.cts} +3 -3
  163. package/dist/{index-BKh0prif.d.cts → index-GjcJTCbz.d.cts} +4 -4
  164. package/dist/{index-CQrKS7PV.d.cts → index-KuQ79Mnz.d.ts} +14 -3
  165. package/dist/{index-Ctqkm3Fx.d.ts → index-P-iT5THa.d.ts} +69 -36
  166. package/dist/{index-CeJOmN-P.d.ts → index-V7XKUQm9.d.cts} +14 -3
  167. package/dist/{index-tKsiUarj.d.ts → index-pXN4LWUX.d.ts} +4 -4
  168. package/dist/index.cjs +353 -57
  169. package/dist/index.cjs.map +1 -1
  170. package/dist/index.d.cts +7 -6
  171. package/dist/index.d.ts +7 -6
  172. package/dist/index.js +331 -37
  173. package/dist/index.js.map +1 -1
  174. package/dist/isLoginPageRedirect-B0EmRsHr.cjs +25 -0
  175. package/dist/isLoginPageRedirect-B0EmRsHr.cjs.map +1 -0
  176. package/dist/isLoginPageRedirect-BTTAedW-.js +20 -0
  177. package/dist/isLoginPageRedirect-BTTAedW-.js.map +1 -0
  178. package/dist/{jobStatus-kQ9JqF8t.cjs → jobStatus-0_Y3Sr4i.cjs} +37 -20
  179. package/dist/jobStatus-0_Y3Sr4i.cjs.map +1 -0
  180. package/dist/{jobStatus-DbMupQEK.js → jobStatus-PSZJMTiA.js} +35 -18
  181. package/dist/jobStatus-PSZJMTiA.js.map +1 -0
  182. package/dist/kaiAgent/index.cjs +1 -1
  183. package/dist/kaiAgent/index.d.cts +2 -210
  184. package/dist/kaiAgent/index.d.ts +2 -210
  185. package/dist/kaiAgent/index.js +1 -1
  186. package/dist/kaiAgent/types.d.cts +1 -1
  187. package/dist/kaiAgent/types.d.ts +1 -1
  188. package/dist/{kaiAgent-HDaFS9BR.js → kaiAgent-8LNzGhZc.js} +48 -4
  189. package/dist/kaiAgent-8LNzGhZc.js.map +1 -0
  190. package/dist/{kaiAgent-4OiIK1C2.cjs → kaiAgent-B_TaUPRt.cjs} +48 -4
  191. package/dist/kaiAgent-B_TaUPRt.cjs.map +1 -0
  192. package/dist/kaiAgentClient-BJj_2aqt.d.ts +250 -0
  193. package/dist/kaiAgentClient-DhTaM3GC.d.cts +250 -0
  194. package/dist/management/index.cjs +1 -1
  195. package/dist/management/index.d.cts +1 -1
  196. package/dist/management/index.d.ts +1 -1
  197. package/dist/management/index.js +1 -1
  198. package/dist/management/types.d.cts +2 -2
  199. package/dist/management/types.d.ts +2 -2
  200. package/dist/{management-DfjwQo7z.cjs → management-BoxlRNg2.cjs} +53 -10
  201. package/dist/management-BoxlRNg2.cjs.map +1 -0
  202. package/dist/{management-CIFhu1Nm.js → management-Bp440RsV.js} +53 -10
  203. package/dist/management-Bp440RsV.js.map +1 -0
  204. package/dist/metastore/index.cjs +1 -1
  205. package/dist/metastore/index.d.cts +1 -1
  206. package/dist/metastore/index.d.ts +1 -1
  207. package/dist/metastore/index.js +1 -1
  208. package/dist/metastore/types.d.cts +1 -1
  209. package/dist/metastore/types.d.ts +1 -1
  210. package/dist/{metastore-Dq2NS6jb.cjs → metastore-BYYWTb3m.cjs} +4 -4
  211. package/dist/{metastore-Dq2NS6jb.cjs.map → metastore-BYYWTb3m.cjs.map} +1 -1
  212. package/dist/{metastore-CrXkKufo.js → metastore-VCDRVhUT.js} +4 -4
  213. package/dist/{metastore-CrXkKufo.js.map → metastore-VCDRVhUT.js.map} +1 -1
  214. package/dist/microsoftGraph/index.cjs +2 -2
  215. package/dist/microsoftGraph/index.d.cts +2 -2
  216. package/dist/microsoftGraph/index.d.ts +2 -2
  217. package/dist/microsoftGraph/index.js +2 -2
  218. package/dist/microsoftGraph/types.d.cts +1 -1
  219. package/dist/microsoftGraph/types.d.ts +1 -1
  220. package/dist/notifications/index.cjs +3 -3
  221. package/dist/notifications/index.d.cts +2 -2
  222. package/dist/notifications/index.d.ts +2 -2
  223. package/dist/notifications/index.js +3 -3
  224. package/dist/notifications/types.d.cts +1 -1
  225. package/dist/notifications/types.d.ts +1 -1
  226. package/dist/oauth/index.cjs +1 -1
  227. package/dist/oauth/index.d.cts +2 -2
  228. package/dist/oauth/index.d.ts +2 -2
  229. package/dist/oauth/index.js +1 -1
  230. package/dist/oauth/types.d.cts +1 -1
  231. package/dist/oauth/types.d.ts +1 -1
  232. package/dist/{oauth-CFwSNz37.js → oauth--asfePw-.js} +5 -5
  233. package/dist/{oauth-CFwSNz37.js.map → oauth--asfePw-.js.map} +1 -1
  234. package/dist/{oauth-CkW5gln-.cjs → oauth-B8yqG6Sy.cjs} +5 -5
  235. package/dist/{oauth-CkW5gln-.cjs.map → oauth-B8yqG6Sy.cjs.map} +1 -1
  236. package/dist/omnisearch/index.cjs +2 -2
  237. package/dist/omnisearch/index.d.cts +2 -2
  238. package/dist/omnisearch/index.d.ts +2 -2
  239. package/dist/omnisearch/index.js +2 -2
  240. package/dist/omnisearch/types.d.cts +1 -1
  241. package/dist/omnisearch/types.d.ts +1 -1
  242. package/dist/{project-BOGaVs-q.d.ts → project-C2wvX0xZ.d.ts} +2 -2
  243. package/dist/{project-BnQkL8cb.d.cts → project-hePfzUY0.d.cts} +2 -2
  244. package/dist/queryService/index.cjs +1 -1
  245. package/dist/queryService/index.d.cts +1 -1
  246. package/dist/queryService/index.d.ts +1 -1
  247. package/dist/queryService/index.js +1 -1
  248. package/dist/queryService/types.d.cts +1 -1
  249. package/dist/queryService/types.d.ts +1 -1
  250. package/dist/{queryService-BLaGbpm-.cjs → queryService-BVtjkXy1.cjs} +6 -6
  251. package/dist/{queryService-BLaGbpm-.cjs.map → queryService-BVtjkXy1.cjs.map} +1 -1
  252. package/dist/{queryService-DK-jUnET.js → queryService-Ca65E5KH.js} +6 -6
  253. package/dist/{queryService-DK-jUnET.js.map → queryService-Ca65E5KH.js.map} +1 -1
  254. package/dist/queue/index.cjs +1 -1
  255. package/dist/queue/index.d.cts +3 -3
  256. package/dist/queue/index.d.ts +3 -3
  257. package/dist/queue/index.js +1 -1
  258. package/dist/queue/types.d.cts +1 -1
  259. package/dist/queue/types.d.ts +1 -1
  260. package/dist/{queue-DViSQ-eq.js → queue-DyotLFJi.js} +5 -5
  261. package/dist/{queue-DViSQ-eq.js.map → queue-DyotLFJi.js.map} +1 -1
  262. package/dist/{queue-B7TY4JLf.cjs → queue-OJJUUqc2.cjs} +5 -5
  263. package/dist/{queue-B7TY4JLf.cjs.map → queue-OJJUUqc2.cjs.map} +1 -1
  264. package/dist/scheduler/index.cjs +3 -3
  265. package/dist/scheduler/index.d.cts +2 -2
  266. package/dist/scheduler/index.d.ts +2 -2
  267. package/dist/scheduler/index.js +3 -3
  268. package/dist/scheduler/types.d.cts +1 -1
  269. package/dist/scheduler/types.d.ts +1 -1
  270. package/dist/sdk/configurations/index.cjs +1 -1
  271. package/dist/sdk/configurations/index.d.cts +4 -4
  272. package/dist/sdk/configurations/index.d.ts +4 -4
  273. package/dist/sdk/configurations/index.js +1 -1
  274. package/dist/sdk/developerPortal/index.cjs +5 -5
  275. package/dist/sdk/developerPortal/index.cjs.map +1 -1
  276. package/dist/sdk/developerPortal/index.d.cts +5 -4
  277. package/dist/sdk/developerPortal/index.d.ts +5 -4
  278. package/dist/sdk/developerPortal/index.js +4 -4
  279. package/dist/sdk/queryService/index.cjs +2 -2
  280. package/dist/sdk/queryService/index.d.cts +1 -1
  281. package/dist/sdk/queryService/index.d.ts +1 -1
  282. package/dist/sdk/queryService/index.js +2 -2
  283. package/dist/sdk/semanticLayer/index.cjs +21 -359
  284. package/dist/sdk/semanticLayer/index.d.cts +35 -13
  285. package/dist/sdk/semanticLayer/index.d.ts +35 -13
  286. package/dist/sdk/semanticLayer/index.js +2 -347
  287. package/dist/sdk/semanticLayer/types.d.cts +2 -2
  288. package/dist/sdk/semanticLayer/types.d.ts +2 -2
  289. package/dist/sdk/storage/index.d.cts +1 -1
  290. package/dist/sdk/storage/index.d.ts +1 -1
  291. package/dist/sdk/tag/index.d.cts +2 -2
  292. package/dist/sdk/tag/index.d.ts +2 -2
  293. package/dist/sdk/tag/types.d.cts +1 -1
  294. package/dist/sdk/tag/types.d.ts +1 -1
  295. package/dist/sdk/vault/index.d.cts +1 -1
  296. package/dist/sdk/vault/index.d.ts +1 -1
  297. package/dist/semanticLayer-CSqmtHRo.js +692 -0
  298. package/dist/semanticLayer-CSqmtHRo.js.map +1 -0
  299. package/dist/semanticLayer-E0Vilu8u.cjs +811 -0
  300. package/dist/semanticLayer-E0Vilu8u.cjs.map +1 -0
  301. package/dist/{serviceIds-fHLDwOg9.d.ts → serviceIds-DRcoTnSd.d.cts} +2 -1
  302. package/dist/{serviceIds-fHLDwOg9.d.cts → serviceIds-DRcoTnSd.d.ts} +2 -1
  303. package/dist/status/index.cjs +1 -1
  304. package/dist/status/index.d.cts +1 -1
  305. package/dist/status/index.d.ts +1 -1
  306. package/dist/status/index.js +1 -1
  307. package/dist/storage/index.cjs +6 -5
  308. package/dist/storage/index.d.cts +3 -3
  309. package/dist/storage/index.d.ts +3 -3
  310. package/dist/storage/index.js +6 -6
  311. package/dist/storage/types.d.cts +3 -3
  312. package/dist/storage/types.d.ts +3 -3
  313. package/dist/{storage-CihHwZ7z.cjs → storage-BKm7cztt.cjs} +7 -7
  314. package/dist/{storage-CihHwZ7z.cjs.map → storage-BKm7cztt.cjs.map} +1 -1
  315. package/dist/{storage-kgxscFEg.js → storage-LYwFQPNO.js} +7 -7
  316. package/dist/{storage-kgxscFEg.js.map → storage-LYwFQPNO.js.map} +1 -1
  317. package/dist/store-C9FQCHGe.js +74 -0
  318. package/dist/store-C9FQCHGe.js.map +1 -0
  319. package/dist/store-xS-Cu_VS.cjs +85 -0
  320. package/dist/store-xS-Cu_VS.cjs.map +1 -0
  321. package/dist/stream/index.cjs +3 -3
  322. package/dist/stream/index.d.cts +2 -2
  323. package/dist/stream/index.d.ts +2 -2
  324. package/dist/stream/index.js +3 -3
  325. package/dist/stream/types.d.cts +1 -1
  326. package/dist/stream/types.d.ts +1 -1
  327. package/dist/syncActions/index.cjs +1 -1
  328. package/dist/syncActions/index.d.cts +1 -1
  329. package/dist/syncActions/index.d.ts +1 -1
  330. package/dist/syncActions/index.js +1 -1
  331. package/dist/syncActions/types.d.cts +1 -1
  332. package/dist/syncActions/types.d.ts +1 -1
  333. package/dist/{syncActions-CevF_TEb.cjs → syncActions-OEZdVffK.cjs} +6 -6
  334. package/dist/{syncActions-CevF_TEb.cjs.map → syncActions-OEZdVffK.cjs.map} +1 -1
  335. package/dist/{syncActions-B75t0NwP.js → syncActions-QeBhIVhG.js} +6 -6
  336. package/dist/{syncActions-B75t0NwP.js.map → syncActions-QeBhIVhG.js.map} +1 -1
  337. package/dist/telemetry/index.cjs +38 -2
  338. package/dist/telemetry/index.cjs.map +1 -0
  339. package/dist/telemetry/index.d.cts +15 -8
  340. package/dist/telemetry/index.d.ts +15 -8
  341. package/dist/telemetry/index.js +37 -1
  342. package/dist/telemetry/index.js.map +1 -0
  343. package/dist/telemetry/types.d.cts +2 -2
  344. package/dist/telemetry/types.d.ts +2 -2
  345. package/dist/{types-D1uloiuY.d.cts → types-3eUgOA7I.d.cts} +2 -2
  346. package/dist/{types-CvkqEvhv.d.cts → types-52irAt99.d.cts} +2 -2
  347. package/dist/{types-CyHZ1ZQe.d.ts → types-B2U9cFcx.d.ts} +2 -2
  348. package/dist/{types-Av2egS_l.d.ts → types-B3GOGUJ7.d.cts} +753 -45
  349. package/dist/{types-BH9ljNmj.d.cts → types-BEe50G2r.d.cts} +2 -2
  350. package/dist/{types-BlCoTm7n.d.ts → types-BH5LLeJy.d.ts} +2 -2
  351. package/dist/{types-BptQ7jpP.d.cts → types-BMeDOB_D.d.ts} +753 -45
  352. package/dist/{types-MbcIiKDI.d.cts → types-BOqD3Hqy.d.cts} +3 -3
  353. package/dist/{types-DeSd3gqW.d.ts → types-BQsOHNI0.d.ts} +3 -3
  354. package/dist/{types-DNXC_-fA.d.cts → types-BQvv4RaI.d.cts} +2 -2
  355. package/dist/{types-BnaAo7xn.d.ts → types-BTWIPEiU.d.ts} +2 -2
  356. package/dist/{types-C1vhYcic.d.cts → types-BW2BXUB4.d.cts} +2 -2
  357. package/dist/{types-CXTqFYah.d.ts → types-BrYkBQo4.d.ts} +37 -6
  358. package/dist/{types-BZBdLUpH.d.ts → types-BsxLGDoC.d.cts} +2 -2
  359. package/dist/{types-BMQW-2Yw.d.ts → types-BupPADSm.d.ts} +737 -80
  360. package/dist/{types-COc-nind.d.cts → types-Bxhh2SJr.d.ts} +2 -2
  361. package/dist/{types-ByWD2oeV.d.ts → types-BztF4HeB.d.ts} +2 -2
  362. package/dist/{types-dybUhlU2.d.ts → types-C0_2KZ-A.d.ts} +2 -2
  363. package/dist/types-C2vefB4D.d.ts +218 -0
  364. package/dist/{types-CkcMoXRk.d.ts → types-CBgLCkYe.d.ts} +3 -3
  365. package/dist/{types-Cz1dj_TM.d.ts → types-CKiW3n6v.d.ts} +2 -2
  366. package/dist/{types-CcuG9cid.d.cts → types-COL1kVEB.d.cts} +2 -2
  367. package/dist/types-CPB-eF82.d.ts +289 -0
  368. package/dist/{types-BoV9M5Xg.d.cts → types-CW6lCqrC.d.cts} +2 -2
  369. package/dist/{types-CPanB0p7.d.cts → types-CaYtinmA.d.cts} +3 -3
  370. package/dist/{types-De_DA2ga.d.ts → types-CcrvrAJX.d.ts} +2 -2
  371. package/dist/{types-DwpRt3e9.d.ts → types-Ct0YPy2w.d.ts} +2 -2
  372. package/dist/{types-B4jdPHoL.d.cts → types-Cz83RiVu.d.cts} +2 -2
  373. package/dist/{types-DlbiVsVo.d.cts → types-D8Rrz51O.d.cts} +2 -2
  374. package/dist/{types-CyiRYRVq.d.cts → types-DARv_P6O.d.cts} +3 -3
  375. package/dist/{types-DuiUN0h8.d.ts → types-DBOSvWtD.d.ts} +2 -2
  376. package/dist/{types-D6jKxUv_.d.ts → types-DEc55spK.d.ts} +45 -4
  377. package/dist/{types-cDU_J45_.d.cts → types-DNxOHnZI.d.cts} +2 -2
  378. package/dist/{types-GuWtMCMn.d.cts → types-DPS8nwkV.d.cts} +2 -2
  379. package/dist/{types-Di8VIZwQ.d.ts → types-DYzJ6K2e.d.ts} +2 -2
  380. package/dist/{types-BI2jI-3-.d.cts → types-DZk3XHiN.d.cts} +3 -3
  381. package/dist/{types-Dfc58bPE.d.ts → types-DajzGOKB.d.ts} +2 -2
  382. package/dist/{types-C2CLlR4i.d.ts → types-DfvdbRPL.d.ts} +2 -2
  383. package/dist/{types-CpALS017.d.ts → types-DhDNS-5B.d.ts} +21 -3
  384. package/dist/{types-BV2BDccJ.d.cts → types-DjrRmQUe.d.cts} +45 -4
  385. package/dist/{types-sVYo0o9_.d.ts → types-Dmu-8g4O.d.ts} +3 -3
  386. package/dist/{types-COIsNoTQ.d.cts → types-DqxIx9Pi.d.cts} +2 -2
  387. package/dist/{types-Cj4bLPp5.d.cts → types-Jw10xuOW.d.cts} +37 -6
  388. package/dist/{types-CJHi0zdD.d.cts → types-M46WuBSm.d.cts} +2 -2
  389. package/dist/{types-zA3H84SM.d.cts → types-N3EChotg.d.cts} +2 -2
  390. package/dist/{types-Bpnpa2Wt.d.ts → types-OaD-cbbl.d.ts} +3 -3
  391. package/dist/{types-BREGN3qo.d.cts → types-_RhBCj4_.d.cts} +2 -2
  392. package/dist/{types-CGH_lfxS.d.cts → types-bGQb4Jtl.d.cts} +21 -3
  393. package/dist/{types-iNlsdRkx.d.cts → types-f8W_j6qD.d.cts} +737 -80
  394. package/dist/types-fX4gbxfV.d.cts +218 -0
  395. package/dist/types-g3vU7hcg.d.cts +289 -0
  396. package/dist/{types-D-qI9ne4.d.ts → types-l9o4gFsI.d.ts} +2 -2
  397. package/dist/{types-EJEoI3ZK.d.ts → types-nrviNdzZ.d.ts} +2 -2
  398. package/dist/{types-BTbczawY.d.ts → types-zZBxJ0P-.d.ts} +2 -2
  399. package/dist/{validateConnectionStatus-V9q6Nl6u.cjs → validateConnectionStatus-CsvYmCOI.cjs} +5 -4
  400. package/dist/validateConnectionStatus-CsvYmCOI.cjs.map +1 -0
  401. package/dist/{validateConnectionStatus-BrLXkoSI.js → validateConnectionStatus-olE2sQ3U.js} +5 -4
  402. package/dist/{validateConnectionStatus-BrLXkoSI.js.map → validateConnectionStatus-olE2sQ3U.js.map} +1 -1
  403. package/dist/vault/index.cjs +4 -4
  404. package/dist/vault/index.d.cts +1 -1
  405. package/dist/vault/index.d.ts +1 -1
  406. package/dist/vault/index.js +4 -4
  407. package/dist/vault/types.d.cts +1 -1
  408. package/dist/vault/types.d.ts +1 -1
  409. package/package.json +30 -4
  410. package/surface/auth.md +2 -2
  411. package/surface/billing.md +9 -0
  412. package/surface/kaiAgent.md +7 -4
  413. package/surface/management.md +13 -3
  414. package/surface/telemetry.md +2 -4
  415. package/dist/ValidationError-CzPWydEb.js.map +0 -1
  416. package/dist/ValidationError-h5qvwahi.cjs.map +0 -1
  417. package/dist/authClient--BtZgjIc.js.map +0 -1
  418. package/dist/authClient-b7uec7sw.cjs.map +0 -1
  419. package/dist/configurations-CqwAxiQL.cjs.map +0 -1
  420. package/dist/configurations-d7SZmw69.js.map +0 -1
  421. package/dist/constants-ByEwVtGf.js.map +0 -1
  422. package/dist/constants-lIfSdTzS.cjs.map +0 -1
  423. package/dist/createFetchClient-BRfTjBLV.cjs.map +0 -1
  424. package/dist/createFetchClient-BbG46bL0.js.map +0 -1
  425. package/dist/createStore-BNiCRQXa.js +0 -148
  426. package/dist/createStore-BNiCRQXa.js.map +0 -1
  427. package/dist/createStore-MQbboXcB.cjs +0 -177
  428. package/dist/createStore-MQbboXcB.cjs.map +0 -1
  429. package/dist/credential-DOXH7XRS.cjs.map +0 -1
  430. package/dist/credential-d2RDcXRB.js.map +0 -1
  431. package/dist/jobStatus-DbMupQEK.js.map +0 -1
  432. package/dist/jobStatus-kQ9JqF8t.cjs.map +0 -1
  433. package/dist/kaiAgent-4OiIK1C2.cjs.map +0 -1
  434. package/dist/kaiAgent-HDaFS9BR.js.map +0 -1
  435. package/dist/management-CIFhu1Nm.js.map +0 -1
  436. package/dist/management-DfjwQo7z.cjs.map +0 -1
  437. package/dist/sdk/semanticLayer/index.cjs.map +0 -1
  438. package/dist/sdk/semanticLayer/index.js.map +0 -1
  439. package/dist/telemetry-DwlSLVAU.cjs +0 -29
  440. package/dist/telemetry-DwlSLVAU.cjs.map +0 -1
  441. package/dist/telemetry-FXpodtJN.js +0 -24
  442. package/dist/telemetry-FXpodtJN.js.map +0 -1
  443. package/dist/types-B2vmg_UF.d.cts +0 -148
  444. package/dist/types-RfaldD4P.d.ts +0 -148
  445. package/dist/types-lFsTSkhe.d.cts +0 -14
  446. package/dist/types-lFsTSkhe.d.ts +0 -14
  447. package/dist/validateConnectionStatus-V9q6Nl6u.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"queryService-BLaGbpm-.cjs","names":["poller","jobStatus","createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient","HttpHeader","parseContentDispositionHeader"],"sources":["../src/clients/queryService/poller.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - Takes the job rather than its id, so a caller hands over what `createQueryJob` gave it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n (\n { id }: { id: GetQueryJobPath['queryJobId'] },\n { interval, maxAttempts, timeout, signal }: QueryJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queryService.job', { queryJobId: id }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) =>\n getQueryJob(params.queryJobId, pollSignal),\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\n\nexport const createQueryServiceClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n getQueryResults,\n getQueryHistory,\n exportResults,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAM,wBAAwB;;;;;;;;;;AAuB9B,MAAa,mBACV,EAAE,mBAED,EAAE,MACF,EAAE,UAAU,aAAa,SAAS,WAAgC,CAAC,MAEnEA,kBAAAA,OAAO;CACL,SAAS,CAAC,oBAAoB,EAAE,YAAY,GAAG,CAAC;CAChD,SAAS,EAAE,SAAS,GAAG,SAAS,QAAQ,iBACtC,YAAY,OAAO,YAAY,UAAU;CAC3C,QAAQ,EAAE,WAAWC,kBAAAA,UAAU,MAAM,WAAW,KAAK,MAAM;CAC3D,SAAS;EAAE,MAAM;EAAY,UAAU,YAAY;CAAsB;CACzE;CACA;CACA;AACF,CAAC;;;ACnBL,MAAa,4BAA4B,EAAE,SAAS,aAAa,WAA8B;CAC7F,MAAM,SAASC,iCAAAA,yBAAgC;EAC7C;EACA;EACA,SAASC,aAAAA,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgBC,iCAAAA,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,iBAAiB,OACrB,UACA,aACA,SACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,gEACA;GAAE,MAAM;IAAE;IAAU;GAAY;GAAG;EAAK,CAC1C;EAEA,OAAO;CACT;CAEA,MAA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cjs","names":["poller","jobStatus","createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient","HttpHeader","parseContentDispositionHeader"],"sources":["../src/clients/queryService/poller.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - Takes the job rather than its id, so a caller hands over what `createQueryJob` gave it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n (\n { id }: { id: GetQueryJobPath['queryJobId'] },\n { interval, maxAttempts, timeout, signal }: QueryJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queryService.job', { queryJobId: id }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) =>\n getQueryJob(params.queryJobId, pollSignal),\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\n\nexport const createQueryServiceClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n getQueryResults,\n getQueryHistory,\n exportResults,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAM,wBAAwB;;;;;;;;;;AAuB9B,MAAa,mBACV,EAAE,mBAED,EAAE,MACF,EAAE,UAAU,aAAa,SAAS,WAAgC,CAAC,MAEnEA,kBAAAA,OAAO;CACL,SAAS,CAAC,oBAAoB,EAAE,YAAY,GAAG,CAAC;CAChD,SAAS,EAAE,SAAS,GAAG,SAAS,QAAQ,iBACtC,YAAY,OAAO,YAAY,UAAU;CAC3C,QAAQ,EAAE,WAAWC,kBAAAA,UAAU,MAAM,WAAW,KAAK,MAAM;CAC3D,SAAS;EAAE,MAAM;EAAY,UAAU,YAAY;CAAsB;CACzE;CACA;CACA;AACF,CAAC;;;ACnBL,MAAa,4BAA4B,EAAE,SAAS,aAAa,WAA8B;CAC7F,MAAM,SAASC,iCAAAA,yBAAgC;EAC7C;EACA;EACA,SAASC,aAAAA,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgBC,iCAAAA,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,iBAAiB,OACrB,UACA,aACA,SACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,gEACA;GAAE,MAAM;IAAE;IAAU;GAAY;GAAG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;AACF"}
@@ -1,8 +1,8 @@
1
- import { a as poller, t as jobStatus } from "./jobStatus-DbMupQEK.js";
2
- import { o as HttpHeader, u as parseContentDispositionHeader } from "./createFetchClient-BbG46bL0.js";
3
- import { t as createGenericFetchClient } from "./createGenericFetchClient-BHYQLZhe.js";
4
- import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-Bn6_Pn0H.js";
5
- import { t as createAuthHeaders } from "./auth-DtbQaeDj.js";
1
+ import { a as poller, t as jobStatus } from "./jobStatus-PSZJMTiA.js";
2
+ import { f as parseContentDispositionHeader, s as HttpHeader } from "./createFetchClient-U-ZrwPl2.js";
3
+ import { t as createGenericFetchClient } from "./createGenericFetchClient-rxvUUbap.js";
4
+ import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-BVSc9ibR.js";
5
+ import { t as createAuthHeaders } from "./auth-aItmDu45.js";
6
6
  //#region src/clients/queryService/poller.ts
7
7
  const DEFAULT_POLL_INTERVAL = 2e3;
8
8
  /**
@@ -111,4 +111,4 @@ const createQueryServiceClient = ({ baseUrl, middlewares, auth }) => {
111
111
  //#endregion
112
112
  export { createQueryServiceClient as t };
113
113
 
114
- //# sourceMappingURL=queryService-DK-jUnET.js.map
114
+ //# sourceMappingURL=queryService-Ca65E5KH.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryService-DK-jUnET.js","names":[],"sources":["../src/clients/queryService/poller.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - Takes the job rather than its id, so a caller hands over what `createQueryJob` gave it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n (\n { id }: { id: GetQueryJobPath['queryJobId'] },\n { interval, maxAttempts, timeout, signal }: QueryJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queryService.job', { queryJobId: id }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) =>\n getQueryJob(params.queryJobId, pollSignal),\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\n\nexport const createQueryServiceClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n getQueryResults,\n getQueryHistory,\n ex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A,MAAM,kBAAkB,OACtB,UACA,aACA,UACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gEACA;GACE,MAAM;IAAE;IAAU;GAAY;GAC9B;EACF,CACF;EAEA,OAAO;CACT;CAEA,MAAM,gBAAgB,OACpB,YACA,aACA,OACA,WACmC;EACnC,MAAM,EAAE,MAAM,aAAa,MAAM,OAAO,IACtC,qDACA;GACE,MAAM;IAAE;IAAY;GAAY;GAChC;EACF,GACA,EAAE,OAAO,CACX;EAOA,OAAO;GACL,UANe,SAAS,QAAQ,IAAI,WAAW,YAAY,KAAK;GAOhE,SAAS;GACT,UAPyB,8BACzB,SAAS,QAAQ,IAAI,WAAW,mBAAmB,CAMxB,CAAC,EAAE,YAAY;EAC5C;CACF;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,YAAY,CAItC;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"queryService-Ca65E5KH.js","names":[],"sources":["../src/clients/queryService/poller.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - Takes the job rather than its id, so a caller hands over what `createQueryJob` gave it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n (\n { id }: { id: GetQueryJobPath['queryJobId'] },\n { interval, maxAttempts, timeout, signal }: QueryJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queryService.job', { queryJobId: id }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) =>\n getQueryJob(params.queryJobId, pollSignal),\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\n\nexport const createQueryServiceClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n getQueryResults,\n getQueryHistory,\n exportResults,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAM,wBAAwB;;;;;;;;;;AAuB9B,MAAa,mBACV,EAAE,mBAED,EAAE,MACF,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AU;GAAY;GAC9B;EACF,CACF;EAEA,OAAO;CACT;CAEA,MAAM,gBAAgB,OACpB,YACA,aACA,OACA,WACmC;EACnC,MAAM,EAAE,MAAM,aAAa,MAAM,OAAO,IACtC,qDACA;GACE,MAAM;IAAE;IAAY;GAAY;GAChC;EACF,GACA,EAAE,OAAO,CACX;EAOA,OAAO;GACL,UANe,SAAS,QAAQ,IAAI,WAAW,YAAY,KAAK;GAOhE,SAAS;GACT,UAPyB,8BACzB,SAAS,QAAQ,IAAI,WAAW,mBAAmB,CAMxB,CAAC,EAAE,YAAY;EAC5C;CACF;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,YAAY,CAItC;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_queue = require("../queue-B7TY4JLf.cjs");
2
+ const require_queue = require("../queue-OJJUUqc2.cjs");
3
3
  exports.createQueueClient = require_queue.createQueueClient;
@@ -1,6 +1,6 @@
1
- import { ut as Poller } from "../index-Bjk-tCpG.cjs";
2
- import { n as ClientInitOptions } from "../types-BREGN3qo.cjs";
3
- import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components, r as KillJobPath, t as CreateJobBody } from "../types-DNXC_-fA.cjs";
1
+ import { _t as Poller } from "../index-BLx14ZI4.cjs";
2
+ import { n as ClientInitOptions } from "../types-_RhBCj4_.cjs";
3
+ import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components, r as KillJobPath, t as CreateJobBody } from "../types-BQvv4RaI.cjs";
4
4
  //#region src/clients/queue/queueClient.d.ts
5
5
  declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
6
6
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
@@ -1,6 +1,6 @@
1
- import { ut as Poller } from "../index-FhKX7Cv1.js";
2
- import { n as ClientInitOptions } from "../types-DwpRt3e9.js";
3
- import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components, r as KillJobPath, t as CreateJobBody } from "../types-De_DA2ga.js";
1
+ import { _t as Poller } from "../index-DFBFa3SS.js";
2
+ import { n as ClientInitOptions } from "../types-Ct0YPy2w.js";
3
+ import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components, r as KillJobPath, t as CreateJobBody } from "../types-CcrvrAJX.js";
4
4
  //#region src/clients/queue/queueClient.d.ts
5
5
  declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
6
6
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
@@ -1,2 +1,2 @@
1
- import { t as createQueueClient } from "../queue-DViSQ-eq.js";
1
+ import { t as createQueueClient } from "../queue-DyotLFJi.js";
2
2
  export { createQueueClient };
@@ -1,2 +1,2 @@
1
- import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, f as SearchJobsResponse, i as OrchestrationRerunPlan, l as SearchGroupedJobsQuery, n as GetQueueJobPath, o as QueueJob, r as KillJobPath, s as QueueJobStatus, t as CreateJobBody, u as SearchGroupedJobsResponse } from "../types-DNXC_-fA.cjs";
1
+ import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, f as SearchJobsResponse, i as OrchestrationRerunPlan, l as SearchGroupedJobsQuery, n as GetQueueJobPath, o as QueueJob, r as KillJobPath, s as QueueJobStatus, t as CreateJobBody, u as SearchGroupedJobsResponse } from "../types-BQvv4RaI.cjs";
2
2
  export { CreateJobBody, GetQueueJobPath, KillJobPath, OrchestrationRerunPlan, OrchestrationRerunPlanPath, QueueJob, QueueJobStatus, SearchAllJobsQuery, SearchGroupedJobsQuery, SearchGroupedJobsResponse, SearchJobsQuery, SearchJobsResponse };
@@ -1,2 +1,2 @@
1
- import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, f as SearchJobsResponse, i as OrchestrationRerunPlan, l as SearchGroupedJobsQuery, n as GetQueueJobPath, o as QueueJob, r as KillJobPath, s as QueueJobStatus, t as CreateJobBody, u as SearchGroupedJobsResponse } from "../types-De_DA2ga.js";
1
+ import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, f as SearchJobsResponse, i as OrchestrationRerunPlan, l as SearchGroupedJobsQuery, n as GetQueueJobPath, o as QueueJob, r as KillJobPath, s as QueueJobStatus, t as CreateJobBody, u as SearchGroupedJobsResponse } from "../types-CcrvrAJX.js";
2
2
  export { CreateJobBody, GetQueueJobPath, KillJobPath, OrchestrationRerunPlan, OrchestrationRerunPlanPath, QueueJob, QueueJobStatus, SearchAllJobsQuery, SearchGroupedJobsQuery, SearchGroupedJobsResponse, SearchJobsQuery, SearchJobsResponse };
@@ -1,7 +1,7 @@
1
- import { a as poller, f as createAbortError, t as jobStatus } from "./jobStatus-DbMupQEK.js";
2
- import { t as createGenericFetchClient } from "./createGenericFetchClient-BHYQLZhe.js";
3
- import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-Bn6_Pn0H.js";
4
- import { t as createAuthHeaders } from "./auth-DtbQaeDj.js";
1
+ import { a as poller, f as createAbortError, t as jobStatus } from "./jobStatus-PSZJMTiA.js";
2
+ import { t as createGenericFetchClient } from "./createGenericFetchClient-rxvUUbap.js";
3
+ import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-BVSc9ibR.js";
4
+ import { t as createAuthHeaders } from "./auth-aItmDu45.js";
5
5
  //#region src/utils/async/collect.ts
6
6
  /**
7
7
  * Collects items from an offset-paginated endpoint — up to `limit` of them, or all of them when
@@ -123,4 +123,4 @@ const createQueueClient = ({ baseUrl, middlewares, auth }) => {
123
123
  //#endregion
124
124
  export { collect as n, createQueueClient as t };
125
125
 
126
- //# sourceMappingURL=queue-DViSQ-eq.js.map
126
+ //# sourceMappingURL=queue-DyotLFJi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queue-DViSQ-eq.js","names":[],"sources":["../src/utils/async/collect.ts","../src/clients/queue/poller.ts","../src/clients/queue/queueClient.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport type CollectOptions<T> = {\n fetchFrom: (offset: number, pageSize?: number, signal?: AbortSignal) => Promise<T[]>;\n pageSize?: number;\n limit?: number;\n signal?: AbortSignal;\n};\n\n/**\n * Collects items from an offset-paginated endpoint — up to `limit` of them, or all of them when\n * `limit` is omitted. Calls `fetchFrom` sequentially with the offset advancing by the number of\n * items received, and hands it `pageSize` so the request and the traversal agree on one value.\n *\n * Traversal ends on a page shorter than `pageSize`, or — when `pageSize` is omitted — only on an\n * empty page. Passing it therefore saves the trailing request, at the cost of stopping early if the\n * endpoint returns fewer items per page than asked for.\n */\nexport const collect = async <T>({\n fetchFrom,\n pageSize,\n limit,\n signal,\n}: CollectOptions<T>): Promise<T[]> => {\n if (signal?.aborted) throw createAbortError(signal.reason);\n if (limit !== undefined && limit < 0) throw new Error('Invalid collect limit');\n if (pageSize !== undefined && pageSize < 1) throw new Error('Invalid collect pageSize');\n\n const items: T[] = [];\n\n if (limit === 0) return items;\n\n let offset = 0;\n\n while (true) {\n const batch = await fetchFrom(offset, pageSize, signal);\n\n items.push(...batch);\n offset += batch.length;\n\n if (limit !== undefined && items.length >= limit) return items.slice(0, limit);\n if (pageSize === undefined ? batch.length === 0 : batch.length < pageSize) return items;\n }\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueueJobPath, QueueJob } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueueJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetJob = (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => Promise<QueueJob>;\n\n/**\n * Waits on a queue job.\n *\n * - Takes the job, not its id: the component is what makes a poll legible in dev tools, and only the\n * job carries it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is terminal: a job that ended as `error` is a `done` poll carrying a failed job, and\n * what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getJob }: { getJob: GetJob }) =>\n (\n { id, component }: { id: GetQueueJobPath['jobId']; component: string },\n { interval, maxAttempts, timeout, signal }: QueueJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queue.job', { jobId: id, component }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) => getJob(params.jobId, pollSignal),\n until: ({ data }) => jobStatus.queue.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import { createGenericFetchClient, createOpenapiFetchClient } from '../../fetchClient';\nimport { collect } from '../../utils';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n CreateJobBody,\n GetQueueJobPath,\n KillJobPath,\n OrchestrationRerunPlanPath,\n SearchAllJobsQuery,\n SearchGroupedJobsQuery,\n SearchJobsQuery,\n} from './types';\n\nexport const createQueueClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const getJob = async (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/jobs/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchJobs = async (query?: SearchJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const searchAllJobs = (query: SearchAllJobsQuery, signal?: AbortSignal) => {\n return collect({\n pageSize: query.limit,\n signal,\n fetchFrom: (offset, pageSize, batchSignal) => {\n return searchJobs({ ...query, limit: pageSize, offset }, batchSignal);\n },\n });\n };\n\n const createJob = async (body: CreateJobBody, signal?: AbortSignal) => {\n const { data } = await client.post('/jobs', { body }, { signal });\n\n return data;\n };\n\n const killJob = async (jobId: KillJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.post(\n '/jobs/{jobId}/kill',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchGroupedJobs = async (query: SearchGroupedJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/grouped-jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const getOrchestrationRerunPlan = async (\n jobId: OrchestrationRerunPlanPath['jobId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get(\n '/orchestration-rerun-plan/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a queue job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getJob });\n\n return {\n healthCheck,\n poller,\n getJob,\n searchJobs,\n searchAllJobs,\n createJob,\n killJob,\n searchGroupedJobs,\n getOrchestrationRerunPlan,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAa,UAAU,OAAU,EAC/B,WACA,UACA,OACA,aACqC;CACrC,IAAI,QAAQ,SAAS,MAAM,iBAAiB,OAAO,MAAM;CACzD,IAAI,UAAU,KAAA,KAAa,QAAQ,GAAG,MAAM,IAAI,MAAM,uBAAuB;CAC7E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,gBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,iBAAiB,OAA2B,WAAyB;EACzE,OAAO,QAAQ;GACb,UAAU,MAAM;GAChB;GACA,YAAY,QAAQ,UAAU,gBAAgB;IAC5C,OAAO,WAAW;KAAE,GAAG;KAAO,OAAO;KAAU;IAAO,GAAG,WAAW;GACtE;EACF,CAAC;CACH;CAEA,MAAM,YAAY,OAAO,MAAqB,WAAyB;EACrE,MAAM,EAAE,SAAS,MAAM,OAAO,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,OAAO,CAAC;EAEhE,OAAO;CACT;CAEA,MAAM,UAAU,OAAO,OAA6B,WAAyB;EAC3E,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,sBACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,oBAAoB,OAAO,OAA+B,WAAyB;EACvF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,wBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,4BAA4B,OAChC,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,OAAO,CAIjC;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"queue-DyotLFJi.js","names":[],"sources":["../src/utils/async/collect.ts","../src/clients/queue/poller.ts","../src/clients/queue/queueClient.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport type CollectOptions<T> = {\n fetchFrom: (offset: number, pageSize?: number, signal?: AbortSignal) => Promise<T[]>;\n pageSize?: number;\n limit?: number;\n signal?: AbortSignal;\n};\n\n/**\n * Collects items from an offset-paginated endpoint — up to `limit` of them, or all of them when\n * `limit` is omitted. Calls `fetchFrom` sequentially with the offset advancing by the number of\n * items received, and hands it `pageSize` so the request and the traversal agree on one value.\n *\n * Traversal ends on a page shorter than `pageSize`, or — when `pageSize` is omitted — only on an\n * empty page. Passing it therefore saves the trailing request, at the cost of stopping early if the\n * endpoint returns fewer items per page than asked for.\n */\nexport const collect = async <T>({\n fetchFrom,\n pageSize,\n limit,\n signal,\n}: CollectOptions<T>): Promise<T[]> => {\n if (signal?.aborted) throw createAbortError(signal.reason);\n if (limit !== undefined && limit < 0) throw new Error('Invalid collect limit');\n if (pageSize !== undefined && pageSize < 1) throw new Error('Invalid collect pageSize');\n\n const items: T[] = [];\n\n if (limit === 0) return items;\n\n let offset = 0;\n\n while (true) {\n const batch = await fetchFrom(offset, pageSize, signal);\n\n items.push(...batch);\n offset += batch.length;\n\n if (limit !== undefined && items.length >= limit) return items.slice(0, limit);\n if (pageSize === undefined ? batch.length === 0 : batch.length < pageSize) return items;\n }\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueueJobPath, QueueJob } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueueJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetJob = (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => Promise<QueueJob>;\n\n/**\n * Waits on a queue job.\n *\n * - Takes the job, not its id: the component is what makes a poll legible in dev tools, and only the\n * job carries it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is terminal: a job that ended as `error` is a `done` poll carrying a failed job, and\n * what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getJob }: { getJob: GetJob }) =>\n (\n { id, component }: { id: GetQueueJobPath['jobId']; component: string },\n { interval, maxAttempts, timeout, signal }: QueueJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queue.job', { jobId: id, component }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) => getJob(params.jobId, pollSignal),\n until: ({ data }) => jobStatus.queue.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import { createGenericFetchClient, createOpenapiFetchClient } from '../../fetchClient';\nimport { collect } from '../../utils';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n CreateJobBody,\n GetQueueJobPath,\n KillJobPath,\n OrchestrationRerunPlanPath,\n SearchAllJobsQuery,\n SearchGroupedJobsQuery,\n SearchJobsQuery,\n} from './types';\n\nexport const createQueueClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const getJob = async (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/jobs/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchJobs = async (query?: SearchJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const searchAllJobs = (query: SearchAllJobsQuery, signal?: AbortSignal) => {\n return collect({\n pageSize: query.limit,\n signal,\n fetchFrom: (offset, pageSize, batchSignal) => {\n return searchJobs({ ...query, limit: pageSize, offset }, batchSignal);\n },\n });\n };\n\n const createJob = async (body: CreateJobBody, signal?: AbortSignal) => {\n const { data } = await client.post('/jobs', { body }, { signal });\n\n return data;\n };\n\n const killJob = async (jobId: KillJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.post(\n '/jobs/{jobId}/kill',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchGroupedJobs = async (query: SearchGroupedJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/grouped-jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const getOrchestrationRerunPlan = async (\n jobId: OrchestrationRerunPlanPath['jobId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get(\n '/orchestration-rerun-plan/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a queue job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getJob });\n\n return {\n healthCheck,\n poller,\n getJob,\n searchJobs,\n searchAllJobs,\n createJob,\n killJob,\n searchGroupedJobs,\n getOrchestrationRerunPlan,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAa,UAAU,OAAU,EAC/B,WACA,UACA,OACA,aACqC;CACrC,IAAI,QAAQ,SAAS,MAAM,iBAAiB,OAAO,MAAM;CACzD,IAAI,UAAU,KAAA,KAAa,QAAQ,GAAG,MAAM,IAAI,MAAM,uBAAuB;CAC7E,IAAI,aAAa,KAAA,KAAa,WAAW,GAAG,MAAM,IAAI,MAAM,0BAA0B;CAEtF,MAAM,QAAa,CAAC;CAEpB,IAAI,UAAU,GAAG,OAAO;CAExB,IAAI,SAAS;CAEb,OAAO,MAAM;EACX,MAAM,QAAQ,MAAM,UAAU,QAAQ,UAAU,MAAM;EAEtD,MAAM,KAAK,GAAG,KAAK;EACnB,UAAU,MAAM;EAEhB,IAAI,UAAU,KAAA,KAAa,MAAM,UAAU,OAAO,OAAO,MAAM,MAAM,GAAG,KAAK;EAC7E,IAAI,aAAa,KAAA,IAAY,MAAM,WAAW,IAAI,MAAM,SAAS,UAAU,OAAO;CACpF;AAC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O,OAA6B,WAAyB;EAC3E,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,sBACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,oBAAoB,OAAO,OAA+B,WAAyB;EACvF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,wBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,4BAA4B,OAChC,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,OAAO,CAIjC;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1,7 +1,7 @@
1
- const require_jobStatus = require("./jobStatus-kQ9JqF8t.cjs");
2
- const require_createGenericFetchClient = require("./createGenericFetchClient-DHs-i7_O.cjs");
3
- const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-CyDUFxHB.cjs");
4
- const require_auth = require("./auth-DP-6TFiM.cjs");
1
+ const require_jobStatus = require("./jobStatus-0_Y3Sr4i.cjs");
2
+ const require_createGenericFetchClient = require("./createGenericFetchClient-o3cPJeRn.cjs");
3
+ const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-DhUU3M1W.cjs");
4
+ const require_auth = require("./auth-JQ33o3nU.cjs");
5
5
  //#region src/utils/async/collect.ts
6
6
  /**
7
7
  * Collects items from an offset-paginated endpoint — up to `limit` of them, or all of them when
@@ -134,4 +134,4 @@ Object.defineProperty(exports, "createQueueClient", {
134
134
  }
135
135
  });
136
136
 
137
- //# sourceMappingURL=queue-B7TY4JLf.cjs.map
137
+ //# sourceMappingURL=queue-OJJUUqc2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"queue-B7TY4JLf.cjs","names":["createAbortError","poller","jobStatus","createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient"],"sources":["../src/utils/async/collect.ts","../src/clients/queue/poller.ts","../src/clients/queue/queueClient.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport type CollectOptions<T> = {\n fetchFrom: (offset: number, pageSize?: number, signal?: AbortSignal) => Promise<T[]>;\n pageSize?: number;\n limit?: number;\n signal?: AbortSignal;\n};\n\n/**\n * Collects items from an offset-paginated endpoint — up to `limit` of them, or all of them when\n * `limit` is omitted. Calls `fetchFrom` sequentially with the offset advancing by the number of\n * items received, and hands it `pageSize` so the request and the traversal agree on one value.\n *\n * Traversal ends on a page shorter than `pageSize`, or — when `pageSize` is omitted — only on an\n * empty page. Passing it therefore saves the trailing request, at the cost of stopping early if the\n * endpoint returns fewer items per page than asked for.\n */\nexport const collect = async <T>({\n fetchFrom,\n pageSize,\n limit,\n signal,\n}: CollectOptions<T>): Promise<T[]> => {\n if (signal?.aborted) throw createAbortError(signal.reason);\n if (limit !== undefined && limit < 0) throw new Error('Invalid collect limit');\n if (pageSize !== undefined && pageSize < 1) throw new Error('Invalid collect pageSize');\n\n const items: T[] = [];\n\n if (limit === 0) return items;\n\n let offset = 0;\n\n while (true) {\n const batch = await fetchFrom(offset, pageSize, signal);\n\n items.push(...batch);\n offset += batch.length;\n\n if (limit !== undefined && items.length >= limit) return items.slice(0, limit);\n if (pageSize === undefined ? batch.length === 0 : batch.length < pageSize) return items;\n }\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueueJobPath, QueueJob } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueueJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetJob = (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => Promise<QueueJob>;\n\n/**\n * Waits on a queue job.\n *\n * - Takes the job, not its id: the component is what makes a poll legible in dev tools, and only the\n * job carries it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is terminal: a job that ended as `error` is a `done` poll carrying a failed job, and\n * what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getJob }: { getJob: GetJob }) =>\n (\n { id, component }: { id: GetQueueJobPath['jobId']; component: string },\n { interval, maxAttempts, timeout, signal }: QueueJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queue.job', { jobId: id, component }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) => getJob(params.jobId, pollSignal),\n until: ({ data }) => jobStatus.queue.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import { createGenericFetchClient, createOpenapiFetchClient } from '../../fetchClient';\nimport { collect } from '../../utils';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n CreateJobBody,\n GetQueueJobPath,\n KillJobPath,\n OrchestrationRerunPlanPath,\n SearchAllJobsQuery,\n SearchGroupedJobsQuery,\n SearchJobsQuery,\n} from './types';\n\nexport const createQueueClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const getJob = async (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/jobs/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchJobs = async (query?: SearchJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const searchAllJobs = (query: SearchAllJobsQuery, signal?: AbortSignal) => {\n return collect({\n pageSize: query.limit,\n signal,\n fetchFrom: (offset, pageSize, batchSignal) => {\n return searchJobs({ ...query, limit: pageSize, offset }, batchSignal);\n },\n });\n };\n\n const createJob = async (body: CreateJobBody, signal?: AbortSignal) => {\n const { data } = await client.post('/jobs', { body }, { signal });\n\n return data;\n };\n\n const killJob = async (jobId: KillJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.post(\n '/jobs/{jobId}/kill',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchGroupedJobs = async (query: SearchGroupedJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/grouped-jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const getOrchestrationRerunPlan = async (\n jobId: OrchestrationRerunPlanPath['jobId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get(\n '/orchestration-rerun-plan/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a queue job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getJob });\n\n return {\n healthCheck,\n poller,\n getJob,\n searchJobs,\n searchAllJobs,\n createJob,\n killJob,\n searchGroupedJobs,\n getOrchestrationRerunPlan,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAa,UAAU,OAAU,EAC/B,WACA,UACA,OACA,aACqC;CACrC,IAAI,QAAQ,SAAS,MAAMA,kBAAAA,iBAAiB,OAAO,MAAM;CACzD,IAAI,UAAU,KAAA,KAAa,QAAQ,GAAG,MAAM,IAAI,MAAM,uBAAuB;CAC7E,IAAI,aAAa,KAAA,KAAa,WAAW,GAAG,MAAM,IAAI,MAAM,0BAA0B;CAEtF,MAAM,QAAa,CAAC;CAEpB,IAAI,UAAU,GAAG,OAAO;CAEx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2B,WAAyB;EACzE,OAAO,QAAQ;GACb,UAAU,MAAM;GAChB;GACA,YAAY,QAAQ,UAAU,gBAAgB;IAC5C,OAAO,WAAW;KAAE,GAAG;KAAO,OAAO;KAAU;IAAO,GAAG,WAAW;GACtE;EACF,CAAC;CACH;CAEA,MAAM,YAAY,OAAO,MAAqB,WAAyB;EACrE,MAAM,EAAE,SAAS,MAAM,OAAO,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,OAAO,CAAC;EAEhE,OAAO;CACT;CAEA,MAAM,UAAU,OAAO,OAA6B,WAAyB;EAC3E,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,sBACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,oBAAoB,OAAO,OAA+B,WAAyB;EACvF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,wBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,4BAA4B,OAChC,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,OAAO,CAIjC;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"queue-OJJUUqc2.cjs","names":["createAbortError","poller","jobStatus","createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient"],"sources":["../src/utils/async/collect.ts","../src/clients/queue/poller.ts","../src/clients/queue/queueClient.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport type CollectOptions<T> = {\n fetchFrom: (offset: number, pageSize?: number, signal?: AbortSignal) => Promise<T[]>;\n pageSize?: number;\n limit?: number;\n signal?: AbortSignal;\n};\n\n/**\n * Collects items from an offset-paginated endpoint — up to `limit` of them, or all of them when\n * `limit` is omitted. Calls `fetchFrom` sequentially with the offset advancing by the number of\n * items received, and hands it `pageSize` so the request and the traversal agree on one value.\n *\n * Traversal ends on a page shorter than `pageSize`, or — when `pageSize` is omitted — only on an\n * empty page. Passing it therefore saves the trailing request, at the cost of stopping early if the\n * endpoint returns fewer items per page than asked for.\n */\nexport const collect = async <T>({\n fetchFrom,\n pageSize,\n limit,\n signal,\n}: CollectOptions<T>): Promise<T[]> => {\n if (signal?.aborted) throw createAbortError(signal.reason);\n if (limit !== undefined && limit < 0) throw new Error('Invalid collect limit');\n if (pageSize !== undefined && pageSize < 1) throw new Error('Invalid collect pageSize');\n\n const items: T[] = [];\n\n if (limit === 0) return items;\n\n let offset = 0;\n\n while (true) {\n const batch = await fetchFrom(offset, pageSize, signal);\n\n items.push(...batch);\n offset += batch.length;\n\n if (limit !== undefined && items.length >= limit) return items.slice(0, limit);\n if (pageSize === undefined ? batch.length === 0 : batch.length < pageSize) return items;\n }\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueueJobPath, QueueJob } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueueJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetJob = (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => Promise<QueueJob>;\n\n/**\n * Waits on a queue job.\n *\n * - Takes the job, not its id: the component is what makes a poll legible in dev tools, and only the\n * job carries it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is terminal: a job that ended as `error` is a `done` poll carrying a failed job, and\n * what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getJob }: { getJob: GetJob }) =>\n (\n { id, component }: { id: GetQueueJobPath['jobId']; component: string },\n { interval, maxAttempts, timeout, signal }: QueueJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queue.job', { jobId: id, component }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) => getJob(params.jobId, pollSignal),\n until: ({ data }) => jobStatus.queue.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import { createGenericFetchClient, createOpenapiFetchClient } from '../../fetchClient';\nimport { collect } from '../../utils';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n CreateJobBody,\n GetQueueJobPath,\n KillJobPath,\n OrchestrationRerunPlanPath,\n SearchAllJobsQuery,\n SearchGroupedJobsQuery,\n SearchJobsQuery,\n} from './types';\n\nexport const createQueueClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const getJob = async (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/jobs/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchJobs = async (query?: SearchJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const searchAllJobs = (query: SearchAllJobsQuery, signal?: AbortSignal) => {\n return collect({\n pageSize: query.limit,\n signal,\n fetchFrom: (offset, pageSize, batchSignal) => {\n return searchJobs({ ...query, limit: pageSize, offset }, batchSignal);\n },\n });\n };\n\n const createJob = async (body: CreateJobBody, signal?: AbortSignal) => {\n const { data } = await client.post('/jobs', { body }, { signal });\n\n return data;\n };\n\n const killJob = async (jobId: KillJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.post(\n '/jobs/{jobId}/kill',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchGroupedJobs = async (query: SearchGroupedJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/grouped-jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const getOrchestrationRerunPlan = async (\n jobId: OrchestrationRerunPlanPath['jobId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get(\n '/orchestration-rerun-plan/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a queue job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getJob });\n\n return {\n healthCheck,\n poller,\n getJob,\n searchJobs,\n searchAllJobs,\n createJob,\n killJob,\n searchGroupedJobs,\n getOrchestrationRerunPlan,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAa,UAAU,OAAU,EAC/B,WACA,UACA,OACA,aACqC;CACrC,IAAI,QAAQ,SAAS,MAAMA,kBAAAA,iBAAiB,OAAO,MAAM;CACzD,IAAI,UAAU,KAAA,KAAa,QAAQ,GAAG,MAAM,IAAI,MAAM,uBAAuB;CAC7E,IAAI,aAAa,KAAA,KAAa,WAAW,GAAG,MAAM,IAAI,MAAM,0BAA0B;CAEtF,MAAM,QAAa,CAAC;CAEpB,IAAI,UAAU,GAAG,OAAO;CAExB,IAAI,SAAS;CAEb,OAAO,MAAM;EACX,MAAM,QAAQ,MAAM,UAAU,QAAQ,UAAU,MAAM;EAEtD,MAAM,KAAK,GAAG,KAAK;EACnB,UAAU,MAAM;EAEhB,IAAI,UAAU,KAAA,KAAa,MAAM,UAAU,OAAO,OAAO,MAAM,MAAM,GAAG,KAAK;EAC7E,IAAI,aAAa,KAAA,IAAY,MAAM,WAAW,IAAI,MAAM,SAAS,UAAU,OAAO;CACpF;AACF;;;ACtCA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,OAAO;CACT;CAEA,MAAM,UAAU,OAAO,OAA6B,WAAyB;EAC3E,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,sBACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,oBAAoB,OAAO,OAA+B,WAAyB;EACvF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,wBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,4BAA4B,OAChC,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,OAAO,CAIjC;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_concurrent = require("../concurrent-tbiIa0UL.cjs");
3
- const require_createGenericFetchClient = require("../createGenericFetchClient-DHs-i7_O.cjs");
4
- const require_createOpenapiFetchClient = require("../createOpenapiFetchClient-CyDUFxHB.cjs");
5
- const require_auth = require("../auth-DP-6TFiM.cjs");
3
+ const require_createGenericFetchClient = require("../createGenericFetchClient-o3cPJeRn.cjs");
4
+ const require_createOpenapiFetchClient = require("../createOpenapiFetchClient-DhUU3M1W.cjs");
5
+ const require_auth = require("../auth-JQ33o3nU.cjs");
6
6
  //#region src/clients/scheduler/schedulerClient.ts
7
7
  const createSchedulerClient = ({ baseUrl, middlewares, auth }) => {
8
8
  const client = require_createOpenapiFetchClient.createOpenapiFetchClient({
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BREGN3qo.cjs";
2
- import { a as SchedulePath, n as ConfigurationPath, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-C1vhYcic.cjs";
1
+ import { n as ClientInitOptions } from "../types-_RhBCj4_.cjs";
2
+ import { a as SchedulePath, n as ConfigurationPath, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-BW2BXUB4.cjs";
3
3
  //#region src/clients/scheduler/schedulerClient.d.ts
4
4
  declare const createSchedulerClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
5
5
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-DwpRt3e9.js";
2
- import { a as SchedulePath, n as ConfigurationPath, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-BTbczawY.js";
1
+ import { n as ClientInitOptions } from "../types-Ct0YPy2w.js";
2
+ import { a as SchedulePath, n as ConfigurationPath, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-zZBxJ0P-.js";
3
3
  //#region src/clients/scheduler/schedulerClient.d.ts
4
4
  declare const createSchedulerClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
5
5
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
@@ -1,7 +1,7 @@
1
1
  import { t as concurrent } from "../concurrent-CH9fbNr3.js";
2
- import { t as createGenericFetchClient } from "../createGenericFetchClient-BHYQLZhe.js";
3
- import { t as createOpenapiFetchClient } from "../createOpenapiFetchClient-Bn6_Pn0H.js";
4
- import { t as createAuthHeaders } from "../auth-DtbQaeDj.js";
2
+ import { t as createGenericFetchClient } from "../createGenericFetchClient-rxvUUbap.js";
3
+ import { t as createOpenapiFetchClient } from "../createOpenapiFetchClient-BVSc9ibR.js";
4
+ import { t as createAuthHeaders } from "../auth-aItmDu45.js";
5
5
  //#region src/clients/scheduler/schedulerClient.ts
6
6
  const createSchedulerClient = ({ baseUrl, middlewares, auth }) => {
7
7
  const client = createOpenapiFetchClient({
@@ -1,2 +1,2 @@
1
- import { a as SchedulePath, i as Schedule, n as ConfigurationPath, o as Schedules, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-C1vhYcic.cjs";
1
+ import { a as SchedulePath, i as Schedule, n as ConfigurationPath, o as Schedules, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-BW2BXUB4.cjs";
2
2
  export { ActivateScheduleBody, ConfigurationPath, GetSchedulesQuery, Schedule, SchedulePath, Schedules };
@@ -1,2 +1,2 @@
1
- import { a as SchedulePath, i as Schedule, n as ConfigurationPath, o as Schedules, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-BTbczawY.js";
1
+ import { a as SchedulePath, i as Schedule, n as ConfigurationPath, o as Schedules, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-zZBxJ0P-.js";
2
2
  export { ActivateScheduleBody, ConfigurationPath, GetSchedulesQuery, Schedule, SchedulePath, Schedules };
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_configurations = require("../../configurations-Ck-mNB_E.cjs");
2
+ const require_configurations = require("../../configurations-zkNjr73Q.cjs");
3
3
  exports.createConfigurationSdk = require_configurations.createConfigurationSdk;
@@ -1,7 +1,7 @@
1
- import { I as createStorageClient, M as RegisteredComponentId, N as registry, Ut as createDefaultBranch } from "../../index-Bjk-tCpG.cjs";
2
- import { Dn as UpdateConfigurationInput, Xt as BaseComponentConfig, an as ConfigurationPath, sn as CreateConfigurationInput } from "../../types-BV2BDccJ.cjs";
3
- import { t as createEncryptionClient } from "../../index-eAlN694c.cjs";
4
- import { t as Project } from "../../project-BnQkL8cb.cjs";
1
+ import { B as createStorageClient, I as RegisteredComponentId, L as registry, Wt as createDefaultBranch } from "../../index-BLx14ZI4.cjs";
2
+ import { Dn as UpdateConfigurationInput, Xt as BaseComponentConfig, an as ConfigurationPath, sn as CreateConfigurationInput } from "../../types-DjrRmQUe.cjs";
3
+ import { t as createEncryptionClient } from "../../index-DR4QqItd.cjs";
4
+ import { t as Project } from "../../project-hePfzUY0.cjs";
5
5
  import { z } from "zod";
6
6
  //#region src/sdks/configurations/configurationsSdk.d.ts
7
7
  type ConfigurationSdkContext = {
@@ -1,7 +1,7 @@
1
- import { I as createStorageClient, M as RegisteredComponentId, N as registry, Ut as createDefaultBranch } from "../../index-FhKX7Cv1.js";
2
- import { Dn as UpdateConfigurationInput, Xt as BaseComponentConfig, an as ConfigurationPath, sn as CreateConfigurationInput } from "../../types-D6jKxUv_.js";
3
- import { t as createEncryptionClient } from "../../index-DeKPpYQy.js";
4
- import { t as Project } from "../../project-BOGaVs-q.js";
1
+ import { B as createStorageClient, I as RegisteredComponentId, L as registry, Wt as createDefaultBranch } from "../../index-DFBFa3SS.js";
2
+ import { Dn as UpdateConfigurationInput, Xt as BaseComponentConfig, an as ConfigurationPath, sn as CreateConfigurationInput } from "../../types-DEc55spK.js";
3
+ import { t as createEncryptionClient } from "../../index-D8rcUbnk.js";
4
+ import { t as Project } from "../../project-C2wvX0xZ.js";
5
5
  import { z } from "zod";
6
6
  //#region src/sdks/configurations/configurationsSdk.d.ts
7
7
  type ConfigurationSdkContext = {
@@ -1,2 +1,2 @@
1
- import { t as createConfigurationSdk } from "../../configurations-ZwBXilW-.js";
1
+ import { t as createConfigurationSdk } from "../../configurations-VtNE0nrT.js";
2
2
  export { createConfigurationSdk };
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_dedupe = require("../../dedupe-CiskLkGR.cjs");
3
- const require_createStore = require("../../createStore-MQbboXcB.cjs");
4
- const require_createFetchClient = require("../../createFetchClient-BRfTjBLV.cjs");
5
- const require_credential = require("../../credential-DOXH7XRS.cjs");
6
- const require_developerPortalClient = require("../../developerPortalClient-CgTSzLoG.cjs");
3
+ const require_store = require("../../store-xS-Cu_VS.cjs");
4
+ const require_createFetchClient = require("../../createFetchClient-DgMiqTJ8.cjs");
5
+ const require_credential = require("../../credential-DVWvJFJs.cjs");
6
+ const require_developerPortalClient = require("../../developerPortalClient-ki0XS_OD.cjs");
7
7
  //#region src/sdks/developerPortal/tokenExpiry.ts
8
8
  /**
9
9
  * Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable ("expiry unknown", which the
@@ -103,7 +103,7 @@ const createDeveloperPortalAuthMiddleware = (credential) => {
103
103
  * apps-api is its own identity domain.
104
104
  */
105
105
  const createDeveloperPortalSdk = ({ baseUrl, tokens: initialTokens = null, onTokensChange, onSessionExpired, refreshLeadTimeMs, middlewares = [] }) => {
106
- const store = require_createStore.createStore(initialTokens);
106
+ const store = require_store.createStore(initialTokens);
107
107
  store.subscribe((value) => onTokensChange?.(value));
108
108
  const getTokens = () => store.get();
109
109
  const requireTokens = (action) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["isUnauthorized","dedupe","HttpHeader","isUnauthorized","createStore","createDeveloperPortalClient"],"sources":["../../../src/sdks/developerPortal/tokenExpiry.ts","../../../src/sdks/developerPortal/credential.ts","../../../src/sdks/developerPortal/middleware.ts","../../../src/sdks/developerPortal/developerPortalSdk.ts"],"sourcesContent":["/**\n * Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable (\"expiry unknown\", which the\n * caller leaves to the 401 path). A read, not a verification.\n *\n * Needed because apps-api reports `expiresIn` on login but never on refresh, so it cannot keep a\n * proactive-refresh clock honest past the first rotation. The token always carries its own expiry.\n */\nexport const readTokenExpiry = (token: string): number | null => {\n const segments = token.split('.');\n if (segments.length !== 3) return null;\n\n const payload = segments[1];\n if (payload === undefined || payload === '') return null;\n\n try {\n // base64url -> base64, and re-pad: `atob` requires padding, base64url omits it.\n const base64 = payload.replaceAll('-', '+').replaceAll('_', '/');\n const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=');\n const claims: unknown = JSON.parse(atob(padded));\n if (typeof claims !== 'object' || claims === null || !('exp' in claims)) return null;\n const { exp } = claims as { exp: unknown };\n if (typeof exp !== 'number' || !Number.isFinite(exp)) return null;\n return exp * 1000;\n } catch {\n return null;\n }\n};\n","import type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport { isUnauthorized } from '../../keboola/bearer/credential';\nimport { dedupe } from '../../utils';\n\nimport { readTokenExpiry } from './tokenExpiry';\n\ntype Options = {\n refresh: () => Promise<DeveloperPortalTokens>;\n /** Live read from the session, so this holds no token of its own. `null` when signed out. */\n getTokens: () => DeveloperPortalTokens | null;\n /** May fire more than once; the caller owns any fire-once latch. */\n onSessionExpired?: () => void;\n /**\n * An absolute lead time rather than `createBearerCredential`'s fractional threshold: that needs the\n * token's full lifetime, and apps-api reports `expiresIn` on login only, never on refresh.\n */\n refreshLeadTimeMs?: number;\n};\n\nconst DEFAULT_REFRESH_LEAD_TIME_MS = 5 * 60 * 1000;\n\nexport type DeveloperPortalCredential = {\n getIdToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n getTokens: () => DeveloperPortalTokens | null;\n notifyExpired: () => void;\n};\n\n/** Mirrors `createBearerCredential`, over the id token of the trio. */\nexport const createDeveloperPortalCredential = ({\n refresh,\n getTokens,\n onSessionExpired,\n refreshLeadTimeMs = DEFAULT_REFRESH_LEAD_TIME_MS,\n}: Options): DeveloperPortalCredential => {\n const doRefresh = async (): Promise<DeveloperPortalTokens> => {\n try {\n return await refresh();\n } catch (error) {\n // Only a 401 means the refresh token is dead. Signing out over a 5xx would be a self-inflicted\n // logout, so anything else propagates without expiring the session.\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n // N concurrent 401s must cause one rotation: each extra one invalidates the tokens the others got.\n const refreshShared = dedupe(doRefresh);\n\n const getIdToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const tokens = getTokens();\n if (tokens === null) return null;\n if (forceRefresh) return (await refreshShared()).token;\n\n const expiresAt = readTokenExpiry(tokens.token);\n // Unknown expiry is left to the 401 path; a `0` here would rotate on every request.\n if (expiresAt === null) return tokens.token;\n if (Date.now() < expiresAt - refreshLeadTimeMs) return tokens.token;\n\n // Proactive rotation is best-effort — a real 401 drives the mandatory one.\n return refreshShared()\n .then((fresh) => fresh.token)\n .catch(() => tokens.token);\n };\n\n return { getIdToken, getTokens, notifyExpired: () => onSessionExpired?.() };\n};\n","import { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { isUnauthorized } from '../../keboola/bearer/credential';\n\nimport type { DeveloperPortalCredential } from './credential';\n\n/**\n * Stamps the id token, and on a 401 force-refreshes and replays once. Mirrors\n * `createBearerAuthMiddleware`, minus the `Bearer ` prefix apps-api does not use.\n *\n * An anonymous session passes through unstamped, so a failed login is never read as session expiry.\n */\nexport const createDeveloperPortalAuthMiddleware = (\n credential: DeveloperPortalCredential,\n): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await credential.getIdToken();\n if (token === null) return next(request);\n\n // Cloned before the first attempt consumes the body. Cloning the `Request` carries a binary or\n // FormData payload through byte-for-byte.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, token);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await credential.getIdToken({ forceRefresh: true }).catch(() => null);\n // Nothing to replay with, because a concurrent sign-out landed or the rotation failed. The\n // caller's request failed with a 401, so that is what they see.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, refreshed);\n\n try {\n return await next({ ...request, request: retryRequest });\n } catch (retryError) {\n if (isUnauthorized(retryError)) credential.notifyExpired();\n throw retryError;\n }\n }\n };\n};\n","import { createDeveloperPortalClient } from '../../clients/developerPortal/developerPortalClient';\nimport type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport type { LoginSuccess } from '../../clients/developerPortal/types';\nimport type { MiddlewareFn } from '../../fetchClient';\nimport { createStore } from '../../utils';\n\nimport { createDeveloperPortalCredential } from './credential';\nimport { createDeveloperPortalAuthMiddleware } from './middleware';\n\nexport type DeveloperPortalSdkOptions = {\n baseUrl: string;\n /** Session to restore on construction — e.g. a trio read back out of `localStorage`. */\n tokens?: DeveloperPortalTokens | null;\n /** Persistence hook, fired on sign-in, every rotation, and with `null` on sign-out or expiry. */\n onTokensChange?: (tokens: DeveloperPortalTokens | null) => void;\n /** The session is dead; tokens are already cleared. The consumer redirects to sign-in. */\n onSessionExpired?: () => void;\n refreshLeadTimeMs?: number;\n middlewares?: MiddlewareFn[];\n};\n\n/**\n * `createDeveloperPortalClient` plus the session that keeps it authenticated: the token store, the\n * credential, the auth middleware, and the tokens the four self-authenticating endpoints need.\n *\n * It constructs its client rather than receiving one like `createTagSdk` does, because the middleware\n * needs the credential, the credential needs the session, and the session needs a client to rotate\n * with. `createKeboola` closes the same cycle the same way, and stays separate from this one because\n * apps-api is its own identity domain.\n */\nexport const createDeveloperPortalSdk = ({\n baseUrl,\n tokens: initialTokens = null,\n onTokensChange,\n onSessionExpired,\n refreshLeadTimeMs,\n middlewares = [],\n}: DeveloperPortalSdkOptions) => {\n const store = createStore<DeveloperPortalTokens | null>(initialTokens);\n store.subscribe((value) => onTokensChange?.(value));\n\n const getTokens = () => store.get();\n\n const requireTokens = (action: string): DeveloperPortalTokens => {\n const tokens = store.get();\n if (tokens === null) {\n throw new Error(`Developer Portal: ${action} requires a signed-in session.`);\n }\n return tokens;\n };\n\n // No auth middleware: `refreshTokens` sets its own header, so a rotation cannot recurse into the\n // middleware that triggered it.\n const refreshClient = createDeveloperPortalClient({ baseUrl, middlewares });\n\n const refresh = async (): Promise<DeveloperPortalTokens> => {\n const before = store.get();\n if (before === null) {\n throw new Error('Cannot refresh the Developer Portal session: signed out.');\n }\n\n const { token, accessToken } = await refreshClient.auth.refreshTokens(before.refreshToken);\n const next: DeveloperPortalTokens = { token, accessToken, refreshToken: before.refreshToken };\n\n // Sign-out wins over an in-flight rotation: without this, a `clear()` that lands while the request\n // is on the wire is undone by the response, silently signing the user back in.\n const after = store.get();\n if (after === null || after.refreshToken !== before.refreshToken) {\n throw new Error('Developer Portal session changed while refreshing; discarding the result.');\n }\n\n store.set(next);\n return next;\n };\n\n const clear = () => store.set(null);\n\n const credential = createDeveloperPortalCredential({\n refresh,\n getTokens,\n refreshLeadTimeMs,\n onSessionExpired: () => {\n clear();\n onSessionExpired?.();\n },\n });\n\n const client = createDeveloperPortalClient({\n baseUrl,\n middlewares,\n authMiddleware: createDeveloperPortalAuthMiddleware(credential),\n });\n\n // `refreshTokens` is not re-exposed: rotating outside the store would leave the session holding\n // tokens the server has moved past. `session.refresh()` is the supported way.\n const { refreshTokens: _storeBypassingRotation, ...auth } = client.auth;\n\n const api = {\n ...client,\n auth: {\n ...auth,\n logout: async (signal?: AbortSignal) =>\n client.auth.logout(requireTokens('sign-out').accessToken, signal),\n // Both MFA calls bypass the reactive 401 path, so rotate proactively first.\n setupMfa: async (signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA enrolment');\n return client.auth.setupMfa({ idToken: token, accessToken }, signal);\n },\n confirmMfa: async (code: string, signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA confirmation');\n return client.auth.confirmMfa({ idToken: token, accessToken, code }, signal);\n },\n },\n };\n\n const session = {\n set: (result: LoginSuccess) => {\n store.set({\n token: result.token,\n accessToken: result.accessToken,\n refreshToken: result.refreshToken,\n });\n },\n get: getTokens,\n subscribe: store.subscribe,\n clear,\n /** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */\n ensureFresh: async (): Promise<void> => {\n await credential.getIdToken();\n },\n /**\n * Rotates now, for a change of *claims* rather than age — leaving a vendor is the case that\n * matters, since the stale `profile` claim keeps scoping requests to a vendor the user just left.\n * Propagates failure: a caller forcing this needs to know whether the claims actually changed.\n */\n refresh: async (): Promise<void> => {\n await credential.getIdToken({ forceRefresh: true });\n },\n isAuthenticated: () => store.get() !== null,\n };\n\n return { api, session };\n};\n\nexport type DeveloperPortalSdk = ReturnType<typeof createDeveloperPortalSdk>;\nexport type DeveloperPortalSession = Develo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AI;KACR,OAAO,OAAO;KACd,aAAa,OAAO;KACpB,cAAc,OAAO;IACvB,CAAC;GACH;GACA,KAAK;GACL,WAAW,MAAM;GACjB;;GAEA,aAAa,YAA2B;IACtC,MAAM,WAAW,WAAW;GAC9B;;;;;;GAMA,SAAS,YAA2B;IAClC,MAAM,WAAW,WAAW,EAAE,cAAc,KAAK,CAAC;GACpD;GACA,uBAAuB,MAAM,IAAI,MAAM;EAGrB;CAAE;AACxB"}
1
+ {"version":3,"file":"index.cjs","names":["isUnauthorized","dedupe","HttpHeader","isUnauthorized","createStore","createDeveloperPortalClient"],"sources":["../../../src/sdks/developerPortal/tokenExpiry.ts","../../../src/sdks/developerPortal/credential.ts","../../../src/sdks/developerPortal/middleware.ts","../../../src/sdks/developerPortal/developerPortalSdk.ts"],"sourcesContent":["/**\n * Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable (\"expiry unknown\", which the\n * caller leaves to the 401 path). A read, not a verification.\n *\n * Needed because apps-api reports `expiresIn` on login but never on refresh, so it cannot keep a\n * proactive-refresh clock honest past the first rotation. The token always carries its own expiry.\n */\nexport const readTokenExpiry = (token: string): number | null => {\n const segments = token.split('.');\n if (segments.length !== 3) return null;\n\n const payload = segments[1];\n if (payload === undefined || payload === '') return null;\n\n try {\n // base64url -> base64, and re-pad: `atob` requires padding, base64url omits it.\n const base64 = payload.replaceAll('-', '+').replaceAll('_', '/');\n const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=');\n const claims: unknown = JSON.parse(atob(padded));\n if (typeof claims !== 'object' || claims === null || !('exp' in claims)) return null;\n const { exp } = claims as { exp: unknown };\n if (typeof exp !== 'number' || !Number.isFinite(exp)) return null;\n return exp * 1000;\n } catch {\n return null;\n }\n};\n","import type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport { isUnauthorized } from '../../keboola/bearer/credential';\nimport { dedupe } from '../../utils';\n\nimport { readTokenExpiry } from './tokenExpiry';\n\ntype Options = {\n refresh: () => Promise<DeveloperPortalTokens>;\n /** Live read from the session, so this holds no token of its own. `null` when signed out. */\n getTokens: () => DeveloperPortalTokens | null;\n /** May fire more than once; the caller owns any fire-once latch. */\n onSessionExpired?: () => void;\n /**\n * An absolute lead time rather than `createBearerCredential`'s fractional threshold: that needs the\n * token's full lifetime, and apps-api reports `expiresIn` on login only, never on refresh.\n */\n refreshLeadTimeMs?: number;\n};\n\nconst DEFAULT_REFRESH_LEAD_TIME_MS = 5 * 60 * 1000;\n\nexport type DeveloperPortalCredential = {\n getIdToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n getTokens: () => DeveloperPortalTokens | null;\n notifyExpired: () => void;\n};\n\n/** Mirrors `createBearerCredential`, over the id token of the trio. */\nexport const createDeveloperPortalCredential = ({\n refresh,\n getTokens,\n onSessionExpired,\n refreshLeadTimeMs = DEFAULT_REFRESH_LEAD_TIME_MS,\n}: Options): DeveloperPortalCredential => {\n const doRefresh = async (): Promise<DeveloperPortalTokens> => {\n try {\n return await refresh();\n } catch (error) {\n // Only a 401 means the refresh token is dead. Signing out over a 5xx would be a self-inflicted\n // logout, so anything else propagates without expiring the session.\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n // N concurrent 401s must cause one rotation: each extra one invalidates the tokens the others got.\n const refreshShared = dedupe(doRefresh);\n\n const getIdToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const tokens = getTokens();\n if (tokens === null) return null;\n if (forceRefresh) return (await refreshShared()).token;\n\n const expiresAt = readTokenExpiry(tokens.token);\n // Unknown expiry is left to the 401 path; a `0` here would rotate on every request.\n if (expiresAt === null) return tokens.token;\n if (Date.now() < expiresAt - refreshLeadTimeMs) return tokens.token;\n\n // Proactive rotation is best-effort — a real 401 drives the mandatory one.\n return refreshShared()\n .then((fresh) => fresh.token)\n .catch(() => tokens.token);\n };\n\n return { getIdToken, getTokens, notifyExpired: () => onSessionExpired?.() };\n};\n","import { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { isUnauthorized } from '../../keboola/bearer/credential';\n\nimport type { DeveloperPortalCredential } from './credential';\n\n/**\n * Stamps the id token, and on a 401 force-refreshes and replays once. Mirrors\n * `createBearerAuthMiddleware`, minus the `Bearer ` prefix apps-api does not use.\n *\n * An anonymous session passes through unstamped, so a failed login is never read as session expiry.\n */\nexport const createDeveloperPortalAuthMiddleware = (\n credential: DeveloperPortalCredential,\n): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await credential.getIdToken();\n if (token === null) return next(request);\n\n // Cloned before the first attempt consumes the body. Cloning the `Request` carries a binary or\n // FormData payload through byte-for-byte.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, token);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await credential.getIdToken({ forceRefresh: true }).catch(() => null);\n // Nothing to replay with, because a concurrent sign-out landed or the rotation failed. The\n // caller's request failed with a 401, so that is what they see.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, refreshed);\n\n try {\n return await next({ ...request, request: retryRequest });\n } catch (retryError) {\n if (isUnauthorized(retryError)) credential.notifyExpired();\n throw retryError;\n }\n }\n };\n};\n","import { createDeveloperPortalClient } from '../../clients/developerPortal/developerPortalClient';\nimport type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport type { LoginSuccess } from '../../clients/developerPortal/types';\nimport type { MiddlewareFn } from '../../fetchClient';\nimport { createStore } from '../../utils';\n\nimport { createDeveloperPortalCredential } from './credential';\nimport { createDeveloperPortalAuthMiddleware } from './middleware';\n\nexport type DeveloperPortalSdkOptions = {\n baseUrl: string;\n /** Session to restore on construction — e.g. a trio read back out of `localStorage`. */\n tokens?: DeveloperPortalTokens | null;\n /** Persistence hook, fired on sign-in, every rotation, and with `null` on sign-out or expiry. */\n onTokensChange?: (tokens: DeveloperPortalTokens | null) => void;\n /** The session is dead; tokens are already cleared. The consumer redirects to sign-in. */\n onSessionExpired?: () => void;\n refreshLeadTimeMs?: number;\n middlewares?: MiddlewareFn[];\n};\n\n/**\n * `createDeveloperPortalClient` plus the session that keeps it authenticated: the token store, the\n * credential, the auth middleware, and the tokens the four self-authenticating endpoints need.\n *\n * It constructs its client rather than receiving one like `createTagSdk` does, because the middleware\n * needs the credential, the credential needs the session, and the session needs a client to rotate\n * with. `createKeboola` closes the same cycle the same way, and stays separate from this one because\n * apps-api is its own identity domain.\n */\nexport const createDeveloperPortalSdk = ({\n baseUrl,\n tokens: initialTokens = null,\n onTokensChange,\n onSessionExpired,\n refreshLeadTimeMs,\n middlewares = [],\n}: DeveloperPortalSdkOptions) => {\n const store = createStore<DeveloperPortalTokens | null>(initialTokens);\n store.subscribe((value) => onTokensChange?.(value));\n\n const getTokens = () => store.get();\n\n const requireTokens = (action: string): DeveloperPortalTokens => {\n const tokens = store.get();\n if (tokens === null) {\n throw new Error(`Developer Portal: ${action} requires a signed-in session.`);\n }\n return tokens;\n };\n\n // No auth middleware: `refreshTokens` sets its own header, so a rotation cannot recurse into the\n // middleware that triggered it.\n const refreshClient = createDeveloperPortalClient({ baseUrl, middlewares });\n\n const refresh = async (): Promise<DeveloperPortalTokens> => {\n const before = store.get();\n if (before === null) {\n throw new Error('Cannot refresh the Developer Portal session: signed out.');\n }\n\n const { token, accessToken } = await refreshClient.auth.refreshTokens(before.refreshToken);\n const next: DeveloperPortalTokens = { token, accessToken, refreshToken: before.refreshToken };\n\n // Sign-out wins over an in-flight rotation: without this, a `clear()` that lands while the request\n // is on the wire is undone by the response, silently signing the user back in.\n const after = store.get();\n if (after === null || after.refreshToken !== before.refreshToken) {\n throw new Error('Developer Portal session changed while refreshing; discarding the result.');\n }\n\n store.set(next);\n return next;\n };\n\n const clear = () => store.set(null);\n\n const credential = createDeveloperPortalCredential({\n refresh,\n getTokens,\n refreshLeadTimeMs,\n onSessionExpired: () => {\n clear();\n onSessionExpired?.();\n },\n });\n\n const client = createDeveloperPortalClient({\n baseUrl,\n middlewares,\n authMiddleware: createDeveloperPortalAuthMiddleware(credential),\n });\n\n // `refreshTokens` is not re-exposed: rotating outside the store would leave the session holding\n // tokens the server has moved past. `session.refresh()` is the supported way.\n const { refreshTokens: _storeBypassingRotation, ...auth } = client.auth;\n\n const api = {\n ...client,\n auth: {\n ...auth,\n logout: async (signal?: AbortSignal) =>\n client.auth.logout(requireTokens('sign-out').accessToken, signal),\n // Both MFA calls bypass the reactive 401 path, so rotate proactively first.\n setupMfa: async (signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA enrolment');\n return client.auth.setupMfa({ idToken: token, accessToken }, signal);\n },\n confirmMfa: async (code: string, signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA confirmation');\n return client.auth.confirmMfa({ idToken: token, accessToken, code }, signal);\n },\n },\n };\n\n const session = {\n set: (result: LoginSuccess) => {\n store.set({\n token: result.token,\n accessToken: result.accessToken,\n refreshToken: result.refreshToken,\n });\n },\n get: getTokens,\n subscribe: store.subscribe,\n clear,\n /** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */\n ensureFresh: async (): Promise<void> => {\n await credential.getIdToken();\n },\n /**\n * Rotates now, for a change of *claims* rather than age — leaving a vendor is the case that\n * matters, since the stale `profile` claim keeps scoping requests to a vendor the user just left.\n * Propagates failure: a caller forcing this needs to know whether the claims actually changed.\n */\n refresh: async (): Promise<void> => {\n await credential.getIdToken({ forceRefresh: true });\n },\n isAuthenticated: () => store.get() !== null,\n };\n\n return { api, session };\n};\n\nexport type DeveloperPortalSdk = ReturnType<typeof createDeveloperPortalSdk>;\nexport type DeveloperPortalSession = DeveloperPortalSdk['session'];\n"],"mappings":";;;;;;;;;;;;;;AAOA,MAAa,mBAAmB,UAAiC;CAC/D,MAAM,WAAW,MAAM,MAAM,GAAG;CAChC,IAAI,SAAS,WAAW,GAAG,OAAO;CAElC,MAAM,UAAU,SAAS;CACzB,IAAI,YAAY,KAAA,KAAa,YAA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WAAW,EAAE,cAAc,KAAK,CAAC;GACpD;GACA,uBAAuB,MAAM,IAAI,MAAM;EAGrB;CAAE;AACxB"}
@@ -1,6 +1,7 @@
1
- import { T as MiddlewareFn } from "../../index-CQrKS7PV.cjs";
2
- import { A as ResetPasswordConfirmInput, E as PaginationQuery, F as UpdateAppAsAdminInput, I as UpdateAppInput, L as UpdateVendorAsAdminInput, N as SignUpInput, R as UpdateVendorInput, S as LoginSuccess, W as components, _ as GetVendorUsersQuery, b as LoginInput, c as ConfirmAccountInput, d as CreateVendorAsAdminInput, f as CreateVendorInput, g as GetChangesQuery, h as GetAppsQuery, k as RejectAppInput, l as CreateAppInput, p as DeprecateAppInput, s as ApproveVendorInput, t as AdminPaginationQuery, u as CreateServiceAccountInput } from "../../types-DlbiVsVo.cjs";
3
- import { t as DeveloperPortalTokens } from "../../index-BKh0prif.cjs";
1
+ import { D as MiddlewareFn } from "../../index-V7XKUQm9.cjs";
2
+ import { A as ResetPasswordConfirmInput, E as PaginationQuery, F as UpdateAppAsAdminInput, I as UpdateAppInput, L as UpdateVendorAsAdminInput, N as SignUpInput, R as UpdateVendorInput, S as LoginSuccess, W as components, _ as GetVendorUsersQuery, b as LoginInput, c as ConfirmAccountInput, d as CreateVendorAsAdminInput, f as CreateVendorInput, g as GetChangesQuery, h as GetAppsQuery, k as RejectAppInput, l as CreateAppInput, p as DeprecateAppInput, s as ApproveVendorInput, t as AdminPaginationQuery, u as CreateServiceAccountInput } from "../../types-D8Rrz51O.cjs";
3
+ import { t as DeveloperPortalTokens } from "../../index-GjcJTCbz.cjs";
4
+ import { n as Listener } from "../../emitter-dLF1Fyfg.cjs";
4
5
  //#region src/sdks/developerPortal/developerPortalSdk.d.ts
5
6
  type DeveloperPortalSdkOptions = {
6
7
  baseUrl: string;
@@ -1351,7 +1352,7 @@ declare const createDeveloperPortalSdk: ({ baseUrl, tokens: initialTokens, onTok
1351
1352
  session: {
1352
1353
  set: (result: LoginSuccess) => void;
1353
1354
  get: () => DeveloperPortalTokens | null;
1354
- subscribe: (listener: (value: DeveloperPortalTokens | null) => void) => () => void;
1355
+ subscribe: (listener: Listener<DeveloperPortalTokens | null>) => () => void;
1355
1356
  clear: () => void;
1356
1357
  /** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */
1357
1358
  ensureFresh: () => Promise<void>;
@@ -1,6 +1,7 @@
1
- import { T as MiddlewareFn } from "../../index-CeJOmN-P.js";
2
- import { A as ResetPasswordConfirmInput, E as PaginationQuery, F as UpdateAppAsAdminInput, I as UpdateAppInput, L as UpdateVendorAsAdminInput, N as SignUpInput, R as UpdateVendorInput, S as LoginSuccess, W as components, _ as GetVendorUsersQuery, b as LoginInput, c as ConfirmAccountInput, d as CreateVendorAsAdminInput, f as CreateVendorInput, g as GetChangesQuery, h as GetAppsQuery, k as RejectAppInput, l as CreateAppInput, p as DeprecateAppInput, s as ApproveVendorInput, t as AdminPaginationQuery, u as CreateServiceAccountInput } from "../../types-Dfc58bPE.js";
3
- import { t as DeveloperPortalTokens } from "../../index-tKsiUarj.js";
1
+ import { D as MiddlewareFn } from "../../index-KuQ79Mnz.js";
2
+ import { A as ResetPasswordConfirmInput, E as PaginationQuery, F as UpdateAppAsAdminInput, I as UpdateAppInput, L as UpdateVendorAsAdminInput, N as SignUpInput, R as UpdateVendorInput, S as LoginSuccess, W as components, _ as GetVendorUsersQuery, b as LoginInput, c as ConfirmAccountInput, d as CreateVendorAsAdminInput, f as CreateVendorInput, g as GetChangesQuery, h as GetAppsQuery, k as RejectAppInput, l as CreateAppInput, p as DeprecateAppInput, s as ApproveVendorInput, t as AdminPaginationQuery, u as CreateServiceAccountInput } from "../../types-DajzGOKB.js";
3
+ import { t as DeveloperPortalTokens } from "../../index-pXN4LWUX.js";
4
+ import { n as Listener } from "../../emitter-dLF1Fyfg.js";
4
5
  //#region src/sdks/developerPortal/developerPortalSdk.d.ts
5
6
  type DeveloperPortalSdkOptions = {
6
7
  baseUrl: string;
@@ -1351,7 +1352,7 @@ declare const createDeveloperPortalSdk: ({ baseUrl, tokens: initialTokens, onTok
1351
1352
  session: {
1352
1353
  set: (result: LoginSuccess) => void;
1353
1354
  get: () => DeveloperPortalTokens | null;
1354
- subscribe: (listener: (value: DeveloperPortalTokens | null) => void) => () => void;
1355
+ subscribe: (listener: Listener<DeveloperPortalTokens | null>) => () => void;
1355
1356
  clear: () => void;
1356
1357
  /** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */
1357
1358
  ensureFresh: () => Promise<void>;
@@ -1,8 +1,8 @@
1
1
  import { t as dedupe } from "../../dedupe-DYIHgZoG.js";
2
- import { i as createStore } from "../../createStore-BNiCRQXa.js";
3
- import { o as HttpHeader } from "../../createFetchClient-BbG46bL0.js";
4
- import { n as isUnauthorized } from "../../credential-d2RDcXRB.js";
5
- import { t as createDeveloperPortalClient } from "../../developerPortalClient-DywKpDlW.js";
2
+ import { t as createStore } from "../../store-C9FQCHGe.js";
3
+ import { s as HttpHeader } from "../../createFetchClient-U-ZrwPl2.js";
4
+ import { n as isUnauthorized } from "../../credential-CihSf_xs.js";
5
+ import { t as createDeveloperPortalClient } from "../../developerPortalClient-C_48z8BN.js";
6
6
  //#region src/sdks/developerPortal/tokenExpiry.ts
7
7
  /**
8
8
  * Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable ("expiry unknown", which the
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_jobStatus = require("../../jobStatus-kQ9JqF8t.cjs");
2
+ const require_jobStatus = require("../../jobStatus-0_Y3Sr4i.cjs");
3
3
  const require_QueryJobTimeoutError = require("../../QueryJobTimeoutError-CVNPdCWX.cjs");
4
- const require_ValidationError = require("../../ValidationError-h5qvwahi.cjs");
4
+ const require_ValidationError = require("../../ValidationError-CLVJCCwH.cjs");
5
5
  //#region src/sdks/queryService/queryServiceSdk.ts
6
6
  const DEFAULT_WAIT_FOR_JOB_INTERVAL = 500;
7
7
  const DEFAULT_MAX_WAIT_TIME = 3e5;
@@ -1,2 +1,2 @@
1
- import { i as createQueryServiceSdk, n as ExecuteQueryOptions, r as WaitForJobOptions } from "../../index-Bjk-tCpG.cjs";
1
+ import { i as createQueryServiceSdk, n as ExecuteQueryOptions, r as WaitForJobOptions } from "../../index-BLx14ZI4.cjs";
2
2
  export { ExecuteQueryOptions, WaitForJobOptions, createQueryServiceSdk };
@@ -1,2 +1,2 @@
1
- import { i as createQueryServiceSdk, n as ExecuteQueryOptions, r as WaitForJobOptions } from "../../index-FhKX7Cv1.js";
1
+ import { i as createQueryServiceSdk, n as ExecuteQueryOptions, r as WaitForJobOptions } from "../../index-DFBFa3SS.js";
2
2
  export { ExecuteQueryOptions, WaitForJobOptions, createQueryServiceSdk };
@@ -1,6 +1,6 @@
1
- import { i as poll, t as jobStatus } from "../../jobStatus-DbMupQEK.js";
1
+ import { i as poll, t as jobStatus } from "../../jobStatus-PSZJMTiA.js";
2
2
  import { r as QueryJobError, t as QueryJobTimeoutError } from "../../QueryJobTimeoutError-C7JbNGOM.js";
3
- import { t as ValidationError } from "../../ValidationError-CzPWydEb.js";
3
+ import { t as ValidationError } from "../../ValidationError-BekhphAq.js";
4
4
  //#region src/sdks/queryService/queryServiceSdk.ts
5
5
  const DEFAULT_WAIT_FOR_JOB_INTERVAL = 500;
6
6
  const DEFAULT_MAX_WAIT_TIME = 3e5;