@keboola/api-client 39.0.0 → 40.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 (518) hide show
  1. package/AGENTS.md +121 -100
  2. package/API-SURFACE.md +23 -2
  3. package/CHANGELOG.md +120 -0
  4. package/README.md +3 -3
  5. package/dist/{ManagementClientAuthError-FcfMJNhr.cjs → ManagementClientAuthError-DE7lNGZQ.cjs} +2 -2
  6. package/dist/{ManagementClientAuthError-FcfMJNhr.cjs.map → ManagementClientAuthError-DE7lNGZQ.cjs.map} +1 -1
  7. package/dist/{ManagementClientAuthError-Cr9IOsnJ.js → ManagementClientAuthError-H30lti_Q.js} +2 -2
  8. package/dist/{ManagementClientAuthError-Cr9IOsnJ.js.map → ManagementClientAuthError-H30lti_Q.js.map} +1 -1
  9. package/dist/{ValidationError-CLVJCCwH.cjs → ValidationError-D65QU0uq.cjs} +10 -16
  10. package/dist/ValidationError-D65QU0uq.cjs.map +1 -0
  11. package/dist/ValidationError-DjhtNMfZ.js +42 -0
  12. package/dist/ValidationError-DjhtNMfZ.js.map +1 -0
  13. package/dist/ai/index.cjs +2 -2
  14. package/dist/ai/index.d.cts +2 -2
  15. package/dist/ai/index.d.ts +2 -2
  16. package/dist/ai/index.js +2 -2
  17. package/dist/ai/types.d.cts +1 -1
  18. package/dist/ai/types.d.ts +1 -1
  19. package/dist/{appLogs-C_zP0lpv.cjs → appLogs-B9zFJIuy.cjs} +2 -2
  20. package/dist/{appLogs-C_zP0lpv.cjs.map → appLogs-B9zFJIuy.cjs.map} +1 -1
  21. package/dist/{appLogs-Cl7Q_MR9.js → appLogs-BBkkUOW1.js} +2 -2
  22. package/dist/{appLogs-Cl7Q_MR9.js.map → appLogs-BBkkUOW1.js.map} +1 -1
  23. package/dist/{appLogs-Ch7DYpzx.d.ts → appLogs-BS6ViVGR.d.ts} +2 -2
  24. package/dist/{appLogs-D5A13Y0y.d.cts → appLogs-C9YlJ2g8.d.cts} +2 -2
  25. package/dist/apps/index.cjs +30 -56
  26. package/dist/apps/index.cjs.map +1 -1
  27. package/dist/apps/index.d.cts +8 -13
  28. package/dist/apps/index.d.ts +8 -13
  29. package/dist/apps/index.js +30 -56
  30. package/dist/apps/index.js.map +1 -1
  31. package/dist/apps/types.d.cts +2 -2
  32. package/dist/apps/types.d.ts +2 -2
  33. package/dist/assets/index.cjs +1 -1
  34. package/dist/assets/index.d.cts +1 -1
  35. package/dist/assets/index.d.ts +1 -1
  36. package/dist/assets/index.js +1 -1
  37. package/dist/auth/index.cjs +8 -4
  38. package/dist/auth/index.d.cts +2 -2
  39. package/dist/auth/index.d.ts +2 -2
  40. package/dist/auth/index.js +2 -2
  41. package/dist/auth/types.d.cts +2 -2
  42. package/dist/auth/types.d.ts +2 -2
  43. package/dist/{auth-DLWnl18b.cjs → auth-Dm0F2rOh.cjs} +2 -2
  44. package/dist/{auth-DLWnl18b.cjs.map → auth-Dm0F2rOh.cjs.map} +1 -1
  45. package/dist/{auth-BjmkFOgd.js → auth-DworfoPy.js} +2 -2
  46. package/dist/{auth-BjmkFOgd.js.map → auth-DworfoPy.js.map} +1 -1
  47. package/dist/{authClient-8yU1last.cjs → authClient-BmuUo0J4.cjs} +141 -48
  48. package/dist/authClient-BmuUo0J4.cjs.map +1 -0
  49. package/dist/{authClient-CTHNs6Tq.d.cts → authClient-CHXWJ9x3.d.ts} +109 -76
  50. package/dist/{authClient-BTo4Afm6.js → authClient-CgcDGd30.js} +108 -39
  51. package/dist/authClient-CgcDGd30.js.map +1 -0
  52. package/dist/{authClient-D8i3JTM-.d.ts → authClient-vEt_7_uk.d.cts} +109 -76
  53. package/dist/billing/index.cjs +2 -2
  54. package/dist/billing/index.d.cts +1 -1
  55. package/dist/billing/index.d.ts +1 -1
  56. package/dist/billing/index.js +2 -2
  57. package/dist/billing/types.d.cts +1 -1
  58. package/dist/billing/types.d.ts +1 -1
  59. package/dist/businessWorkspaceApi/index.cjs +1 -1
  60. package/dist/businessWorkspaceApi/index.d.cts +1 -1
  61. package/dist/businessWorkspaceApi/index.d.ts +1 -1
  62. package/dist/businessWorkspaceApi/index.js +1 -1
  63. package/dist/businessWorkspaceApi/types.d.cts +1 -1
  64. package/dist/businessWorkspaceApi/types.d.ts +1 -1
  65. package/dist/{businessWorkspaceApi-wyBdbpIJ.cjs → businessWorkspaceApi-6tCDdpnY.cjs} +3 -3
  66. package/dist/{businessWorkspaceApi-wyBdbpIJ.cjs.map → businessWorkspaceApi-6tCDdpnY.cjs.map} +1 -1
  67. package/dist/{businessWorkspaceApi-BD-iUj07.js → businessWorkspaceApi-BLUdefRF.js} +3 -3
  68. package/dist/{businessWorkspaceApi-BD-iUj07.js.map → businessWorkspaceApi-BLUdefRF.js.map} +1 -1
  69. package/dist/{businessWorkspaceApiClient-CRM1U8b-.d.cts → businessWorkspaceApiClient-BHDJlHFo.d.cts} +3 -3
  70. package/dist/{businessWorkspaceApiClient-C2WyWN3b.d.ts → businessWorkspaceApiClient-DI-z1VIH.d.ts} +3 -3
  71. package/dist/chat/index.cjs +7 -3
  72. package/dist/chat/index.cjs.map +1 -1
  73. package/dist/chat/index.d.cts +2 -2
  74. package/dist/chat/index.d.ts +2 -2
  75. package/dist/chat/index.js +7 -3
  76. package/dist/chat/index.js.map +1 -1
  77. package/dist/chat/types.cjs +1 -3
  78. package/dist/chat/types.cjs.map +1 -1
  79. package/dist/chat/types.d.cts +2 -2
  80. package/dist/chat/types.d.ts +2 -2
  81. package/dist/chat/types.js +1 -3
  82. package/dist/chat/types.js.map +1 -1
  83. package/dist/{componentId-DkyQ8PM0.cjs → componentId-57vjsa2i.cjs} +4 -2
  84. package/dist/{componentId-DkyQ8PM0.cjs.map → componentId-57vjsa2i.cjs.map} +1 -1
  85. package/dist/{componentId-vJz-kWs6.js → componentId-C6WZa_R1.js} +4 -2
  86. package/dist/{componentId-vJz-kWs6.js.map → componentId-C6WZa_R1.js.map} +1 -1
  87. package/dist/{concurrent-CH9fbNr3.js → concurrent-BacWxPwi.js} +5 -7
  88. package/dist/concurrent-BacWxPwi.js.map +1 -0
  89. package/dist/{concurrent-tbiIa0UL.cjs → concurrent-CdVfR1N5.cjs} +5 -7
  90. package/dist/concurrent-CdVfR1N5.cjs.map +1 -0
  91. package/dist/{configurations-VtNE0nrT.js → configurations-BPKGGy-M.js} +14 -22
  92. package/dist/configurations-BPKGGy-M.js.map +1 -0
  93. package/dist/{configurations-CyFF9Dtu.cjs → configurations-BTRHVSRq.cjs} +20 -53
  94. package/dist/configurations-BTRHVSRq.cjs.map +1 -0
  95. package/dist/{configurations-BVvcimzo.js → configurations-Chg_JwJ1.js} +20 -53
  96. package/dist/configurations-Chg_JwJ1.js.map +1 -0
  97. package/dist/{configurations-zkNjr73Q.cjs → configurations-IYyOvhI3.cjs} +14 -22
  98. package/dist/configurations-IYyOvhI3.cjs.map +1 -0
  99. package/dist/constants/index.cjs +1 -1
  100. package/dist/constants/index.d.cts +1 -1
  101. package/dist/constants/index.d.ts +1 -1
  102. package/dist/constants/index.js +1 -1
  103. package/dist/{createFetchClient-BlgPbjFj.cjs → createFetchClient-Cwp8max9.cjs} +11 -4
  104. package/dist/createFetchClient-Cwp8max9.cjs.map +1 -0
  105. package/dist/{createFetchClient-C-cadpBx.js → createFetchClient-DXHQK63w.js} +11 -4
  106. package/dist/createFetchClient-DXHQK63w.js.map +1 -0
  107. package/dist/{createGenericFetchClient-Bnf1QK9W.js → createGenericFetchClient-Dg1rgzmG.js} +2 -2
  108. package/dist/{createGenericFetchClient-Bnf1QK9W.js.map → createGenericFetchClient-Dg1rgzmG.js.map} +1 -1
  109. package/dist/{createGenericFetchClient-lcozzwk2.cjs → createGenericFetchClient-Dl9cqTvR.cjs} +2 -2
  110. package/dist/{createGenericFetchClient-lcozzwk2.cjs.map → createGenericFetchClient-Dl9cqTvR.cjs.map} +1 -1
  111. package/dist/{createOpenapiFetchClient-C3UmDXpe.cjs → createOpenapiFetchClient-BYqW-9tm.cjs} +2 -2
  112. package/dist/{createOpenapiFetchClient-C3UmDXpe.cjs.map → createOpenapiFetchClient-BYqW-9tm.cjs.map} +1 -1
  113. package/dist/{createOpenapiFetchClient-COaPeeQ0.js → createOpenapiFetchClient-DZUOVupy.js} +2 -2
  114. package/dist/{createOpenapiFetchClient-COaPeeQ0.js.map → createOpenapiFetchClient-DZUOVupy.js.map} +1 -1
  115. package/dist/dataScience/index.cjs +2 -2
  116. package/dist/dataScience/index.d.cts +2 -2
  117. package/dist/dataScience/index.d.ts +2 -2
  118. package/dist/dataScience/index.js +2 -2
  119. package/dist/dataScience/types.d.cts +2 -2
  120. package/dist/dataScience/types.d.ts +2 -2
  121. package/dist/{dataScience-D-hyc4GY.cjs → dataScience-B5QxZnvW.cjs} +5 -5
  122. package/dist/{dataScience-D-hyc4GY.cjs.map → dataScience-B5QxZnvW.cjs.map} +1 -1
  123. package/dist/{dataScience-B_BmnB1m.js → dataScience-OXcwdk1p.js} +5 -5
  124. package/dist/{dataScience-B_BmnB1m.js.map → dataScience-OXcwdk1p.js.map} +1 -1
  125. package/dist/dedupe-Cky1gSUu.js +21 -0
  126. package/dist/dedupe-Cky1gSUu.js.map +1 -0
  127. package/dist/dedupe-OSnnst2u.cjs +26 -0
  128. package/dist/dedupe-OSnnst2u.cjs.map +1 -0
  129. package/dist/developerPortal/index.cjs +1 -1
  130. package/dist/developerPortal/index.d.cts +2 -2
  131. package/dist/developerPortal/index.d.ts +2 -2
  132. package/dist/developerPortal/index.js +1 -1
  133. package/dist/developerPortal/types.d.cts +1 -1
  134. package/dist/developerPortal/types.d.ts +1 -1
  135. package/dist/{developerPortalClient-yHFTkKPb.js → developerPortalClient-B1QZ1rYi.js} +6 -8
  136. package/dist/{developerPortalClient-yHFTkKPb.js.map → developerPortalClient-B1QZ1rYi.js.map} +1 -1
  137. package/dist/{developerPortalClient-CutPqoAa.cjs → developerPortalClient-CLPpBksD.cjs} +6 -8
  138. package/dist/{developerPortalClient-CutPqoAa.cjs.map → developerPortalClient-CLPpBksD.cjs.map} +1 -1
  139. package/dist/domain/permissions/index.cjs +9 -30
  140. package/dist/domain/permissions/index.cjs.map +1 -1
  141. package/dist/domain/permissions/index.d.cts +29 -102
  142. package/dist/domain/permissions/index.d.ts +29 -102
  143. package/dist/domain/permissions/index.js +9 -30
  144. package/dist/domain/permissions/index.js.map +1 -1
  145. package/dist/domain/storageTable/index.d.cts +1 -1
  146. package/dist/domain/storageTable/index.d.ts +1 -1
  147. package/dist/editor/index.cjs +2 -2
  148. package/dist/editor/index.cjs.map +1 -1
  149. package/dist/editor/index.d.cts +2 -2
  150. package/dist/editor/index.d.ts +2 -2
  151. package/dist/editor/index.js +2 -2
  152. package/dist/editor/index.js.map +1 -1
  153. package/dist/editor/types.d.cts +1 -1
  154. package/dist/editor/types.d.ts +1 -1
  155. package/dist/encryption/index.cjs +2 -22
  156. package/dist/encryption/index.cjs.map +1 -1
  157. package/dist/encryption/index.d.cts +1 -1
  158. package/dist/encryption/index.d.ts +1 -1
  159. package/dist/encryption/index.js +2 -22
  160. package/dist/encryption/index.js.map +1 -1
  161. package/dist/encryption/types.d.cts +1 -1
  162. package/dist/encryption/types.d.ts +1 -1
  163. package/dist/import/index.cjs +1 -1
  164. package/dist/import/index.d.cts +3 -3
  165. package/dist/import/index.d.ts +3 -3
  166. package/dist/import/index.js +1 -1
  167. package/dist/{import-7YyyD_U_.cjs → import-CNk89mqy.cjs} +3 -3
  168. package/dist/{import-7YyyD_U_.cjs.map → import-CNk89mqy.cjs.map} +1 -1
  169. package/dist/{import-xliONVib.js → import-DiMQCzLa.js} +3 -3
  170. package/dist/{import-xliONVib.js.map → import-DiMQCzLa.js.map} +1 -1
  171. package/dist/{index-1r_CskjU.d.ts → index--ZpnE3YT.d.cts} +3 -3
  172. package/dist/{index-C77vTm2K.d.ts → index-BDZvaRud.d.ts} +6 -6
  173. package/dist/{index-KuQ79Mnz.d.ts → index-BVhHt5lx.d.cts} +18 -26
  174. package/dist/{index-NC1dXRTD.d.ts → index-BfqkgPGI.d.cts} +7 -13
  175. package/dist/{index-NC1dXRTD.d.cts → index-BfqkgPGI.d.ts} +7 -13
  176. package/dist/{index-V7XKUQm9.d.cts → index-BgR5zcjJ.d.ts} +18 -26
  177. package/dist/{index-GfKzh267.d.ts → index-BkqackZf.d.ts} +369 -297
  178. package/dist/{index-BK-qHT39.d.ts → index-ByRpNVcs.d.cts} +83 -17
  179. package/dist/{index-pXN4LWUX.d.ts → index-C11JSxBY.d.ts} +8 -11
  180. package/dist/{index-GjcJTCbz.d.cts → index-C4TNAA8-.d.cts} +8 -11
  181. package/dist/{index-DBklbaTp.d.cts → index-C8gRRWHL.d.cts} +3 -1
  182. package/dist/{index-DBklbaTp.d.ts → index-C8gRRWHL.d.ts} +3 -1
  183. package/dist/{index-3LUk2rpD.d.ts → index-CPu4Nezo.d.cts} +34 -9
  184. package/dist/{index-BMqLPS6S.d.ts → index-CXcWpZQ2.d.cts} +4 -12
  185. package/dist/{index-BMqLPS6S.d.cts → index-CXcWpZQ2.d.ts} +4 -12
  186. package/dist/{index-Dx52hNLP.d.cts → index-CcMHJcuP.d.cts} +3 -3
  187. package/dist/{index-DVw4Av4b.d.cts → index-Cvbjp3jx.d.cts} +6 -6
  188. package/dist/{index-DppA4k3b.d.cts → index-Cz0MXhzs.d.cts} +5 -5
  189. package/dist/{index-6Xe81qN3.d.ts → index-D-VMgpGc.d.ts} +5 -5
  190. package/dist/{index-DWf6FXOr.d.cts → index-D7-o-oGa.d.ts} +3 -3
  191. package/dist/{index-CWoEnDJ_.d.cts → index-DCRKjihs.d.ts} +83 -17
  192. package/dist/{kaiAgentClient-CHpULyeG.d.cts → index-DNThyEej.d.cts} +14 -5
  193. package/dist/{index-DXSmFkol.d.cts → index-DOAZmWvh.d.cts} +6 -6
  194. package/dist/{index-CHXnJQ9s.d.cts → index-DXYASsPP.d.cts} +369 -297
  195. package/dist/{index-BuegqrS1.d.ts → index-D_-4uQF8.d.ts} +3 -3
  196. package/dist/{index-CW3Pj7DY.d.cts → index-Dazy-meb.d.ts} +34 -9
  197. package/dist/{index-De5qUWhp.d.ts → index-DnQTuc6t.d.ts} +6 -6
  198. package/dist/{kaiAgentClient-B5L4gbQ1.d.ts → index-Qb7X6-ph.d.ts} +14 -5
  199. package/dist/index.cjs +1498 -901
  200. package/dist/index.cjs.map +1 -1
  201. package/dist/index.d.cts +7 -7
  202. package/dist/index.d.ts +7 -7
  203. package/dist/index.js +1497 -902
  204. package/dist/index.js.map +1 -1
  205. package/dist/isLoginPageRedirect-XPwAOKK3.js +14 -0
  206. package/dist/isLoginPageRedirect-XPwAOKK3.js.map +1 -0
  207. package/dist/isLoginPageRedirect-jQHiLrG7.cjs +19 -0
  208. package/dist/isLoginPageRedirect-jQHiLrG7.cjs.map +1 -0
  209. package/dist/{jobStatus-0_Y3Sr4i.cjs → jobStatus-BMlsyXWI.cjs} +19 -45
  210. package/dist/jobStatus-BMlsyXWI.cjs.map +1 -0
  211. package/dist/{jobStatus-PSZJMTiA.js → jobStatus-CfRtsIpv.js} +19 -45
  212. package/dist/jobStatus-CfRtsIpv.js.map +1 -0
  213. package/dist/kaiAgent/index.cjs +1 -1
  214. package/dist/kaiAgent/index.d.cts +3 -2
  215. package/dist/kaiAgent/index.d.ts +3 -2
  216. package/dist/kaiAgent/index.js +1 -1
  217. package/dist/kaiAgent/types.d.cts +2 -2
  218. package/dist/kaiAgent/types.d.ts +2 -2
  219. package/dist/{kaiAgent-CcT2oNip.js → kaiAgent-Dp20HLTh.js} +32 -11
  220. package/dist/kaiAgent-Dp20HLTh.js.map +1 -0
  221. package/dist/{kaiAgent-DaB6UCsh.cjs → kaiAgent-QNoeVKPs.cjs} +32 -11
  222. package/dist/kaiAgent-QNoeVKPs.cjs.map +1 -0
  223. package/dist/kaiMemory-CClSPInt.cjs +289 -0
  224. package/dist/kaiMemory-CClSPInt.cjs.map +1 -0
  225. package/dist/kaiMemory-D0Y_16U4.js +260 -0
  226. package/dist/kaiMemory-D0Y_16U4.js.map +1 -0
  227. package/dist/management/index.cjs +1 -1
  228. package/dist/management/index.d.cts +1 -1
  229. package/dist/management/index.d.ts +1 -1
  230. package/dist/management/index.js +1 -1
  231. package/dist/management/types.d.cts +2 -2
  232. package/dist/management/types.d.ts +2 -2
  233. package/dist/{management-DeZiQSlw.cjs → management-CCY0IYnq.cjs} +59 -24
  234. package/dist/management-CCY0IYnq.cjs.map +1 -0
  235. package/dist/{management-ckdnu1dA.js → management-DvmPiG64.js} +59 -24
  236. package/dist/management-DvmPiG64.js.map +1 -0
  237. package/dist/metastore/index.cjs +1 -1
  238. package/dist/metastore/index.d.cts +1 -1
  239. package/dist/metastore/index.d.ts +1 -1
  240. package/dist/metastore/index.js +1 -1
  241. package/dist/metastore/types.d.cts +2 -2
  242. package/dist/metastore/types.d.ts +2 -2
  243. package/dist/{metastore-B0PolCjQ.js → metastore-BycJxe7A.js} +14 -8
  244. package/dist/metastore-BycJxe7A.js.map +1 -0
  245. package/dist/{metastore-9AGrwjmN.cjs → metastore-XtWciCZT.cjs} +14 -8
  246. package/dist/metastore-XtWciCZT.cjs.map +1 -0
  247. package/dist/microsoftGraph/index.cjs +2 -2
  248. package/dist/microsoftGraph/index.d.cts +2 -2
  249. package/dist/microsoftGraph/index.d.ts +2 -2
  250. package/dist/microsoftGraph/index.js +2 -2
  251. package/dist/microsoftGraph/types.d.cts +1 -1
  252. package/dist/microsoftGraph/types.d.ts +1 -1
  253. package/dist/middleware-CBwrtgQd.js +34 -0
  254. package/dist/middleware-CBwrtgQd.js.map +1 -0
  255. package/dist/middleware-IjYx3d5u.cjs +45 -0
  256. package/dist/middleware-IjYx3d5u.cjs.map +1 -0
  257. package/dist/notifications/index.cjs +4 -4
  258. package/dist/notifications/index.d.cts +2 -2
  259. package/dist/notifications/index.d.ts +2 -2
  260. package/dist/notifications/index.js +4 -4
  261. package/dist/notifications/types.d.cts +1 -1
  262. package/dist/notifications/types.d.ts +1 -1
  263. package/dist/oauth/index.cjs +1 -1
  264. package/dist/oauth/index.d.cts +2 -2
  265. package/dist/oauth/index.d.ts +2 -2
  266. package/dist/oauth/index.js +1 -1
  267. package/dist/oauth/types.d.cts +1 -1
  268. package/dist/oauth/types.d.ts +1 -1
  269. package/dist/{oauth-DNtv4Ihb.cjs → oauth--2p8jkJf.cjs} +5 -5
  270. package/dist/{oauth-DNtv4Ihb.cjs.map → oauth--2p8jkJf.cjs.map} +1 -1
  271. package/dist/{oauth-BnHVf4cB.js → oauth-l5zE39cD.js} +5 -5
  272. package/dist/{oauth-BnHVf4cB.js.map → oauth-l5zE39cD.js.map} +1 -1
  273. package/dist/omnisearch/index.cjs +6 -14
  274. package/dist/omnisearch/index.cjs.map +1 -1
  275. package/dist/omnisearch/index.d.cts +6 -14
  276. package/dist/omnisearch/index.d.ts +6 -14
  277. package/dist/omnisearch/index.js +6 -14
  278. package/dist/omnisearch/index.js.map +1 -1
  279. package/dist/omnisearch/types.d.cts +1 -1
  280. package/dist/omnisearch/types.d.ts +1 -1
  281. package/dist/{project-DCHOxRWd.d.ts → project-B15gStbM.d.ts} +2 -2
  282. package/dist/{project-BRpzv3yE.d.cts → project-cHKuGvqJ.d.cts} +2 -2
  283. package/dist/queryService/index.cjs +1 -1
  284. package/dist/queryService/index.d.cts +1 -1
  285. package/dist/queryService/index.d.ts +1 -1
  286. package/dist/queryService/index.js +1 -1
  287. package/dist/queryService/types.d.cts +1 -1
  288. package/dist/queryService/types.d.ts +1 -1
  289. package/dist/{queryService-j3XZ2mX6.js → queryService-CCOYbRbw.js} +6 -6
  290. package/dist/{queryService-j3XZ2mX6.js.map → queryService-CCOYbRbw.js.map} +1 -1
  291. package/dist/{queryService-BVwD6Vmc.cjs → queryService-CQzclHdL.cjs} +6 -6
  292. package/dist/{queryService-BVwD6Vmc.cjs.map → queryService-CQzclHdL.cjs.map} +1 -1
  293. package/dist/queue/index.cjs +1 -1
  294. package/dist/queue/index.d.cts +3 -3
  295. package/dist/queue/index.d.ts +3 -3
  296. package/dist/queue/index.js +1 -1
  297. package/dist/queue/types.d.cts +1 -1
  298. package/dist/queue/types.d.ts +1 -1
  299. package/dist/{queue-Dagl0sdP.js → queue-Cowbg6bR.js} +8 -11
  300. package/dist/queue-Cowbg6bR.js.map +1 -0
  301. package/dist/{queue-e3rMWbmK.cjs → queue-UG_BWKIC.cjs} +8 -11
  302. package/dist/queue-UG_BWKIC.cjs.map +1 -0
  303. package/dist/scheduler/index.cjs +4 -4
  304. package/dist/scheduler/index.d.cts +2 -2
  305. package/dist/scheduler/index.d.ts +2 -2
  306. package/dist/scheduler/index.js +4 -4
  307. package/dist/scheduler/types.d.cts +1 -1
  308. package/dist/scheduler/types.d.ts +1 -1
  309. package/dist/sdk/configurations/index.cjs +1 -1
  310. package/dist/sdk/configurations/index.d.cts +11 -11
  311. package/dist/sdk/configurations/index.d.ts +11 -11
  312. package/dist/sdk/configurations/index.js +1 -1
  313. package/dist/sdk/developerPortal/index.cjs +10 -18
  314. package/dist/sdk/developerPortal/index.cjs.map +1 -1
  315. package/dist/sdk/developerPortal/index.d.cts +7 -15
  316. package/dist/sdk/developerPortal/index.d.ts +7 -15
  317. package/dist/sdk/developerPortal/index.js +7 -15
  318. package/dist/sdk/developerPortal/index.js.map +1 -1
  319. package/dist/sdk/kaiMemory/index.cjs +7 -0
  320. package/dist/sdk/kaiMemory/index.d.cts +41 -0
  321. package/dist/sdk/kaiMemory/index.d.ts +41 -0
  322. package/dist/sdk/kaiMemory/index.js +2 -0
  323. package/dist/sdk/kaiMemory/types.cjs +0 -0
  324. package/dist/sdk/kaiMemory/types.d.cts +2 -0
  325. package/dist/sdk/kaiMemory/types.d.ts +2 -0
  326. package/dist/sdk/kaiMemory/types.js +1 -0
  327. package/dist/sdk/queryService/index.cjs +2 -2
  328. package/dist/sdk/queryService/index.d.cts +1 -1
  329. package/dist/sdk/queryService/index.d.ts +1 -1
  330. package/dist/sdk/queryService/index.js +2 -2
  331. package/dist/sdk/semanticLayer/index.cjs +1 -1
  332. package/dist/sdk/semanticLayer/index.d.cts +16 -40
  333. package/dist/sdk/semanticLayer/index.d.ts +16 -40
  334. package/dist/sdk/semanticLayer/index.js +1 -1
  335. package/dist/sdk/semanticLayer/types.d.cts +1 -1
  336. package/dist/sdk/semanticLayer/types.d.ts +1 -1
  337. package/dist/sdk/storage/index.cjs +0 -5
  338. package/dist/sdk/storage/index.cjs.map +1 -1
  339. package/dist/sdk/storage/index.d.cts +2 -2
  340. package/dist/sdk/storage/index.d.ts +2 -2
  341. package/dist/sdk/storage/index.js +1 -5
  342. package/dist/sdk/storage/index.js.map +1 -1
  343. package/dist/sdk/tag/index.cjs +1 -1
  344. package/dist/sdk/tag/index.d.cts +3 -3
  345. package/dist/sdk/tag/index.d.ts +3 -3
  346. package/dist/sdk/tag/index.js +1 -1
  347. package/dist/sdk/tag/types.d.cts +1 -1
  348. package/dist/sdk/tag/types.d.ts +1 -1
  349. package/dist/sdk/vault/index.cjs +1 -1
  350. package/dist/sdk/vault/index.d.cts +1 -1
  351. package/dist/sdk/vault/index.d.ts +1 -1
  352. package/dist/sdk/vault/index.js +1 -1
  353. package/dist/{semanticLayer-9uTaU7UT.cjs → semanticLayer-CKDVkU56.cjs} +62 -183
  354. package/dist/semanticLayer-CKDVkU56.cjs.map +1 -0
  355. package/dist/{semanticLayer-6_gtFxDu.js → semanticLayer-pYy082Ju.js} +62 -183
  356. package/dist/semanticLayer-pYy082Ju.js.map +1 -0
  357. package/dist/status/index.cjs +1 -1
  358. package/dist/status/index.d.cts +1 -1
  359. package/dist/status/index.d.ts +1 -1
  360. package/dist/status/index.js +1 -1
  361. package/dist/storage/index.cjs +5 -5
  362. package/dist/storage/index.d.cts +2 -2
  363. package/dist/storage/index.d.ts +2 -2
  364. package/dist/storage/index.js +5 -5
  365. package/dist/storage/types.d.cts +2 -2
  366. package/dist/storage/types.d.ts +2 -2
  367. package/dist/{storage-Ob1LUIDq.js → storage-CZQHZcXG.js} +109 -302
  368. package/dist/storage-CZQHZcXG.js.map +1 -0
  369. package/dist/{storage-HFUdEy7P.cjs → storage-JinL1y1s.cjs} +109 -302
  370. package/dist/storage-JinL1y1s.cjs.map +1 -0
  371. package/dist/stream/index.cjs +3 -3
  372. package/dist/stream/index.d.cts +2 -2
  373. package/dist/stream/index.d.ts +2 -2
  374. package/dist/stream/index.js +3 -3
  375. package/dist/stream/types.d.cts +1 -1
  376. package/dist/stream/types.d.ts +1 -1
  377. package/dist/syncActions/index.cjs +1 -1
  378. package/dist/syncActions/index.d.cts +1 -1
  379. package/dist/syncActions/index.d.ts +1 -1
  380. package/dist/syncActions/index.js +1 -1
  381. package/dist/syncActions/types.d.cts +2 -2
  382. package/dist/syncActions/types.d.ts +2 -2
  383. package/dist/{syncActions-B3NS5a0g.js → syncActions-BmmoqZO_.js} +130 -111
  384. package/dist/syncActions-BmmoqZO_.js.map +1 -0
  385. package/dist/{syncActions-D2DhY6pP.cjs → syncActions-CtcLGQiy.cjs} +130 -111
  386. package/dist/syncActions-CtcLGQiy.cjs.map +1 -0
  387. package/dist/{tag-CsoOZWB_.cjs → tag-DHS_soa7.cjs} +2 -2
  388. package/dist/{tag-CsoOZWB_.cjs.map → tag-DHS_soa7.cjs.map} +1 -1
  389. package/dist/{tag-DCsoewjL.js → tag-hh-1nhNr.js} +2 -2
  390. package/dist/{tag-DCsoewjL.js.map → tag-hh-1nhNr.js.map} +1 -1
  391. package/dist/telemetry/index.cjs +7 -11
  392. package/dist/telemetry/index.cjs.map +1 -1
  393. package/dist/telemetry/index.d.cts +5 -9
  394. package/dist/telemetry/index.d.ts +5 -9
  395. package/dist/telemetry/index.js +7 -11
  396. package/dist/telemetry/index.js.map +1 -1
  397. package/dist/telemetry/types.d.cts +1 -1
  398. package/dist/telemetry/types.d.ts +1 -1
  399. package/dist/{types-DqxIx9Pi.d.cts → types-6kuMW4JW.d.cts} +2 -2
  400. package/dist/{types-Ct0YPy2w.d.ts → types-B2w2TtSA.d.ts} +3 -3
  401. package/dist/{types-M46WuBSm.d.cts → types-B61aCifg.d.cts} +2 -2
  402. package/dist/{types-COL1kVEB.d.cts → types-B8N_k79M.d.cts} +2 -2
  403. package/dist/{types-Jw10xuOW.d.cts → types-BIECJYun.d.ts} +171 -44
  404. package/dist/{types-DZk3XHiN.d.cts → types-BLNB882w.d.cts} +3 -3
  405. package/dist/{types-BEe50G2r.d.cts → types-BPy5Ozee.d.cts} +2 -2
  406. package/dist/{types-gi4Eay19.d.ts → types-BS4jwuMi.d.ts} +7 -15
  407. package/dist/{types-BrYkBQo4.d.ts → types-BTK7Bv3n.d.cts} +171 -44
  408. package/dist/{types-DYzJ6K2e.d.ts → types-BYM9Ptz5.d.ts} +93 -43
  409. package/dist/{types-D6UmMa6E.d.ts → types-BZDV8DZk.d.ts} +3 -3
  410. package/dist/{types-Cz83RiVu.d.cts → types-B_iLJlp4.d.ts} +255 -12
  411. package/dist/{types-CmF3pR2n.d.cts → types-BiMahEK8.d.cts} +91 -237
  412. package/dist/{types-BH5LLeJy.d.ts → types-Bl03Cg2n.d.cts} +255 -12
  413. package/dist/{types-bGQb4Jtl.d.cts → types-ByLH46Dt.d.cts} +13 -8
  414. package/dist/{types-g3vU7hcg.d.cts → types-Bydx6ga_.d.cts} +2 -2
  415. package/dist/{types-CW6lCqrC.d.cts → types-CFeZCQ9p.d.cts} +93 -43
  416. package/dist/{types-B95uNQ9o.d.ts → types-CKmTZSPG.d.ts} +91 -237
  417. package/dist/{types-D_j2Uq5X.d.cts → types-CMzQSHAQ.d.cts} +3 -3
  418. package/dist/{types-N3EChotg.d.cts → types-CP_LBmw3.d.cts} +2 -2
  419. package/dist/{types-zZBxJ0P-.d.ts → types-CWyXTMwy.d.ts} +2 -2
  420. package/dist/{types-CPB-eF82.d.ts → types-CZJlLCbA.d.ts} +2 -2
  421. package/dist/{types-l9o4gFsI.d.ts → types-CZXPu3gn.d.ts} +2 -2
  422. package/dist/{types-BztF4HeB.d.ts → types-CaOtNjSZ.d.ts} +6 -13
  423. package/dist/{types-BTWIPEiU.d.ts → types-CfwqVkEA.d.ts} +2 -2
  424. package/dist/types-Cg14ncdV.d.ts +63 -0
  425. package/dist/{types-BsxLGDoC.d.cts → types-CoJVrRAD.d.ts} +2 -2
  426. package/dist/{types-CKiW3n6v.d.ts → types-D3wcs4tp.d.ts} +2 -2
  427. package/dist/{types-DOyNe7oe.d.cts → types-DDOa07rU.d.cts} +7 -15
  428. package/dist/{types-BW2BXUB4.d.cts → types-DE9hgr7i.d.cts} +2 -2
  429. package/dist/{types-BOqD3Hqy.d.cts → types-DEzW1CfI.d.cts} +3 -3
  430. package/dist/{types-OaD-cbbl.d.ts → types-DIiOMV-t.d.ts} +3 -3
  431. package/dist/{types-B-P4vQe0.d.cts → types-DKc1gmd9.d.ts} +857 -131
  432. package/dist/{types-BrPlv-NS.d.ts → types-DRCMBt89.d.ts} +3 -3
  433. package/dist/{types-BQvv4RaI.d.cts → types-DUMal2E-.d.cts} +5 -8
  434. package/dist/types-DWiLcrxt.d.cts +63 -0
  435. package/dist/{types-DNxOHnZI.d.cts → types-Dd31Lw4S.d.cts} +2 -2
  436. package/dist/{types-Dmu-8g4O.d.ts → types-DekYAlA-.d.ts} +3 -3
  437. package/dist/{types-B2U9cFcx.d.ts → types-DgJeO9Nd.d.ts} +2 -2
  438. package/dist/{types-nrviNdzZ.d.ts → types-DicSaNwq.d.ts} +2 -2
  439. package/dist/{types-Crhy0c9m.d.cts → types-DinIJ1D_.d.cts} +40 -11
  440. package/dist/{types-DhDNS-5B.d.ts → types-DlQw6FCi.d.ts} +13 -8
  441. package/dist/{types-_RhBCj4_.d.cts → types-DoZtE9tz.d.cts} +3 -3
  442. package/dist/{types-Bxhh2SJr.d.ts → types-DrvKfXXd.d.cts} +2 -2
  443. package/dist/{types-DPl8pZsY.d.ts → types-Dtuvhm3K.d.cts} +857 -131
  444. package/dist/{types-CcrvrAJX.d.ts → types-DwVSj-Da.d.ts} +5 -8
  445. package/dist/{types-C2vefB4D.d.ts → types-FwRmjsNN.d.ts} +10 -34
  446. package/dist/{types-C0_2KZ-A.d.ts → types-RbrfiY8T.d.ts} +2 -2
  447. package/dist/{types-DfvdbRPL.d.ts → types-WZBztugL.d.ts} +2 -2
  448. package/dist/{types-52irAt99.d.cts → types-YHUEArkR.d.cts} +2 -2
  449. package/dist/{types-fX4gbxfV.d.cts → types-bc-4z_gc.d.cts} +10 -34
  450. package/dist/{types-3eUgOA7I.d.cts → types-ePSqbXRr.d.cts} +6 -13
  451. package/dist/{types-DrqKICcK.d.ts → types-n4PTnLii.d.ts} +40 -11
  452. package/dist/{types-DXskkNp8.d.cts → types-pvQzbgNE.d.cts} +3 -3
  453. package/dist/{types-DajzGOKB.d.ts → types-q-1r_9d1.d.ts} +2 -2
  454. package/dist/{types-D8Rrz51O.d.cts → types-tKkeLa2B.d.cts} +2 -2
  455. package/dist/{validateConnectionStatus-828HV8WL.js → validateConnectionStatus-BEGu8wXT.js} +6 -10
  456. package/dist/validateConnectionStatus-BEGu8wXT.js.map +1 -0
  457. package/dist/{validateConnectionStatus-CvBKyeDO.cjs → validateConnectionStatus-BEYkQpu9.cjs} +6 -10
  458. package/dist/validateConnectionStatus-BEYkQpu9.cjs.map +1 -0
  459. package/dist/vault/index.cjs +4 -4
  460. package/dist/vault/index.d.cts +1 -1
  461. package/dist/vault/index.d.ts +1 -1
  462. package/dist/vault/index.js +4 -4
  463. package/dist/vault/types.d.cts +1 -1
  464. package/dist/vault/types.d.ts +1 -1
  465. package/package.json +32 -4
  466. package/surface/apps.md +3 -3
  467. package/surface/auth.md +13 -6
  468. package/surface/chat.md +6 -6
  469. package/surface/kaiAgent.md +9 -8
  470. package/surface/management.md +14 -5
  471. package/surface/metastore.md +2 -2
  472. package/surface/queue.md +3 -3
  473. package/surface/sdk.md +13 -3
  474. package/surface/storage.md +6 -6
  475. package/surface/syncActions.md +9 -0
  476. package/dist/ValidationError-BekhphAq.js +0 -48
  477. package/dist/ValidationError-BekhphAq.js.map +0 -1
  478. package/dist/ValidationError-CLVJCCwH.cjs.map +0 -1
  479. package/dist/authClient-8yU1last.cjs.map +0 -1
  480. package/dist/authClient-BTo4Afm6.js.map +0 -1
  481. package/dist/concurrent-CH9fbNr3.js.map +0 -1
  482. package/dist/concurrent-tbiIa0UL.cjs.map +0 -1
  483. package/dist/configurations-BVvcimzo.js.map +0 -1
  484. package/dist/configurations-CyFF9Dtu.cjs.map +0 -1
  485. package/dist/configurations-VtNE0nrT.js.map +0 -1
  486. package/dist/configurations-zkNjr73Q.cjs.map +0 -1
  487. package/dist/createFetchClient-BlgPbjFj.cjs.map +0 -1
  488. package/dist/createFetchClient-C-cadpBx.js.map +0 -1
  489. package/dist/credential-CAulvfZ-.cjs +0 -47
  490. package/dist/credential-CAulvfZ-.cjs.map +0 -1
  491. package/dist/credential-DWXbo4IX.js +0 -36
  492. package/dist/credential-DWXbo4IX.js.map +0 -1
  493. package/dist/dedupe-CiskLkGR.cjs +0 -30
  494. package/dist/dedupe-CiskLkGR.cjs.map +0 -1
  495. package/dist/dedupe-DYIHgZoG.js +0 -25
  496. package/dist/dedupe-DYIHgZoG.js.map +0 -1
  497. package/dist/isLoginPageRedirect-Cm6Pn8Pj.cjs +0 -25
  498. package/dist/isLoginPageRedirect-Cm6Pn8Pj.cjs.map +0 -1
  499. package/dist/isLoginPageRedirect-hyPqyWNX.js +0 -20
  500. package/dist/isLoginPageRedirect-hyPqyWNX.js.map +0 -1
  501. package/dist/jobStatus-0_Y3Sr4i.cjs.map +0 -1
  502. package/dist/jobStatus-PSZJMTiA.js.map +0 -1
  503. package/dist/kaiAgent-CcT2oNip.js.map +0 -1
  504. package/dist/kaiAgent-DaB6UCsh.cjs.map +0 -1
  505. package/dist/management-DeZiQSlw.cjs.map +0 -1
  506. package/dist/management-ckdnu1dA.js.map +0 -1
  507. package/dist/metastore-9AGrwjmN.cjs.map +0 -1
  508. package/dist/metastore-B0PolCjQ.js.map +0 -1
  509. package/dist/queue-Dagl0sdP.js.map +0 -1
  510. package/dist/queue-e3rMWbmK.cjs.map +0 -1
  511. package/dist/semanticLayer-6_gtFxDu.js.map +0 -1
  512. package/dist/semanticLayer-9uTaU7UT.cjs.map +0 -1
  513. package/dist/storage-HFUdEy7P.cjs.map +0 -1
  514. package/dist/storage-Ob1LUIDq.js.map +0 -1
  515. package/dist/syncActions-B3NS5a0g.js.map +0 -1
  516. package/dist/syncActions-D2DhY6pP.cjs.map +0 -1
  517. package/dist/validateConnectionStatus-828HV8WL.js.map +0 -1
  518. package/dist/validateConnectionStatus-CvBKyeDO.cjs.map +0 -1
