@keboola/api-client 56.0.0 → 57.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 (345) hide show
  1. package/AGENTS.md +110 -229
  2. package/API-SURFACE.md +10 -2
  3. package/CHANGELOG.md +45 -0
  4. package/README.md +20 -133
  5. package/dist/{ManagementSessionMintError-Bc9bc7Ai.cjs → ManagementSessionMintError-BCOLLaJi.cjs} +3 -2
  6. package/dist/ManagementSessionMintError-BCOLLaJi.cjs.map +1 -0
  7. package/dist/{ManagementSessionMintError-BMHDcEqV.js → ManagementSessionMintError-KUX3utTV.js} +3 -2
  8. package/dist/ManagementSessionMintError-KUX3utTV.js.map +1 -0
  9. package/dist/{adminRoles-CUB0JddB.d.ts → adminRoles-CnfGDvjN.d.ts} +2 -2
  10. package/dist/{adminRoles-BFOPSedO.d.cts → adminRoles-D6AS9Bzx.d.cts} +2 -2
  11. package/dist/ai/index.d.cts +2 -2
  12. package/dist/ai/index.d.ts +2 -2
  13. package/dist/ai/types.d.cts +1 -1
  14. package/dist/ai/types.d.ts +1 -1
  15. package/dist/apps/index.cjs +1 -1
  16. package/dist/apps/index.d.cts +2 -2
  17. package/dist/apps/index.d.ts +2 -2
  18. package/dist/apps/index.js +1 -1
  19. package/dist/apps/types.d.cts +2 -2
  20. package/dist/apps/types.d.ts +2 -2
  21. package/dist/{apps-C1x5IKNQ.cjs → apps-BA9JRLAZ.cjs} +55 -1
  22. package/dist/apps-BA9JRLAZ.cjs.map +1 -0
  23. package/dist/{apps-BN7fWtSm.js → apps-DDcguJ1i.js} +55 -1
  24. package/dist/apps-DDcguJ1i.js.map +1 -0
  25. package/dist/assets/index.d.cts +1 -1
  26. package/dist/assets/index.d.ts +1 -1
  27. package/dist/auth/index.cjs +1 -1
  28. package/dist/auth/index.d.cts +1 -1
  29. package/dist/auth/index.d.ts +1 -1
  30. package/dist/auth/index.js +1 -1
  31. package/dist/auth/types.d.cts +2 -2
  32. package/dist/auth/types.d.ts +2 -2
  33. package/dist/{authClient-B_Mb4Vzs.js → authClient-BKGpJI5L.js} +13 -2
  34. package/dist/authClient-BKGpJI5L.js.map +1 -0
  35. package/dist/{authClient-C9QqhT2M.cjs → authClient-C3KG9hXw.cjs} +17 -6
  36. package/dist/authClient-C3KG9hXw.cjs.map +1 -0
  37. package/dist/{authClient-Dgyb0EFi.d.ts → authClient-CbWpMmdX.d.ts} +7 -4
  38. package/dist/{authClient-DOetdp2k.d.cts → authClient-UKeopxZZ.d.cts} +7 -4
  39. package/dist/billing/index.d.cts +1 -1
  40. package/dist/billing/index.d.ts +1 -1
  41. package/dist/billing/types.d.cts +1 -1
  42. package/dist/billing/types.d.ts +1 -1
  43. package/dist/chat/index.d.cts +2 -2
  44. package/dist/chat/index.d.ts +2 -2
  45. package/dist/chat/types.d.cts +1 -1
  46. package/dist/chat/types.d.ts +1 -1
  47. package/dist/componentsMcp/index.d.cts +1 -1
  48. package/dist/componentsMcp/index.d.ts +1 -1
  49. package/dist/componentsMcp/types.d.cts +1 -1
  50. package/dist/componentsMcp/types.d.ts +1 -1
  51. package/dist/constants/index.cjs +2 -2
  52. package/dist/constants/index.d.cts +3 -3
  53. package/dist/constants/index.d.ts +3 -3
  54. package/dist/constants/index.js +2 -2
  55. package/dist/{constants-HccvU5kx.js → constants-CxEaHCyt.js} +4 -3
  56. package/dist/constants-CxEaHCyt.js.map +1 -0
  57. package/dist/{constants-V9hAyPTo.cjs → constants-fiyOLyZE.cjs} +4 -3
  58. package/dist/constants-fiyOLyZE.cjs.map +1 -0
  59. package/dist/dataScience/index.d.cts +3 -3
  60. package/dist/dataScience/index.d.ts +3 -3
  61. package/dist/dataScience/types.d.cts +1 -1
  62. package/dist/dataScience/types.d.ts +1 -1
  63. package/dist/developerPortal/index.cjs +1 -1
  64. package/dist/developerPortal/index.d.cts +3 -3
  65. package/dist/developerPortal/index.d.ts +3 -3
  66. package/dist/developerPortal/index.js +1 -1
  67. package/dist/developerPortal/types.d.cts +2 -2
  68. package/dist/developerPortal/types.d.ts +2 -2
  69. package/dist/{developerPortalClient-CzCJ5sE3.js → developerPortalClient-3Q7049-4.js} +19 -1
  70. package/dist/developerPortalClient-3Q7049-4.js.map +1 -0
  71. package/dist/{developerPortalClient-BcK9F-Fs.cjs → developerPortalClient-Cj9bStCS.cjs} +19 -1
  72. package/dist/developerPortalClient-Cj9bStCS.cjs.map +1 -0
  73. package/dist/domain/permissions/index.d.cts +1 -1
  74. package/dist/domain/permissions/index.d.ts +1 -1
  75. package/dist/editor/index.d.cts +2 -2
  76. package/dist/editor/index.d.ts +2 -2
  77. package/dist/editor/types.d.cts +1 -1
  78. package/dist/editor/types.d.ts +1 -1
  79. package/dist/{emitter-raKkIqRp.d.ts → emitter-yaYzJOdh.d.cts} +1 -2
  80. package/dist/{emitter-raKkIqRp.d.cts → emitter-yaYzJOdh.d.ts} +1 -2
  81. package/dist/encryption/index.d.cts +1 -1
  82. package/dist/encryption/index.d.ts +1 -1
  83. package/dist/encryption/types.d.cts +1 -1
  84. package/dist/encryption/types.d.ts +1 -1
  85. package/dist/import/index.d.cts +3 -3
  86. package/dist/import/index.d.ts +3 -3
  87. package/dist/{index-DcKc3_Y1.d.cts → index-9p4O-clX.d.cts} +2033 -72
  88. package/dist/{index-DcKc3_Y1.d.ts → index-9p4O-clX.d.ts} +2033 -72
  89. package/dist/{index-CLqZfRpv.d.cts → index-B-HCh7LL.d.cts} +3 -3
  90. package/dist/{index-CxoJuIzB.d.cts → index-B0e42GnK.d.cts} +4 -3
  91. package/dist/{index-Bgu3hnMO.d.ts → index-BbXGsspe.d.ts} +4 -4
  92. package/dist/{index-B7Ogo2SK.d.ts → index-Bg9BWpIY.d.ts} +4 -3
  93. package/dist/{index-DPhGNQC5.d.cts → index-BgEu7wGk.d.cts} +2559 -7319
  94. package/dist/{index-C_A0JS9s.d.ts → index-Btft3BFn.d.ts} +29 -3
  95. package/dist/{index-DXNRd61K.d.cts → index-ByaAn_lm.d.cts} +4 -4
  96. package/dist/{index-A8udJCGv.d.ts → index-C92Ct6K5.d.ts} +178 -4
  97. package/dist/{index-B30dBBBH.d.ts → index-CBq59Aif.d.ts} +3 -3
  98. package/dist/{index-DAb1g6je.d.cts → index-CGUPsu_R.d.cts} +29 -3
  99. package/dist/{index-CLxvW_pn.d.ts → index-CIA6-x2Q.d.ts} +4 -4
  100. package/dist/{index-B2YNTI4p.d.ts → index-CeWVf3d1.d.ts} +4 -4
  101. package/dist/{index-GlHJ4j3a.d.ts → index-Cj0l_DL_.d.ts} +2559 -7319
  102. package/dist/{index-BUZ-vTRt.d.ts → index-Ck0UPKMM.d.ts} +2 -2
  103. package/dist/{index-B-HhOTVk.d.cts → index-D0ACg_Pp.d.cts} +7 -4
  104. package/dist/{index-Dx02AUpZ.d.cts → index-D8nMnVp1.d.cts} +4 -4
  105. package/dist/{index-24GpnYhn.d.cts → index-DENUPo51.d.cts} +2 -2
  106. package/dist/{index-RHYdFrfn.d.cts → index-DGjxLWZ-.d.cts} +3 -3
  107. package/dist/{index-BH1jo-bb.d.ts → index-Dse6Psvc.d.ts} +7 -4
  108. package/dist/{index-BaJ-GMa7.d.ts → index-DxcaEIhU.d.ts} +3 -3
  109. package/dist/{index-CpidrJQc.d.cts → index-OCEoQ1Y-.d.cts} +4 -4
  110. package/dist/{index-DxbqDi_0.d.cts → index-jR69kGUZ.d.cts} +178 -4
  111. package/dist/index.cjs +615 -867
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.d.cts +9 -9
  114. package/dist/index.d.ts +9 -9
  115. package/dist/index.js +611 -860
  116. package/dist/index.js.map +1 -1
  117. package/dist/kaiAgent/index.cjs +1 -1
  118. package/dist/kaiAgent/index.d.cts +2 -2
  119. package/dist/kaiAgent/index.d.ts +2 -2
  120. package/dist/kaiAgent/index.js +1 -1
  121. package/dist/kaiAgent/types.d.cts +2 -2
  122. package/dist/kaiAgent/types.d.ts +2 -2
  123. package/dist/{kaiAgent-De2T6G4G.cjs → kaiAgent-Q00g6S1v.cjs} +16 -1
  124. package/dist/kaiAgent-Q00g6S1v.cjs.map +1 -0
  125. package/dist/{kaiAgent-D0MoKqXe.js → kaiAgent-aqylPZHY.js} +16 -1
  126. package/dist/kaiAgent-aqylPZHY.js.map +1 -0
  127. package/dist/management/index.cjs +1 -1
  128. package/dist/management/index.d.cts +1 -1
  129. package/dist/management/index.d.ts +1 -1
  130. package/dist/management/index.js +1 -1
  131. package/dist/management/types.d.cts +1 -1
  132. package/dist/management/types.d.ts +1 -1
  133. package/dist/{management-BlMQnPNS.js → management-CIK5-Aq5.js} +14 -7
  134. package/dist/management-CIK5-Aq5.js.map +1 -0
  135. package/dist/{management-dIMrTTpI.cjs → management-Dqrc516s.cjs} +14 -7
  136. package/dist/management-Dqrc516s.cjs.map +1 -0
  137. package/dist/{metaObject-qWyZAD-5.d.ts → metaObject-AQ7wKDOu.d.ts} +2 -2
  138. package/dist/{metaObject-BsBMgWRt.d.cts → metaObject-I35_krxf.d.cts} +2 -2
  139. package/dist/metastore/index.d.cts +1 -1
  140. package/dist/metastore/index.d.ts +1 -1
  141. package/dist/metastore/types.d.cts +1 -1
  142. package/dist/metastore/types.d.ts +1 -1
  143. package/dist/microsoftGraph/index.d.cts +3 -3
  144. package/dist/microsoftGraph/index.d.ts +3 -3
  145. package/dist/microsoftGraph/types.d.cts +2 -2
  146. package/dist/microsoftGraph/types.d.ts +2 -2
  147. package/dist/{middleware-DxGv7DG8.js → middleware-DWmhthX0.js} +2 -2
  148. package/dist/middleware-DWmhthX0.js.map +1 -0
  149. package/dist/{middleware-vIaPDtQI.cjs → middleware-DYdDD4O6.cjs} +2 -2
  150. package/dist/middleware-DYdDD4O6.cjs.map +1 -0
  151. package/dist/notifications/index.d.cts +2 -2
  152. package/dist/notifications/index.d.ts +2 -2
  153. package/dist/notifications/types.d.cts +1 -1
  154. package/dist/notifications/types.d.ts +1 -1
  155. package/dist/oauth/index.d.cts +2 -2
  156. package/dist/oauth/index.d.ts +2 -2
  157. package/dist/oauth/types.d.cts +1 -1
  158. package/dist/oauth/types.d.ts +1 -1
  159. package/dist/omnisearch/index.d.cts +2 -2
  160. package/dist/omnisearch/index.d.ts +2 -2
  161. package/dist/omnisearch/types.d.cts +1 -1
  162. package/dist/omnisearch/types.d.ts +1 -1
  163. package/dist/{project-CmV1OhK4.d.ts → project-DwRvx_zN.d.ts} +3 -3
  164. package/dist/{project-F6eHCACz.d.cts → project-ERH0FTGW.d.cts} +3 -3
  165. package/dist/queryService/index.cjs +1 -1
  166. package/dist/queryService/index.d.cts +1 -1
  167. package/dist/queryService/index.d.ts +1 -1
  168. package/dist/queryService/index.js +1 -1
  169. package/dist/queryService/types.d.cts +1 -1
  170. package/dist/queryService/types.d.ts +1 -1
  171. package/dist/{queryService-C3BQ6GKW.cjs → queryService-CECWubS0.cjs} +2 -2
  172. package/dist/{queryService-C3BQ6GKW.cjs.map → queryService-CECWubS0.cjs.map} +1 -1
  173. package/dist/{queryService-DQHtHy2-.js → queryService-CIxb_mcP.js} +2 -2
  174. package/dist/{queryService-DQHtHy2-.js.map → queryService-CIxb_mcP.js.map} +1 -1
  175. package/dist/queue/index.cjs +1 -1
  176. package/dist/queue/index.d.cts +11 -4
  177. package/dist/queue/index.d.ts +11 -4
  178. package/dist/queue/index.js +1 -1
  179. package/dist/queue/types.d.cts +1 -1
  180. package/dist/queue/types.d.ts +1 -1
  181. package/dist/{queue-6cywDnA-.js → queue-BBihD5qQ.js} +2 -2
  182. package/dist/{queue-6cywDnA-.js.map → queue-BBihD5qQ.js.map} +1 -1
  183. package/dist/{queue-J2uXzXR9.cjs → queue-PmTfoniJ.cjs} +2 -2
  184. package/dist/{queue-J2uXzXR9.cjs.map → queue-PmTfoniJ.cjs.map} +1 -1
  185. package/dist/scheduler/index.d.cts +2 -2
  186. package/dist/scheduler/index.d.ts +2 -2
  187. package/dist/scheduler/types.d.cts +1 -1
  188. package/dist/scheduler/types.d.ts +1 -1
  189. package/dist/{schema-DLmBEgPM.d.cts → schema-CqzWi5cO.d.cts} +14 -4
  190. package/dist/{schema-DLmBEgPM.d.ts → schema-CqzWi5cO.d.ts} +14 -4
  191. package/dist/sdk/configurations/index.d.cts +2 -3
  192. package/dist/sdk/configurations/index.d.ts +2 -3
  193. package/dist/sdk/dataAppServer/index.cjs +3 -3
  194. package/dist/sdk/dataAppServer/index.d.cts +1 -1
  195. package/dist/sdk/dataAppServer/index.d.ts +1 -1
  196. package/dist/sdk/dataAppServer/index.js +3 -3
  197. package/dist/sdk/developerPortal/index.cjs +3 -3
  198. package/dist/sdk/developerPortal/index.cjs.map +1 -1
  199. package/dist/sdk/developerPortal/index.d.cts +178 -4
  200. package/dist/sdk/developerPortal/index.d.ts +178 -4
  201. package/dist/sdk/developerPortal/index.js +3 -3
  202. package/dist/sdk/developerPortal/index.js.map +1 -1
  203. package/dist/sdk/kaiMemory/index.d.cts +1 -1
  204. package/dist/sdk/kaiMemory/index.d.ts +1 -1
  205. package/dist/sdk/kaiMemory/types.d.cts +1 -1
  206. package/dist/sdk/kaiMemory/types.d.ts +1 -1
  207. package/dist/sdk/queryService/index.d.cts +1 -1
  208. package/dist/sdk/queryService/index.d.ts +1 -1
  209. package/dist/sdk/securityPolicy/index.d.cts +2 -2
  210. package/dist/sdk/securityPolicy/index.d.ts +2 -2
  211. package/dist/sdk/securityPolicy/types.d.cts +1 -1
  212. package/dist/sdk/securityPolicy/types.d.ts +1 -1
  213. package/dist/sdk/semanticLayer/index.d.cts +1 -1
  214. package/dist/sdk/semanticLayer/index.d.ts +1 -1
  215. package/dist/sdk/semanticLayer/types.d.cts +1 -1
  216. package/dist/sdk/semanticLayer/types.d.ts +1 -1
  217. package/dist/sdk/tag/index.d.cts +3 -3
  218. package/dist/sdk/tag/index.d.ts +3 -3
  219. package/dist/sdk/tag/types.d.cts +1 -1
  220. package/dist/sdk/tag/types.d.ts +1 -1
  221. package/dist/sdk/vault/index.d.cts +1 -1
  222. package/dist/sdk/vault/index.d.ts +1 -1
  223. package/dist/status/index.d.cts +1 -1
  224. package/dist/status/index.d.ts +1 -1
  225. package/dist/storage/index.cjs +5 -5
  226. package/dist/storage/index.d.cts +2 -3
  227. package/dist/storage/index.d.ts +2 -3
  228. package/dist/storage/index.js +3 -3
  229. package/dist/storage/types.d.cts +5 -5
  230. package/dist/storage/types.d.ts +5 -5
  231. package/dist/{storage-jLhVrKZh.cjs → storage-chxoWtAL.cjs} +44 -56
  232. package/dist/storage-chxoWtAL.cjs.map +1 -0
  233. package/dist/{storage-Bw-HSnPp.js → storage-o9teEKl_.js} +42 -54
  234. package/dist/storage-o9teEKl_.js.map +1 -0
  235. package/dist/{store-2OyH1XOP.cjs → store-7xlVu4qF.cjs} +3 -14
  236. package/dist/store-7xlVu4qF.cjs.map +1 -0
  237. package/dist/{store-HP0zRcLz.js → store-DDUzPeCm.js} +3 -14
  238. package/dist/store-DDUzPeCm.js.map +1 -0
  239. package/dist/stream/index.d.cts +2 -2
  240. package/dist/stream/index.d.ts +2 -2
  241. package/dist/stream/types.d.cts +1 -1
  242. package/dist/stream/types.d.ts +1 -1
  243. package/dist/syncActions/index.d.cts +2 -2
  244. package/dist/syncActions/index.d.ts +2 -2
  245. package/dist/syncActions/types.d.cts +1 -1
  246. package/dist/syncActions/types.d.ts +1 -1
  247. package/dist/telemetry/index.d.cts +2 -2
  248. package/dist/telemetry/index.d.ts +2 -2
  249. package/dist/telemetry/types.d.cts +1 -1
  250. package/dist/telemetry/types.d.ts +1 -1
  251. package/dist/{transientRetries-BORv47mH.js → transientRetries-dssygpwU.js} +2 -2
  252. package/dist/{transientRetries-BORv47mH.js.map → transientRetries-dssygpwU.js.map} +1 -1
  253. package/dist/{transientRetries-CBorl4Ue.cjs → transientRetries-yVaQgKqP.cjs} +2 -2
  254. package/dist/{transientRetries-CBorl4Ue.cjs.map → transientRetries-yVaQgKqP.cjs.map} +1 -1
  255. package/dist/{types-LOf_GCej.d.cts → types-B1kernzE.d.cts} +2 -2
  256. package/dist/{types-Cvbcjdgf.d.ts → types-BBmS7-IS.d.ts} +151 -4
  257. package/dist/{types-DaRxZt3v.d.ts → types-BJyWTgXX.d.ts} +2 -2
  258. package/dist/{types-CnKiVVb8.d.ts → types-BPNFTA63.d.cts} +21 -7
  259. package/dist/{types-BJRRAQ9R.d.cts → types-BPSExpye.d.cts} +244 -4
  260. package/dist/{types-Cg_66Toy.d.ts → types-BiXonOK6.d.ts} +2 -2
  261. package/dist/{types-CNDemlfn.d.cts → types-BimRBONo.d.cts} +3 -3
  262. package/dist/{types-CrXoqs8E.d.cts → types-BuEC58u3.d.cts} +2 -2
  263. package/dist/{types-BnkHyxdp.d.ts → types-BzHyi99r.d.cts} +5 -3
  264. package/dist/{types-2CMPwArl.d.ts → types-C4T_2JdN.d.cts} +40 -27
  265. package/dist/{types-lZRyNwOH.d.ts → types-C53aKnWt.d.ts} +2 -2
  266. package/dist/{types-6oLbURTK.d.cts → types-CEjgqmr2.d.cts} +2 -2
  267. package/dist/{types-BEEGI4aq.d.ts → types-CGtpwTJk.d.ts} +2 -2
  268. package/dist/{types-B_yv00AL.d.ts → types-CH1uguug.d.cts} +2 -163
  269. package/dist/{types-DMEl2iet.d.ts → types-CP8-CssY.d.ts} +2 -2
  270. package/dist/{types-DgAMVyiT.d.ts → types-CPQ6RkiZ.d.ts} +244 -4
  271. package/dist/{types-EdL0Eb0B.d.ts → types-CPwofeyq.d.ts} +3 -3
  272. package/dist/{types-CFuT8zr3.d.cts → types-CQAEOq-K.d.cts} +2 -2
  273. package/dist/{types-DslO1S5E.d.cts → types-CVWoP_PC.d.cts} +3 -3
  274. package/dist/{types-BqJycQNM.d.cts → types-CbM2MApW.d.cts} +2 -2
  275. package/dist/{types-BDGkMVWf.d.cts → types-CbOfT6lb.d.ts} +21 -7
  276. package/dist/{types-B6OG1lLf.d.cts → types-CcPpqVhm.d.cts} +2 -2
  277. package/dist/{types-D2J3SaoY.d.ts → types-CeqpzbBH.d.ts} +2 -2
  278. package/dist/{types-C_JO7FI9.d.cts → types-CjJYZaMO.d.cts} +2 -2
  279. package/dist/{types-D0Gqu-Xz.d.cts → types-CjP8RcFN.d.cts} +2 -2
  280. package/dist/{types-CUovU--e.d.ts → types-CjfsPtwk.d.ts} +2 -2
  281. package/dist/{types-DPFG6AAA.d.ts → types-CnSBLcZB.d.ts} +163 -3
  282. package/dist/{types-D4knWlwr.d.ts → types-CsXLdnfV.d.ts} +2 -2
  283. package/dist/{types-C3Kf_ggm.d.cts → types-CzAh5-0z.d.cts} +2 -2
  284. package/dist/{types-D6Fbf_y3.d.ts → types-D0F_c5KI.d.ts} +4 -4
  285. package/dist/{types-DykEfF2N.d.cts → types-D3L3CqKl.d.cts} +151 -4
  286. package/dist/{types--mz2z0Zm.d.cts → types-D4oIei5M.d.cts} +163 -3
  287. package/dist/{types-Cm1iOHE5.d.cts → types-D6ilG8sC.d.cts} +3 -3
  288. package/dist/{types-DtS7qAdz.d.cts → types-DEGkXcw2.d.ts} +5 -3
  289. package/dist/{types-DQguGTlM.d.cts → types-DEhAcO1Z.d.cts} +2 -2
  290. package/dist/{types-CuYaiy4R.d.cts → types-DaIfg9Mb.d.cts} +4 -4
  291. package/dist/{types-ByKSM08P.d.ts → types-DhofEmWy.d.ts} +2 -2
  292. package/dist/{types-B5FgsIiY.d.ts → types-Dp61pYgP.d.ts} +3 -3
  293. package/dist/{types-BhGr9OQ4.d.ts → types-Dteot3tT.d.ts} +757 -112
  294. package/dist/{types-3ZE32k8V.d.cts → types-K-JISUUI.d.cts} +757 -112
  295. package/dist/{types-CjqFLXVx.d.cts → types-TywAc1ow.d.ts} +40 -27
  296. package/dist/{types-DiXeO0yB.d.ts → types-UBpth6_9.d.ts} +2 -2
  297. package/dist/{types-D0BOES7q.d.cts → types-Vw-tduOH.d.ts} +2 -163
  298. package/dist/{types-CF5ZROX5.d.cts → types-ZyLTqgpa.d.cts} +2 -2
  299. package/dist/{types-BmcZyKgM.d.cts → types-aylD1zQz.d.cts} +3 -3
  300. package/dist/{types-CbPO9cGq.d.cts → types-fYY4q7dC.d.cts} +2 -2
  301. package/dist/{types-Foy0RnqF.d.ts → types-jYn3e3Du.d.ts} +3 -3
  302. package/dist/{types-p6UYqJo_.d.ts → types-qXqJRPHj.d.ts} +2 -2
  303. package/dist/{types-B452bFfS.d.ts → types-r-Qa3y8e.d.ts} +2 -2
  304. package/dist/{types-DhE7iY90.d.ts → types-z82j5aNW.d.ts} +3 -3
  305. package/dist/{collectByCursor-2-8SuJ-8.js → validateConnectionStatus-DgJwuEy9.js} +32 -22
  306. package/dist/validateConnectionStatus-DgJwuEy9.js.map +1 -0
  307. package/dist/{collectByCursor-D58__WD1.cjs → validateConnectionStatus-DpYRsU-e.cjs} +37 -21
  308. package/dist/validateConnectionStatus-DpYRsU-e.cjs.map +1 -0
  309. package/dist/vault/index.d.cts +1 -1
  310. package/dist/vault/index.d.ts +1 -1
  311. package/dist/vault/types.d.cts +1 -1
  312. package/dist/vault/types.d.ts +1 -1
  313. package/package.json +2 -2
  314. package/surface/apps.md +8 -3
  315. package/surface/auth.md +3 -2
  316. package/surface/chat.md +3 -3
  317. package/surface/dataScience.md +2 -2
  318. package/surface/kaiAgent.md +4 -3
  319. package/surface/management.md +4 -4
  320. package/surface/queue.md +7 -7
  321. package/surface/storage.md +27 -26
  322. package/dist/ManagementSessionMintError-BMHDcEqV.js.map +0 -1
  323. package/dist/ManagementSessionMintError-Bc9bc7Ai.cjs.map +0 -1
  324. package/dist/apps-BN7fWtSm.js.map +0 -1
  325. package/dist/apps-C1x5IKNQ.cjs.map +0 -1
  326. package/dist/authClient-B_Mb4Vzs.js.map +0 -1
  327. package/dist/authClient-C9QqhT2M.cjs.map +0 -1
  328. package/dist/collectByCursor-2-8SuJ-8.js.map +0 -1
  329. package/dist/collectByCursor-D58__WD1.cjs.map +0 -1
  330. package/dist/constants-HccvU5kx.js.map +0 -1
  331. package/dist/constants-V9hAyPTo.cjs.map +0 -1
  332. package/dist/developerPortalClient-BcK9F-Fs.cjs.map +0 -1
  333. package/dist/developerPortalClient-CzCJ5sE3.js.map +0 -1
  334. package/dist/index-C6FI_Lc7.d.ts +0 -10
  335. package/dist/index-CmtqbTse.d.cts +0 -10
  336. package/dist/kaiAgent-D0MoKqXe.js.map +0 -1
  337. package/dist/kaiAgent-De2T6G4G.cjs.map +0 -1
  338. package/dist/management-BlMQnPNS.js.map +0 -1
  339. package/dist/management-dIMrTTpI.cjs.map +0 -1
  340. package/dist/middleware-DxGv7DG8.js.map +0 -1
  341. package/dist/middleware-vIaPDtQI.cjs.map +0 -1
  342. package/dist/storage-Bw-HSnPp.js.map +0 -1
  343. package/dist/storage-jLhVrKZh.cjs.map +0 -1
  344. package/dist/store-2OyH1XOP.cjs.map +0 -1
  345. package/dist/store-HP0zRcLz.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-CF5ZROX5.cjs";
1
+ import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-ZyLTqgpa.cjs";
2
2
  export type { CreateMetaObjectBody, CreateMetaObjectInput, CreateMetaObjectPath, CreateMetaObjectReturn, DeleteMetaObjectPath, DeleteMetaObjectRevisionPath, GetMetaObjectPath, GetMetaObjectRevisionPath, GetMetaObjectRevisionsInput, GetMetaObjectRevisionsPath, GetMetaObjectRevisionsQuery, GetMetaObjectRevisionsSchemaQuery, GetMetaObjectsInput, GetMetaObjectsPath, GetMetaObjectsQuery, GetMetaObjectsSchemaQuery, GetOrganizationMetaObjectsPath, GetOrganizationMetaObjectsQuery, GetOrganizationMetaObjectsSchemaQuery, GetSchemaPath, GetVersionedSchemaPath, MetaObject, MetaObjectMeta, MetaObjectScope, MetaStoreListResponse, MetaStoreObjectResponse, RawMetaObject, ReplaceMetaObjectBody, ReplaceMetaObjectInput, ReplaceMetaObjectPath, ReplaceTargetProjectsBody, ReplaceTargetProjectsInput, ReplaceTargetProjectsPath, ScopeElevationRequestPath, UpdateMetaObjectBody, UpdateMetaObjectInput, UpdateMetaObjectPath };