package/AGENTS.md CHANGED
@@ -17,8 +17,13 @@ pnpm type-check --filter=@keboola/api-client # tsc --noEmit
17
17
  pnpm --filter @keboola/api-client gen:types --list # What can be regenerated
18
18
  pnpm --filter @keboola/api-client gen:types storage # One service — leaves the rest alone
19
19
  pnpm --filter @keboola/api-client gen:types # Every API in redocly.yaml
20
+ pnpm --filter @keboola/api-client gen:types:drift # Which schemas no longer match their service
20
21
  ```
21
22
 
23
+ `gen:types:drift` is what the weekly **api-client Weekly OpenAPI Drift** lane runs; it writes into
24
+ the working tree to diff, so discard afterwards. See
25
+ [`docs/regenerate-api-types.md`](./docs/regenerate-api-types.md).
26
+
22
27
  ## Getting a client
23
28
 
24
29
  **React (the common case).** In `apps/kbc-ui` and other React apps, use `useApiClient()` from [`@keboola/api-client-react`](../api-client-react/AGENTS.md) — it returns the flow-agnostic `api` (auth + management + product namespaces). At startup an auth provider (`LegacyAuthProvider` for SAPI, `AuthProvider` for bearer) drives the module-load singleton's `session` to ready and renders a fallback until then; `ApiClientProvider` propagates that `api` to the tree. Don't create a client per component.
@@ -34,7 +39,7 @@ const { data } = useQuery({
34
39
  **Scripts / CLIs / non-React.** Create one directly — pick the smallest that covers you:
35
40
 
36
41
  - **`createStorageClient`** — Storage-only. Needs only `baseUrl` + `token`, skipping the stack-info round-trip. Start here when in doubt; upgrading later is mechanical, downgrading is not. (React apps still get their client via `ApiClientProvider` + `useApiClient()` — see above; this section is about the non-React/single-service case.)
37
- - **`createLegacyKeboola` / `createKeboola`** — full SDK across all stack services. Each returns `{ api, session }`; drive the `session` to ready, then use `api`. Bootstrap (`getStackInfo` + `tokens.verify()` to discover services against the actual stack) runs while the storage build resolves, after which `api.context` is synchronous. Every stack service — including `metastore` — is resolved from the stack's advertised service URLs. See the lifecycle section below for the per-flow `session` verbs. The token-less public clients `createAssetsClient` / `createStatusClient` are **not** part of this — import them directly from `@keboola/api-client/assets` and `@keboola/api-client/status`.
42
+ - **`createLegacyKeboola` / `createKeboola`** — full SDK across all stack services. `createLegacyKeboola` returns `{ api, session }` and `createKeboola` returns `{ session, getActiveApi, getApi }`; drive the `session` to ready, then use the product surface. Bootstrap (`getStackInfo` + `tokens.verify()` to discover services against the actual stack) runs while the storage build resolves, after which `api.context` is synchronous. Every stack service — including `metastore` — is resolved from the stack's advertised service URLs. See the lifecycle section below for the per-flow `session` verbs. The token-less public clients `createAssetsClient` / `createStatusClient` are **not** part of this — import them directly from `@keboola/api-client/assets` and `@keboola/api-client/status`.
38
43
 
39
44
  **`clients/` also holds clients for third-party APIs the platform talks to directly** (`microsoftGraph` today): a vendor API is still HTTP that must run through the shared fetch client, its middleware chain and its error guards, so it gets a client here rather than a hand-rolled `fetch` in the consuming app. They differ from stack clients in three ways, and a new one should follow the same rules: **never** registered in `createServiceClients.ts` (they are not stack services, so they must not appear on `api.*`), they default their own `baseUrl` (a vendor's host and version prefix are part of its API contract, not something we discover or configure), and they carry no `healthCheck` (we don't own the service's liveness). Consumers construct them directly from the sub-path, like the token-less clients above.
40
45
 
@@ -61,10 +66,11 @@ const buckets = await api.storage.buckets.getBuckets();
61
66
 
62
67
  ## Lifecycle & auth (the stateful client)
63
68
 
64
- Two flow-specific factories back the SDK, and **both return `{ api, session }`**:
69
+ Two flow-specific factories back the SDK:
65
70
 
66
- - `createKeboola(opts?)` — the **bearer (OAuth)** flow.
67
- - `createLegacyKeboola(opts?)` — the **legacy (SAPI-token)** flow.
71
+ - `createKeboola({ defaultBaseUrl, … })` — the **bearer (OAuth)** flow. Returns `{ session, getActiveApi, getApi }`;
72
+ `getActiveApi()` is the scoped product surface, `getApi(projectId)` a pinned one (see below).
73
+ - `createLegacyKeboola(opts?)` — the **legacy (SAPI-token)** flow. Returns `{ api, session }`.
68
74
 
69
75
  `api` is the same **flow-agnostic** product surface for both — a state-gating proxy:
70
76
 
@@ -73,13 +79,20 @@ Two flow-specific factories back the SDK, and **both return `{ api, session }`**
73
79
  - **`api.storage` / `api.queue` / `api.context` / `api.sdk` / …** — product namespaces, live only once
74
80
  the async storage build reaches `ready` (throw `KeboolaError` (`NotReady`) before that).
75
81
 
76
- `session` is **flow-specific** lifecycle machinery. Both share `setBaseUrl`, `isStorageReady()`,
77
- `subscribe(cb)` (fires on config **and** storage-build transitions), and `debug()`. Then:
78
-
79
- - bearer: `authenticate(token)` → `setProject(projectId)` / `setProjectAsync(projectId)` (awaits the
80
- build) / `forProject(projectId)` (a second project alongside the first) / `reset()`.
81
- - legacy: `authenticateStorage(sapiToken)` / `authenticateStorageAsync(sapiToken)` (awaits the build),
82
- `authenticateManagement(manageToken)`.
82
+ `session` is **flow-specific** lifecycle machinery:
83
+
84
+ - bearer: `stack.select(baseUrl)` → `auth.authenticate(credential)` → `project.select(projectId)`,
85
+ plus `auth.signOut()` / `auth.replace(credential)` / `auth.isAuthenticated()` / `auth.isAuthenticatedAsync()` / `auth.rotate(baseUrl)` / `auth.getHeaders(projectId?)`, `stack.close` and
86
+ the two `deactivate`s, and `getState()` / `subscribe(cb)` over the stack-and-project table. Every
87
+ verb is synchronous — nothing awaits a build; a namespace throws `NotReady` until its fetch lands.
88
+ The one fetch each entry does own is readable both ways: `stack.getContext(baseUrl?)` /
89
+ `project.getContext(entryId?)` answer from cache (`null` until it lands), and the
90
+ `getContextAsync` sibling of each awaits it. `retryContext` refetches after a failure. The
91
+ project trio keys by `${baseUrl}#${projectId}` — a row on any stack — where `getApi` and
92
+ `auth.getHeaders` take a bare project id and address the active stack.
93
+ - legacy: `setBaseUrl`, `authenticateStorage(sapiToken)` / `authenticateStorageAsync(sapiToken)`
94
+ (awaits the build), `authenticateManagement(manageToken)`, `isStorageReady()`, `subscribe(cb)`
95
+ (fires on config **and** storage-build transitions) and `debug()`.
83
96
 