@@ -1,2 +1,2 @@
1
- import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-D4knWlwr.js";
1
+ import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-CsXLdnfV.js";
2
2
  export type { CreateMetaObjectBody, CreateMetaObjectInput, CreateMetaObjectPath, CreateMetaObjectReturn, DeleteMetaObjectPath, DeleteMetaObjectRevisionPath, GetMetaObjectPath, GetMetaObjectRevisionPath, GetMetaObjectRevisionsInput, GetMetaObjectRevisionsPath, GetMetaObjectRevisionsQuery, GetMetaObjectRevisionsSchemaQuery, GetMetaObjectsInput, GetMetaObjectsPath, GetMetaObjectsQuery, GetMetaObjectsSchemaQuery, GetOrganizationMetaObjectsPath, GetOrganizationMetaObjectsQuery, GetOrganizationMetaObjectsSchemaQuery, GetSchemaPath, GetVersionedSchemaPath, MetaObject, MetaObjectMeta, MetaObjectScope, MetaStoreListResponse, MetaStoreObjectResponse, RawMetaObject, ReplaceMetaObjectBody, ReplaceMetaObjectInput, ReplaceMetaObjectPath, ReplaceTargetProjectsBody, ReplaceTargetProjectsInput, ReplaceTargetProjectsPath, ScopeElevationRequestPath, UpdateMetaObjectBody, UpdateMetaObjectInput, UpdateMetaObjectPath };
@@ -1,6 +1,6 @@
1
- import { fi as MiddlewareFn } from "../index-DcKc3_Y1.cjs";
2
- import { n as ClientInitOptions } from "../types-BqJycQNM.cjs";
3
- import { t as components } from "../schema-DLmBEgPM.cjs";
1
+ import { fi as MiddlewareFn } from "../index-9p4O-clX.cjs";
2
+ import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
3
+ import { t as components } from "../schema-CqzWi5cO.cjs";
4
4
  /**
5
5
  * Auth arrives as a middleware, never as a token: a client here holds no credential. Pair it with
6
6
  * `createMicrosoftGraphAuthMiddleware`, which the consumer builds from the token its OAuth flow
@@ -1,6 +1,6 @@
1
- import { fi as MiddlewareFn } from "../index-DcKc3_Y1.js";
2
- import { n as ClientInitOptions } from "../types-DMEl2iet.js";
3
- import { t as components } from "../schema-DLmBEgPM.js";
1
+ import { fi as MiddlewareFn } from "../index-9p4O-clX.js";
2
+ import { n as ClientInitOptions } from "../types-CP8-CssY.js";
3
+ import { t as components } from "../schema-CqzWi5cO.js";
4
4
  /**
5
5
  * Auth arrives as a middleware, never as a token: a client here holds no credential. Pair it with
6
6
  * `createMicrosoftGraphAuthMiddleware`, which the consumer builds from the token its OAuth flow
@@ -1,5 +1,5 @@
1
- import { l as OpenapiReturnType } from "../index-DcKc3_Y1.cjs";
2
- import { n as paths } from "../schema-DLmBEgPM.cjs";
1
+ import { l as OpenapiReturnType } from "../index-9p4O-clX.cjs";
2
+ import { n as paths } from "../schema-CqzWi5cO.cjs";
3
3
  type User = OpenapiReturnType<paths['/me']['get']>;
4
4
  type Drive = OpenapiReturnType<paths['/me/drive']['get']>;
5
5
  type DriveItem = OpenapiReturnType<paths['/drives/{drive-id}/items/{driveItem-id}']['get']>;
@@ -1,5 +1,5 @@
1
- import { l as OpenapiReturnType } from "../index-DcKc3_Y1.js";
2
- import { n as paths } from "../schema-DLmBEgPM.js";
1
+ import { l as OpenapiReturnType } from "../index-9p4O-clX.js";
2
+ import { n as paths } from "../schema-CqzWi5cO.js";
3
3
  type User = OpenapiReturnType<paths['/me']['get']>;
4
4
  type Drive = OpenapiReturnType<paths['/me/drive']['get']>;
5
5
  type DriveItem = OpenapiReturnType<paths['/drives/{drive-id}/items/{driveItem-id}']['get']>;
@@ -1,5 +1,5 @@
1
1
  import { _ as HttpStatus, p as ApiError, s as HttpHeader } from "./createFetchClient-Dc_ZMuq7.js";
2
- // src/keboola/bearer/credentials/middleware.ts
2
+ // src/keboola/credentials/middleware.ts
3
3
  const isUnauthorized = (error) => error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;
4
4
  /**
5
5
  * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.
@@ -29,4 +29,4 @@ const createBearerAuthMiddleware = (source) => {
29
29
  };
30
30
  export { isUnauthorized as n, createBearerAuthMiddleware as t };
31
31
 
32
- //# sourceMappingURL=middleware-DxGv7DG8.js.map
32
+ //# sourceMappingURL=middleware-DWmhthX0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware-DWmhthX0.js","names":[],"sources":["../src/keboola/credentials/middleware.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { HttpStatus } from '../../internal';\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type AccessTokenSource = {\n /** `null` while anonymous — nothing to stamp. */\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n};\n\n/**\n * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.\n *\n * - A replay that still 401s passes on, not as expiry: an unreachable project gets the same 401.\n * - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.\n */\nexport const createBearerAuthMiddleware = (source: AccessTokenSource): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await source.getAccessToken({ forceRefresh: false });\n if (token === null) return next(request);\n\n // Cloned for the replay: the first attempt may consume the body.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${token}`);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await source.getAccessToken({ forceRefresh: true });\n // Went anonymous mid-flight — surface the original 401.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);\n\n return await next({ ...request, request: retryRequest });\n }\n };\n};\n"],"mappings":";;AAIA,MAAa,kBAAkB,UAC7B,iBAAiB,YAAY,MAAM,SAAS,WAAW,WAAW;;;;;;;AAapE,MAAa,8BAA8B,WAA4C;CACrF,QAAQ,SAAS,OAAO,YAAY;EAClC,MAAM,QAAQ,MAAM,OAAO,eAAe,EAAE,cAAc,MAAM,CAAC;EACjE,IAAI,UAAU,MAAM,OAAO,KAAK,OAAO;EAGvC,MAAM,eAAe,QAAQ,QAAQ,MAAM;EAC3C,QAAQ,QAAQ,QAAQ,IAAI,WAAW,eAAe,UAAU,OAAO;EAEvE,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,CAAC,eAAe,KAAK,GAAG,MAAM;GAElC,MAAM,YAAY,MAAM,OAAO,eAAe,EAAE,cAAc,KAAK,CAAC;GAEpE,IAAI,cAAc,MAAM,MAAM;GAC9B,aAAa,QAAQ,IAAI,WAAW,eAAe,UAAU,WAAW;GAExE,OAAO,MAAM,KAAK;IAAE,GAAG;IAAS,SAAS;GAAa,CAAC;EACzD;CACF;AACF"}
@@ -1,5 +1,5 @@
1
1
  const require_createFetchClient = require("./createFetchClient-CDKSkd7i.cjs");