84
97
  ```ts
85
98
  // Legacy (SAPI token in hand): one step to ready
@@ -88,92 +101,86 @@ await session.authenticateStorageAsync(token);
88
101
  const buckets = await api.storage.buckets.getBuckets(defaultBranchId);
89
102
 
90
103
  // Bearer (OAuth) login flow (browser)
91
- const { api, session } = createKeboola({ baseUrl });
92
- await api.auth.login({ email, password }); // → carries the bearer token
93
- const projects = await api.auth.getProjects(); // introspect → picker
94
- await session.authenticate(bearerToken);
95
- await session.setProjectAsync(projects[0].id); // → ready
96
- session.setProject(otherId); // runtime re-scope (rebuilds against the new project)
97
-
98
- session.debug(); // { baseUrl, authReady, managementReady, storage, config }
104
+ const { session, getActiveApi } = createKeboola({ defaultBaseUrl: baseUrl }); // `auth` is live now
105
+ const result = await getActiveApi().auth.login.withPassword({ email, password });
106
+ if (!result.mfaRequired) session.auth.authenticate({ type: 'token', ...result });
107
+ session.project.select(projectId); // → the scope `getActiveApi()` addresses
99
108
  ```
100
109
 
101
110
  ### Several projects at once (bearer)
102
111
 