2
- // src/keboola/bearer/credentials/middleware.ts
2
+ // src/keboola/credentials/middleware.ts
3
3
  const isUnauthorized = (error) => error instanceof require_createFetchClient.ApiError && error.response.status === require_createFetchClient.HttpStatus.UNAUTHORIZED;
4
4
  /**
5
5
  * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.
@@ -40,4 +40,4 @@ Object.defineProperty(exports, "isUnauthorized", {
40
40
  }
41
41
  });
42
42
 
43
- //# sourceMappingURL=middleware-vIaPDtQI.cjs.map
43
+ //# sourceMappingURL=middleware-DYdDD4O6.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware-DYdDD4O6.cjs","names":["ApiError","HttpStatus","HttpHeader"],"sources":["../src/keboola/credentials/middleware.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { HttpStatus } from '../../internal';\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type AccessTokenSource = {\n /** `null` while anonymous — nothing to stamp. */\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n};\n\n/**\n * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.\n *\n * - A replay that still 401s passes on, not as expiry: an unreachable project gets the same 401.\n * - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.\n */\nexport const createBearerAuthMiddleware = (source: AccessTokenSource): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await source.getAccessToken({ forceRefresh: false });\n if (token === null) return next(request);\n\n // Cloned for the replay: the first attempt may consume the body.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${token}`);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await source.getAccessToken({ forceRefresh: true });\n // Went anonymous mid-flight — surface the original 401.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);\n\n return await next({ ...request, request: retryRequest });\n }\n };\n};\n"],"mappings":";;AAIA,MAAa,kBAAkB,UAC7B,iBAAiBA,0BAAAA,YAAY,MAAM,SAAS,WAAWC,0BAAAA,WAAW;;;;;;;AAapE,MAAa,8BAA8B,WAA4C;CACrF,QAAQ,SAAS,OAAO,YAAY;EAClC,MAAM,QAAQ,MAAM,OAAO,eAAe,EAAE,cAAc,MAAM,CAAC;EACjE,IAAI,UAAU,MAAM,OAAO,KAAK,OAAO;EAGvC,MAAM,eAAe,QAAQ,QAAQ,MAAM;EAC3C,QAAQ,QAAQ,QAAQ,IAAIC,0BAAAA,WAAW,eAAe,UAAU,OAAO;EAEvE,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,CAAC,eAAe,KAAK,GAAG,MAAM;GAElC,MAAM,YAAY,MAAM,OAAO,eAAe,EAAE,cAAc,KAAK,CAAC;GAEpE,IAAI,cAAc,MAAM,MAAM;GAC9B,aAAa,QAAQ,IAAIA,0BAAAA,WAAW,eAAe,UAAU,WAAW;GAExE,OAAO,MAAM,KAAK;IAAE,GAAG;IAAS,SAAS;GAAa,CAAC;EACzD;CACF;AACF"}
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BqJycQNM.cjs";
2
- import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-DQguGTlM.cjs";
1
+ import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
2
+ import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-DEhAcO1Z.cjs";
3
3
  declare const createNotificationsClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