103
- One session can address any number of projects. The credential is a **user** token — project scope is
104
- one header, `X-KBC-ProjectId` — so `session.forProject(projectId)` builds a `ProjectClients` set for
105
- any project the user can reach, off the session already in hand:
112
+ One credential reaches every project on its stack — project scope is one header, `X-KBC-ProjectId` —
113
+ so `getApi(projectId)` hands out a product surface per project, off the client already in hand:
106
114
 
107
115
  ```ts
108
- const { api, session } = createKeboola({ baseUrl });
109
- const result = await api.auth.login.withPassword({ email, password });
110
- if (!result.mfaRequired) session.authenticate(result); // a TokenSet, not a token string
111
- await session.setProjectAsync(42); // the session's scope — this is what `api.*` addresses
116
+ const { session, getActiveApi, getApi } = createKeboola({ defaultBaseUrl: baseUrl });
117
+ session.auth.authenticate(credential);
118
+ session.project.select(42);
119
+
120
+ const api = getActiveApi(); // the scoped project, 42
121
+ const other = getApi(7); // project 7, opened by the call
112
122
 
113
- const other = await session.forProject(7); // a second project, alongside the first
114
123
  const [mine, theirs] = await Promise.all([
115
- api.storage.buckets.getBuckets({ branchId: 'default' }), // project 42
116
- other.storage.buckets.getBuckets({ branchId: 'default' }), // project 7
124
+ api.storage.buckets.getBuckets({ branchId: 'default' }),
125
+ other.storage.buckets.getBuckets({ branchId: 'default' }),
117
126
  ]);
118
127
  ```
119
128
 
120
- `setProjectAsync` **moves** the session (and `api`) to another project; `forProject` **adds** one. Use
121
- `setProjectAsync` for the project the app is centred on, and `forProject` for every other project it
122
- reads alongside — the returned clients are yours to hold and never appear on `api`.
123
-
124
- - **One credential, one refresh loop.** Every set shares the session's auth middleware, so a token
125
- rotation happens once and serves all of them.
126
- - **Repeat calls are cheap** — a project is bootstrapped once and concurrent callers share that one
127
- build. A failed build is retryable.
128
- - **A project you cannot reach fails the build, not the session.** Connection answers a denied or
129
- nonexistent project with the same `invalid_token` 401 as a revoked token — bearer failures are
130
- collapsed deliberately, so scope cannot be probed. `forProject` is the only surface taking a
131
- caller-supplied id, so it reads a 401 that survives a token rotation as being about the project:
132
- the build rejects with the underlying `ApiError` and the session stays signed in. A credential that
133
- really is dead still signs you out — the refresh itself 401s, which is unambiguous.
134
- - **Independent of the scope**, in both directions: re-scoping the session never redirects a set
135
- someone holds, and `forProject(scopedProject)` builds a _second_ set rather than reusing `api`'s.
136
- For the project the app is centred on, use `api.*`.
137
- - **Nothing extra is persisted.** Storage still holds one entry, `{ baseUrl, projectId, refreshToken }`
138
- — and that `projectId` is the _scope_. The extra projects are runtime state; re-add them on startup.
139
- - **`reset()` really is a teardown.** Every set is pinned to the sign-in that built it, so one held
140
- across a sign-out throws `KeboolaError` (`NotAuthenticated`) on its next request instead of quietly
141
- acting as whoever signed in after. Ask again for a fresh one. `clearProject()` drops the scope, not
142
- the credential, so it leaves the extra projects alone.
143
-
144
- The pin is not specific to `forProject`: **anything that emits this session's credential is bound to
145
- the sign-in it was built on** — `api.storage`, `api.context`, `api.management`,
146
- `session.getAuthHeaders()` and `session.restore()` included. The auth middleware holds no token, it
147
- reads the credential live, so rebuilding a store on sign-out only stops new reads; a request already
148
- in flight would otherwise complete as the next user, still stamped with the previous project.
149
- `api.auth` is built once per stack and serves every session, so it pins each _request_ to the sign-in
150
- that started it rather than to its build — enough to stop a 401 recovery from replaying as the next
151
- user, and the next session's `login` runs unstamped either way. The guard wraps the **credential**,
152
- not just the outgoing request: the 401 path rotates the token by calling the credential directly, and
153
- a straggler from a dead session would otherwise spend the live session's single-use refresh token —
154
- and sign that session out if the rotation itself came back 401. Anything new that takes the auth
155
- middleware, or hands the credential to a transport we don't own, needs the same pin — see
156
- `createPinnedAuthMiddleware` / `pinToSession` in `bearer/keboola.ts`.
157
-
158
- **The pin has to cover the failure branches, not only the happy path** — that is where it keeps being
159
- missed. Two shapes:
160
-
161
- - **Anything that re-invokes `next` goes _inside_ the pin**, via `createPinnedAuthMiddleware`'s
162
- `inner`, never beside it in the middleware array. The array's first element is the outermost one,
163
- so a retry placed there re-enters the pin per attempt — and where the epoch is read per request
164
- (`api.auth`) every attempt re-pins to whoever is signed in by then. A 503 backoff is long enough
165
- for a sign-out to land in.
166
- - **A rotation or a restore that _fails_ after its session ended must be re-labelled before the
167
- error travels on.** A raw 401 is read as "this credential is dead" by `credential.ts` and as "the
168
- stored token is dead" by `restore()`, and both then act on the session that replaced it — signing
169
- it out, or clearing the storage entry it just wrote. Compare the epoch in the `catch` as well as
170
- after the `await`.
171
-
172
- ⚠️ **A second `createKeboola()` is not the way to reach a second project — it signs you out of both.**
173
- Both instances hold the same single-use refresh token, and refresh _rotates_ it, with two-phase
174
- rotation and replay detection on the server. Whichever instance rotates first invalidates the other's
175
- token, whose next refresh 401s and signs it out. This is a functional break, not a style preference,
176
- and it does not depend on a `storage` adapter being configured.
129
+ Both return the same `KeboolaApi`, and both are synchronous and lazy: the surface resolves per
130
+ property read, so a namespace throws `KeboolaError` (`NotReady`) until that project's context fetch
131
+ lands, exactly as the scoped one does.
132
+
133
+ **The method is the lifetime, and that is the whole difference:**
134
+
135
+ - **`getActiveApi()` follows the scope.** It re-points when `session.project.select` moves, so a
136
+ component holding it sees the new project. This is the handle an app is centred on, and what
137
+ `ApiClientProvider` propagates to `useApiClient()`.
138
+ - **`getApi(7)` is pinned.** It never re-points, and it stops working when project 7 closes — by
139
+ `session.project.close(7)`, or by a sign-out, which closes every project on the stack. A handle
140
+ held across either throws `No project "…"` on its next read rather than quietly serving whoever
141
+ signed in after. Ask for a fresh one.
142
+
143
+ Three things follow from that, worth knowing before you hold one:
144
+
145
+ - **`getApi(7)` opens project 7**, which starts its context fetch and persists the row — so the
146
+ project comes back on reload, alongside the scoped one. **Close it when you are done with it**
147
+ (`session.project.close(7)`), or the set only grows and every reload re-fetches all of it. The
148
+ open is attempted, not required: asked for before the sign-in lands, the handle comes back
149
+ anyway and its reads throw until the row exists. It resolves against the **active stack at call
150
+ time** and pins the result; nothing follows a later `session.stack.select`.
151
+ - **One credential, one refresh loop.** Every handle shares the stack's auth middleware, which reads
152
+ the credential live, so a rotation happens once and serves all of them. `auth` and `management`
153
+ answer for the stack the handle's project sits on, not for whatever stack is active.
154
+ - **A project you cannot reach fails the request, not the session.** Connection answers a denied or
155
+ nonexistent project with the same `invalid_token` 401 as a revoked token — collapsed deliberately,
156
+ so scope cannot be probed. So a 401 is never read as expiry: the project's row goes `errored` and
157
+ the sign-in stands. **The refresh is the only oracle** — the server refusing the refresh token is
158
+ the one unambiguous report of a dead credential, and that is where the sign-out happens
159
+ (`rotateOnce` in `credentials.ts`). A cookie credential's refresh is the same oracle: the server
160
+ refusing its session signs it out. A static token cannot refresh, so it never signs itself out; a
161
+ 401 on it surfaces to the caller.
162
+ - **Memoised per project** — `getApi(7) === getApi(7)`, which is what React `key`s and hook deps
163
+ need. A sign-out drops everything built for that stack's projects, so a reopened project is built
164
+ from scratch rather than from what the previous sign-in left behind.
165
+
166
+ `session.auth.getHeaders(projectId?)` takes the same optional argument, for a transport that is not
167
+ a fetch client (the chat stream). Pass the project whose `api` produced the URL, so the request's
168
+ headers and its target name the same project. A project id alone does not name a project — two
169
+ stacks can each have a project 138 — so the active stack decides, falling back to a single project
170
+ with that id open elsewhere.
171
+
172
+ ⚠️ **One client per stack, per page.** Two `createKeboola()` instances signed in to the same stack
173
+ share its single-use refresh token: whichever rotates first invalidates the other's, and that one's
174
+ next rotation is refused — which signs it out. Nothing in the SDK detects this (a client has no
175
+ `dispose`, so a live sibling is indistinguishable from an abandoned one). `apps/kbc-ui` builds two
176
+ bearer clients for its two strategies and stays correct only because just one of them ever holds a
177
+ credential.
178
+
179
+ ⚠️ **A second `createKeboola()` is not the way to reach a second project — it signs you out of
180
+ both.** Both instances hold the same single-use refresh token, and refresh _rotates_ it, with
181
+ two-phase rotation and replay detection on the server. Whichever instance rotates first invalidates
182
+ the other's token, whose next refresh 401s and signs it out. This is a functional break, not a style
183
+ preference, and it does not depend on a `storage` adapter being configured.
177
184
 