4
4
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
5
5
  getSubscriptions: (query?: ListSubscriptionsQuery, signal?: AbortSignal) => Promise<({
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-DMEl2iet.js";
2
- import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-Cg_66Toy.js";
1
+ import { n as ClientInitOptions } from "../types-CP8-CssY.js";
2
+ import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-BiXonOK6.js";
3
3
  declare const createNotificationsClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
4
4
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
5
5
  getSubscriptions: (query?: ListSubscriptionsQuery, signal?: AbortSignal) => Promise<({
@@ -1,2 +1,2 @@
1
- import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-DQguGTlM.cjs";
1
+ import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-DEhAcO1Z.cjs";
2
2
  export { CreateSubscriptionBody, ListSubscriptionsQuery, ProjectSubscription, SubscriptionFilter, SubscriptionId, SubscriptionRecipient };
@@ -1,2 +1,2 @@
1
- import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-Cg_66Toy.js";
1
+ import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-BiXonOK6.js";
2
2
  export { CreateSubscriptionBody, ListSubscriptionsQuery, ProjectSubscription, SubscriptionFilter, SubscriptionId, SubscriptionRecipient };
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BqJycQNM.cjs";
2
- import { a as CredentialInput, c as GetOrganizationConnectFormInput, h as GetCredentialsInput, l as GetOrganizationCredentialsInput, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, u as GetOrganizationGitHubAppsInput } from "../types-B6OG1lLf.cjs";
1
+ import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
2
+ import { a as CredentialInput, c as GetOrganizationConnectFormInput, h as GetCredentialsInput, l as GetOrganizationCredentialsInput, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, u as GetOrganizationGitHubAppsInput } from "../types-CcPpqVhm.cjs";
3
3
  declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
4
4
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
5
5
  getCredentials: (scope: GetCredentialsInput, signal?: AbortSignal) => Promise<{
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-DMEl2iet.js";
2
- import { a as CredentialInput, c as GetOrganizationConnectFormInput, h as GetCredentialsInput, l as GetOrganizationCredentialsInput, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, u as GetOrganizationGitHubAppsInput } from "../types-ByKSM08P.js";
1
+ import { n as ClientInitOptions } from "../types-CP8-CssY.js";
2
+ import { a as CredentialInput, c as GetOrganizationConnectFormInput, h as GetCredentialsInput, l as GetOrganizationCredentialsInput, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, u as GetOrganizationGitHubAppsInput } from "../types-DhofEmWy.js";
3
3
  declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
4
4
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
5
5
  getCredentials: (scope: GetCredentialsInput, signal?: AbortSignal) => Promise<{
@@ -1,2 +1,2 @@
1
- import { a as CredentialInput, c as GetOrganizationConnectFormInput, d as OrganizationConnectErrorCode, f as OrganizationConnection, h as GetCredentialsInput, i as Credential, l as GetOrganizationCredentialsInput, m as OrganizationGitHubApp, n as CreateCredentialBody, o as CredentialPath, p as OrganizationCredentials, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, t as ComponentPath, u as GetOrganizationGitHubAppsInput } from "../types-B6OG1lLf.cjs";
1
+ import { a as CredentialInput, c as GetOrganizationConnectFormInput, d as OrganizationConnectErrorCode, f as OrganizationConnection, h as GetCredentialsInput, i as Credential, l as GetOrganizationCredentialsInput, m as OrganizationGitHubApp, n as CreateCredentialBody, o as CredentialPath, p as OrganizationCredentials, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, t as ComponentPath, u as GetOrganizationGitHubAppsInput } from "../types-CcPpqVhm.cjs";
2
2
  export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, DeleteOrganizationCredentialsInput, type GetCredentialsInput, GetOrganizationConnectFormInput, GetOrganizationCredentialsInput, GetOrganizationGitHubAppsInput, OrganizationConnectErrorCode, OrganizationConnection, OrganizationCredentials, OrganizationGitHubApp };
@@ -1,2 +1,2 @@
1
- import { a as CredentialInput, c as GetOrganizationConnectFormInput, d as OrganizationConnectErrorCode, f as OrganizationConnection, h as GetCredentialsInput, i as Credential, l as GetOrganizationCredentialsInput, m as OrganizationGitHubApp, n as CreateCredentialBody, o as CredentialPath, p as OrganizationCredentials, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, t as ComponentPath, u as GetOrganizationGitHubAppsInput } from "../types-ByKSM08P.js";
1
+ import { a as CredentialInput, c as GetOrganizationConnectFormInput, d as OrganizationConnectErrorCode, f as OrganizationConnection, h as GetCredentialsInput, i as Credential, l as GetOrganizationCredentialsInput, m as OrganizationGitHubApp, n as CreateCredentialBody, o as CredentialPath, p as OrganizationCredentials, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, t as ComponentPath, u as GetOrganizationGitHubAppsInput } from "../types-DhofEmWy.js";
2
2
  export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, DeleteOrganizationCredentialsInput, type GetCredentialsInput, GetOrganizationConnectFormInput, GetOrganizationCredentialsInput, GetOrganizationGitHubAppsInput, OrganizationConnectErrorCode, OrganizationConnection, OrganizationCredentials, OrganizationGitHubApp };
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BqJycQNM.cjs";
2
- import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-BmcZyKgM.cjs";
1
+ import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
2
+ import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-aylD1zQz.cjs";
3
3
  /**
4
4
  * Omnisearch — data lineage.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-DMEl2iet.js";
2
- import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-DhE7iY90.js";
1
+ import { n as ClientInitOptions } from "../types-CP8-CssY.js";
2
+ import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-z82j5aNW.js";
3
3
  /**
4
4
  * Omnisearch — data lineage.
5
5
  *
@@ -1,2 +1,2 @@
1
- import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-BmcZyKgM.cjs";
1
+ import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-aylD1zQz.cjs";
2
2
  export { GetProjectsLineageQuery, GetTablesLineageQuery, LineageBucket, LineageConfiguration, LineageMetadata, LineageProject, LineageSource, LineageTable, ProjectLineageRelation, ProjectsLineage, ProjectsLineageResponse, TableLineageRelation, TablesLineage, TablesLineageResponse };
@@ -1,2 +1,2 @@
1
- import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-DhE7iY90.js";
1
+ import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-z82j5aNW.js";
2
2
  export { GetProjectsLineageQuery, GetTablesLineageQuery, LineageBucket, LineageConfiguration, LineageMetadata, LineageProject, LineageSource, LineageTable, ProjectLineageRelation, ProjectsLineage, ProjectsLineageResponse, TableLineageRelation, TablesLineage, TablesLineageResponse };
@@ -1,5 +1,5 @@
1
- import { Rr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-DcKc3_Y1.js";
2
- import "./adminRoles-CUB0JddB.js";
1
+ import { Rr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-9p4O-clX.js";
2
+ import "./adminRoles-CnfGDvjN.js";
3
3
  import { t as Backend } from "./backends-BHotIdL0.js";
4
4
  type ProjectId = number;
5
5
  type CreateTokenSchemaBody = OpenapiBodyType<paths['/v2/storage/tokens']['post']>;
@@ -68,4 +68,4 @@ declare const createProject: ({ sapiToken }: Options) => {
68
68
  };
69
69
  type Project = ReturnType<typeof createProject>;
70
70
  export { UpdateTokenBody as _, CreateTokenBody as a, UpdateTokenSchemaBody as b, GetTokenEventsInput as c, ShareTokenBody as d, ShareTokenInput as f, TokenListItem as g, StorageTokenRaw as h, hasFeature as i, GetTokenEventsPath as l, StorageToken as m, createProject as n, CreateTokenResponse as o, ShareTokenPath as p, hasAdminFeature as r, CreateTokenSchemaBody as s, Project as t, ProjectId as u, UpdateTokenInput as v, UpdateTokenPath as y };
71
- //# sourceMappingURL=project-CmV1OhK4.d.ts.map
71
+ //# sourceMappingURL=project-DwRvx_zN.d.ts.map
@@ -1,5 +1,5 @@
1
- import { Rr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-DcKc3_Y1.cjs";
2
- import "./adminRoles-BFOPSedO.cjs";
1
+ import { Rr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-9p4O-clX.cjs";
2
+ import "./adminRoles-D6AS9Bzx.cjs";
3
3
  import { t as Backend } from "./backends-BHotIdL0.cjs";
4
4
  type ProjectId = number;
5
5
  type CreateTokenSchemaBody = OpenapiBodyType<paths['/v2/storage/tokens']['post']>;
@@ -68,4 +68,4 @@ declare const createProject: ({ sapiToken }: Options) => {
68
68
  };
69
69
  type Project = ReturnType<typeof createProject>;
70
70
  export { UpdateTokenBody as _, CreateTokenBody as a, UpdateTokenSchemaBody as b, GetTokenEventsInput as c, ShareTokenBody as d, ShareTokenInput as f, TokenListItem as g, StorageTokenRaw as h, hasFeature as i, GetTokenEventsPath as l, StorageToken as m, createProject as n, CreateTokenResponse as o, ShareTokenPath as p, hasAdminFeature as r, CreateTokenSchemaBody as s, Project as t, ProjectId as u, UpdateTokenInput as v, UpdateTokenPath as y };
71
- //# sourceMappingURL=project-F6eHCACz.d.cts.map
71
+ //# sourceMappingURL=project-ERH0FTGW.d.cts.map
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_queryService = require("../queryService-C3BQ6GKW.cjs");
2
+ const require_queryService = require("../queryService-CECWubS0.cjs");
3
3
  exports.createQueryServiceClient = require_queryService.createQueryServiceClient;
@@ -1,2 +1,2 @@
1
- import { C as QueryServiceClientInitOptions, D as QueryServiceCredentialProvider, E as QueryServiceCredential, O as TokenSource, T as AppUserTokenAuth, w as createQueryServiceClient } from "../index-DPhGNQC5.cjs";
1
+ import { C as QueryServiceClientInitOptions, D as QueryServiceCredentialProvider, E as QueryServiceCredential, O as TokenSource, T as AppUserTokenAuth, w as createQueryServiceClient } from "../index-BgEu7wGk.cjs";
2
2
  export { type AppUserTokenAuth, QueryServiceClientInitOptions, type QueryServiceCredential, type QueryServiceCredentialProvider, type TokenSource, createQueryServiceClient };
@@ -1,2 +1,2 @@
1
- import { C as QueryServiceClientInitOptions, D as QueryServiceCredentialProvider, E as QueryServiceCredential, O as TokenSource, T as AppUserTokenAuth, w as createQueryServiceClient } from "../index-GlHJ4j3a.js";
1
+ import { C as QueryServiceClientInitOptions, D as QueryServiceCredentialProvider, E as QueryServiceCredential, O as TokenSource, T as AppUserTokenAuth, w as createQueryServiceClient } from "../index-Cj0l_DL_.js";
2
2
  export { type AppUserTokenAuth, QueryServiceClientInitOptions, type QueryServiceCredential, type QueryServiceCredentialProvider, type TokenSource, createQueryServiceClient };
@@ -1 +1 @@
1
- export { t as createQueryServiceClient } from "../queryService-DQHtHy2-.js";
1
+ export { t as createQueryServiceClient } from "../queryService-CIxb_mcP.js";
@@ -1,2 +1,2 @@
1
- import { $ as ExportResultsResponse, Q as QueryJobPollOptions, at as GetQueryResutsQuery, ct as PostQueryBody, dt as QueryResult, et as GetExportResultsQuery, ft as Statements, it as GetQueryResultsPath, lt as PostQueryPath, nt as GetQueriesPath, ot as JobStatusResponse, rt as GetQueryJobPath, st as PostCancelQueryJobPath, tt as GetQueriesHistoryQuery, ut as QueryJobStatus } from "../index-DPhGNQC5.cjs";
1
+ import { at as GetQueryJobPath, ct as JobStatusResponse, dt as PostQueryPath, et as QueryJobPollOptions, ft as QueryJobStatus, it as GetQueriesPath, lt as PostCancelQueryJobPath, mt as Statements, nt as GetExportResultsQuery, ot as GetQueryResultsPath, pt as QueryResult, rt as GetQueriesHistoryQuery, st as GetQueryResutsQuery, tt as ExportResultsResponse, ut as PostQueryBody } from "../index-BgEu7wGk.cjs";
2
2
  export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, type QueryJobPollOptions, QueryJobStatus, QueryResult, Statements };
@@ -1,2 +1,2 @@
1
- import { $ as ExportResultsResponse, Q as QueryJobPollOptions, at as GetQueryResutsQuery, ct as PostQueryBody, dt as QueryResult, et as GetExportResultsQuery, ft as Statements, it as GetQueryResultsPath, lt as PostQueryPath, nt as GetQueriesPath, ot as JobStatusResponse, rt as GetQueryJobPath, st as PostCancelQueryJobPath, tt as GetQueriesHistoryQuery, ut as QueryJobStatus } from "../index-GlHJ4j3a.js";
1
+ import { at as GetQueryJobPath, ct as JobStatusResponse, dt as PostQueryPath, et as QueryJobPollOptions, ft as QueryJobStatus, it as GetQueriesPath, lt as PostCancelQueryJobPath, mt as Statements, nt as GetExportResultsQuery, ot as GetQueryResultsPath, pt as QueryResult, rt as GetQueriesHistoryQuery, st as GetQueryResutsQuery, tt as ExportResultsResponse, ut as PostQueryBody } from "../index-Cj0l_DL_.js";
2
2
  export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, type QueryJobPollOptions, QueryJobStatus, QueryResult, Statements };
@@ -3,7 +3,7 @@ const require_RowLevelSecurityError = require("./RowLevelSecurityError-RK_NhhAx.
3
3
  const require_ValidationError = require("./ValidationError-BXcFX4nD.cjs");
4
4
  const require_createGenericFetchClient = require("./createGenericFetchClient-BuYzzV_D.cjs");
5
5
  const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-dkssExkU.cjs");
6
- const require_transientRetries = require("./transientRetries-CBorl4Ue.cjs");
6
+ const require_transientRetries = require("./transientRetries-yVaQgKqP.cjs");
7
7
  const require_auth = require("./auth-AehUDNRK.cjs");
8
8
  // src/clients/queryService/auth.ts
9
9
  const PRINTABLE_ASCII_WITHOUT_SPACES = /^[\x21-\x7E]+$/;
@@ -211,4 +211,4 @@ Object.defineProperty(exports, "createQueryServiceClient", {
211
211
  }
212
212
  });
213
213
 
214
- //# sourceMappingURL=queryService-C3BQ6GKW.cjs.map
214
+ //# sourceMappingURL=queryService-CECWubS0.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryService-C3BQ6GKW.cjs","names":["ValidationError","KeboolaHttpHeader","APP_USER_TOKEN_HEADER","createAuthHeaders","HttpHeader","transientRetries","poller","jobStatus","QueryJobError","HttpStatus","RowLevelSecurityError","defaultValidateStatus","createOpenapiFetchClient","createGenericFetchClient","HttpHeader","parseContentDispositionHeader"],"sources":["../src/clients/queryService/auth.ts","../src/clients/queryService/poller.ts","../src/clients/queryService/validateStatus.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { ValidationError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { APP_USER_TOKEN_HEADER, KeboolaHttpHeader } from '../../internal';\nimport { createAuthHeaders } from '../auth';\n\n/** A token value, or a callback that returns the current one (read before every request). */\nexport type TokenSource = string | (() => string | Promise<string>);\n\n/** A data app user's token, sent as `X-Kbc-App-User-Token` together with the app's Storage token. */\nexport type AppUserTokenAuth = {\n type: 'app-user-token';\n token: TokenSource;\n storageToken: TokenSource;\n};\n\n/** One credential; a request carries exactly that credential's headers. */\nexport type QueryServiceCredential =\n | { type: 'sapi-token'; token: TokenSource }\n | { type: 'bearer'; token: TokenSource; projectId: number }\n | AppUserTokenAuth;\n\n/** Resolved before every request, retries included. */\nexport type QueryServiceCredentialProvider = () =>\n | QueryServiceCredential\n | Promise<QueryServiceCredential>;\n\nconst PRINTABLE_ASCII_WITHOUT_SPACES = /^[\\x21-\\x7E]+$/;\n\nconst requireToken = (token: unknown): string => {\n if (typeof token !== 'string' || !PRINTABLE_ASCII_WITHOUT_SPACES.test(token)) {\n throw new ValidationError('token must be non-empty printable ASCII without spaces');\n }\n return token;\n};\n\nconst readToken = async (source: TokenSource) =>\n requireToken(typeof source === 'function' ? await source() : source);\n\nconst hasCallback = (credential: QueryServiceCredential) =>\n typeof credential.token === 'function' ||\n (credential.type === 'app-user-token' && typeof credential.storageToken === 'function');\n\n/**\n * Fixed headers for a credential with only string tokens.\n *\n * - `app-user-token` tokens are checked here, so an empty user token throws at client creation.\n * - `sapi-token` / `bearer` strings go out unchecked: service clients send an empty `bearer` token\n * that their own middleware replaces.\n */\nconst staticHeaders = (credential: QueryServiceCredential): Record<string, string> => {\n const { token } = credential;\n if (typeof token !== 'string') return {};\n if (credential.type === 'app-user-token') {\n return typeof credential.storageToken === 'string'\n ? {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: requireToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: requireToken(token),\n }\n : {};\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst resolvedHeaders = async (\n credential: QueryServiceCredential,\n): Promise<Record<string, string>> => {\n const token = await readToken(credential.token);\n if (credential.type === 'app-user-token') {\n return {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: await readToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: token,\n };\n }\n if (\n credential.type === 'bearer' &&\n (!Number.isInteger(credential.projectId) || credential.projectId <= 0)\n ) {\n throw new ValidationError('projectId must be a positive integer');\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst CREDENTIAL_HEADER_NAMES = [\n KeboolaHttpHeader.STORAGE_API_TOKEN,\n KeboolaHttpHeader.MANAGEMENT_API_TOKEN,\n KeboolaHttpHeader.PROJECT_ID,\n HttpHeader.AUTHORIZATION,\n APP_USER_TOKEN_HEADER,\n];\n\nconst createCredentialMiddleware =\n (provider: QueryServiceCredentialProvider): MiddlewareFn =>\n (next) =>\n async (request) => {\n const credentialHeaders = await resolvedHeaders(await provider());\n const { headers } = request.request;\n for (const name of CREDENTIAL_HEADER_NAMES) headers.delete(name);\n for (const [name, value] of Object.entries(credentialHeaders)) headers.set(name, value);\n return next(request);\n };\n\n/**\n * The Query Service client's credential setup for its `auth`.\n *\n * 1. A credential with only string tokens: default headers, set once (as `createAuthHeaders`).\n * 2. A credential with a token callback, or a provider: no default headers; the innermost\n * middleware resolves and checks every token on every attempt.\n */\nexport const resolveAuth = (\n auth: QueryServiceCredential | QueryServiceCredentialProvider,\n middlewares: MiddlewareFn[],\n) => {\n if (typeof auth === 'function') {\n return { headers: undefined, middlewares: [...middlewares, createCredentialMiddleware(auth)] };\n }\n if (hasCallback(auth)) {\n return {\n headers: undefined,\n middlewares: [...middlewares, createCredentialMiddleware(() => auth)],\n };\n }\n return { headers: staticHeaders(auth), middlewares };\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { QueryJobError } from '../../errors';\nimport { poller } from '../../utils/async';\nimport { transientRetries } from '../transientRetries';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\nexport type 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 * - `init` is the job, or the request that yields it, so a caller hands over what `createQueryJob` gave it.\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 */\ntype JobRef = { id: GetQueryJobPath['queryJobId'] };\n\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n ({\n init,\n interval,\n maxAttempts,\n timeout,\n signal,\n }: QueryJobPollOptions & { init: JobRef | ((signal: AbortSignal) => Promise<JobRef>) }) => {\n const retries = transientRetries();\n\n return poller({\n pollKey: ({ id }) => ['queryService.job', { id }] as const,\n init,\n pollFn: async ({ init: { id }, signal: pollSignal }) => {\n const job = await getQueryJob(id, pollSignal);\n retries.reset();\n return job;\n },\n isRetryable: retries.isRetryable,\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n failed: (job) => {\n if (job.status !== 'failed') return undefined;\n const failedStatements = job.statements\n .filter((statement) => statement.status === 'failed')\n .map((statement) => ({ id: statement.id, error: statement.error }));\n\n return new QueryJobError(failedStatements[0]?.error ?? 'Job failed', job.queryJobId, {\n failedStatements,\n });\n },\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n };\n","import { RowLevelSecurityError } from '../../errors';\nimport { defaultValidateStatus, type ValidateStatusFn } from '../../fetchClient';\nimport { HttpStatus, ROW_LEVEL_SECURITY_DENIED_MESSAGE } from '../../internal';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * Status validation for Query Service, which reads a row-level security refusal as `RowLevelSecurityError`.\n *\n * - The fixed `exception` text is the only signal: `X-KBC-RLS-Mode` is not exposed through CORS,\n * and a credentials 403 on a governed workspace carries that header too.\n */\nexport const validateQueryServiceStatus: ValidateStatusFn = (apiResponse) => {\n const { response, data } = apiResponse;\n\n if (\n response.status === HttpStatus.FORBIDDEN &&\n isRecord(data) &&\n data.exception === ROW_LEVEL_SECURITY_DENIED_MESSAGE\n ) {\n return new RowLevelSecurityError(apiResponse);\n }\n\n return defaultValidateStatus(apiResponse);\n};\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n type MiddlewareFn,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport {\n type QueryServiceCredential,\n type QueryServiceCredentialProvider,\n resolveAuth,\n} from './auth';\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';\nimport { validateQueryServiceStatus } from './validateStatus';\n\nexport type QueryServiceClientInitOptions = Omit<ClientInitOptions, 'auth' | 'middlewares'> & {\n auth: QueryServiceCredential | QueryServiceCredentialProvider;\n middlewares?: MiddlewareFn[];\n};\n\nexport const createQueryServiceClient = ({\n baseUrl,\n middlewares = [],\n auth,\n}: QueryServiceClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n ...resolveAuth(auth, middlewares),\n validateStatus: validateQueryServiceStatus,\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,\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AEA,MAAM,kBAAkB,OACtB,YACA,aACA,UACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,sDAAsD;GACtF,MAAM;IAAE;IAAY;GAAY;GAChC;EACF,CAAC;EAED,OAAO;CACT;CAEA,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,IAAIC,0BAAAA,WAAW,YAAY,KAAK;GAOhE,SAAS;GACT,UAPyBC,0BAAAA,8BACzB,SAAS,QAAQ,IAAID,0BAAAA,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-CECWubS0.cjs","names":["ValidationError","KeboolaHttpHeader","APP_USER_TOKEN_HEADER","createAuthHeaders","HttpHeader","transientRetries","poller","jobStatus","QueryJobError","HttpStatus","RowLevelSecurityError","defaultValidateStatus","createOpenapiFetchClient","createGenericFetchClient","HttpHeader","parseContentDispositionHeader"],"sources":["../src/clients/queryService/auth.ts","../src/clients/queryService/poller.ts","../src/clients/queryService/validateStatus.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { ValidationError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { APP_USER_TOKEN_HEADER, KeboolaHttpHeader } from '../../internal';\nimport { createAuthHeaders } from '../auth';\n\n/** A token value, or a callback that returns the current one (read before every request). */\nexport type TokenSource = string | (() => string | Promise<string>);\n\n/** A data app user's token, sent as `X-Kbc-App-User-Token` together with the app's Storage token. */\nexport type AppUserTokenAuth = {\n type: 'app-user-token';\n token: TokenSource;\n storageToken: TokenSource;\n};\n\n/** One credential; a request carries exactly that credential's headers. */\nexport type QueryServiceCredential =\n | { type: 'sapi-token'; token: TokenSource }\n | { type: 'bearer'; token: TokenSource; projectId: number }\n | AppUserTokenAuth;\n\n/** Resolved before every request, retries included. */\nexport type QueryServiceCredentialProvider = () =>\n | QueryServiceCredential\n | Promise<QueryServiceCredential>;\n\nconst PRINTABLE_ASCII_WITHOUT_SPACES = /^[\\x21-\\x7E]+$/;\n\nconst requireToken = (token: unknown): string => {\n if (typeof token !== 'string' || !PRINTABLE_ASCII_WITHOUT_SPACES.test(token)) {\n throw new ValidationError('token must be non-empty printable ASCII without spaces');\n }\n return token;\n};\n\nconst readToken = async (source: TokenSource) =>\n requireToken(typeof source === 'function' ? await source() : source);\n\nconst hasCallback = (credential: QueryServiceCredential) =>\n typeof credential.token === 'function' ||\n (credential.type === 'app-user-token' && typeof credential.storageToken === 'function');\n\n/**\n * Fixed headers for a credential with only string tokens.\n *\n * - `app-user-token` tokens are checked here, so an empty user token throws at client creation.\n * - `sapi-token` / `bearer` strings go out unchecked: service clients send an empty `bearer` token\n * that their own middleware replaces.\n */\nconst staticHeaders = (credential: QueryServiceCredential): Record<string, string> => {\n const { token } = credential;\n if (typeof token !== 'string') return {};\n if (credential.type === 'app-user-token') {\n return typeof credential.storageToken === 'string'\n ? {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: requireToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: requireToken(token),\n }\n : {};\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst resolvedHeaders = async (\n credential: QueryServiceCredential,\n): Promise<Record<string, string>> => {\n const token = await readToken(credential.token);\n if (credential.type === 'app-user-token') {\n return {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: await readToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: token,\n };\n }\n if (\n credential.type === 'bearer' &&\n (!Number.isInteger(credential.projectId) || credential.projectId <= 0)\n ) {\n throw new ValidationError('projectId must be a positive integer');\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst CREDENTIAL_HEADER_NAMES = [\n KeboolaHttpHeader.STORAGE_API_TOKEN,\n KeboolaHttpHeader.MANAGEMENT_API_TOKEN,\n KeboolaHttpHeader.PROJECT_ID,\n HttpHeader.AUTHORIZATION,\n APP_USER_TOKEN_HEADER,\n];\n\nconst createCredentialMiddleware =\n (provider: QueryServiceCredentialProvider): MiddlewareFn =>\n (next) =>\n async (request) => {\n const credentialHeaders = await resolvedHeaders(await provider());\n const { headers } = request.request;\n for (const name of CREDENTIAL_HEADER_NAMES) headers.delete(name);\n for (const [name, value] of Object.entries(credentialHeaders)) headers.set(name, value);\n return next(request);\n };\n\n/**\n * The Query Service client's credential setup for its `auth`.\n *\n * 1. A credential with only string tokens: default headers, set once (as `createAuthHeaders`).\n * 2. A credential with a token callback, or a provider: no default headers; the innermost\n * middleware resolves and checks every token on every attempt.\n */\nexport const resolveAuth = (\n auth: QueryServiceCredential | QueryServiceCredentialProvider,\n middlewares: MiddlewareFn[],\n) => {\n if (typeof auth === 'function') {\n return { headers: undefined, middlewares: [...middlewares, createCredentialMiddleware(auth)] };\n }\n if (hasCallback(auth)) {\n return {\n headers: undefined,\n middlewares: [...middlewares, createCredentialMiddleware(() => auth)],\n };\n }\n return { headers: staticHeaders(auth), middlewares };\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { QueryJobError } from '../../errors';\nimport { poller } from '../../utils/async';\nimport { transientRetries } from '../transientRetries';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\nexport type 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 * - `init` is the job, or the request that yields it, so a caller hands over what `createQueryJob` gave it.\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 */\ntype JobRef = { id: GetQueryJobPath['queryJobId'] };\n\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n ({\n init,\n interval,\n maxAttempts,\n timeout,\n signal,\n }: QueryJobPollOptions & { init: JobRef | ((signal: AbortSignal) => Promise<JobRef>) }) => {\n const retries = transientRetries();\n\n return poller({\n pollKey: ({ id }) => ['queryService.job', { id }] as const,\n init,\n pollFn: async ({ init: { id }, signal: pollSignal }) => {\n const job = await getQueryJob(id, pollSignal);\n retries.reset();\n return job;\n },\n isRetryable: retries.isRetryable,\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n failed: (job) => {\n if (job.status !== 'failed') return undefined;\n const failedStatements = job.statements\n .filter((statement) => statement.status === 'failed')\n .map((statement) => ({ id: statement.id, error: statement.error }));\n\n return new QueryJobError(failedStatements[0]?.error ?? 'Job failed', job.queryJobId, {\n failedStatements,\n });\n },\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n };\n","import { RowLevelSecurityError } from '../../errors';\nimport { defaultValidateStatus, type ValidateStatusFn } from '../../fetchClient';\nimport { HttpStatus, ROW_LEVEL_SECURITY_DENIED_MESSAGE } from '../../internal';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * Status validation for Query Service, which reads a row-level security refusal as `RowLevelSecurityError`.\n *\n * - The fixed `exception` text is the only signal: `X-KBC-RLS-Mode` is not exposed through CORS,\n * and a credentials 403 on a governed workspace carries that header too.\n */\nexport const validateQueryServiceStatus: ValidateStatusFn = (apiResponse) => {\n const { response, data } = apiResponse;\n\n if (\n response.status === HttpStatus.FORBIDDEN &&\n isRecord(data) &&\n data.exception === ROW_LEVEL_SECURITY_DENIED_MESSAGE\n ) {\n return new RowLevelSecurityError(apiResponse);\n }\n\n return defaultValidateStatus(apiResponse);\n};\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n type MiddlewareFn,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport {\n type QueryServiceCredential,\n type QueryServiceCredentialProvider,\n resolveAuth,\n} from './auth';\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';\nimport { validateQueryServiceStatus } from './validateStatus';\n\nexport type QueryServiceClientInitOptions = Omit<ClientInitOptions, 'auth' | 'middlewares'> & {\n auth: QueryServiceCredential | QueryServiceCredentialProvider;\n middlewares?: MiddlewareFn[];\n};\n\nexport const createQueryServiceClient = ({\n baseUrl,\n middlewares = [],\n auth,\n}: QueryServiceClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n ...resolveAuth(auth, middlewares),\n validateStatus: validateQueryServiceStatus,\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,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,UACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,sDAAsD;GACtF,MAAM;IAAE;IAAY;GAAY;GAChC;EACF,CAAC;EAED,OAAO;CACT;CAEA,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,IAAIC,0BAAAA,WAAW,YAAY,KAAK;GAOhE,SAAS;GACT,UAPyBC,0BAAAA,8BACzB,SAAS,QAAQ,IAAID,0BAAAA,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"}
@@ -3,7 +3,7 @@ import { r as QueryJobError, t as RowLevelSecurityError } from "./RowLevelSecuri
3
3
  import { t as ValidationError } from "./ValidationError-BsdFDGY2.js";
4
4
  import { t as createGenericFetchClient } from "./createGenericFetchClient-Ba4E4T-Y.js";
5
5
  import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-DSk29o_s.js";
6
- import { a as poller, n as jobStatus, t as transientRetries } from "./transientRetries-BORv47mH.js";
6
+ import { a as poller, n as jobStatus, t as transientRetries } from "./transientRetries-dssygpwU.js";
7
7
  import { t as createAuthHeaders } from "./auth-ZBQWCJPM.js";
8
8
  // src/clients/queryService/auth.ts
9
9
  const PRINTABLE_ASCII_WITHOUT_SPACES = /^[\x21-\x7E]+$/;
@@ -206,4 +206,4 @@ const createQueryServiceClient = ({ baseUrl, middlewares = [], auth }) => {
206
206
  };
207
207
  export { createQueryServiceClient as t };
208
208
 
209
- //# sourceMappingURL=queryService-DQHtHy2-.js.map
209
+ //# sourceMappingURL=queryService-CIxb_mcP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryService-DQHtHy2-.js","names":[],"sources":["../src/clients/queryService/auth.ts","../src/clients/queryService/poller.ts","../src/clients/queryService/validateStatus.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { ValidationError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { APP_USER_TOKEN_HEADER, KeboolaHttpHeader } from '../../internal';\nimport { createAuthHeaders } from '../auth';\n\n/** A token value, or a callback that returns the current one (read before every request). */\nexport type TokenSource = string | (() => string | Promise<string>);\n\n/** A data app user's token, sent as `X-Kbc-App-User-Token` together with the app's Storage token. */\nexport type AppUserTokenAuth = {\n type: 'app-user-token';\n token: TokenSource;\n storageToken: TokenSource;\n};\n\n/** One credential; a request carries exactly that credential's headers. */\nexport type QueryServiceCredential =\n | { type: 'sapi-token'; token: TokenSource }\n | { type: 'bearer'; token: TokenSource; projectId: number }\n | AppUserTokenAuth;\n\n/** Resolved before every request, retries included. */\nexport type QueryServiceCredentialProvider = () =>\n | QueryServiceCredential\n | Promise<QueryServiceCredential>;\n\nconst PRINTABLE_ASCII_WITHOUT_SPACES = /^[\\x21-\\x7E]+$/;\n\nconst requireToken = (token: unknown): string => {\n if (typeof token !== 'string' || !PRINTABLE_ASCII_WITHOUT_SPACES.test(token)) {\n throw new ValidationError('token must be non-empty printable ASCII without spaces');\n }\n return token;\n};\n\nconst readToken = async (source: TokenSource) =>\n requireToken(typeof source === 'function' ? await source() : source);\n\nconst hasCallback = (credential: QueryServiceCredential) =>\n typeof credential.token === 'function' ||\n (credential.type === 'app-user-token' && typeof credential.storageToken === 'function');\n\n/**\n * Fixed headers for a credential with only string tokens.\n *\n * - `app-user-token` tokens are checked here, so an empty user token throws at client creation.\n * - `sapi-token` / `bearer` strings go out unchecked: service clients send an empty `bearer` token\n * that their own middleware replaces.\n */\nconst staticHeaders = (credential: QueryServiceCredential): Record<string, string> => {\n const { token } = credential;\n if (typeof token !== 'string') return {};\n if (credential.type === 'app-user-token') {\n return typeof credential.storageToken === 'string'\n ? {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: requireToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: requireToken(token),\n }\n : {};\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst resolvedHeaders = async (\n credential: QueryServiceCredential,\n): Promise<Record<string, string>> => {\n const token = await readToken(credential.token);\n if (credential.type === 'app-user-token') {\n return {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: await readToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: token,\n };\n }\n if (\n credential.type === 'bearer' &&\n (!Number.isInteger(credential.projectId) || credential.projectId <= 0)\n ) {\n throw new ValidationError('projectId must be a positive integer');\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst CREDENTIAL_HEADER_NAMES = [\n KeboolaHttpHeader.STORAGE_API_TOKEN,\n KeboolaHttpHeader.MANAGEMENT_API_TOKEN,\n KeboolaHttpHeader.PROJECT_ID,\n HttpHeader.AUTHORIZATION,\n APP_USER_TOKEN_HEADER,\n];\n\nconst createCredentialMiddleware =\n (provider: QueryServiceCredentialProvider): MiddlewareFn =>\n (next) =>\n async (request) => {\n const credentialHeaders = await resolvedHeaders(await provider());\n const { headers } = request.request;\n for (const name of CREDENTIAL_HEADER_NAMES) headers.delete(name);\n for (const [name, value] of Object.entries(credentialHeaders)) headers.set(name, value);\n return next(request);\n };\n\n/**\n * The Query Service client's credential setup for its `auth`.\n *\n * 1. A credential with only string tokens: default headers, set once (as `createAuthHeaders`).\n * 2. A credential with a token callback, or a provider: no default headers; the innermost\n * middleware resolves and checks every token on every attempt.\n */\nexport const resolveAuth = (\n auth: QueryServiceCredential | QueryServiceCredentialProvider,\n middlewares: MiddlewareFn[],\n) => {\n if (typeof auth === 'function') {\n return { headers: undefined, middlewares: [...middlewares, createCredentialMiddleware(auth)] };\n }\n if (hasCallback(auth)) {\n return {\n headers: undefined,\n middlewares: [...middlewares, createCredentialMiddleware(() => auth)],\n };\n }\n return { headers: staticHeaders(auth), middlewares };\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { QueryJobError } from '../../errors';\nimport { poller } from '../../utils/async';\nimport { transientRetries } from '../transientRetries';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\nexport type 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 * - `init` is the job, or the request that yields it, so a caller hands over what `createQueryJob` gave it.\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 */\ntype JobRef = { id: GetQueryJobPath['queryJobId'] };\n\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n ({\n init,\n interval,\n maxAttempts,\n timeout,\n signal,\n }: QueryJobPollOptions & { init: JobRef | ((signal: AbortSignal) => Promise<JobRef>) }) => {\n const retries = transientRetries();\n\n return poller({\n pollKey: ({ id }) => ['queryService.job', { id }] as const,\n init,\n pollFn: async ({ init: { id }, signal: pollSignal }) => {\n const job = await getQueryJob(id, pollSignal);\n retries.reset();\n return job;\n },\n isRetryable: retries.isRetryable,\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n failed: (job) => {\n if (job.status !== 'failed') return undefined;\n const failedStatements = job.statements\n .filter((statement) => statement.status === 'failed')\n .map((statement) => ({ id: statement.id, error: statement.error }));\n\n return new QueryJobError(failedStatements[0]?.error ?? 'Job failed', job.queryJobId, {\n failedStatements,\n });\n },\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n };\n","import { RowLevelSecurityError } from '../../errors';\nimport { defaultValidateStatus, type ValidateStatusFn } from '../../fetchClient';\nimport { HttpStatus, ROW_LEVEL_SECURITY_DENIED_MESSAGE } from '../../internal';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * Status validation for Query Service, which reads a row-level security refusal as `RowLevelSecurityError`.\n *\n * - The fixed `exception` text is the only signal: `X-KBC-RLS-Mode` is not exposed through CORS,\n * and a credentials 403 on a governed workspace carries that header too.\n */\nexport const validateQueryServiceStatus: ValidateStatusFn = (apiResponse) => {\n const { response, data } = apiResponse;\n\n if (\n response.status === HttpStatus.FORBIDDEN &&\n isRecord(data) &&\n data.exception === ROW_LEVEL_SECURITY_DENIED_MESSAGE\n ) {\n return new RowLevelSecurityError(apiResponse);\n }\n\n return defaultValidateStatus(apiResponse);\n};\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n type MiddlewareFn,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport {\n type QueryServiceCredential,\n type QueryServiceCredentialProvider,\n resolveAuth,\n} from './auth';\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';\nimport { validateQueryServiceStatus } from './validateStatus';\n\nexport type QueryServiceClientInitOptions = Omit<ClientInitOptions, 'auth' | 'middlewares'> & {\n auth: QueryServiceCredential | QueryServiceCredentialProvider;\n middlewares?: MiddlewareFn[];\n};\n\nexport const createQueryServiceClient = ({\n baseUrl,\n middlewares = [],\n auth,\n}: QueryServiceClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n ...resolveAuth(auth, middlewares),\n validateStatus: validateQueryServiceStatus,\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":";;;;;;;;AA0BA,MAAM,iCAAiC;AAEvC,MAAM,gBAAgB,UAA2B;CAC/C,IAAI,OAAO,UAAU,YAAY,CAAC,+BAA+B,KAAK,KAAK,GACzE,MAAM,IAAI,gBAAgB,wDAAwD;CAEpF,OAAO;AACT;AAEA,MAAM,YAAY,OAAO,WACvB,aAAa,OAAO,WAAW,aAAa,MAAM,OAAO,IAAI,MAAM;AAErE,MAAM,eAAe,eACnB,OAAO,WAAW,UAAU,cAC3B,WAAW,SAAS,oBAAoB,OAAO,WAAW,iBAAiB;;;;;;;;AAS9E,MAAM,iBAAiB,eAA+D;CACpF,MAAM,EAAE,UAAU;CAClB,IAAI,OAAO,UAAU,UAAU,OAAO,CAAC;CACvC,IAAI,WAAW,SAAS,kBACtB,OAAO,OAAO,WAAW,iBAAiB,WACtC;GACG,kBAAkB,oBAAoB,aAAa,WAAW,YAAY;GAC1E,wBAAwB,aAAa,KAAK;CAC7C,IACA,CAAC;CAEP,OAAO,kBAAkB;EAAE,GAAG;EAAY;CAAM,CAAC;AACnD;AAEA,MAAM,kBAAkB,OACtB,eACoC;CACpC,MAAM,QAAQ,MAAM,UAAU,WAAW,KAAK;CAC9C,IAAI,WAAW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Q,oBAAoB;EACtC,CAAC;EAED,OAAO;CACT;CAEA,MAAM,cAAc,OAAO,YAA2C,WAAyB;EAC7F,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gCACA,EAAE,MAAM,EAAE,WAAW,EAAE,GACvB,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,kBAAkB,OACtB,YACA,aACA,UACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,sDAAsD;GACtF,MAAM;IAAE;IAAY;GAAY;GAChC;EACF,CAAC;EAED,OAAO;CACT;CAEA,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-CIxb_mcP.js","names":[],"sources":["../src/clients/queryService/auth.ts","../src/clients/queryService/poller.ts","../src/clients/queryService/validateStatus.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { ValidationError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { APP_USER_TOKEN_HEADER, KeboolaHttpHeader } from '../../internal';\nimport { createAuthHeaders } from '../auth';\n\n/** A token value, or a callback that returns the current one (read before every request). */\nexport type TokenSource = string | (() => string | Promise<string>);\n\n/** A data app user's token, sent as `X-Kbc-App-User-Token` together with the app's Storage token. */\nexport type AppUserTokenAuth = {\n type: 'app-user-token';\n token: TokenSource;\n storageToken: TokenSource;\n};\n\n/** One credential; a request carries exactly that credential's headers. */\nexport type QueryServiceCredential =\n | { type: 'sapi-token'; token: TokenSource }\n | { type: 'bearer'; token: TokenSource; projectId: number }\n | AppUserTokenAuth;\n\n/** Resolved before every request, retries included. */\nexport type QueryServiceCredentialProvider = () =>\n | QueryServiceCredential\n | Promise<QueryServiceCredential>;\n\nconst PRINTABLE_ASCII_WITHOUT_SPACES = /^[\\x21-\\x7E]+$/;\n\nconst requireToken = (token: unknown): string => {\n if (typeof token !== 'string' || !PRINTABLE_ASCII_WITHOUT_SPACES.test(token)) {\n throw new ValidationError('token must be non-empty printable ASCII without spaces');\n }\n return token;\n};\n\nconst readToken = async (source: TokenSource) =>\n requireToken(typeof source === 'function' ? await source() : source);\n\nconst hasCallback = (credential: QueryServiceCredential) =>\n typeof credential.token === 'function' ||\n (credential.type === 'app-user-token' && typeof credential.storageToken === 'function');\n\n/**\n * Fixed headers for a credential with only string tokens.\n *\n * - `app-user-token` tokens are checked here, so an empty user token throws at client creation.\n * - `sapi-token` / `bearer` strings go out unchecked: service clients send an empty `bearer` token\n * that their own middleware replaces.\n */\nconst staticHeaders = (credential: QueryServiceCredential): Record<string, string> => {\n const { token } = credential;\n if (typeof token !== 'string') return {};\n if (credential.type === 'app-user-token') {\n return typeof credential.storageToken === 'string'\n ? {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: requireToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: requireToken(token),\n }\n : {};\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst resolvedHeaders = async (\n credential: QueryServiceCredential,\n): Promise<Record<string, string>> => {\n const token = await readToken(credential.token);\n if (credential.type === 'app-user-token') {\n return {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: await readToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: token,\n };\n }\n if (\n credential.type === 'bearer' &&\n (!Number.isInteger(credential.projectId) || credential.projectId <= 0)\n ) {\n throw new ValidationError('projectId must be a positive integer');\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst CREDENTIAL_HEADER_NAMES = [\n KeboolaHttpHeader.STORAGE_API_TOKEN,\n KeboolaHttpHeader.MANAGEMENT_API_TOKEN,\n KeboolaHttpHeader.PROJECT_ID,\n HttpHeader.AUTHORIZATION,\n APP_USER_TOKEN_HEADER,\n];\n\nconst createCredentialMiddleware =\n (provider: QueryServiceCredentialProvider): MiddlewareFn =>\n (next) =>\n async (request) => {\n const credentialHeaders = await resolvedHeaders(await provider());\n const { headers } = request.request;\n for (const name of CREDENTIAL_HEADER_NAMES) headers.delete(name);\n for (const [name, value] of Object.entries(credentialHeaders)) headers.set(name, value);\n return next(request);\n };\n\n/**\n * The Query Service client's credential setup for its `auth`.\n *\n * 1. A credential with only string tokens: default headers, set once (as `createAuthHeaders`).\n * 2. A credential with a token callback, or a provider: no default headers; the innermost\n * middleware resolves and checks every token on every attempt.\n */\nexport const resolveAuth = (\n auth: QueryServiceCredential | QueryServiceCredentialProvider,\n middlewares: MiddlewareFn[],\n) => {\n if (typeof auth === 'function') {\n return { headers: undefined, middlewares: [...middlewares, createCredentialMiddleware(auth)] };\n }\n if (hasCallback(auth)) {\n return {\n headers: undefined,\n middlewares: [...middlewares, createCredentialMiddleware(() => auth)],\n };\n }\n return { headers: staticHeaders(auth), middlewares };\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { QueryJobError } from '../../errors';\nimport { poller } from '../../utils/async';\nimport { transientRetries } from '../transientRetries';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\nexport type 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 * - `init` is the job, or the request that yields it, so a caller hands over what `createQueryJob` gave it.\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 */\ntype JobRef = { id: GetQueryJobPath['queryJobId'] };\n\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n ({\n init,\n interval,\n maxAttempts,\n timeout,\n signal,\n }: QueryJobPollOptions & { init: JobRef | ((signal: AbortSignal) => Promise<JobRef>) }) => {\n const retries = transientRetries();\n\n return poller({\n pollKey: ({ id }) => ['queryService.job', { id }] as const,\n init,\n pollFn: async ({ init: { id }, signal: pollSignal }) => {\n const job = await getQueryJob(id, pollSignal);\n retries.reset();\n return job;\n },\n isRetryable: retries.isRetryable,\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n failed: (job) => {\n if (job.status !== 'failed') return undefined;\n const failedStatements = job.statements\n .filter((statement) => statement.status === 'failed')\n .map((statement) => ({ id: statement.id, error: statement.error }));\n\n return new QueryJobError(failedStatements[0]?.error ?? 'Job failed', job.queryJobId, {\n failedStatements,\n });\n },\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n };\n","import { RowLevelSecurityError } from '../../errors';\nimport { defaultValidateStatus, type ValidateStatusFn } from '../../fetchClient';\nimport { HttpStatus, ROW_LEVEL_SECURITY_DENIED_MESSAGE } from '../../internal';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * Status validation for Query Service, which reads a row-level security refusal as `RowLevelSecurityError`.\n *\n * - The fixed `exception` text is the only signal: `X-KBC-RLS-Mode` is not exposed through CORS,\n * and a credentials 403 on a governed workspace carries that header too.\n */\nexport const validateQueryServiceStatus: ValidateStatusFn = (apiResponse) => {\n const { response, data } = apiResponse;\n\n if (\n response.status === HttpStatus.FORBIDDEN &&\n isRecord(data) &&\n data.exception === ROW_LEVEL_SECURITY_DENIED_MESSAGE\n ) {\n return new RowLevelSecurityError(apiResponse);\n }\n\n return defaultValidateStatus(apiResponse);\n};\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n type MiddlewareFn,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport {\n type QueryServiceCredential,\n type QueryServiceCredentialProvider,\n resolveAuth,\n} from './auth';\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';\nimport { validateQueryServiceStatus } from './validateStatus';\n\nexport type QueryServiceClientInitOptions = Omit<ClientInitOptions, 'auth' | 'middlewares'> & {\n auth: QueryServiceCredential | QueryServiceCredentialProvider;\n middlewares?: MiddlewareFn[];\n};\n\nexport const createQueryServiceClient = ({\n baseUrl,\n middlewares = [],\n auth,\n}: QueryServiceClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n ...resolveAuth(auth, middlewares),\n validateStatus: validateQueryServiceStatus,\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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;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,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_queue = require("../queue-J2uXzXR9.cjs");
2
+ const require_queue = require("../queue-PmTfoniJ.cjs");
3
3
  exports.createQueueClient = require_queue.createQueueClient;
@@ -1,7 +1,7 @@
1
- import { $r as SearchJobsQuery, Gr as KillJobPath, Ur as CreateJobBody, Wr as GetQueueJobPath, Xr as SearchAllJobsQuery, Zr as SearchGroupedJobsQuery, qr as OrchestrationRerunPlanPath, ti as components } from "../index-DcKc3_Y1.cjs";
2
- import "../index-DPhGNQC5.cjs";
3
- import { n as ClientInitOptions } from "../types-BqJycQNM.cjs";
4
- import { c as Poller } from "../index-24GpnYhn.cjs";
1
+ import { $r as SearchJobsQuery, Gr as KillJobPath, Ur as CreateJobBody, Wr as GetQueueJobPath, Xr as SearchAllJobsQuery, Zr as SearchGroupedJobsQuery, qr as OrchestrationRerunPlanPath, ti as components } from "../index-9p4O-clX.cjs";
2
+ import "../index-BgEu7wGk.cjs";
3
+ import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
4
+ import { c as Poller } from "../index-DENUPo51.cjs";
5
5
  declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
6
6
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
7
7
  poller: ({ init, interval, maxAttempts, timeout, signal }: {
@@ -78,6 +78,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
78
78
  type?: components['schemas']['JobType'];
79
79
  orchestrationTaskId?: string | null;
80
80
  previousJobId?: string | null;
81
+ runtimeTimezone?: string | null;
81
82
  onlyOrchestrationTaskIds?: string[] | null;
82
83
  onlyFlowTaskIds?: string[] | null;
83
84
  }, {
@@ -141,6 +142,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
141
142
  type?: components['schemas']['JobType'];
142
143
  orchestrationTaskId?: string | null;
143
144
  previousJobId?: string | null;
145
+ runtimeTimezone?: string | null;
144
146
  onlyOrchestrationTaskIds?: string[] | null;
145
147
  onlyFlowTaskIds?: string[] | null;
146
148
  }>;
@@ -205,6 +207,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
205
207
  type?: components['schemas']['JobType'];
206
208
  orchestrationTaskId?: string | null;
207
209
  previousJobId?: string | null;
210
+ runtimeTimezone?: string | null;
208
211
  onlyOrchestrationTaskIds?: string[] | null;
209
212
  onlyFlowTaskIds?: string[] | null;
210
213
  }>;
@@ -269,6 +272,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
269
272
  type?: components['schemas']['JobType'];
270
273
  orchestrationTaskId?: string | null;
271
274
  previousJobId?: string | null;
275
+ runtimeTimezone?: string | null;
272
276
  onlyOrchestrationTaskIds?: string[] | null;
273
277
  onlyFlowTaskIds?: string[] | null;
274
278
  }[]>;
@@ -333,6 +337,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
333
337
  type?: components['schemas']['JobType'];
334
338
  orchestrationTaskId?: string | null;
335
339
  previousJobId?: string | null;
340
+ runtimeTimezone?: string | null;
336
341
  onlyOrchestrationTaskIds?: string[] | null;
337
342
  onlyFlowTaskIds?: string[] | null;
338
343
  }[]>;
@@ -397,6 +402,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
397
402
  type?: components['schemas']['JobType'];
398
403
  orchestrationTaskId?: string | null;
399
404
  previousJobId?: string | null;
405
+ runtimeTimezone?: string | null;
400
406
  onlyOrchestrationTaskIds?: string[] | null;
401
407
  onlyFlowTaskIds?: string[] | null;
402
408
  }>;
@@ -461,6 +467,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
461
467
  type?: components['schemas']['JobType'];
462
468
  orchestrationTaskId?: string | null;
463
469
  previousJobId?: string | null;
470
+ runtimeTimezone?: string | null;
464
471
  onlyOrchestrationTaskIds?: string[] | null;
465
472
  onlyFlowTaskIds?: string[] | null;
466
473
  }>;