178
185
  In React, `useApiClient()` returns `api`; `AuthProvider` (bearer) / `LegacyAuthProvider` (legacy) own
179
186
  driving the `session` to ready and gate on a `fallback`. See
@@ -185,21 +192,33 @@ and the session is in-memory (lost on reload); pass a storage adapter to make it
185
192
  ```ts
186
193
  import { createLocalStorage } from '@keboola/api-client';
187
194
 
188
- const { api, session } = createKeboola({ baseUrl, storage: createLocalStorage() });
189
- // On startup, call `session.restore()` to rehydrate: it exchanges the persisted refresh token for a
190
- // fresh credential eagerly (before any request), then re-scopes to the stored project. It resolves
191
- // `{ status: 'restored' | 'empty' | 'expired' }` — `expired` means the refresh token was dead and the
192
- // stored session was cleared; route to login. `session.reset()` clears the stored session — and one
193
- // landing mid-restore wins: the restore resolves `empty` rather than signing the user back in.
194
- const result = await session.restore();
195
+ // `defaultBaseUrl` is active from here on, until `resume()` or `stack.select` moves it.
196
+ const { session } = createKeboola({ defaultBaseUrl, storage: createLocalStorage() });
197
+
198
+ // The stored stack and project become active again; with nothing stored, the default stays.
199
+ // Resolves `restored | empty | expired | unreachable` — `expired` means a stored credential was refused.
200
+ const status = await session.resume();
195
201
  ```
196
202
 
197
- Every credential change (login, project switch, token rotation, sign-out) is written back — only the
198
- durable subset `{ baseUrl, projectId, refreshToken }`, never the access token or user identity. A
199
- single fixed key holds one bearer session, tagged with the stack (`baseUrl`) it belongs to. The
200
- configured stack is authoritative: `restore()` adopts the stored `baseUrl` only when you construct
201
- without one; if you pass a `baseUrl` that differs from the stored session's stack, that session is
202
- **discarded** (a stored refresh token is only ever sent to the stack that issued it, never another).
203
+ Every credential change (login, project switch, token rotation, sign-out) is written back under one
204
+ fixed key, and what it holds is the whole table rather than a single session: `current` — the scoped
205
+ stack and project — plus a `stacks` array, each entry carrying its own credential and the projects
206
+ open under it. Only the durable part of a credential is written: a token credential's rotating
207
+ refresh token, a static one's token, and a cookie one's session id, which renews nothing without the
208
+ HttpOnly session cookie the browser keeps. An access token or user identity is never written.
209
+
210
+ **Token or cookie is picked at construction.** `createKeboola({ defaultBaseUrl, credentials: 'cookie' })` signs in with
211
+ browser-mode logins (`login.withPassword({ …, browserMode: true })`) and renews through
212
+ `token.refreshWithSession` — the refresh token never reaches JS. It only works from the stack's own
213
+ origin, so localhost and previews stay on the default `'token'`. `authenticate` refuses the other
214
+ rotating kind, and a restore ignores a stored one.
215
+
216
+ **A stack is always active**, so `session.stack.getActive()` never returns `null` and the active
217
+ stack cannot be closed. Call `resume()` once on startup: persistence starts only after it settles,
218
+ and a second call returns the same promise. The caller wins over the stored session — once it
219
+ has selected a stack or project, or signed in or out, the resume leaves the scope where it is, and a
220
+ stack already signed in or out keeps that sign-in. Leaving a project is `project.deactivate()`; switching stacks
221
+ keeps every other stack's credential.
203
222
  Adapters: `createLocalStorage` / `createSessionStorage` (browser, memory fallback on Node/SSR),
204
223
  `createMemoryStorage`, `createNullStorage`. In Node, supply your own adapter or default to memory.
205
224
 
@@ -484,7 +503,7 @@ Don't invent a shape for the second case. These specs are uneven and, where pres
484
503
  `apps-api.keboola.com` (the Developer Portal / `components.keboola.com` backend) authenticates with its
485
504
  **own Cognito pool**, issuing a token trio — `token` (id), `accessToken`, `refreshToken` — not a
486
505
  Connection storage token. `createKeboola`'s session cannot drive it: driving to ready runs
487
- `tokens.verify()` against Connection, and `setProjectAsync` is meaningless. So it is not registered in
506
+ `tokens.verify()` against Connection, and `session.project.select` is meaningless. So it is not registered in
488
507
  `createServiceClients.ts` and never appears on the `api` proxy — `api.developerPortal` does not exist.
489
508
 
490
509
  Two layers, as everywhere else in this package:
@@ -594,6 +613,8 @@ If the resolved value is a `Job` — the request only _enqueues_ the work — th
594
613
 
595
614
  The suffix is the only thing at a call site that says "you are not done yet — poll this." Anything that returns a job needs a follow-up (`jobs.getJob`, `pollStorageJob`, a `jobPoller`), and a bare name is what makes a caller forget. Correspondingly, **don't** use `Async` on a method that resolves to the finished resource; every method here is `async` in the JavaScript sense, so the suffix would carry no information.
596
615
 
616
+ This rule governs **service-client endpoint methods**, where every method is already async. On a `session` surface the suffix means the other thing — the promise-returning sibling of a genuinely _synchronous_ call, where it does carry information: `authenticateStorage` / `authenticateStorageAsync`, `stack.getContext` / `stack.getContextAsync`.
617
+
597
618
  ```ts
598
619
  const deleteBucketAsync = async (…): Promise<Job<'bucketDelete'>> => { … }; // enqueues
599
620
  const getBucket = async (…): Promise<BucketDetail> => { … }; // done on resolve
package/API-SURFACE.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Every namespace and method reachable from a ready `KeboolaApi` — the `api` half of a keboola client (`createKeboola(...).api` / `createLegacyKeboola(...).api`, or `useApiClient()`). Generated from the TypeScript type checker — see `scripts/gen-surface.mjs`.
6
6
 
7
- 26 top-level namespaces, 645 methods. This index lists method **names** only — full signatures live per namespace under [`surface/`](./surface). Open `surface/<namespace>.md` for the one you need.
7
+ 26 top-level namespaces, 666 methods. This index lists method **names** only — full signatures live per namespace under [`surface/`](./surface). Open `surface/<namespace>.md` for the one you need.
8
8
 
9
9
  ## [`api.ai`](./surface/ai.md)
10
10
 
@@ -56,6 +56,9 @@ Every namespace and method reachable from a ready `KeboolaApi` — the `api` hal
56
56
  - `login.methods`
57
57
  - `login.withOidc`
58
58
  - `login.withPassword`
59
+ - `manageTokens.create`
60
+ - `manageTokens.getAll`
61
+ - `manageTokens.revoke`
59
62
  - `mfa.regenerateRecoveryCodes`
60
63
  - `mfa.totp.disable`
61
64
  - `mfa.totp.setup`
@@ -78,7 +81,8 @@ Every namespace and method reachable from a ready `KeboolaApi` — the `api` hal
78
81
  - `sudo.challenge`
79
82
  - `sudo.verify`
80
83
  - `token.introspect`
81
- - `token.refresh`
84
+ - `token.refreshWithSession`
85
+ - `token.refreshWithToken`
82
86
  - `token.revoke`
83
87
  - `webauthn.getAll`
84
88
  - `webauthn.register`
@@ -216,11 +220,16 @@ Every namespace and method reachable from a ready `KeboolaApi` — the `api` hal
216
220
  - `submitToolOutput`
217
221
  - `submitVote`
218
222
  - `updateAgentSettings`
223
+ - `updateProjectToolPolicy`
219
224
  - `updateSpendCaps`
220
225
  - `updateUserAgentSettings`
221
226
 
222
227
  ## [`api.management`](./surface/management.md)
223
228
 
229
+ - `applicationTokens.createApplicationToken`
230
+ - `applicationTokens.deleteApplicationToken`
231
+ - `applicationTokens.getApplicationTokenScopes`
232
+ - `applicationTokens.getApplicationTokens`
224
233
  - `currentUser.acceptMaintainerInvitation`
225
234
  - `currentUser.acceptOrganizationInvitation`
226
235
  - `currentUser.acceptProjectInvitation`
@@ -353,8 +362,10 @@ Every namespace and method reachable from a ready `KeboolaApi` — the `api` hal
353
362
  - `storageBackends.updateStorageBackend`
354
363
  - `uiApps.activateUiAppVersion`
355
364
  - `uiApps.deleteUiApp`
365
+ - `uiApps.getUiApp`
356
366
  - `uiApps.getUiApps`
357
367
  - `uiApps.registerUiApp`
368
+ - `uiApps.renameUiApp`
358
369
  - `users.addUserAdminFeature`
359
370
  - `users.deleteUser`
360
371
  - `users.deleteUserMetadata`
@@ -451,6 +462,13 @@ Every namespace and method reachable from a ready `KeboolaApi` — the `api` hal
451
462
  - `configuration.createConfiguration`
452
463
  - `configuration.getConfiguration`
453
464
  - `configuration.updateConfiguration`
465
+ - `kaiMemory.createItem`
466
+ - `kaiMemory.deleteUnreadableItem`
467
+ - `kaiMemory.getItems`
468
+ - `kaiMemory.getItemsByStatus`
469
+ - `kaiMemory.getItemsByStatusStrict`
470
+ - `kaiMemory.getUnreadableItemIds`
471
+ - `kaiMemory.updateStatus`
454
472
  - `semanticLayer.createModel`
455
473
  - `semanticLayer.createModelTree`
456
474
  - `semanticLayer.createObject`
@@ -709,11 +727,14 @@ Every namespace and method reachable from a ready `KeboolaApi` — the `api` hal
709
727
  - `dbt.compile`
710
728
  - `dbt.runResults`
711
729
  - `enrollMFA`
730
+ - `flowMigration.preview`
731
+ - `flowMigration.validate`
712
732
  - `git.getBranches`
713
733
  - `git.getEntrypoints`
714
734
  - `healthCheck`
715
735
  - `looker.testCredentials`
716
736
  - `sendSyncAction`
737
+ - `sshKeys.generate`
717
738
 
718
739
  ## [`api.telemetry`](./surface/telemetry.md)
719
740
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,125 @@
1
1
  # @keboola/api-client
2
2
 
3
+ ## 40.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Cookie (browser-mode) credentials on the bearer client.
8
+ - `createKeboola({ credentials: 'cookie' })` renews its credential through `auth.token.refreshWithSession`. The refresh token stays server-side, bound to the session cookie. A refused session signs the stack out, the same way a refused refresh token does. The default stays `'token'`.
9
+ - **Breaking:** a `cookie` credential carries `sessionId`, and `session.auth.authenticate` requires it.
10
+ - `authenticate` refuses a rotating credential of the kind the client was not built for, with `KeboolaErrorType.CredentialKindMismatch`. A restore reads a stored one of that kind as nothing stored.
11
+ - A cookie credential persists its session id, so a reload restores it through the session cookie.
12
+ - `CredentialMode` is exported.
13
+
14
+ - Remove `removeBranchFromUrl` from `@keboola/api-client/sdk/storage`
15
+
16
+ It stripped the `/branch/{id}/` segment from a project URL. Project URLs now always name a branch — production is the default branch, not the absence of one — so a URL with the segment removed is not a production URL, it is an old link that gets rewritten back on arrival. Its last caller is gone.
17
+
18
+ Replace a call with the branch you actually want: build the URL at the default branch id rather than stripping the segment.
19
+
20
+ - Browser/cookie mode on the auth client.
21
+ - `auth.login.withPassword` / `withOidc` take `browserMode` (default `false`), which also mints a browser session cookie for the issued session. The backend requires an `Origin` matching the stack app URL for it. The result type follows the flag: browser mode carries no `refreshToken`, API mode guarantees one.
22
+ - **Breaking:** `auth.token.refresh` is replaced by `refreshWithToken({ refreshToken })` (API mode) and `refreshWithSession({ sessionId })` (browser mode, sending `X-KBC-CSRF`).
23
+ - **Breaking:** the bearer credential kinds are renamed for what renews them — `browser` → `token`, `mediated` → `cookie`. A session stored under the old names is not read, so it signs in again.
24
+ - **Breaking:** `LoginSuccess` / `LoginResult` / `loginSuccessSchema` / `loginResultSchema` are replaced by `Api*` and `Browser*` pairs; `loginInputSchema` is no longer exported (use `passwordInputSchema`).
25
+ - **Breaking:** `saml.assert` takes the regenerated body, which now carries `browserMode`.
26
+
27
+ - replace MANAGE_TOKEN_SCOPES with management.applicationTokens.getApplicationTokenScopes
28
+
29
+ The constant mirrored the stack's scope list by hand and had to be edited in lockstep with the
30
+ backend; the Manage API now publishes the list, so the copy is gone.
31
+
32
+ - The bearer client always has an active stack, and restores only when asked.
33
+ - `createKeboola({ defaultBaseUrl })` is required. That stack is active from construction until `session.resume()` or `stack.select` moves it; `baseUrl` is gone.
34
+ - `session.stack.getActive()` returns `Stack`, never `null`. `stack.close` refuses the active stack (`KeboolaErrorType.StackActive`); `stack.deactivate()` is removed.
35
+ - `session.restored` is replaced by `session.resume()`, called once on startup and resolving with the same `RestoreStatus`. It rebuilds the stored stacks, credentials and projects and makes the stored stack and project active again; with nothing stored, or on a failed restore, the default stays active. A caller that selected a stack or project, or signed in or out, first keeps its scope, and a stack it signed in or out of keeps that sign-in. Persistence starts only after it settles.
36
+ - `session.auth.isAuthenticated()` reports whether the active stack holds a credential; `isAuthenticatedAsync()` answers once the stored session has resumed.
37
+ - `session.auth.replace(credential)` signs the active stack out and in with `credential`, winning over a restore still in flight.
38
+ - `session.auth.adoptInjected(credential)` (deprecated on arrival) adopts a server-injected `token` credential even in cookie mode. Temporary, for the agent-project claim page, until Connection stops injecting `UiConfig.programmaticAuth`.
39
+ - `createLegacyKeboola` keeps `baseUrl` (`LegacyKeboolaOptions`).
40
+
41
+ - rework management.uiApps around the application's `stringId`
42
+ - **New:** `getUiApp(stringId)` returns the application with every registered version.
43
+ - **New:** `renameUiApp({ stringId, name })`.
44
+ - **New:** `getUiApps({ includeInactive })` also lists applications with no active version.
45
+ - **Breaking:** `activateUiAppVersion` and `deleteUiApp` take the `stringId` instead of `id`.
46
+ - **Breaking:** `UiApp` carries `stringId`, and its version fields are nullable; `ActivateUiAppVersionPath` is no longer exported.
47
+
48
+ - Rebuild the bearer (OAuth) flow around a session-state table addressed by stack and project.
49
+ - **`createKeboola` is the factory's only public name.** The `createSessionClient` alias and the `SessionClient` type are gone — import `createKeboola`, and type a session as `BearerSession`.
50
+ - **It returns `{ session, getActiveApi, getApi }`, not `{ api, session }`.** `getActiveApi()` follows `session.project.select`; `getApi(projectId)` opens that project and stays pinned to it, so one signed-in client reaches several projects at once. Close a pinned project with `session.project.close(projectId)`.
51
+ - **The bearer `session` is regrouped** into `stack.*`, `project.*` and `auth.*`, plus `getState()` / `subscribe()` over the stack-and-project table and a `restored` promise resolving `RestoreStatus` (`'restored' | 'expired' | 'unreachable' | 'empty'`, where `expired` means the server refused the refresh token and `unreachable` means the exchange never got an answer — retry, never a login). Every verb is synchronous — a product namespace throws `NotReady` until that entry's context fetch lands, and `stack.getContextAsync` / `project.getContextAsync` await it.
52
+
53
+ | Was | Now |
54
+ | -------------------------------- | ------------------------------------------ |
55
+ | `setBaseUrl(url)` | `stack.select(url)` |
56
+ | `authenticate(tokens)` | `auth.authenticate(credential)` |
57
+ | `setProject(id)` | `project.select(id)` |
58
+ | `clearProject()` | `project.deactivate()` |
59
+ | `reset()` | `auth.signOut()` |
60
+ | `getAuthHeaders(projectId?)` | `auth.getHeaders(projectId?)` |
61
+ | `api` (the scoped surface) | `getActiveApi()` |
62
+ | `forProject(id)` | `getApi(id)` |
63
+ | `restore()` | the `restored` promise |
64
+ | `subscribe(cb)` (debug snapshot) | `subscribe(cb)` + `getState()` (the table) |
65
+
66
+ Removed with no replacement: `setProjectAsync`, `isStorageReady`, `hasPersistedValue`, `debug`, `debugForceRefresh`.
67
+
68
+ - **`baseUrl` is now the stack to start on, not the stack to talk to.** The bearer factory scopes it once `restored` settles, and only if the restore scoped nothing — so a stored session keeps its own stack. Any stack still enters the table through `session.stack.select(baseUrl)`.
69
+ - **The bearer engine no longer carries the legacy SAPI flow.** Use `createLegacyKeboola` for SAPI tokens.
70
+ - New type exports: `RestoreStatus`, `SessionState`, `AuthPhase`, `FetchStatus`, `ActiveLocation`, `StackEntry`, `ProjectEntry`, `BearerCredentialEntry`.
71
+
72
+ ### Minor Changes
73
+
74
+ - Project-level Kai tool policy: `kaiAgent.updateProjectToolPolicy`, `toolPermissions`/`canWriteToolPolicy` on agent settings and `projectToolPermissions` on user agent settings; org-admin Tool permissions card in Project Settings.
75
+
76
+ - AI-3943: `kaiAgent.getUsage` exposes the organization's one-time free Kai allowance (`freeAllowance.grantedPpu`/`remainingPpu`); kbc-ui shows a one-time dismissible info notice in the Kai chat surfaces until dismissed or spent.
77
+
78
+ - Deprecate `createModelTree` in the semantic layer SDK (`@keboola/api-client/sdk/semanticLayer`); it is removed in the next major
79
+
80
+ It creates a model, then its children, one request each, and rejects on the first failed child, leaving behind whatever it had already written. Nothing in this repository calls it.
81
+
82
+ Create the model with `createModel`, then its children with `createObject` or `createObjects`. To delete a model that failed partway through, use `deleteModel`.
83
+
84
+ - `api.syncActions.flowMigration.validate` and `.preview` run `keboola.flow-migration-tool`'s sync
85
+ actions for a list of orchestrations and return one parsed result per orchestration. `preview` is a
86
+ dry run: its results carry the status (`dry-run`, `skipped` or `failed`), the structural changes,
87
+ and the flow configuration the orchestration would become.
88
+
89
+ - `api.syncActions.sshKeys.generate` generates an SSH key pair via `keboola.ssh-keygen-v2` and
90
+ returns its `public` and `private` keys.
91
+
92
+ - Deleted project detail exposes storage backend `backends` (like project detail) so the UI can show the backend ID as a link to `/control/storage-backends/<id>`; control-ui renders ID + type badge, gated by `canReadStorageBackends`.
93
+
94
+ - Support per-chat model tier selection and optional Fast preparation context. Chat detail responses include requested and effective tier labels plus the fixed effort. Existing callers may omit the additive request fields.
95
+
96
+ - Adds the `kaiMemory` SDK (`api.sdk.kaiMemory`) over the metastore client for Kai's org-wide knowledge-base notes, and a `canManageKaiMemory` permission predicate.
97
+
98
+ - add management.applicationTokens service, including the stack-published scope list
99
+
100
+ - `createManagementClient` takes `mintSessionToken` on a `management-token` auth strategy.
101
+ - The client authenticates every call with a session token minted from `token` (`POST /manage/current-user/session-token`), not with `token` itself.
102
+ - When that session token expires, the next one is minted from `token` again.
103
+ - Without `mintSessionToken`, an invalid token is replaced from the browser's login session (`POST /admin/account/session-token`) in every environment.
104
+
105
+ ### Patch Changes
106
+
107
+ - `canWriteSemanticLayer` now mirrors the metastore's role rule: only the `admin` and `productionManager` project roles may write the semantic layer, and the metastore answers every other role (and a limited token) with a 403. kbc-ui's semantic-layer editor stops offering write actions to those callers, and Kai hides its semantic-layer write tools from them. Tool Permissions lists those tools for every caller, a project block hides them from Kai, and Kai reports a metastore 403 in the metastore's own words (AI-3742).
108
+
109
+ - Messages the UI sends on its own (data-app preview error forwards, job-finished nudges) are tagged `autoForwarded` and no longer count toward the monthly Kai message limit; the burst limiter still counts them. kai-agent honors the flag only when the text matches one of the UI's fixed auto-forward templates and strips it otherwise (AI-3887)
110
+
111
+ - Accept an optional `AbortSignal` in `chat.getHistory` and `kaiAgent.getHistory`, matching the other read methods on both clients. Callers that cancel a query now abort the request it started.
112
+
113
+ - Add `auth.manageTokens` — list, create and revoke Manage API tokens. The list keeps hand-made tokens and session tokens in separate arrays, and creating one needs an active sudo window.
114
+
115
+ - Add the optional `continueOnFailure` boolean to the `keboola.ex-google-ads` configuration schema, alongside the existing `onlyEnabledCustomers` flag.
116
+
117
+ - The generated Manage API types match the live document.
118
+ - A deleted project's `backends` entries are `{ id }`, the only field the endpoint returns for each backend.
119
+ - The schema carries `PATCH` and `DELETE /manage/file-storage/{fileStorageId}`.
120
+
121
+ - Accept an optional `query` filter on `metastore.repository.getMetaObjects` and `getMetaObjectRevisions` (AI-3975). The metastore already filters these list endpoints server-side on any object field (`{ status: 'pending' }`, `{ 'field[in]': 'a|b' }`, ...) — the SDK just wasn't forwarding it. Callers no longer have to page every object of a type and filter client-side.
122
+
3
123
  ## 39.0.0
4
124
 
5
125
  ### Minor Changes
package/README.md CHANGED
@@ -78,9 +78,9 @@ Interactive login, then scope to a project:
78
78
  ```typescript
79
79
  import { createKeboola } from '@keboola/api-client';
80
80
 
81
- const { api, session } = createKeboola({ baseUrl });
81
+ const { api, session } = createKeboola({ defaultBaseUrl: baseUrl });
82
82
 
83
- // api.auth is live as soon as baseUrl is configured
83
+ // api.auth is live from construction: a stack is always active
84
84
  const result = await api.auth.login.withPassword({ email, password });
85
85
  if (result.mfaRequired) {
86
86
  // result is an MFA challenge — verify via api.auth.mfa.* to obtain the LoginSuccess
@@ -103,7 +103,7 @@ credential, hand a `LoginSuccess`-shaped object straight to `session.authenticat
103
103
  ```typescript
104
104
  import { createKeboola } from '@keboola/api-client';
105
105
 
106
- const { api, session } = createKeboola({ baseUrl: process.env.KEBOOLA_STACK_URL! });
106
+ const { api, session } = createKeboola({ defaultBaseUrl: process.env.KEBOOLA_STACK_URL! });
107
107
 
108
108
  session.authenticate({
109
109
  mfaRequired: false,
@@ -1,4 +1,4 @@
1
- const require_createFetchClient = require("./createFetchClient-BlgPbjFj.cjs");
1
+ const require_createFetchClient = require("./createFetchClient-Cwp8max9.cjs");
2
2
  //#region src/errors/ManagementClientAuthError.ts
3
3
  var ManagementClientAuthError = class extends require_createFetchClient.ApiError {
4
4
  title;
@@ -18,4 +18,4 @@ Object.defineProperty(exports, "ManagementClientAuthError", {
18
18
  }
19
19
  });
20
20
 
21
- //# sourceMappingURL=ManagementClientAuthError-FcfMJNhr.cjs.map
21
+ //# sourceMappingURL=ManagementClientAuthError-DE7lNGZQ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManagementClientAuthError-FcfMJNhr.cjs","names":["ApiError"],"sources":["../src/errors/ManagementClientAuthError.ts"],"sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nimport { ApiError } from './ApiError';\n\nexport class ManagementClientAuthError extends ApiError {\n title: string;\n message: string;\n constructor(title: string, message: string, res: ApiResponse) {\n super(res);\n this.name = 'ManagementClientAuthError';\n this.title = title;\n this.message = message;\n }\n}\n"],"mappings":";;AAIA,IAAa,4BAAb,cAA+CA,0BAAAA,SAAS;CACtD;CACA;CACA,YAAY,OAAe,SAAiB,KAAkB;EAC5D,MAAM,GAAG;EACT,KAAK,OAAO;EACZ,KAAK,QAAQ;EACb,KAAK,UAAU;CACjB;AACF"}
1
+ {"version":3,"file":"ManagementClientAuthError-DE7lNGZQ.cjs","names":["ApiError"],"sources":["../src/errors/ManagementClientAuthError.ts"],"sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nimport { ApiError } from './ApiError';\n\nexport class ManagementClientAuthError extends ApiError {\n title: string;\n message: string;\n constructor(title: string, message: string, res: ApiResponse) {\n super(res);\n this.name = 'ManagementClientAuthError';\n this.title = title;\n this.message = message;\n }\n}\n"],"mappings":";;AAIA,IAAa,4BAAb,cAA+CA,0BAAAA,SAAS;CACtD;CACA;CACA,YAAY,OAAe,SAAiB,KAAkB;EAC5D,MAAM,GAAG;EACT,KAAK,OAAO;EACZ,KAAK,QAAQ;EACb,KAAK,UAAU;CACjB;AACF"}
@@ -1,4 +1,4 @@
1
- import { g as ApiError } from "./createFetchClient-C-cadpBx.js";
1
+ import { g as ApiError } from "./createFetchClient-DXHQK63w.js";
2
2
  //#region src/errors/ManagementClientAuthError.ts
3
3
  var ManagementClientAuthError = class extends ApiError {
4
4
  title;
@@ -13,4 +13,4 @@ var ManagementClientAuthError = class extends ApiError {
13
13
  //#endregion
14
14
  export { ManagementClientAuthError as t };
15
15
 
16
- //# sourceMappingURL=ManagementClientAuthError-Cr9IOsnJ.js.map
16
+ //# sourceMappingURL=ManagementClientAuthError-H30lti_Q.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManagementClientAuthError-Cr9IOsnJ.js","names":[],"sources":["../src/errors/ManagementClientAuthError.ts"],"sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nimport { ApiError } from './ApiError';\n\nexport class ManagementClientAuthError extends ApiError {\n title: string;\n message: string;\n constructor(title: string, message: string, res: ApiResponse) {\n super(res);\n this.name = 'ManagementClientAuthError';\n this.title = title;\n this.message = message;\n }\n}\n"],"mappings":";;AAIA,IAAa,4BAAb,cAA+C,SAAS;CACtD;CACA;CACA,YAAY,OAAe,SAAiB,KAAkB;EAC5D,MAAM,GAAG;EACT,KAAK,OAAO;EACZ,KAAK,QAAQ;EACb,KAAK,UAAU;CACjB;AACF"}
1
+ {"version":3,"file":"ManagementClientAuthError-H30lti_Q.js","names":[],"sources":["../src/errors/ManagementClientAuthError.ts"],"sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nimport { ApiError } from './ApiError';\n\nexport class ManagementClientAuthError extends ApiError {\n title: string;\n message: string;\n constructor(title: string, message: string, res: ApiResponse) {\n super(res);\n this.name = 'ManagementClientAuthError';\n this.title = title;\n this.message = message;\n }\n}\n"],"mappings":";;AAIA,IAAa,4BAAb,cAA+C,SAAS;CACtD;CACA;CACA,YAAY,OAAe,SAAiB,KAAkB;EAC5D,MAAM,GAAG;EACT,KAAK,OAAO;EACZ,KAAK,QAAQ;EACb,KAAK,UAAU;CACjB;AACF"}