@keboola/api-client 29.0.0 → 31.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 (344) hide show
  1. package/API-SURFACE.md +6 -1
  2. package/CHANGELOG.md +1785 -0
  3. package/dist/{ManagementClientAuthError-B97OtOQ7.js → ManagementClientAuthError-90pvsej0.js} +2 -2
  4. package/dist/{ManagementClientAuthError-B97OtOQ7.js.map → ManagementClientAuthError-90pvsej0.js.map} +1 -1
  5. package/dist/{ManagementClientAuthError-ZJ2-RoKT.cjs → ManagementClientAuthError-DFhi5yxe.cjs} +2 -2
  6. package/dist/{ManagementClientAuthError-ZJ2-RoKT.cjs.map → ManagementClientAuthError-DFhi5yxe.cjs.map} +1 -1
  7. package/dist/ai/index.cjs +2 -2
  8. package/dist/ai/index.d.cts +2 -2
  9. package/dist/ai/index.d.ts +2 -2
  10. package/dist/ai/index.js +2 -2
  11. package/dist/ai/types.d.cts +1 -1
  12. package/dist/ai/types.d.ts +1 -1
  13. package/dist/{appLogs-CNG3yby-.cjs → appLogs-BCCi02w6.cjs} +2 -2
  14. package/dist/{appLogs-CNG3yby-.cjs.map → appLogs-BCCi02w6.cjs.map} +1 -1
  15. package/dist/{appLogs-VdgP08aX.d.ts → appLogs-BdMG6Cvn.d.ts} +2 -2
  16. package/dist/{appLogs-enL9XR9r.js → appLogs-CLHhkQJn.js} +2 -2
  17. package/dist/{appLogs-enL9XR9r.js.map → appLogs-CLHhkQJn.js.map} +1 -1
  18. package/dist/{appLogs-Dl5BcCSD.d.cts → appLogs-hQdKt_8J.d.cts} +2 -2
  19. package/dist/apps/index.cjs +3 -3
  20. package/dist/apps/index.d.cts +3 -3
  21. package/dist/apps/index.d.ts +3 -3
  22. package/dist/apps/index.js +3 -3
  23. package/dist/apps/types.d.cts +2 -2
  24. package/dist/apps/types.d.ts +2 -2
  25. package/dist/assets/index.cjs +1 -1
  26. package/dist/assets/index.d.cts +1 -1
  27. package/dist/assets/index.d.ts +1 -1
  28. package/dist/assets/index.js +1 -1
  29. package/dist/auth/index.cjs +2 -1
  30. package/dist/auth/index.d.cts +2 -2
  31. package/dist/auth/index.d.ts +2 -2
  32. package/dist/auth/index.js +2 -2
  33. package/dist/auth/types.d.cts +2 -2
  34. package/dist/auth/types.d.ts +2 -2
  35. package/dist/{auth-D2jfNlpX.js → auth-CE6Hlc9W.js} +2 -2
  36. package/dist/{auth-D2jfNlpX.js.map → auth-CE6Hlc9W.js.map} +1 -1
  37. package/dist/{auth-5HCvCsZO.cjs → auth-DmgTH0uY.cjs} +2 -2
  38. package/dist/{auth-5HCvCsZO.cjs.map → auth-DmgTH0uY.cjs.map} +1 -1
  39. package/dist/{authClient-Bgj2Ay7h.d.cts → authClient-BL6h78Q1.d.cts} +52 -5
  40. package/dist/{authClient-Dsd7W99W.d.ts → authClient-Bc_bDisO.d.ts} +52 -5
  41. package/dist/{authClient-Z8Eg8rlN.cjs → authClient-Cixa8_L1.cjs} +81 -10
  42. package/dist/authClient-Cixa8_L1.cjs.map +1 -0
  43. package/dist/{authClient-DOk6VKdV.js → authClient-XBAUz9g-.js} +76 -11
  44. package/dist/authClient-XBAUz9g-.js.map +1 -0
  45. package/dist/chat/index.cjs +3 -3
  46. package/dist/chat/index.d.cts +2 -2
  47. package/dist/chat/index.d.ts +2 -2
  48. package/dist/chat/index.js +3 -3
  49. package/dist/chat/types.d.cts +1 -1
  50. package/dist/chat/types.d.ts +1 -1
  51. package/dist/constants/index.cjs +3 -1
  52. package/dist/constants/index.d.cts +2 -2
  53. package/dist/constants/index.d.ts +2 -2
  54. package/dist/constants/index.js +2 -2
  55. package/dist/{constants-CqyyBkXW.cjs → constants-CkAVvuUq.cjs} +23 -1
  56. package/dist/constants-CkAVvuUq.cjs.map +1 -0
  57. package/dist/{constants-_HhqKvBg.js → constants-qeWGfk_7.js} +12 -2
  58. package/dist/constants-qeWGfk_7.js.map +1 -0
  59. package/dist/{createFetchClient-BK0TZK-U.js → createFetchClient-B1h3-p65.js} +10 -2
  60. package/dist/createFetchClient-B1h3-p65.js.map +1 -0
  61. package/dist/{createFetchClient-BsG719K1.cjs → createFetchClient-B9Cv0W9f.cjs} +15 -1
  62. package/dist/createFetchClient-B9Cv0W9f.cjs.map +1 -0
  63. package/dist/{createGenericFetchClient-DLbjX0eM.cjs → createGenericFetchClient-BWoSkTki.cjs} +2 -2
  64. package/dist/{createGenericFetchClient-DLbjX0eM.cjs.map → createGenericFetchClient-BWoSkTki.cjs.map} +1 -1
  65. package/dist/{createGenericFetchClient-CVZYekDk.js → createGenericFetchClient-DhpvUSlX.js} +2 -2
  66. package/dist/{createGenericFetchClient-CVZYekDk.js.map → createGenericFetchClient-DhpvUSlX.js.map} +1 -1
  67. package/dist/{createOpenapiFetchClient-B5U1fCHS.js → createOpenapiFetchClient-0_oqhdPv.js} +2 -2
  68. package/dist/{createOpenapiFetchClient-B5U1fCHS.js.map → createOpenapiFetchClient-0_oqhdPv.js.map} +1 -1
  69. package/dist/{createOpenapiFetchClient-Cr90VXY4.cjs → createOpenapiFetchClient-yirrW6Tg.cjs} +2 -2
  70. package/dist/{createOpenapiFetchClient-Cr90VXY4.cjs.map → createOpenapiFetchClient-yirrW6Tg.cjs.map} +1 -1
  71. package/dist/{credential-0c6yFwtp.cjs → credential-D-tX9gP4.cjs} +2 -2
  72. package/dist/{credential-0c6yFwtp.cjs.map → credential-D-tX9gP4.cjs.map} +1 -1
  73. package/dist/{credential-kEGLnVez.js → credential-dKxArMic.js} +2 -2
  74. package/dist/{credential-kEGLnVez.js.map → credential-dKxArMic.js.map} +1 -1
  75. package/dist/dataScience/index.cjs +2 -2
  76. package/dist/dataScience/index.d.cts +2 -2
  77. package/dist/dataScience/index.d.ts +2 -2
  78. package/dist/dataScience/index.js +2 -2
  79. package/dist/dataScience/types.d.cts +2 -2
  80. package/dist/dataScience/types.d.ts +2 -2
  81. package/dist/{dataScience-C-JrA0Uk.cjs → dataScience-BqNWX-Gr.cjs} +5 -5
  82. package/dist/{dataScience-C-JrA0Uk.cjs.map → dataScience-BqNWX-Gr.cjs.map} +1 -1
  83. package/dist/{dataScience-CE0pSWbl.js → dataScience-jdbSSPYF.js} +5 -5
  84. package/dist/{dataScience-CE0pSWbl.js.map → dataScience-jdbSSPYF.js.map} +1 -1
  85. package/dist/developerPortal/index.cjs +1 -1
  86. package/dist/developerPortal/index.d.cts +2 -2
  87. package/dist/developerPortal/index.d.ts +2 -2
  88. package/dist/developerPortal/index.js +1 -1
  89. package/dist/developerPortal/types.d.cts +1 -1
  90. package/dist/developerPortal/types.d.ts +1 -1
  91. package/dist/{developerPortalClient-BPPEAdJW.js → developerPortalClient-5ABcxz1U.js} +3 -3
  92. package/dist/{developerPortalClient-BPPEAdJW.js.map → developerPortalClient-5ABcxz1U.js.map} +1 -1
  93. package/dist/{developerPortalClient-C8oq48xW.cjs → developerPortalClient-B7lNR5q0.cjs} +3 -3
  94. package/dist/{developerPortalClient-C8oq48xW.cjs.map → developerPortalClient-B7lNR5q0.cjs.map} +1 -1
  95. package/dist/domain/permissions/index.d.cts +2 -2
  96. package/dist/domain/permissions/index.d.ts +2 -2
  97. package/dist/editor/index.cjs +2 -2
  98. package/dist/editor/index.d.cts +2 -2
  99. package/dist/editor/index.d.ts +2 -2
  100. package/dist/editor/index.js +2 -2
  101. package/dist/editor/types.d.cts +1 -1
  102. package/dist/editor/types.d.ts +1 -1
  103. package/dist/encryption/index.cjs +1 -1
  104. package/dist/encryption/index.d.cts +1 -1
  105. package/dist/encryption/index.d.ts +1 -1
  106. package/dist/encryption/index.js +1 -1
  107. package/dist/encryption/types.d.cts +1 -1
  108. package/dist/encryption/types.d.ts +1 -1
  109. package/dist/import/index.cjs +1 -1
  110. package/dist/import/index.d.cts +3 -3
  111. package/dist/import/index.d.ts +3 -3
  112. package/dist/import/index.js +1 -1
  113. package/dist/{import-Cf0W-7YD.js → import-CExRbskw.js} +3 -3
  114. package/dist/{import-Cf0W-7YD.js.map → import-CExRbskw.js.map} +1 -1
  115. package/dist/{import-KLH1uRtx.cjs → import-CXHppAxd.cjs} +3 -3
  116. package/dist/{import-KLH1uRtx.cjs.map → import-CXHppAxd.cjs.map} +1 -1
  117. package/dist/{index-vb9Rfqca.d.cts → index--pxLseaw.d.cts} +13 -3
  118. package/dist/{index-vb9Rfqca.d.ts → index--pxLseaw.d.ts} +13 -3
  119. package/dist/{index-DYQt4zxC.d.ts → index-7RvXnXmd.d.ts} +6 -6
  120. package/dist/{index-CLPrlyIz.d.cts → index-B-frWtGW.d.cts} +19 -2
  121. package/dist/{index-WQkVzx5e.d.cts → index-B6q7HxKJ.d.cts} +4 -4
  122. package/dist/{index-Dwp8tF6O.d.ts → index-BR2Fu-Wo.d.ts} +32 -31
  123. package/dist/{index-IN0qzs52.d.cts → index-BSjfVDTr.d.cts} +5 -5
  124. package/dist/{index-BEKaJ7Cc.d.cts → index-BfVv8isU.d.cts} +4 -4
  125. package/dist/{index-DXi6wsr5.d.cts → index-C9mAoXF6.d.cts} +6 -6
  126. package/dist/{index-KKJkrxjx.d.ts → index-CMb0ygwb.d.ts} +3 -3
  127. package/dist/{index-DVsnxZap.d.cts → index-CR9LsDaG.d.cts} +4 -4
  128. package/dist/{index-Cfrl7sd5.d.ts → index-CW4VC9oN.d.ts} +4 -4
  129. package/dist/{index-CeistZnj.d.ts → index-CYMAwD3E.d.ts} +4 -4
  130. package/dist/{index-CXQRvZ-f.d.cts → index-Cpjh05sx.d.cts} +4 -4
  131. package/dist/{index-eEBVG5s3.d.cts → index-CwJE18PJ.d.cts} +3 -3
  132. package/dist/{index-DIM8KZly.d.ts → index-D_TnbEtp.d.cts} +3 -3
  133. package/dist/{index-BthgbVdd.d.ts → index-Daks5CeX.d.ts} +4 -4
  134. package/dist/{index-BmjeNd9u.d.ts → index-DeMDxHTz.d.ts} +4 -4
  135. package/dist/{index-8pN6Emos.d.ts → index-Ds8e0l7-.d.ts} +19 -2
  136. package/dist/{index-DNlX-H1V.d.ts → index-J1I2HlSm.d.ts} +5 -5
  137. package/dist/{index-BWBScAYc.d.cts → index-NicJZIzu.d.ts} +3 -3
  138. package/dist/{index-DplMbm9E.d.cts → index-cu8THqZV.d.cts} +32 -31
  139. package/dist/index.cjs +28 -19
  140. package/dist/index.cjs.map +1 -1
  141. package/dist/index.d.cts +6 -6
  142. package/dist/index.d.ts +6 -6
  143. package/dist/index.js +27 -20
  144. package/dist/index.js.map +1 -1
  145. package/dist/management/index.cjs +1 -1
  146. package/dist/management/index.d.cts +1 -1
  147. package/dist/management/index.d.ts +1 -1
  148. package/dist/management/index.js +1 -1
  149. package/dist/management/types.d.cts +1 -1
  150. package/dist/management/types.d.ts +1 -1
  151. package/dist/{management-DqwQcDCx.js → management-Cc8mKfnf.js} +6 -7
  152. package/dist/management-Cc8mKfnf.js.map +1 -0
  153. package/dist/{management-WOmlBt6H.cjs → management-DlVdxzPw.cjs} +6 -7
  154. package/dist/management-DlVdxzPw.cjs.map +1 -0
  155. package/dist/metastore/index.cjs +1 -1
  156. package/dist/metastore/index.d.cts +1 -1
  157. package/dist/metastore/index.d.ts +1 -1
  158. package/dist/metastore/index.js +1 -1
  159. package/dist/metastore/types.d.cts +1 -1
  160. package/dist/metastore/types.d.ts +1 -1
  161. package/dist/{metastore-CNEhL66f.js → metastore-CNf1412Z.js} +4 -4
  162. package/dist/{metastore-CNEhL66f.js.map → metastore-CNf1412Z.js.map} +1 -1
  163. package/dist/{metastore-CkQluyX1.cjs → metastore-DbsxqjhS.cjs} +4 -4
  164. package/dist/{metastore-CkQluyX1.cjs.map → metastore-DbsxqjhS.cjs.map} +1 -1
  165. package/dist/notifications/index.cjs +3 -3
  166. package/dist/notifications/index.d.cts +2 -2
  167. package/dist/notifications/index.d.ts +2 -2
  168. package/dist/notifications/index.js +3 -3
  169. package/dist/notifications/types.d.cts +1 -1
  170. package/dist/notifications/types.d.ts +1 -1
  171. package/dist/oauth/index.cjs +1 -1
  172. package/dist/oauth/index.d.cts +2 -2
  173. package/dist/oauth/index.d.ts +2 -2
  174. package/dist/oauth/index.js +1 -1
  175. package/dist/oauth/types.d.cts +1 -1
  176. package/dist/oauth/types.d.ts +1 -1
  177. package/dist/{oauth-DYDObUX9.js → oauth-ClksaYRY.js} +5 -5
  178. package/dist/{oauth-DYDObUX9.js.map → oauth-ClksaYRY.js.map} +1 -1
  179. package/dist/{oauth-DTvrqe6P.cjs → oauth-DsZgmtPj.cjs} +5 -5
  180. package/dist/{oauth-DTvrqe6P.cjs.map → oauth-DsZgmtPj.cjs.map} +1 -1
  181. package/dist/omnisearch/index.cjs +2 -2
  182. package/dist/omnisearch/index.d.cts +2 -2
  183. package/dist/omnisearch/index.d.ts +2 -2
  184. package/dist/omnisearch/index.js +2 -2
  185. package/dist/omnisearch/types.d.cts +1 -1
  186. package/dist/omnisearch/types.d.ts +1 -1
  187. package/dist/{project-io1pY-hW.d.ts → project-5SLw86eZ.d.ts} +2 -2
  188. package/dist/{project-CcGxXIW_.d.cts → project-CRrsxSAK.d.cts} +2 -2
  189. package/dist/queryService/index.cjs +1 -1
  190. package/dist/queryService/index.d.cts +1 -1
  191. package/dist/queryService/index.d.ts +1 -1
  192. package/dist/queryService/index.js +1 -1
  193. package/dist/queryService/types.d.cts +1 -1
  194. package/dist/queryService/types.d.ts +1 -1
  195. package/dist/{queryService-BHV_OZI2.js → queryService-BlyAcBxP.js} +5 -5
  196. package/dist/{queryService-BHV_OZI2.js.map → queryService-BlyAcBxP.js.map} +1 -1
  197. package/dist/{queryService-CvqDqigW.cjs → queryService-DxUUkTcy.cjs} +5 -5
  198. package/dist/{queryService-CvqDqigW.cjs.map → queryService-DxUUkTcy.cjs.map} +1 -1
  199. package/dist/queue/index.cjs +1 -1
  200. package/dist/queue/index.d.cts +3 -3
  201. package/dist/queue/index.d.ts +3 -3
  202. package/dist/queue/index.js +1 -1
  203. package/dist/queue/types.d.cts +1 -1
  204. package/dist/queue/types.d.ts +1 -1
  205. package/dist/{queue-CUHKupTA.cjs → queue-CpcqeMPz.cjs} +4 -4
  206. package/dist/{queue-CUHKupTA.cjs.map → queue-CpcqeMPz.cjs.map} +1 -1
  207. package/dist/{queue-uofE4Eu6.js → queue-DpZTm7U7.js} +4 -4
  208. package/dist/{queue-uofE4Eu6.js.map → queue-DpZTm7U7.js.map} +1 -1
  209. package/dist/scheduler/index.cjs +3 -3
  210. package/dist/scheduler/index.d.cts +2 -2
  211. package/dist/scheduler/index.d.ts +2 -2
  212. package/dist/scheduler/index.js +3 -3
  213. package/dist/scheduler/types.d.cts +1 -1
  214. package/dist/scheduler/types.d.ts +1 -1
  215. package/dist/sdk/configurations/index.d.cts +4 -4
  216. package/dist/sdk/configurations/index.d.ts +4 -4
  217. package/dist/sdk/developerPortal/index.cjs +3 -3
  218. package/dist/sdk/developerPortal/index.d.cts +3 -3
  219. package/dist/sdk/developerPortal/index.d.ts +3 -3
  220. package/dist/sdk/developerPortal/index.js +3 -3
  221. package/dist/sdk/queryService/index.d.cts +1 -1
  222. package/dist/sdk/queryService/index.d.ts +1 -1
  223. package/dist/sdk/semanticLayer/index.d.cts +1 -1
  224. package/dist/sdk/semanticLayer/index.d.ts +1 -1
  225. package/dist/sdk/semanticLayer/types.d.cts +1 -1
  226. package/dist/sdk/semanticLayer/types.d.ts +1 -1
  227. package/dist/sdk/storage/index.d.cts +1 -1
  228. package/dist/sdk/storage/index.d.ts +1 -1
  229. package/dist/sdk/tag/index.d.cts +2 -2
  230. package/dist/sdk/tag/index.d.ts +2 -2
  231. package/dist/sdk/tag/types.d.cts +1 -1
  232. package/dist/sdk/tag/types.d.ts +1 -1
  233. package/dist/sdk/vault/index.d.cts +1 -1
  234. package/dist/sdk/vault/index.d.ts +1 -1
  235. package/dist/status/index.cjs +1 -1
  236. package/dist/status/index.d.cts +1 -1
  237. package/dist/status/index.d.ts +1 -1
  238. package/dist/status/index.js +1 -1
  239. package/dist/storage/index.cjs +6 -3
  240. package/dist/storage/index.d.cts +3 -3
  241. package/dist/storage/index.d.ts +3 -3
  242. package/dist/storage/index.js +5 -4
  243. package/dist/storage/types.d.cts +2 -2
  244. package/dist/storage/types.d.ts +2 -2
  245. package/dist/{storage-luq7YBZF.js → storage-CQxu0EY3.js} +10 -7
  246. package/dist/{storage-luq7YBZF.js.map → storage-CQxu0EY3.js.map} +1 -1
  247. package/dist/{storage-DbyNnkIJ.cjs → storage-vnH64B_Q.cjs} +10 -7
  248. package/dist/storage-vnH64B_Q.cjs.map +1 -0
  249. package/dist/stream/index.cjs +3 -3
  250. package/dist/stream/index.d.cts +2 -2
  251. package/dist/stream/index.d.ts +2 -2
  252. package/dist/stream/index.js +3 -3
  253. package/dist/stream/types.d.cts +1 -1
  254. package/dist/stream/types.d.ts +1 -1
  255. package/dist/syncActions/index.cjs +1 -1
  256. package/dist/syncActions/index.d.cts +1 -1
  257. package/dist/syncActions/index.d.ts +1 -1
  258. package/dist/syncActions/index.js +1 -1
  259. package/dist/syncActions/types.d.cts +1 -1
  260. package/dist/syncActions/types.d.ts +1 -1
  261. package/dist/{syncActions-ssWWVN_4.js → syncActions-AgFiMjRS.js} +5 -5
  262. package/dist/{syncActions-ssWWVN_4.js.map → syncActions-AgFiMjRS.js.map} +1 -1
  263. package/dist/{syncActions-DKWeJ8GH.cjs → syncActions-DPcAPYgJ.cjs} +5 -5
  264. package/dist/{syncActions-DKWeJ8GH.cjs.map → syncActions-DPcAPYgJ.cjs.map} +1 -1
  265. package/dist/telemetry/index.cjs +1 -1
  266. package/dist/telemetry/index.d.cts +2 -2
  267. package/dist/telemetry/index.d.ts +2 -2
  268. package/dist/telemetry/index.js +1 -1
  269. package/dist/{telemetry-2IrE8HaZ.cjs → telemetry-BLgaYEvi.cjs} +3 -3
  270. package/dist/{telemetry-2IrE8HaZ.cjs.map → telemetry-BLgaYEvi.cjs.map} +1 -1
  271. package/dist/{telemetry-yQfQxBBI.js → telemetry-CPiGWpLi.js} +3 -3
  272. package/dist/{telemetry-yQfQxBBI.js.map → telemetry-CPiGWpLi.js.map} +1 -1
  273. package/dist/{types-DCBKso0t.d.cts → types-056giLrn.d.cts} +2 -2
  274. package/dist/{types-B1S2H7q1.d.ts → types-B1S60aS2.d.ts} +2 -2
  275. package/dist/{types-DwX1uxp_.d.ts → types-B2Al1BNh.d.ts} +2 -2
  276. package/dist/{types--T-vBqdd.d.cts → types-B2El99VY.d.cts} +2 -2
  277. package/dist/{types-BXK6Ebtm.d.ts → types-BHCigZFc.d.ts} +3 -3
  278. package/dist/{types-CtdyAkzI.d.cts → types-BIAP4CYp.d.cts} +2 -2
  279. package/dist/{types-B1glyy_Q.d.ts → types-BJLRgXw0.d.ts} +2 -2
  280. package/dist/{types-h9TTimS_.d.ts → types-BMsK6T5k.d.ts} +2 -2
  281. package/dist/{types-DebL68-g.d.ts → types-BV74LS5r.d.ts} +3 -3
  282. package/dist/{types-V8rC5if7.d.cts → types-BXnUqdBB.d.cts} +2 -2
  283. package/dist/{types-BREBK0xX.d.ts → types-Bc3-a3DT.d.cts} +2 -2
  284. package/dist/{types-C8XiTXxi.d.cts → types-BdKtW2Ml.d.cts} +2 -2
  285. package/dist/{types-DgaYUtu_.d.cts → types-Bv5vw2dc.d.cts} +2 -2
  286. package/dist/{types-D2n3h1gp.d.ts → types-BvXODdf5.d.ts} +2 -2
  287. package/dist/{types-CyRK5z-E.d.cts → types-By47HWwB.d.cts} +2 -2
  288. package/dist/{types-DeApSCzx.d.cts → types-C0bGZqFI.d.cts} +2 -2
  289. package/dist/{types-BefwoXik.d.cts → types-C2p7JYQ3.d.cts} +2 -2
  290. package/dist/{types-QOIQ-dZU.d.cts → types-CFhAduFK.d.cts} +3 -3
  291. package/dist/{types-ISUNM_BR.d.cts → types-CIJAtX8q.d.cts} +2 -2
  292. package/dist/{types-DvsGS8By.d.cts → types-CIybfUJ9.d.cts} +3 -3
  293. package/dist/{types-x4xPlrr0.d.ts → types-COFrOmuO.d.ts} +2 -2
  294. package/dist/{types-CexuN7Mw.d.cts → types-CQd9PuKY.d.cts} +7 -5
  295. package/dist/{types-CvADp-x-.d.ts → types-CgF9R0Na.d.ts} +2 -2
  296. package/dist/{types-BCt0EMiO.d.ts → types-Co8WobOo.d.ts} +3 -3
  297. package/dist/{types-DMvU4kZ2.d.cts → types-CuAoZH8w.d.cts} +2 -2
  298. package/dist/{types-SGuvOEV8.d.ts → types-Culr5v8R.d.ts} +3 -3
  299. package/dist/{types-BD6czYPH.d.ts → types-D5VvEdOv.d.ts} +7 -5
  300. package/dist/{types-DEKF5pbg.d.cts → types-D7YGPUsm.d.ts} +2 -2
  301. package/dist/{types-CwvOcTOm.d.cts → types-DG_FlLJt.d.cts} +3 -3
  302. package/dist/{types-B06L4-WE.d.cts → types-DLazCdFR.d.cts} +3 -3
  303. package/dist/{types-CC0wymfG.d.ts → types-DMMMQuNt.d.ts} +3 -3
  304. package/dist/{types-bws2RtKq.d.ts → types-DN7RWWBw.d.ts} +2 -2
  305. package/dist/{types-BhBvnvqe.d.ts → types-DQOOWgLt.d.cts} +2 -2
  306. package/dist/{types-CAOvDtMC.d.cts → types-DSBNqF1J.d.cts} +2 -2
  307. package/dist/{types-Z-vUwgym.d.ts → types-DWUd__fe.d.ts} +2 -2
  308. package/dist/{types-CjAia48k.d.ts → types-DdeZK3BO.d.ts} +2 -2
  309. package/dist/{types-BpWqpMkL.d.ts → types-Dirp9mni.d.ts} +3 -3
  310. package/dist/{types-DkbfBOBr.d.cts → types-DkoyCUqv.d.ts} +2 -2
  311. package/dist/{types-BmFyDKe6.d.ts → types-DnOGCb-p.d.cts} +24 -3
  312. package/dist/{types-CSmttcZ_.d.ts → types-Drk7PEhk.d.ts} +2 -2
  313. package/dist/{types-n4FFKqa4.d.ts → types-DyIKgbGB.d.ts} +2 -2
  314. package/dist/{types-2mHlPakp.d.cts → types-RmbvQimP.d.ts} +24 -3
  315. package/dist/{types-7H6Dnz0Y.d.ts → types-SX78XZZ0.d.ts} +2 -2
  316. package/dist/{types-CRYtdj5w.d.ts → types-X-gQF8F8.d.ts} +2 -2
  317. package/dist/{types-DBOEA7l0.d.cts → types-ca-YNg1r.d.cts} +3 -3
  318. package/dist/{types-BO-mTxKb.d.cts → types-eP06LqcE.d.cts} +2 -2
  319. package/dist/{types-CI1mW2lA.d.ts → types-lVXf05pr.d.ts} +2 -2
  320. package/dist/{types-BRQAKEC1.d.cts → types-mXM8MrYS.d.cts} +3 -3
  321. package/dist/{types-DS8uFAeq.d.cts → types-sTH4KiPc.d.cts} +2 -2
  322. package/dist/{types-CbZ8aMKW.d.cts → types-uP64XthM.d.cts} +2 -2
  323. package/dist/validateConnectionStatus-CBhXmvWC.js +38 -0
  324. package/dist/validateConnectionStatus-CBhXmvWC.js.map +1 -0
  325. package/dist/validateConnectionStatus-DVHXGTdi.cjs +55 -0
  326. package/dist/validateConnectionStatus-DVHXGTdi.cjs.map +1 -0
  327. package/dist/vault/index.cjs +4 -4
  328. package/dist/vault/index.d.cts +1 -1
  329. package/dist/vault/index.d.ts +1 -1
  330. package/dist/vault/index.js +4 -4
  331. package/dist/vault/types.d.cts +1 -1
  332. package/dist/vault/types.d.ts +1 -1
  333. package/package.json +4 -3
  334. package/surface/auth.md +9 -2
  335. package/surface/kaiAgent.md +1 -0
  336. package/dist/authClient-DOk6VKdV.js.map +0 -1
  337. package/dist/authClient-Z8Eg8rlN.cjs.map +0 -1
  338. package/dist/constants-CqyyBkXW.cjs.map +0 -1
  339. package/dist/constants-_HhqKvBg.js.map +0 -1
  340. package/dist/createFetchClient-BK0TZK-U.js.map +0 -1
  341. package/dist/createFetchClient-BsG719K1.cjs.map +0 -1
  342. package/dist/management-DqwQcDCx.js.map +0 -1
  343. package/dist/management-WOmlBt6H.cjs.map +0 -1
  344. package/dist/storage-DbyNnkIJ.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
1
  import { t as AdminRole } from "../adminRoles-C696kD_U.js";
2
2
  import { t as Backend } from "../backends-DKBz5OxE.js";
3
- import { a as STACKS, i as Provider, n as Continent, o as ProjectFeature, r as KeboolaStack, s as ComponentId, t as URLS } from "../index-vb9Rfqca.js";
4
- export { AdminRole, Backend, ComponentId, type Continent, type KeboolaStack, ProjectFeature, type Provider, STACKS, URLS };
3
+ import { a as STACKS, i as Provider, n as Continent, o as ProjectFeature, r as KeboolaStack, s as ComponentId, t as URLS } from "../index--pxLseaw.js";
4
+ export { AdminRole, Backend, ComponentId, Continent, type KeboolaStack, ProjectFeature, Provider, STACKS, URLS };
@@ -1,4 +1,4 @@
1
- import { i as ProjectFeature, n as STACKS, r as Backend, t as URLS } from "../constants-_HhqKvBg.js";
1
+ import { a as Backend, i as STACKS, n as Continent, o as ProjectFeature, r as Provider, t as URLS } from "../constants-qeWGfk_7.js";
2
2
  import { t as AdminRole } from "../adminRoles-B40yBcmq.js";
3
3
  import { t as ComponentId } from "../componentId-vJz-kWs6.js";
4
- export { AdminRole, Backend, ComponentId, ProjectFeature, STACKS, URLS };
4
+ export { AdminRole, Backend, ComponentId, Continent, ProjectFeature, Provider, STACKS, URLS };
@@ -12,6 +12,15 @@ const Backend = {
12
12
  };
13
13
  //#endregion
14
14
  //#region src/constants/stacks.ts
15
+ const Provider = {
16
+ Aws: "aws",
17
+ Azure: "azure",
18
+ Gcp: "gcp"
19
+ };
20
+ const Continent = {
21
+ Us: "us",
22
+ Europe: "europe"
23
+ };
15
24
  const STACKS = {
16
25
  NORTH_EUROPE_AZURE: {
17
26
  id: "com-keboola-azure-north-europe",
@@ -165,6 +174,7 @@ const URLS = {
165
174
  CLIENT_CURSOR_QUICKSTART: "https://cursor.com/docs/get-started/quickstart",
166
175
  CLIENT_VS_CODE_SETUP: "https://code.visualstudio.com/docs/setup/setup-overview",
167
176
  CLIENT_CODEX_QUICKSTART: "https://developers.openai.com/codex/cli",
177
+ CLIENT_CHATGPT_DOWNLOAD: "https://chatgpt.com/download",
168
178
  CLIENT_MAKE_GET_STARTED: "https://help.make.com/get-started",
169
179
  CLIENT_DEVIN_DESKTOP: "https://docs.devin.ai/desktop/getting-started"
170
180
  };
@@ -175,12 +185,24 @@ Object.defineProperty(exports, "Backend", {
175
185
  return Backend;
176
186
  }
177
187
  });
188
+ Object.defineProperty(exports, "Continent", {
189
+ enumerable: true,
190
+ get: function() {
191
+ return Continent;
192
+ }
193
+ });
178
194
  Object.defineProperty(exports, "ProjectFeature", {
179
195
  enumerable: true,
180
196
  get: function() {
181
197
  return ProjectFeature;
182
198
  }
183
199
  });
200
+ Object.defineProperty(exports, "Provider", {
201
+ enumerable: true,
202
+ get: function() {
203
+ return Provider;
204
+ }
205
+ });
184
206
  Object.defineProperty(exports, "STACKS", {
185
207
  enumerable: true,
186
208
  get: function() {
@@ -194,4 +216,4 @@ Object.defineProperty(exports, "URLS", {
194
216
  }
195
217
  });
196
218
 
197
- //# sourceMappingURL=constants-CqyyBkXW.cjs.map
219
+ //# sourceMappingURL=constants-CkAVvuUq.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-CkAVvuUq.cjs","names":[],"sources":["../src/constants/projectFeatures.ts","../src/constants/backends.ts","../src/constants/stacks.ts","../src/constants/index.ts"],"sourcesContent":["export const ProjectFeature = {\n DisableLegacyBucketPrefix: 'disable-legacy-bucket-prefix',\n SoxProtectedDefaultBranch: 'protected-default-branch',\n StorageBranches: 'storage-branches',\n} as const;\n\nexport type ProjectFeature = (typeof ProjectFeature)[keyof typeof ProjectFeature];\n","export const Backend = {\n Snowflake: 'snowflake',\n Bigquery: 'bigquery',\n} as const;\n\nexport type Backend = (typeof Backend)[keyof typeof Backend];\n","export const Provider = {\n Aws: 'aws',\n Azure: 'azure',\n Gcp: 'gcp',\n} as const;\n\nexport type Provider = (typeof Provider)[keyof typeof Provider];\n\nexport const Continent = {\n Us: 'us',\n Europe: 'europe',\n} as const;\n\nexport type Continent = (typeof Continent)[keyof typeof Continent];\n\nexport type KeboolaStack = {\n id: string;\n host: string;\n isSingleTenant?: boolean;\n isTesting?: boolean;\n isPayg?: boolean;\n provider?: Provider;\n continent?: Continent;\n region?: string;\n isCanary?: boolean;\n};\n\nexport const STACKS: Record<string, Readonly<KeboolaStack>> = {\n NORTH_EUROPE_AZURE: {\n id: 'com-keboola-azure-north-europe',\n region: 'north-europe',\n host: 'connection.north-europe.azure.keboola.com',\n provider: 'azure',\n continent: 'europe',\n isPayg: true,\n },\n EU_CENTRAL_1_AWS: {\n id: 'kbc-eu-central-1',\n region: 'eu-central-1',\n host: 'connection.eu-central-1.keboola.com',\n provider: 'aws',\n continent: 'europe',\n },\n US_EAST_1_AWS: {\n id: 'kbc-us-east-1',\n region: 'us-east-1',\n host: 'connection.keboola.com',\n provider: 'aws',\n continent: 'us',\n },\n EUROPE_WEST3_GCP: {\n id: 'com-keboola-gcp-europe-west3',\n region: 'europe-west3',\n host: 'connection.europe-west3.gcp.keboola.com',\n provider: 'gcp',\n continent: 'europe',\n },\n US_EAST_4_GCP: {\n id: 'com-keboola-gcp-us-east4',\n region: 'us-east4',\n host: 'connection.us-east4.gcp.keboola.com',\n provider: 'gcp',\n continent: 'us',\n isPayg: true,\n },\n\n /* PRIVATE SINGLE TENANT STACKS\n ---------------------------- */\n HCI: {\n id: 'cloud-keboola-hci',\n host: 'connection.hci.keboola.cloud',\n isSingleTenant: true,\n },\n CSAS_PROD: {\n id: 'cloud-keboola-cs',\n host: 'connection.cs.keboola.cloud',\n isSingleTenant: true,\n },\n CSAS_TEST: {\n id: 'cloud-keboola-cs-test',\n host: 'connection.cs-test.keboola.cloud',\n isSingleTenant: true,\n },\n INNOGY: {\n id: 'cloud-keboola-innogy-hub',\n host: 'connection.innogy-hub.keboola.cloud',\n isSingleTenant: true,\n },\n GROUPON: {\n id: 'cloud-keboola-groupon',\n host: 'connection.groupon.keboola.cloud',\n isSingleTenant: true,\n },\n CREDIT_INFO: {\n id: 'cloud-keboola-creditinfo',\n host: 'connection.creditinfo.keboola.cloud',\n isSingleTenant: true,\n },\n COATES: {\n id: 'cloud-keboola-coates',\n host: 'connection.coates.keboola.cloud',\n isSingleTenant: true,\n },\n SLSP: {\n id: 'cloud-keboola-slsp',\n host: 'connection.slsp.keboola.cloud',\n isSingleTenant: true,\n },\n HCKZ: {\n id: 'cloud-keboola-hckz',\n host: 'connection.hckz.keboola.cloud',\n isSingleTenant: true,\n },\n PASHA: {\n id: 'cloud-keboola-pasha',\n host: 'connection.pasha.keboola.cloud',\n isSingleTenant: true,\n },\n RBI: {\n id: 'cloud-keboola-rbi',\n host: 'connection.rbi.keboola.cloud',\n isSingleTenant: true,\n },\n NAH: {\n id: 'cloud-keboola-nah',\n host: 'connection.nah.keboola.cloud',\n isSingleTenant: true,\n provider: 'azure',\n continent: 'us',\n },\n\n /* DEV STACKS\n ---------------------------- */\n DEV_US_CENTRAL_1_GCP: {\n id: 'dev-keboola-gcp-us-central1',\n region: 'us-central1',\n host: 'connection.us-central1.gcp.keboola.dev',\n provider: 'gcp',\n continent: 'us',\n isTesting: true,\n },\n DEV_EU_WEST_1_AWS: {\n id: 'dev-keboola-aws-eu-west-1',\n region: 'eu-west-1',\n host: 'connection.eu-west-1.aws.keboola.dev',\n provider: 'aws',\n continent: 'europe',\n isTesting: true,\n },\n DEV_US_EAST_2_AZURE: {\n id: 'kbc-testing-azure-east-us-2',\n region: 'east-us-2',\n host: 'connection.east-us-2.azure.keboola-testing.com',\n provider: 'azure',\n continent: 'us',\n isTesting: true,\n },\n DEV_KEBOOLA_CANARY_ORION: {\n id: 'dev-keboola-canary-orion',\n region: 'europe-west3',\n host: 'connection.canary-orion.keboola.dev',\n provider: 'gcp',\n continent: 'europe',\n isCanary: true,\n },\n};\n","export { ComponentId } from './componentId';\nexport { ProjectFeature } from './projectFeatures';\nexport { Backend } from './backends';\nexport { AdminRole } from './adminRoles';\nexport { Continent, Provider, STACKS } from './stacks';\nexport type { KeboolaStack } from './stacks';\n\nexport const URLS = {\n USER_DOCUMENTATION: 'https://help.keboola.com',\n COMPONENTS: 'https://components.keboola.com',\n DEVELOPERS_DOCUMENTATION: 'https://developers.keboola.com',\n ACADEMY: 'https://academy.keboola.com',\n SALES_CONTACT_FORM: 'https://keboola.com/contact',\n SNOWFLAKE: 'https://www.snowflake.com',\n SNOWFLAKE_DOCS: 'https://docs.snowflake.com',\n MCP: 'https://www.keboola.com/mcp',\n CLI: 'https://www.keboola.com/cli',\n NODE_JS: 'https://nodejs.org/en',\n CLAUDE_CONNECTORS: 'https://claude.ai/customize/connectors',\n // Vendor \"how do I get this client\" pages linked from the connect surfaces.\n CLIENT_CLAUDE_CODE_QUICKSTART: 'https://code.claude.com/docs/en/quickstart',\n CLIENT_CLAUDE_AI: 'https://claude.ai',\n CLIENT_CLAUDE_DESKTOP_DOWNLOAD: 'https://claude.com/download',\n CLIENT_CURSOR_QUICKSTART: 'https://cursor.com/docs/get-started/quickstart',\n CLIENT_VS_CODE_SETUP: 'https://code.visualstudio.com/docs/setup/setup-overview',\n CLIENT_CODEX_QUICKSTART: 'https://developers.openai.com/codex/cli',\n CLIENT_CHATGPT_DOWNLOAD: 'https://chatgpt.com/download',\n CLIENT_MAKE_GET_STARTED: 'https://help.make.com/get-started',\n CLIENT_DEVIN_DESKTOP: 'https://docs.devin.ai/desktop/getting-started',\n} as const;\n"],"mappings":";AAAA,MAAa,iBAAiB;CAC5B,2BAA2B;CAC3B,2BAA2B;CAC3B,iBAAiB;AACnB;;;ACJA,MAAa,UAAU;CACrB,WAAW;CACX,UAAU;AACZ;;;ACHA,MAAa,WAAW;CACtB,KAAK;CACL,OAAO;CACP,KAAK;AACP;AAIA,MAAa,YAAY;CACvB,IAAI;CACJ,QAAQ;AACV;AAgBA,MAAa,SAAiD;CAC5D,oBAAoB;EAClB,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,UAAU;EACV,WAAW;EACX,QAAQ;CACV;CACA,kBAAkB;EAChB,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,UAAU;EACV,WAAW;CACb;CACA,eAAe;EACb,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,UAAU;EACV,WAAW;CACb;CACA,kBAAkB;EAChB,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,UAAU;EACV,WAAW;CACb;CACA,eAAe;E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AAS;CACT,mBAAmB;CAEnB,+BAA+B;CAC/B,kBAAkB;CAClB,gCAAgC;CAChC,0BAA0B;CAC1B,sBAAsB;CACtB,yBAAyB;CACzB,yBAAyB;CACzB,yBAAyB;CACzB,sBAAsB;AACxB"}
@@ -12,6 +12,15 @@ const Backend = {
12
12
  };
13
13
  //#endregion
14
14
  //#region src/constants/stacks.ts
15
+ const Provider = {
16
+ Aws: "aws",
17
+ Azure: "azure",
18
+ Gcp: "gcp"
19
+ };
20
+ const Continent = {
21
+ Us: "us",
22
+ Europe: "europe"
23
+ };
15
24
  const STACKS = {
16
25
  NORTH_EUROPE_AZURE: {
17
26
  id: "com-keboola-azure-north-europe",
@@ -165,10 +174,11 @@ const URLS = {
165
174
  CLIENT_CURSOR_QUICKSTART: "https://cursor.com/docs/get-started/quickstart",
166
175
  CLIENT_VS_CODE_SETUP: "https://code.visualstudio.com/docs/setup/setup-overview",
167
176
  CLIENT_CODEX_QUICKSTART: "https://developers.openai.com/codex/cli",
177
+ CLIENT_CHATGPT_DOWNLOAD: "https://chatgpt.com/download",
168
178
  CLIENT_MAKE_GET_STARTED: "https://help.make.com/get-started",
169
179
  CLIENT_DEVIN_DESKTOP: "https://docs.devin.ai/desktop/getting-started"
170
180
  };
171
181
  //#endregion
172
- export { ProjectFeature as i, STACKS as n, Backend as r, URLS as t };
182
+ export { Backend as a, STACKS as i, Continent as n, ProjectFeature as o, Provider as r, URLS as t };
173
183
 
174
- //# sourceMappingURL=constants-_HhqKvBg.js.map
184
+ //# sourceMappingURL=constants-qeWGfk_7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-qeWGfk_7.js","names":[],"sources":["../src/constants/projectFeatures.ts","../src/constants/backends.ts","../src/constants/stacks.ts","../src/constants/index.ts"],"sourcesContent":["export const ProjectFeature = {\n DisableLegacyBucketPrefix: 'disable-legacy-bucket-prefix',\n SoxProtectedDefaultBranch: 'protected-default-branch',\n StorageBranches: 'storage-branches',\n} as const;\n\nexport type ProjectFeature = (typeof ProjectFeature)[keyof typeof ProjectFeature];\n","export const Backend = {\n Snowflake: 'snowflake',\n Bigquery: 'bigquery',\n} as const;\n\nexport type Backend = (typeof Backend)[keyof typeof Backend];\n","export const Provider = {\n Aws: 'aws',\n Azure: 'azure',\n Gcp: 'gcp',\n} as const;\n\nexport type Provider = (typeof Provider)[keyof typeof Provider];\n\nexport const Continent = {\n Us: 'us',\n Europe: 'europe',\n} as const;\n\nexport type Continent = (typeof Continent)[keyof typeof Continent];\n\nexport type KeboolaStack = {\n id: string;\n host: string;\n isSingleTenant?: boolean;\n isTesting?: boolean;\n isPayg?: boolean;\n provider?: Provider;\n continent?: Continent;\n region?: string;\n isCanary?: boolean;\n};\n\nexport const STACKS: Record<string, Readonly<KeboolaStack>> = {\n NORTH_EUROPE_AZURE: {\n id: 'com-keboola-azure-north-europe',\n region: 'north-europe',\n host: 'connection.north-europe.azure.keboola.com',\n provider: 'azure',\n continent: 'europe',\n isPayg: true,\n },\n EU_CENTRAL_1_AWS: {\n id: 'kbc-eu-central-1',\n region: 'eu-central-1',\n host: 'connection.eu-central-1.keboola.com',\n provider: 'aws',\n continent: 'europe',\n },\n US_EAST_1_AWS: {\n id: 'kbc-us-east-1',\n region: 'us-east-1',\n host: 'connection.keboola.com',\n provider: 'aws',\n continent: 'us',\n },\n EUROPE_WEST3_GCP: {\n id: 'com-keboola-gcp-europe-west3',\n region: 'europe-west3',\n host: 'connection.europe-west3.gcp.keboola.com',\n provider: 'gcp',\n continent: 'europe',\n },\n US_EAST_4_GCP: {\n id: 'com-keboola-gcp-us-east4',\n region: 'us-east4',\n host: 'connection.us-east4.gcp.keboola.com',\n provider: 'gcp',\n continent: 'us',\n isPayg: true,\n },\n\n /* PRIVATE SINGLE TENANT STACKS\n ---------------------------- */\n HCI: {\n id: 'cloud-keboola-hci',\n host: 'connection.hci.keboola.cloud',\n isSingleTenant: true,\n },\n CSAS_PROD: {\n id: 'cloud-keboola-cs',\n host: 'connection.cs.keboola.cloud',\n isSingleTenant: true,\n },\n CSAS_TEST: {\n id: 'cloud-keboola-cs-test',\n host: 'connection.cs-test.keboola.cloud',\n isSingleTenant: true,\n },\n INNOGY: {\n id: 'cloud-keboola-innogy-hub',\n host: 'connection.innogy-hub.keboola.cloud',\n isSingleTenant: true,\n },\n GROUPON: {\n id: 'cloud-keboola-groupon',\n host: 'connection.groupon.keboola.cloud',\n isSingleTenant: true,\n },\n CREDIT_INFO: {\n id: 'cloud-keboola-creditinfo',\n host: 'connection.creditinfo.keboola.cloud',\n isSingleTenant: true,\n },\n COATES: {\n id: 'cloud-keboola-coates',\n host: 'connection.coates.keboola.cloud',\n isSingleTenant: true,\n },\n SLSP: {\n id: 'cloud-keboola-slsp',\n host: 'connection.slsp.keboola.cloud',\n isSingleTenant: true,\n },\n HCKZ: {\n id: 'cloud-keboola-hckz',\n host: 'connection.hckz.keboola.cloud',\n isSingleTenant: true,\n },\n PASHA: {\n id: 'cloud-keboola-pasha',\n host: 'connection.pasha.keboola.cloud',\n isSingleTenant: true,\n },\n RBI: {\n id: 'cloud-keboola-rbi',\n host: 'connection.rbi.keboola.cloud',\n isSingleTenant: true,\n },\n NAH: {\n id: 'cloud-keboola-nah',\n host: 'connection.nah.keboola.cloud',\n isSingleTenant: true,\n provider: 'azure',\n continent: 'us',\n },\n\n /* DEV STACKS\n ---------------------------- */\n DEV_US_CENTRAL_1_GCP: {\n id: 'dev-keboola-gcp-us-central1',\n region: 'us-central1',\n host: 'connection.us-central1.gcp.keboola.dev',\n provider: 'gcp',\n continent: 'us',\n isTesting: true,\n },\n DEV_EU_WEST_1_AWS: {\n id: 'dev-keboola-aws-eu-west-1',\n region: 'eu-west-1',\n host: 'connection.eu-west-1.aws.keboola.dev',\n provider: 'aws',\n continent: 'europe',\n isTesting: true,\n },\n DEV_US_EAST_2_AZURE: {\n id: 'kbc-testing-azure-east-us-2',\n region: 'east-us-2',\n host: 'connection.east-us-2.azure.keboola-testing.com',\n provider: 'azure',\n continent: 'us',\n isTesting: true,\n },\n DEV_KEBOOLA_CANARY_ORION: {\n id: 'dev-keboola-canary-orion',\n region: 'europe-west3',\n host: 'connection.canary-orion.keboola.dev',\n provider: 'gcp',\n continent: 'europe',\n isCanary: true,\n },\n};\n","export { ComponentId } from './componentId';\nexport { ProjectFeature } from './projectFeatures';\nexport { Backend } from './backends';\nexport { AdminRole } from './adminRoles';\nexport { Continent, Provider, STACKS } from './stacks';\nexport type { KeboolaStack } from './stacks';\n\nexport const URLS = {\n USER_DOCUMENTATION: 'https://help.keboola.com',\n COMPONENTS: 'https://components.keboola.com',\n DEVELOPERS_DOCUMENTATION: 'https://developers.keboola.com',\n ACADEMY: 'https://academy.keboola.com',\n SALES_CONTACT_FORM: 'https://keboola.com/contact',\n SNOWFLAKE: 'https://www.snowflake.com',\n SNOWFLAKE_DOCS: 'https://docs.snowflake.com',\n MCP: 'https://www.keboola.com/mcp',\n CLI: 'https://www.keboola.com/cli',\n NODE_JS: 'https://nodejs.org/en',\n CLAUDE_CONNECTORS: 'https://claude.ai/customize/connectors',\n // Vendor \"how do I get this client\" pages linked from the connect surfaces.\n CLIENT_CLAUDE_CODE_QUICKSTART: 'https://code.claude.com/docs/en/quickstart',\n CLIENT_CLAUDE_AI: 'https://claude.ai',\n CLIENT_CLAUDE_DESKTOP_DOWNLOAD: 'https://claude.com/download',\n CLIENT_CURSOR_QUICKSTART: 'https://cursor.com/docs/get-started/quickstart',\n CLIENT_VS_CODE_SETUP: 'https://code.visualstudio.com/docs/setup/setup-overview',\n CLIENT_CODEX_QUICKSTART: 'https://developers.openai.com/codex/cli',\n CLIENT_CHATGPT_DOWNLOAD: 'https://chatgpt.com/download',\n CLIENT_MAKE_GET_STARTED: 'https://help.make.com/get-started',\n CLIENT_DEVIN_DESKTOP: 'https://docs.devin.ai/desktop/getting-started',\n} as const;\n"],"mappings":";AAAA,MAAa,iBAAiB;CAC5B,2BAA2B;CAC3B,2BAA2B;CAC3B,iBAAiB;AACnB;;;ACJA,MAAa,UAAU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;EACpB,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,UAAU;EACV,WAAW;EACX,WAAW;CACb;CACA,mBAAmB;EACjB,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,UAAU;EACV,WAAW;EACX,WAAW;CACb;CACA,qBAAqB;EACnB,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,UAAU;EACV,WAAW;EACX,WAAW;CACb;CACA,0BAA0B;EACxB,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,UAAU;EACV,WAAW;EACX,UAAU;CACZ;AACF;;;AC9JA,MAAa,OAAO;CAClB,oBAAoB;CACpB,YAAY;CACZ,0BAA0B;CAC1B,SAAS;CACT,oBAAoB;CACpB,WAAW;CACX,gBAAgB;CAChB,KAAK;CACL,KAAK;CACL,SAAS;CACT,mBAAmB;CAEnB,+BAA+B;CAC/B,kBAAkB;CAClB,gCAAgC;CAChC,0BAA0B;CAC1B,sBAAsB;CACtB,yBAAyB;CACzB,yBAAyB;CACzB,yBAAyB;CACzB,sBAAsB;AACxB"}
@@ -57,6 +57,13 @@ const HttpContentType = {
57
57
  TEXT_HTML: "text/html"
58
58
  };
59
59
  const defaultValidateStatus = ({ response }) => response.status >= 200 && response.status <= 299;
60
+ /**
61
+ * Whether a response carries an HTML document.
62
+ *
63
+ * - Media types are case-insensitive, so a `Text/HTML` login page is still one.
64
+ * - Only meaningful on a *successful* response: HTML on a failed one is a real error page.
65
+ */
66
+ const isHtmlResponse = ({ response }) => !!response.headers.get(HttpHeader.CONTENT_TYPE)?.toLowerCase().includes(HttpContentType.TEXT_HTML);
60
67
  function removeUndefined(obj) {
61
68
  const objCopy = { ...obj };
62
69
  for (const [key, value] of Object.entries(objCopy)) if (value == null) delete objCopy[key];
@@ -71,6 +78,7 @@ const parseData = async (response) => {
71
78
  const text = await response.text();
72
79
  return text.trim() === "" ? null : JSON.parse(text);
73
80
  }
81
+ if (mediaType === "application/octet-stream") return response.blob();
74
82
  return response.text();
75
83
  };
76
84
  const cleanHeadersInit = (headersInit) => {
@@ -179,6 +187,6 @@ const createFetchClient = ({ middlewares = [], ...defaultOptions }) => {
179
187
  };
180
188
  };
181
189
  //#endregion
182
- export { HttpContentType as a, normalizeBaseUrl as c, HttpStatus as d, KeboolaHttpHeader as f, isFetchClientError as i, parseContentDispositionHeader as l, isAbortError as n, HttpHeader as o, ApiError as p, isApiError as r, defaultValidateStatus as s, createFetchClient as t, ENCRYPTED_VALUE_PREFIX as u };
190
+ export { HttpContentType as a, isHtmlResponse as c, ENCRYPTED_VALUE_PREFIX as d, HttpStatus as f, isFetchClientError as i, normalizeBaseUrl as l, ApiError as m, isAbortError as n, HttpHeader as o, KeboolaHttpHeader as p, isApiError as r, defaultValidateStatus as s, createFetchClient as t, parseContentDispositionHeader as u };
183
191
 
184
- //# sourceMappingURL=createFetchClient-BK0TZK-U.js.map
192
+ //# sourceMappingURL=createFetchClient-B1h3-p65.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFetchClient-B1h3-p65.js","names":[],"sources":["../src/errors/ApiError.ts","../src/internal.ts","../src/fetchClient/createFetchClient/utils.ts","../src/fetchClient/createFetchClient/createFetchClient.ts"],"sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nexport class ApiError extends Error {\n response: Response;\n request: Request;\n data: unknown;\n\n constructor({ response, request, data }: ApiResponse) {\n super(response.statusText);\n this.response = response;\n this.request = request;\n this.data = data;\n }\n}\n","// Package-internal constants. Not part of the public\n// `@keboola/api-client/constants` sub-path (that is the `constants/` directory).\n\nexport const KeboolaHttpHeader = {\n STORAGE_API_TOKEN: 'X-StorageApi-Token',\n MANAGEMENT_API_TOKEN: 'X-Kbc-Manageapitoken',\n STORAGE_API_URL: 'x-storageapi-url',\n PROJECT_ID: 'X-KBC-ProjectId',\n /** Storage job a request enqueued, reported on the response rather than in its body. */\n STORAGE_API_JOB_ID: 'X-StorageApi-Job-Id',\n} as const;\n\nexport const HttpStatus = {\n NO_CONTENT: 204,\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n UNPROCESSABLE_ENTITY: 422,\n INTERNAL_SERVER_ERROR: 500,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n} as const;\n\nexport const ENCRYPTED_VALUE_PREFIX = 'KBC::';\n","import type { IStringifyOptions } from 'qs';\nimport qs from 'qs';\n\nimport { HttpStatus } from '../../internal';\n\nimport type {\n ApiResponse,\n BodyParam,\n CreateFetchRequestFn,\n PathParam,\n ValidateStatusFn,\n} from './types';\n\n/**\n * Strips trailing slashes from a base URL so concatenating a leading-slash\n * path (e.g. `/v2/storage`) never produces a double slash.\n *\n * Without this, callers that pass `https://connection.keboola.com/` end up\n * issuing requests to `https://connection.keboola.com//v2/storage/...`, which\n * the Storage API rejects with a 404.\n */\nexport const normalizeBaseUrl = (baseUrl: string): string => baseUrl.replace(/\\/+$/, '');\n\nexport const HttpHeader = {\n CONTENT_TYPE: 'content-type',\n CONTENT_DISPOSITION: 'content-disposition',\n AUTHORIZATION: 'Authorization',\n IDEMPOTENCY_KEY: 'Idempotency-Key',\n IF_MATCH: 'If-Match',\n};\n\nexport const HttpContentType = {\n JSON: 'application/json',\n TEXT_PLAIN: 'text/plain',\n FORM_DATA: 'multipart/form-data',\n TEXT_HTML: 'text/html',\n};\n\nexport const defaultValidateStatus: ValidateStatusFn = ({ response }) =>\n response.status >= 200 && response.status <= 299;\n\n/**\n * Whether a response carries an HTML document.\n *\n * - Media types are case-insensitive, so a `Text/HTML` login page is still one.\n * - Only meaningful on a *successful* response: HTML on a failed one is a real error page.\n */\nexport const isHtmlResponse = ({ response }: ApiResponse) =>\n !!response.headers\n .get(HttpHeader.CONTENT_TYPE)\n ?.toLowerCase()\n .includes(HttpContentType.TEXT_HTML);\n\nfunction removeUndefined(obj: Record<string, string>) {\n const objCopy = { ...obj };\n for (const [key, value] of Object.entries(objCopy)) {\n if (value == null) delete objCopy[key];\n }\n return objCopy;\n}\n\n// `application/json`, but also `application/json; charset=utf-8` and the `+json` suffix family.\n// Comparing the raw header for equality misses every response that carries a charset.\nconst JSON_MEDIA_TYPE = /^application\\/([\\w.-]+\\+)?json$/;\n\nconst getMediaType = (response: Response) =>\n response.headers.get(HttpHeader.CONTENT_TYPE)?.split(';')[0]?.trim().toLowerCase() ?? '';\n\nexport const parseData = async (response: Response) => {\n if (response.status === HttpStatus.NO_CONTENT) return null;\n\n const mediaType = getMediaType(response);\n\n // Declared JSON is parsed strictly: a body that doesn't parse is a broken response, not a text\n // payload, and `JSON.parse` throwing is the right answer. Read it as text first only so an empty\n // body can resolve to `null` like a 204 — matching the charset form brings `application/json;\n // charset=utf-8` onto this path, where `response.json()` would turn a 200-with-no-body into a\n // `SyntaxError` it never used to be.\n if (JSON_MEDIA_TYPE.test(mediaType)) {\n const text = await response.text();\n\n return text.trim() === '' ? null : JSON.parse(text);\n }\n\n // A declared binary payload must come back as bytes — `text()` would decode it as UTF-8 and\n // corrupt it. `application/octet-stream` is the only binary type an endpoint declares today\n // (kai-agent's sandbox file download); widen deliberately, never by sniffing.\n if (mediaType === 'application/octet-stream') {\n return response.blob();\n }\n\n // Any other declared type describes its own payload — the query-service CSV export, the\n // data-science `text/plain` endpoints — so hand back the exact bytes instead of sniffing them.\n return response.text();\n};\n\n// Header instance serialize undefined value as `undefined`, we do not want that\nconst cleanHeadersInit = (headersInit: HeadersInit | undefined) => {\n if (Array.isArray(headersInit)) return headersInit;\n if (headersInit instanceof Headers) return headersInit;\n if (headersInit == null) return headersInit;\n\n return removeUndefined(headersInit);\n};\n\nconst createHeaders = (\n headersInitA: HeadersInit | undefined,\n headersInitB: HeadersInit | undefined,\n) => {\n const headersA = new Headers(cleanHeadersInit(headersInitA));\n const headersB = new Headers(cleanHeadersInit(headersInitB));\n\n headersB.forEach((value, key) => {\n headersA.set(key, value);\n });\n\n return headersA;\n};\n\nexport const createPath = (path: string, pathParam: PathParam = {}) =>\n path.replace(/\\{([^}]+)}/g, (_, key) => {\n if (!(key in pathParam))\n throw new Error(`Path parameter \"${key}\" is missing in the path \"${path}\"`);\n\n return encodeURIComponent(pathParam[key]!);\n });\n\nexport const createSearch = (\n query: Record<string, unknown>,\n options: Pick<IStringifyOptions, 'arrayFormat'> = {},\n) => {\n return qs.stringify(query, {\n encodeValuesOnly: true,\n skipNulls: true,\n ...options,\n });\n};\n\nexport const createBody = (body: BodyParam, headers: Headers) => {\n if (body == null) return null;\n if (body instanceof FormData) return body; // fetch automatically sets content-type header\n if (typeof body === 'string') return body; // fetch automatically sets content-type header\n\n const stringifyBody = JSON.stringify(body);\n const stringBody = stringifyBody === '{}' ? null : stringifyBody;\n if (stringBody) headers.set(HttpHeader.CONTENT_TYPE, HttpContentType.JSON);\n\n return stringBody;\n};\n\nexport const parseContentDispositionHeader = (contentDisposition?: string | null) => {\n // extract the type ('inline' or 'attachment'), default the type to 'unknown'\n const type = (() => {\n const typeMatch = contentDisposition?.match(/^\\s*(inline|attachment)\\s*;/i);\n return (typeMatch?.[1]?.toLowerCase() ?? 'unknown') as 'inline' | 'attachment' | 'unknown';\n })();\n\n // extract the filename, default the type to null\n const filename = (() => {\n const filenameMatch = contentDisposition?.match(/filename=\"([^\"]+)\"/i);\n if (filenameMatch) return filenameMatch[1];\n\n // If no filename=\"...\", check for encoded filename*=UTF-8''\n const encodedFilenameMatch = contentDisposition?.match(/filename\\*=(?:UTF-8'')?([^;]+)/i);\n if (encodedFilenameMatch?.[1]) return decodeURIComponent(encodedFilenameMatch[1]);\n\n // Check for unquoted filenames (rare but possible)\n const unquotedFilenameMatch = contentDisposition?.match(/filename=([^;]+)/i);\n return unquotedFilenameMatch?.[1] ?? null;\n })();\n\n // Return the parsed result\n return { type, filename };\n};\n\nexport const createFetchRequest: CreateFetchRequestFn = ({\n url,\n method,\n params,\n options = {},\n defaultOptions,\n}) => {\n const {\n baseUrl,\n validateStatus: defValidateStatus = defaultValidateStatus,\n headers: defaultHeaders,\n fetchFn: defaultFetchFn,\n ...restDefaultOptions\n } = defaultOptions;\n const {\n validateStatus,\n queryArrayFormat,\n headers: endpointHeaders,\n fetchFn,\n ...restOptions\n } = options;\n\n const headers = createHeaders(defaultHeaders, endpointHeaders);\n const path = createPath(url, params.path);\n const search = createSearch(params.query ?? {}, { arrayFormat: queryArrayFormat });\n const body = createBody(params.body, headers);\n\n const urlInstance = new URL(normalizeBaseUrl(baseUrl) + path);\n urlInstance.search = search;\n\n const request = new Request(urlInstance, {\n ...restDefaultOptions,\n ...restOptions,\n headers,\n method: method.toUpperCase(),\n body,\n });\n\n return {\n request,\n validateStatus: validateStatus ?? defValidateStatus,\n fetchFn: fetchFn ?? defaultFetchFn,\n };\n};\n","import { ApiError } from '../../errors';\n\nimport type {\n BaseFetchParams,\n CoreFetchFn,\n CreateFetchClientOptions,\n FetchClientOptions,\n HttpMethod,\n} from './types';\nimport { createFetchRequest, parseData } from './utils';\n\nexport type FetchClientError = TypeError | ApiError | SyntaxError | DOMException;\n\nexport const isApiError = (error: unknown): error is ApiError => error instanceof ApiError;\n\nexport const isAbortError = (error: unknown): error is DOMException =>\n error instanceof DOMException && error.name === 'AbortError';\n\nexport const isFetchClientError = (error: unknown): error is FetchClientError =>\n error instanceof TypeError || error instanceof SyntaxError || isApiError(error);\n\n// `fetchFn` is resolved per request by `createFetchRequest` (endpoint option beats client option),\n// so a single request can swap the transport without rebuilding the client.\nconst coreFetch: CoreFetchFn = async ({ request, validateStatus, fetchFn = fetch }) => {\n const response = await fetchFn(request);\n const data = await parseData(response);\n\n const apiResponse = {\n request,\n response,\n data,\n };\n\n const boolOrError = validateStatus(apiResponse);\n if (isApiError(boolOrError)) throw boolOrError;\n if (!boolOrError) throw new ApiError(apiResponse);\n\n return apiResponse;\n};\n\nexport const createFetchClient = ({\n middlewares = [],\n ...defaultOptions\n}: CreateFetchClientOptions) => {\n const fetchWithMiddlewares = middlewares.reduceRight(\n (next, middleware) => middleware(next),\n coreFetch,\n );\n\n const createFetchMethod =\n (method: HttpMethod) =>\n async (url: string, params: BaseFetchParams, options: FetchClientOptions = {}) => {\n const request = createFetchRequest({\n url,\n method,\n params,\n defaultOptions,\n options,\n });\n\n const methodMiddlewares = options?.middlewares ?? [];\n\n return methodMiddlewares.reduceRight(\n (next, middleware) => middleware(next),\n fetchWithMiddlewares,\n )(request);\n };\n\n return {\n get: createFetchMethod('get'),\n post: createFetchMethod('post'),\n put: createFetchMethod('put'),\n patch: createFetchMethod('patch'),\n delete: createFetchMethod('delete'),\n };\n};\n"],"mappings":";;AAEA,IAAa,WAAb,cAA8B,MAAM;CAClC;CACA;CACA;CAEA,YAAY,EAAE,UAAU,SAAS,QAAqB;EACpD,MAAM,SAAS,UAAU;EACzB,KAAK,WAAW;EAChB,KAAK,UAAU;EACf,KAAK,OAAO;CACd;AACF;;;ACVA,MAAa,oBAAoB;CAC/B,mBAAmB;CACnB,sBAAsB;CACtB,iBAAiB;CACjB,YAAY;;CAEZ,oBAAoB;AACtB;AAEA,MAAa,aAAa;CACxB,YAAY;CACZ,aAAa;CACb,cAAc;CACd,sBAAsB;CACtB,uBAAuB;CACvB,aAAa;CACb,qBAAqB;CACrB,iBAAiB;AACnB;AAEA,MAAa,yBAAyB;;;;;;;;;;;ACFtC,MAAa,oBAAoB,YAA4B,QAAQ,QAAQ,QAAQ,EAAE;AAEvF,MAAa,aAAa;CACxB,cAAc;CACd,qBAAqB;CACrB,eAAe;CACf,iBAAiB;CACjB,UAAU;AACZ;AAEA,MAAa,kBAAkB;CAC7B,MAAM;CACN,YAAY;CACZ,WAAW;CACX,WAAW;AACb;AAEA,MAAa,yBAA2C,EAAE,eACxD,SAAS,UAAU,OAAO,SAAS,UAAU;;;;;;;AAQ/C,MAAa,kBAAkB,EAAE,eAC/B,CAAC,CAAC,SAAS,QACR,IAAI,WAAW,YAAY,CAAC,EAC3B,YAAY,CAAC,CACd,SAAS,gBAAgB,SAAS;AAEvC,SAAS,gBAAgB,KAA6B;CACpD,MAAM,UAAU,EAAE,GAAG,IAAI;CACzB,KAAK,MAAM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const defaultValidateStatus = ({ response }) => response.status >= 200 && response.status <= 299;
62
+ /**
63
+ * Whether a response carries an HTML document.
64
+ *
65
+ * - Media types are case-insensitive, so a `Text/HTML` login page is still one.
66
+ * - Only meaningful on a *successful* response: HTML on a failed one is a real error page.
67
+ */
68
+ const isHtmlResponse = ({ response }) => !!response.headers.get(HttpHeader.CONTENT_TYPE)?.toLowerCase().includes(HttpContentType.TEXT_HTML);
62
69
  function removeUndefined(obj) {
63
70
  const objCopy = { ...obj };
64
71
  for (const [key, value] of Object.entries(objCopy)) if (value == null) delete objCopy[key];
@@ -73,6 +80,7 @@ const parseData = async (response) => {
73
80
  const text = await response.text();
74
81
  return text.trim() === "" ? null : JSON.parse(text);
75
82
  }
83
+ if (mediaType === "application/octet-stream") return response.blob();
76
84
  return response.text();
77
85
  };
78
86
  const cleanHeadersInit = (headersInit) => {
@@ -247,6 +255,12 @@ Object.defineProperty(exports, "isFetchClientError", {
247
255
  return isFetchClientError;
248
256
  }
249
257
  });
258
+ Object.defineProperty(exports, "isHtmlResponse", {
259
+ enumerable: true,
260
+ get: function() {
261
+ return isHtmlResponse;
262
+ }
263
+ });
250
264
  Object.defineProperty(exports, "normalizeBaseUrl", {
251
265
  enumerable: true,
252
266
  get: function() {
@@ -260,4 +274,4 @@ Object.defineProperty(exports, "parseContentDispositionHeader", {
260
274
  }
261
275
  });
262
276
 
263
- //# sourceMappingURL=createFetchClient-BsG719K1.cjs.map
277
+ //# sourceMappingURL=createFetchClient-B9Cv0W9f.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFetchClient-B9Cv0W9f.cjs","names":[],"sources":["../src/errors/ApiError.ts","../src/internal.ts","../src/fetchClient/createFetchClient/utils.ts","../src/fetchClient/createFetchClient/createFetchClient.ts"],"sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nexport class ApiError extends Error {\n response: Response;\n request: Request;\n data: unknown;\n\n constructor({ response, request, data }: ApiResponse) {\n super(response.statusText);\n this.response = response;\n this.request = request;\n this.data = data;\n }\n}\n","// Package-internal constants. Not part of the public\n// `@keboola/api-client/constants` sub-path (that is the `constants/` directory).\n\nexport const KeboolaHttpHeader = {\n STORAGE_API_TOKEN: 'X-StorageApi-Token',\n MANAGEMENT_API_TOKEN: 'X-Kbc-Manageapitoken',\n STORAGE_API_URL: 'x-storageapi-url',\n PROJECT_ID: 'X-KBC-ProjectId',\n /** Storage job a request enqueued, reported on the response rather than in its body. */\n STORAGE_API_JOB_ID: 'X-StorageApi-Job-Id',\n} as const;\n\nexport const HttpStatus = {\n NO_CONTENT: 204,\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n UNPROCESSABLE_ENTITY: 422,\n INTERNAL_SERVER_ERROR: 500,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n} as const;\n\nexport const ENCRYPTED_VALUE_PREFIX = 'KBC::';\n","import type { IStringifyOptions } from 'qs';\nimport qs from 'qs';\n\nimport { HttpStatus } from '../../internal';\n\nimport type {\n ApiResponse,\n BodyParam,\n CreateFetchRequestFn,\n PathParam,\n ValidateStatusFn,\n} from './types';\n\n/**\n * Strips trailing slashes from a base URL so concatenating a leading-slash\n * path (e.g. `/v2/storage`) never produces a double slash.\n *\n * Without this, callers that pass `https://connection.keboola.com/` end up\n * issuing requests to `https://connection.keboola.com//v2/storage/...`, which\n * the Storage API rejects with a 404.\n */\nexport const normalizeBaseUrl = (baseUrl: string): string => baseUrl.replace(/\\/+$/, '');\n\nexport const HttpHeader = {\n CONTENT_TYPE: 'content-type',\n CONTENT_DISPOSITION: 'content-disposition',\n AUTHORIZATION: 'Authorization',\n IDEMPOTENCY_KEY: 'Idempotency-Key',\n IF_MATCH: 'If-Match',\n};\n\nexport const HttpContentType = {\n JSON: 'application/json',\n TEXT_PLAIN: 'text/plain',\n FORM_DATA: 'multipart/form-data',\n TEXT_HTML: 'text/html',\n};\n\nexport const defaultValidateStatus: ValidateStatusFn = ({ response }) =>\n response.status >= 200 && response.status <= 299;\n\n/**\n * Whether a response carries an HTML document.\n *\n * - Media types are case-insensitive, so a `Text/HTML` login page is still one.\n * - Only meaningful on a *successful* response: HTML on a failed one is a real error page.\n */\nexport const isHtmlResponse = ({ response }: ApiResponse) =>\n !!response.headers\n .get(HttpHeader.CONTENT_TYPE)\n ?.toLowerCase()\n .includes(HttpContentType.TEXT_HTML);\n\nfunction removeUndefined(obj: Record<string, string>) {\n const objCopy = { ...obj };\n for (const [key, value] of Object.entries(objCopy)) {\n if (value == null) delete objCopy[key];\n }\n return objCopy;\n}\n\n// `application/json`, but also `application/json; charset=utf-8` and the `+json` suffix family.\n// Comparing the raw header for equality misses every response that carries a charset.\nconst JSON_MEDIA_TYPE = /^application\\/([\\w.-]+\\+)?json$/;\n\nconst getMediaType = (response: Response) =>\n response.headers.get(HttpHeader.CONTENT_TYPE)?.split(';')[0]?.trim().toLowerCase() ?? '';\n\nexport const parseData = async (response: Response) => {\n if (response.status === HttpStatus.NO_CONTENT) return null;\n\n const mediaType = getMediaType(response);\n\n // Declared JSON is parsed strictly: a body that doesn't parse is a broken response, not a text\n // payload, and `JSON.parse` throwing is the right answer. Read it as text first only so an empty\n // body can resolve to `null` like a 204 — matching the charset form brings `application/json;\n // charset=utf-8` onto this path, where `response.json()` would turn a 200-with-no-body into a\n // `SyntaxError` it never used to be.\n if (JSON_MEDIA_TYPE.test(mediaType)) {\n const text = await response.text();\n\n return text.trim() === '' ? null : JSON.parse(text);\n }\n\n // A declared binary payload must come back as bytes — `text()` would decode it as UTF-8 and\n // corrupt it. `application/octet-stream` is the only binary type an endpoint declares today\n // (kai-agent's sandbox file download); widen deliberately, never by sniffing.\n if (mediaType === 'application/octet-stream') {\n return response.blob();\n }\n\n // Any other declared type describes its own payload — the query-service CSV export, the\n // data-science `text/plain` endpoints — so hand back the exact bytes instead of sniffing them.\n return response.text();\n};\n\n// Header instance serialize undefined value as `undefined`, we do not want that\nconst cleanHeadersInit = (headersInit: HeadersInit | undefined) => {\n if (Array.isArray(headersInit)) return headersInit;\n if (headersInit instanceof Headers) return headersInit;\n if (headersInit == null) return headersInit;\n\n return removeUndefined(headersInit);\n};\n\nconst createHeaders = (\n headersInitA: HeadersInit | undefined,\n headersInitB: HeadersInit | undefined,\n) => {\n const headersA = new Headers(cleanHeadersInit(headersInitA));\n const headersB = new Headers(cleanHeadersInit(headersInitB));\n\n headersB.forEach((value, key) => {\n headersA.set(key, value);\n });\n\n return headersA;\n};\n\nexport const createPath = (path: string, pathParam: PathParam = {}) =>\n path.replace(/\\{([^}]+)}/g, (_, key) => {\n if (!(key in pathParam))\n throw new Error(`Path parameter \"${key}\" is missing in the path \"${path}\"`);\n\n return encodeURIComponent(pathParam[key]!);\n });\n\nexport const createSearch = (\n query: Record<string, unknown>,\n options: Pick<IStringifyOptions, 'arrayFormat'> = {},\n) => {\n return qs.stringify(query, {\n encodeValuesOnly: true,\n skipNulls: true,\n ...options,\n });\n};\n\nexport const createBody = (body: BodyParam, headers: Headers) => {\n if (body == null) return null;\n if (body instanceof FormData) return body; // fetch automatically sets content-type header\n if (typeof body === 'string') return body; // fetch automatically sets content-type header\n\n const stringifyBody = JSON.stringify(body);\n const stringBody = stringifyBody === '{}' ? null : stringifyBody;\n if (stringBody) headers.set(HttpHeader.CONTENT_TYPE, HttpContentType.JSON);\n\n return stringBody;\n};\n\nexport const parseContentDispositionHeader = (contentDisposition?: string | null) => {\n // extract the type ('inline' or 'attachment'), default the type to 'unknown'\n const type = (() => {\n const typeMatch = contentDisposition?.match(/^\\s*(inline|attachment)\\s*;/i);\n return (typeMatch?.[1]?.toLowerCase() ?? 'unknown') as 'inline' | 'attachment' | 'unknown';\n })();\n\n // extract the filename, default the type to null\n const filename = (() => {\n const filenameMatch = contentDisposition?.match(/filename=\"([^\"]+)\"/i);\n if (filenameMatch) return filenameMatch[1];\n\n // If no filename=\"...\", check for encoded filename*=UTF-8''\n const encodedFilenameMatch = contentDisposition?.match(/filename\\*=(?:UTF-8'')?([^;]+)/i);\n if (encodedFilenameMatch?.[1]) return decodeURIComponent(encodedFilenameMatch[1]);\n\n // Check for unquoted filenames (rare but possible)\n const unquotedFilenameMatch = contentDisposition?.match(/filename=([^;]+)/i);\n return unquotedFilenameMatch?.[1] ?? null;\n })();\n\n // Return the parsed result\n return { type, filename };\n};\n\nexport const createFetchRequest: CreateFetchRequestFn = ({\n url,\n method,\n params,\n options = {},\n defaultOptions,\n}) => {\n const {\n baseUrl,\n validateStatus: defValidateStatus = defaultValidateStatus,\n headers: defaultHeaders,\n fetchFn: defaultFetchFn,\n ...restDefaultOptions\n } = defaultOptions;\n const {\n validateStatus,\n queryArrayFormat,\n headers: endpointHeaders,\n fetchFn,\n ...restOptions\n } = options;\n\n const headers = createHeaders(defaultHeaders, endpointHeaders);\n const path = createPath(url, params.path);\n const search = createSearch(params.query ?? {}, { arrayFormat: queryArrayFormat });\n const body = createBody(params.body, headers);\n\n const urlInstance = new URL(normalizeBaseUrl(baseUrl) + path);\n urlInstance.search = search;\n\n const request = new Request(urlInstance, {\n ...restDefaultOptions,\n ...restOptions,\n headers,\n method: method.toUpperCase(),\n body,\n });\n\n return {\n request,\n validateStatus: validateStatus ?? defValidateStatus,\n fetchFn: fetchFn ?? defaultFetchFn,\n };\n};\n","import { ApiError } from '../../errors';\n\nimport type {\n BaseFetchParams,\n CoreFetchFn,\n CreateFetchClientOptions,\n FetchClientOptions,\n HttpMethod,\n} from './types';\nimport { createFetchRequest, parseData } from './utils';\n\nexport type FetchClientError = TypeError | ApiError | SyntaxError | DOMException;\n\nexport const isApiError = (error: unknown): error is ApiError => error instanceof ApiError;\n\nexport const isAbortError = (error: unknown): error is DOMException =>\n error instanceof DOMException && error.name === 'AbortError';\n\nexport const isFetchClientError = (error: unknown): error is FetchClientError =>\n error instanceof TypeError || error instanceof SyntaxError || isApiError(error);\n\n// `fetchFn` is resolved per request by `createFetchRequest` (endpoint option beats client option),\n// so a single request can swap the transport without rebuilding the client.\nconst coreFetch: CoreFetchFn = async ({ request, validateStatus, fetchFn = fetch }) => {\n const response = await fetchFn(request);\n const data = await parseData(response);\n\n const apiResponse = {\n request,\n response,\n data,\n };\n\n const boolOrError = validateStatus(apiResponse);\n if (isApiError(boolOrError)) throw boolOrError;\n if (!boolOrError) throw new ApiError(apiResponse);\n\n return apiResponse;\n};\n\nexport const createFetchClient = ({\n middlewares = [],\n ...defaultOptions\n}: CreateFetchClientOptions) => {\n const fetchWithMiddlewares = middlewares.reduceRight(\n (next, middleware) => middleware(next),\n coreFetch,\n );\n\n const createFetchMethod =\n (method: HttpMethod) =>\n async (url: string, params: BaseFetchParams, options: FetchClientOptions = {}) => {\n const request = createFetchRequest({\n url,\n method,\n params,\n defaultOptions,\n options,\n });\n\n const methodMiddlewares = options?.middlewares ?? [];\n\n return methodMiddlewares.reduceRight(\n (next, middleware) => middleware(next),\n fetchWithMiddlewares,\n )(request);\n };\n\n return {\n get: createFetchMethod('get'),\n post: createFetchMethod('post'),\n put: createFetchMethod('put'),\n patch: createFetchMethod('patch'),\n delete: createFetchMethod('delete'),\n };\n};\n"],"mappings":";;;;AAEA,IAAa,WAAb,cAA8B,MAAM;CAClC;CACA;CACA;CAEA,YAAY,EAAE,UAAU,SAAS,QAAqB;EACpD,MAAM,SAAS,UAAU;EACzB,KAAK,WAAW;EAChB,KAAK,UAAU;EACf,KAAK,OAAO;CACd;AACF;;;ACVA,MAAa,oBAAoB;CAC/B,mBAAmB;CACnB,sBAAsB;CACtB,iBAAiB;CACjB,YAAY;;CAEZ,oBAAoB;AACtB;AAEA,MAAa,aAAa;CACxB,YAAY;CACZ,aAAa;CACb,cAAc;CACd,sBAAsB;CACtB,uBAAuB;CACvB,aAAa;CACb,qBAAqB;CACrB,iBAAiB;AACnB;AAEA,MAAa,yBAAyB;;;;;;;;;;;ACFtC,MAAa,oBAAoB,YAA4B,QAAQ,QAAQ,QAAQ,EAAE;AAEvF,MAAa,aAAa;CACxB,cAAc;CACd,qBAAqB;CACrB,eAAe;CAC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,mBAAmB;GACjC;GACA;GACA;GACA;GACA;EACF,CAAC;EAID,QAF0B,SAAS,eAAe,CAAC,EAAA,CAE1B,aACtB,MAAM,eAAe,WAAW,IAAI,GACrC,oBACF,CAAC,CAAC,OAAO;CACX;CAEF,OAAO;EACL,KAAK,kBAAkB,KAAK;EAC5B,MAAM,kBAAkB,MAAM;EAC9B,KAAK,kBAAkB,KAAK;EAC5B,OAAO,kBAAkB,OAAO;EAChC,QAAQ,kBAAkB,QAAQ;CACpC;AACF"}
@@ -1,4 +1,4 @@
1
- const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
1
+ const require_createFetchClient = require("./createFetchClient-B9Cv0W9f.cjs");
2
2
  //#region src/fetchClient/createGenericFetchClient.ts
3
3
  const createGenericFetchClient = (defaultOptions) => require_createFetchClient.createFetchClient(defaultOptions);
4
4
  //#endregion
@@ -9,4 +9,4 @@ Object.defineProperty(exports, "createGenericFetchClient", {
9
9
  }
10
10
  });
11
11
 
12
- //# sourceMappingURL=createGenericFetchClient-DLbjX0eM.cjs.map
12
+ //# sourceMappingURL=createGenericFetchClient-BWoSkTki.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"createGenericFetchClient-DLbjX0eM.cjs","names":["createFetchClient"],"sources":["../src/fetchClient/createGenericFetchClient.ts"],"sourcesContent":["import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n"],"mappings":";;AA8BA,MAAa,4BAA4B,mBACvCA,0BAAAA,kBAAkB,cAAc"}
1
+ {"version":3,"file":"createGenericFetchClient-BWoSkTki.cjs","names":["createFetchClient"],"sources":["../src/fetchClient/createGenericFetchClient.ts"],"sourcesContent":["import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n"],"mappings":";;AA8BA,MAAa,4BAA4B,mBACvCA,0BAAAA,kBAAkB,cAAc"}
@@ -1,7 +1,7 @@
1
- import { t as createFetchClient } from "./createFetchClient-BK0TZK-U.js";
1
+ import { t as createFetchClient } from "./createFetchClient-B1h3-p65.js";
2
2
  //#region src/fetchClient/createGenericFetchClient.ts
3
3
  const createGenericFetchClient = (defaultOptions) => createFetchClient(defaultOptions);
4
4
  //#endregion
5
5
  export { createGenericFetchClient as t };
6
6
 
7
- //# sourceMappingURL=createGenericFetchClient-CVZYekDk.js.map
7
+ //# sourceMappingURL=createGenericFetchClient-DhpvUSlX.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createGenericFetchClient-CVZYekDk.js","names":[],"sources":["../src/fetchClient/createGenericFetchClient.ts"],"sourcesContent":["import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n"],"mappings":";;AA8BA,MAAa,4BAA4B,mBACvC,kBAAkB,cAAc"}
1
+ {"version":3,"file":"createGenericFetchClient-DhpvUSlX.js","names":[],"sources":["../src/fetchClient/createGenericFetchClient.ts"],"sourcesContent":["import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n"],"mappings":";;AA8BA,MAAa,4BAA4B,mBACvC,kBAAkB,cAAc"}
@@ -1,7 +1,7 @@
1
- import { t as createFetchClient } from "./createFetchClient-BK0TZK-U.js";
1
+ import { t as createFetchClient } from "./createFetchClient-B1h3-p65.js";
2
2
  //#region src/fetchClient/createOpenapiFetchClient.ts
3
3
  const createOpenapiFetchClient = (defaultOptions) => createFetchClient(defaultOptions);
4
4
  //#endregion
5
5
  export { createOpenapiFetchClient as t };
6
6
 
7
- //# sourceMappingURL=createOpenapiFetchClient-B5U1fCHS.js.map
7
+ //# sourceMappingURL=createOpenapiFetchClient-0_oqhdPv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createOpenapiFetchClient-B5U1fCHS.js","names":[],"sources":["../src/fetchClient/createOpenapiFetchClient.ts"],"sourcesContent":["import {\n type ApiResponse,\n createFetchClient,\n type CreateFetchClientOptions,\n type FetchClientOptions,\n type HttpMethod,\n} from './createFetchClient';\nimport type { OpenapiParametersType, OpenapiReturnType } from './types';\n\ntype OpenapiPaths<Paths> = {\n [P in keyof Paths]: {\n [M in HttpMethod]?: unknown;\n };\n};\n\ntype PathsWithMethod<Paths extends OpenapiPaths<Paths>, PathnameMethod extends HttpMethod> = {\n [Pathname in keyof Paths]: Paths[Pathname] extends {\n [K in PathnameMethod]: any;\n }\n ? Pathname\n : never;\n}[keyof Paths];\n\ntype FetchMethod<Paths extends OpenapiPaths<Paths>, Method extends HttpMethod> = <\n Path extends PathsWithMethod<Paths, Method>,\n>(\n url: Path,\n params: OpenapiParametersType<Paths[Path][Method]>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<OpenapiReturnType<Paths[Path][Method]>>>;\n\ntype FetchClient<Paths extends OpenapiPaths<Paths>> = {\n get: FetchMethod<Paths, 'get'>;\n post: FetchMethod<Paths, 'post'>;\n put: FetchMethod<Paths, 'put'>;\n patch: FetchMethod<Paths, 'patch'>;\n delete: FetchMethod<Paths, 'delete'>;\n};\n\nexport const createOpenapiFetchClient = <Paths extends OpenapiPaths<Paths>>(\n defaultOptions: CreateFetchClientOptions,\n) => createFetchClient(defaultOptions) as FetchClient<Paths>;\n"],"mappings":";;AAuCA,MAAa,4BACX,mBACG,kBAAkB,cAAc"}
1
+ {"version":3,"file":"createOpenapiFetchClient-0_oqhdPv.js","names":[],"sources":["../src/fetchClient/createOpenapiFetchClient.ts"],"sourcesContent":["import {\n type ApiResponse,\n createFetchClient,\n type CreateFetchClientOptions,\n type FetchClientOptions,\n type HttpMethod,\n} from './createFetchClient';\nimport type { OpenapiParametersType, OpenapiReturnType } from './types';\n\ntype OpenapiPaths<Paths> = {\n [P in keyof Paths]: {\n [M in HttpMethod]?: unknown;\n };\n};\n\ntype PathsWithMethod<Paths extends OpenapiPaths<Paths>, PathnameMethod extends HttpMethod> = {\n [Pathname in keyof Paths]: Paths[Pathname] extends {\n [K in PathnameMethod]: any;\n }\n ? Pathname\n : never;\n}[keyof Paths];\n\ntype FetchMethod<Paths extends OpenapiPaths<Paths>, Method extends HttpMethod> = <\n Path extends PathsWithMethod<Paths, Method>,\n>(\n url: Path,\n params: OpenapiParametersType<Paths[Path][Method]>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<OpenapiReturnType<Paths[Path][Method]>>>;\n\ntype FetchClient<Paths extends OpenapiPaths<Paths>> = {\n get: FetchMethod<Paths, 'get'>;\n post: FetchMethod<Paths, 'post'>;\n put: FetchMethod<Paths, 'put'>;\n patch: FetchMethod<Paths, 'patch'>;\n delete: FetchMethod<Paths, 'delete'>;\n};\n\nexport const createOpenapiFetchClient = <Paths extends OpenapiPaths<Paths>>(\n defaultOptions: CreateFetchClientOptions,\n) => createFetchClient(defaultOptions) as FetchClient<Paths>;\n"],"mappings":";;AAuCA,MAAa,4BACX,mBACG,kBAAkB,cAAc"}
@@ -1,4 +1,4 @@
1
- const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
1
+ const require_createFetchClient = require("./createFetchClient-B9Cv0W9f.cjs");
2
2
  //#region src/fetchClient/createOpenapiFetchClient.ts
3
3
  const createOpenapiFetchClient = (defaultOptions) => require_createFetchClient.createFetchClient(defaultOptions);
4
4
  //#endregion
@@ -9,4 +9,4 @@ Object.defineProperty(exports, "createOpenapiFetchClient", {
9
9
  }
10
10
  });
11
11
 
12
- //# sourceMappingURL=createOpenapiFetchClient-Cr90VXY4.cjs.map
12
+ //# sourceMappingURL=createOpenapiFetchClient-yirrW6Tg.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"createOpenapiFetchClient-Cr90VXY4.cjs","names":["createFetchClient"],"sources":["../src/fetchClient/createOpenapiFetchClient.ts"],"sourcesContent":["import {\n type ApiResponse,\n createFetchClient,\n type CreateFetchClientOptions,\n type FetchClientOptions,\n type HttpMethod,\n} from './createFetchClient';\nimport type { OpenapiParametersType, OpenapiReturnType } from './types';\n\ntype OpenapiPaths<Paths> = {\n [P in keyof Paths]: {\n [M in HttpMethod]?: unknown;\n };\n};\n\ntype PathsWithMethod<Paths extends OpenapiPaths<Paths>, PathnameMethod extends HttpMethod> = {\n [Pathname in keyof Paths]: Paths[Pathname] extends {\n [K in PathnameMethod]: any;\n }\n ? Pathname\n : never;\n}[keyof Paths];\n\ntype FetchMethod<Paths extends OpenapiPaths<Paths>, Method extends HttpMethod> = <\n Path extends PathsWithMethod<Paths, Method>,\n>(\n url: Path,\n params: OpenapiParametersType<Paths[Path][Method]>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<OpenapiReturnType<Paths[Path][Method]>>>;\n\ntype FetchClient<Paths extends OpenapiPaths<Paths>> = {\n get: FetchMethod<Paths, 'get'>;\n post: FetchMethod<Paths, 'post'>;\n put: FetchMethod<Paths, 'put'>;\n patch: FetchMethod<Paths, 'patch'>;\n delete: FetchMethod<Paths, 'delete'>;\n};\n\nexport const createOpenapiFetchClient = <Paths extends OpenapiPaths<Paths>>(\n defaultOptions: CreateFetchClientOptions,\n) => createFetchClient(defaultOptions) as FetchClient<Paths>;\n"],"mappings":";;AAuCA,MAAa,4BACX,mBACGA,0BAAAA,kBAAkB,cAAc"}
1
+ {"version":3,"file":"createOpenapiFetchClient-yirrW6Tg.cjs","names":["createFetchClient"],"sources":["../src/fetchClient/createOpenapiFetchClient.ts"],"sourcesContent":["import {\n type ApiResponse,\n createFetchClient,\n type CreateFetchClientOptions,\n type FetchClientOptions,\n type HttpMethod,\n} from './createFetchClient';\nimport type { OpenapiParametersType, OpenapiReturnType } from './types';\n\ntype OpenapiPaths<Paths> = {\n [P in keyof Paths]: {\n [M in HttpMethod]?: unknown;\n };\n};\n\ntype PathsWithMethod<Paths extends OpenapiPaths<Paths>, PathnameMethod extends HttpMethod> = {\n [Pathname in keyof Paths]: Paths[Pathname] extends {\n [K in PathnameMethod]: any;\n }\n ? Pathname\n : never;\n}[keyof Paths];\n\ntype FetchMethod<Paths extends OpenapiPaths<Paths>, Method extends HttpMethod> = <\n Path extends PathsWithMethod<Paths, Method>,\n>(\n url: Path,\n params: OpenapiParametersType<Paths[Path][Method]>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<OpenapiReturnType<Paths[Path][Method]>>>;\n\ntype FetchClient<Paths extends OpenapiPaths<Paths>> = {\n get: FetchMethod<Paths, 'get'>;\n post: FetchMethod<Paths, 'post'>;\n put: FetchMethod<Paths, 'put'>;\n patch: FetchMethod<Paths, 'patch'>;\n delete: FetchMethod<Paths, 'delete'>;\n};\n\nexport const createOpenapiFetchClient = <Paths extends OpenapiPaths<Paths>>(\n defaultOptions: CreateFetchClientOptions,\n) => createFetchClient(defaultOptions) as FetchClient<Paths>;\n"],"mappings":";;AAuCA,MAAa,4BACX,mBACGA,0BAAAA,kBAAkB,cAAc"}
@@ -1,5 +1,5 @@
1
1
  const require_dedupe = require("./dedupe-CiskLkGR.cjs");
2
- const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
2
+ const require_createFetchClient = require("./createFetchClient-B9Cv0W9f.cjs");
3
3
  //#region src/keboola/bearer/credential.ts
4
4
  const DEFAULT_REFRESH_THRESHOLD = .9;
5
5
  const isUnauthorized = (error) => error instanceof require_createFetchClient.ApiError && error.response.status === require_createFetchClient.HttpStatus.UNAUTHORIZED;
@@ -41,4 +41,4 @@ Object.defineProperty(exports, "isUnauthorized", {
41
41
  }
42
42
  });
43
43
 
44
- //# sourceMappingURL=credential-0c6yFwtp.cjs.map
44
+ //# sourceMappingURL=credential-D-tX9gP4.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"credential-0c6yFwtp.cjs","names":["ApiError","HttpStatus","dedupe"],"sources":["../src/keboola/bearer/credential.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpStatus } from '../../internal';\nimport { dedupe } from '../../utils';\n\ntype TokenTiming = { issuedAt: number; expiresIn: number };\ntype TokenSnapshot = { accessToken: string; timing: TokenTiming };\n\ntype Options = {\n // Rotate the credential (single-use refresh-token flow); resolves to the fresh access token.\n refresh: () => Promise<string>;\n // Live read of the current token + timing from the single source of truth (config). `null` when the\n // session is anonymous (no credential yet) — e.g. a pre-auth `login` request.\n getToken: () => TokenSnapshot | null;\n // Called when the session is found dead (refresh or replay rejected). The caller owns the\n // fire-once latch + per-session re-arm (see `config.notifyExpired`), so this may fire more than once.\n onSessionExpired?: () => void;\n refreshThreshold?: number;\n};\n\nconst DEFAULT_REFRESH_THRESHOLD = 0.9;\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type BearerCredential = {\n // Resolves the current access token, or `null` when the session is anonymous (nothing to stamp).\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n notifyExpired: () => void;\n};\n\nexport const createBearerCredential = ({\n refresh,\n getToken,\n onSessionExpired,\n refreshThreshold = DEFAULT_REFRESH_THRESHOLD,\n}: Options): BearerCredential => {\n const doRefresh = async (): Promise<string> => {\n try {\n return await refresh();\n } catch (error) {\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n const refreshShared = dedupe(doRefresh);\n\n const refreshAt = (timing: TokenTiming): number =>\n timing.issuedAt + timing.expiresIn * 1000 * refreshThreshold;\n\n const getAccessToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const snapshot = getToken();\n if (snapshot === null) return null; // anonymous: nothing to stamp (pre-auth request)\n const { accessToken, timing } = snapshot;\n if (forceRefresh) return refreshShared(); // 401 path: must succeed, propagate failure\n if (Date.now() < refreshAt(timing)) return accessToken; // still fresh: current token\n // Proactive: best-effort — if the ahead-of-time refresh fails, proceed with the current token\n // and let a real 401 drive the mandatory refresh.\n return refreshShared().catch(() => accessToken);\n };\n\n return { getAccessToken, notifyExpired: () => onSessionExpired?.() };\n};\n"],"mappings":";;;AAmBA,MAAM,4BAA4B;AAElC,MAAa,kBAAkB,UAC7B,iBAAiBA,0BAAAA,YAAY,MAAM,SAAS,WAAWC,0BAAAA,WAAW;AAQpE,MAAa,0BAA0B,EACrC,SACA,UACA,kBACA,mBAAmB,gCACY;CAC/B,MAAM,YAAY,YAA6B;EAC7C,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO;GACd,IAAI,eAAe,KAAK,GAAG,mBAAmB;GAC9C,MAAM;EACR;CACF;CAEA,MAAM,gBAAgBC,eAAAA,OAAO,SAAS;CAEtC,MAAM,aAAa,WACjB,OAAO,WAAW,OAAO,YAAY,MAAO;CAE9C,MAAM,iBAAiB,OAAO,EAAE,eAAe,UAAU,CAAC,MAA8B;EACtF,MAAM,WAAW,SAAS;EAC1B,IAAI,aAAa,MAAM,OAAO;EAC9B,MAAM,EAAE,aAAa,WAAW;EAChC,IAAI,cAAc,OAAO,cAAc;EACvC,IAAI,KAAK,IAAI,IAAI,UAAU,MAAM,GAAG,OAAO;EAG3C,OAAO,cAAc,CAAC,CAAC,YAAY,WAAW;CAChD;CAEA,OAAO;EAAE;EAAgB,qBAAqB,mBAAmB;CAAE;AACrE"}
1
+ {"version":3,"file":"credential-D-tX9gP4.cjs","names":["ApiError","HttpStatus","dedupe"],"sources":["../src/keboola/bearer/credential.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpStatus } from '../../internal';\nimport { dedupe } from '../../utils';\n\ntype TokenTiming = { issuedAt: number; expiresIn: number };\ntype TokenSnapshot = { accessToken: string; timing: TokenTiming };\n\ntype Options = {\n // Rotate the credential (single-use refresh-token flow); resolves to the fresh access token.\n refresh: () => Promise<string>;\n // Live read of the current token + timing from the single source of truth (config). `null` when the\n // session is anonymous (no credential yet) — e.g. a pre-auth `login` request.\n getToken: () => TokenSnapshot | null;\n // Called when the session is found dead (refresh or replay rejected). The caller owns the\n // fire-once latch + per-session re-arm (see `config.notifyExpired`), so this may fire more than once.\n onSessionExpired?: () => void;\n refreshThreshold?: number;\n};\n\nconst DEFAULT_REFRESH_THRESHOLD = 0.9;\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type BearerCredential = {\n // Resolves the current access token, or `null` when the session is anonymous (nothing to stamp).\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n notifyExpired: () => void;\n};\n\nexport const createBearerCredential = ({\n refresh,\n getToken,\n onSessionExpired,\n refreshThreshold = DEFAULT_REFRESH_THRESHOLD,\n}: Options): BearerCredential => {\n const doRefresh = async (): Promise<string> => {\n try {\n return await refresh();\n } catch (error) {\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n const refreshShared = dedupe(doRefresh);\n\n const refreshAt = (timing: TokenTiming): number =>\n timing.issuedAt + timing.expiresIn * 1000 * refreshThreshold;\n\n const getAccessToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const snapshot = getToken();\n if (snapshot === null) return null; // anonymous: nothing to stamp (pre-auth request)\n const { accessToken, timing } = snapshot;\n if (forceRefresh) return refreshShared(); // 401 path: must succeed, propagate failure\n if (Date.now() < refreshAt(timing)) return accessToken; // still fresh: current token\n // Proactive: best-effort — if the ahead-of-time refresh fails, proceed with the current token\n // and let a real 401 drive the mandatory refresh.\n return refreshShared().catch(() => accessToken);\n };\n\n return { getAccessToken, notifyExpired: () => onSessionExpired?.() };\n};\n"],"mappings":";;;AAmBA,MAAM,4BAA4B;AAElC,MAAa,kBAAkB,UAC7B,iBAAiBA,0BAAAA,YAAY,MAAM,SAAS,WAAWC,0BAAAA,WAAW;AAQpE,MAAa,0BAA0B,EACrC,SACA,UACA,kBACA,mBAAmB,gCACY;CAC/B,MAAM,YAAY,YAA6B;EAC7C,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO;GACd,IAAI,eAAe,KAAK,GAAG,mBAAmB;GAC9C,MAAM;EACR;CACF;CAEA,MAAM,gBAAgBC,eAAAA,OAAO,SAAS;CAEtC,MAAM,aAAa,WACjB,OAAO,WAAW,OAAO,YAAY,MAAO;CAE9C,MAAM,iBAAiB,OAAO,EAAE,eAAe,UAAU,CAAC,MAA8B;EACtF,MAAM,WAAW,SAAS;EAC1B,IAAI,aAAa,MAAM,OAAO;EAC9B,MAAM,EAAE,aAAa,WAAW;EAChC,IAAI,cAAc,OAAO,cAAc;EACvC,IAAI,KAAK,IAAI,IAAI,UAAU,MAAM,GAAG,OAAO;EAG3C,OAAO,cAAc,CAAC,CAAC,YAAY,WAAW;CAChD;CAEA,OAAO;EAAE;EAAgB,qBAAqB,mBAAmB;CAAE;AACrE"}
@@ -1,5 +1,5 @@
1
1
  import { t as dedupe } from "./dedupe-DYIHgZoG.js";
2
- import { d as HttpStatus, p as ApiError } from "./createFetchClient-BK0TZK-U.js";
2
+ import { f as HttpStatus, m as ApiError } from "./createFetchClient-B1h3-p65.js";
3
3
  //#region src/keboola/bearer/credential.ts
4
4
  const DEFAULT_REFRESH_THRESHOLD = .9;
5
5
  const isUnauthorized = (error) => error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;
@@ -30,4 +30,4 @@ const createBearerCredential = ({ refresh, getToken, onSessionExpired, refreshTh
30
30
  //#endregion
31
31
  export { isUnauthorized as n, createBearerCredential as t };
32
32
 
33
- //# sourceMappingURL=credential-kEGLnVez.js.map
33
+ //# sourceMappingURL=credential-dKxArMic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"credential-kEGLnVez.js","names":[],"sources":["../src/keboola/bearer/credential.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpStatus } from '../../internal';\nimport { dedupe } from '../../utils';\n\ntype TokenTiming = { issuedAt: number; expiresIn: number };\ntype TokenSnapshot = { accessToken: string; timing: TokenTiming };\n\ntype Options = {\n // Rotate the credential (single-use refresh-token flow); resolves to the fresh access token.\n refresh: () => Promise<string>;\n // Live read of the current token + timing from the single source of truth (config). `null` when the\n // session is anonymous (no credential yet) — e.g. a pre-auth `login` request.\n getToken: () => TokenSnapshot | null;\n // Called when the session is found dead (refresh or replay rejected). The caller owns the\n // fire-once latch + per-session re-arm (see `config.notifyExpired`), so this may fire more than once.\n onSessionExpired?: () => void;\n refreshThreshold?: number;\n};\n\nconst DEFAULT_REFRESH_THRESHOLD = 0.9;\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type BearerCredential = {\n // Resolves the current access token, or `null` when the session is anonymous (nothing to stamp).\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n notifyExpired: () => void;\n};\n\nexport const createBearerCredential = ({\n refresh,\n getToken,\n onSessionExpired,\n refreshThreshold = DEFAULT_REFRESH_THRESHOLD,\n}: Options): BearerCredential => {\n const doRefresh = async (): Promise<string> => {\n try {\n return await refresh();\n } catch (error) {\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n const refreshShared = dedupe(doRefresh);\n\n const refreshAt = (timing: TokenTiming): number =>\n timing.issuedAt + timing.expiresIn * 1000 * refreshThreshold;\n\n const getAccessToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const snapshot = getToken();\n if (snapshot === null) return null; // anonymous: nothing to stamp (pre-auth request)\n const { accessToken, timing } = snapshot;\n if (forceRefresh) return refreshShared(); // 401 path: must succeed, propagate failure\n if (Date.now() < refreshAt(timing)) return accessToken; // still fresh: current token\n // Proactive: best-effort — if the ahead-of-time refresh fails, proceed with the current token\n // and let a real 401 drive the mandatory refresh.\n return refreshShared().catch(() => accessToken);\n };\n\n return { getAccessToken, notifyExpired: () => onSessionExpired?.() };\n};\n"],"mappings":";;;AAmBA,MAAM,4BAA4B;AAElC,MAAa,kBAAkB,UAC7B,iBAAiB,YAAY,MAAM,SAAS,WAAW,WAAW;AAQpE,MAAa,0BAA0B,EACrC,SACA,UACA,kBACA,mBAAmB,gCACY;CAC/B,MAAM,YAAY,YAA6B;EAC7C,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO;GACd,IAAI,eAAe,KAAK,GAAG,mBAAmB;GAC9C,MAAM;EACR;CACF;CAEA,MAAM,gBAAgB,OAAO,SAAS;CAEtC,MAAM,aAAa,WACjB,OAAO,WAAW,OAAO,YAAY,MAAO;CAE9C,MAAM,iBAAiB,OAAO,EAAE,eAAe,UAAU,CAAC,MAA8B;EACtF,MAAM,WAAW,SAAS;EAC1B,IAAI,aAAa,MAAM,OAAO;EAC9B,MAAM,EAAE,aAAa,WAAW;EAChC,IAAI,cAAc,OAAO,cAAc;EACvC,IAAI,KAAK,IAAI,IAAI,UAAU,MAAM,GAAG,OAAO;EAG3C,OAAO,cAAc,CAAC,CAAC,YAAY,WAAW;CAChD;CAEA,OAAO;EAAE;EAAgB,qBAAqB,mBAAmB;CAAE;AACrE"}
1
+ {"version":3,"file":"credential-dKxArMic.js","names":[],"sources":["../src/keboola/bearer/credential.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpStatus } from '../../internal';\nimport { dedupe } from '../../utils';\n\ntype TokenTiming = { issuedAt: number; expiresIn: number };\ntype TokenSnapshot = { accessToken: string; timing: TokenTiming };\n\ntype Options = {\n // Rotate the credential (single-use refresh-token flow); resolves to the fresh access token.\n refresh: () => Promise<string>;\n // Live read of the current token + timing from the single source of truth (config). `null` when the\n // session is anonymous (no credential yet) — e.g. a pre-auth `login` request.\n getToken: () => TokenSnapshot | null;\n // Called when the session is found dead (refresh or replay rejected). The caller owns the\n // fire-once latch + per-session re-arm (see `config.notifyExpired`), so this may fire more than once.\n onSessionExpired?: () => void;\n refreshThreshold?: number;\n};\n\nconst DEFAULT_REFRESH_THRESHOLD = 0.9;\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type BearerCredential = {\n // Resolves the current access token, or `null` when the session is anonymous (nothing to stamp).\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n notifyExpired: () => void;\n};\n\nexport const createBearerCredential = ({\n refresh,\n getToken,\n onSessionExpired,\n refreshThreshold = DEFAULT_REFRESH_THRESHOLD,\n}: Options): BearerCredential => {\n const doRefresh = async (): Promise<string> => {\n try {\n return await refresh();\n } catch (error) {\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n const refreshShared = dedupe(doRefresh);\n\n const refreshAt = (timing: TokenTiming): number =>\n timing.issuedAt + timing.expiresIn * 1000 * refreshThreshold;\n\n const getAccessToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const snapshot = getToken();\n if (snapshot === null) return null; // anonymous: nothing to stamp (pre-auth request)\n const { accessToken, timing } = snapshot;\n if (forceRefresh) return refreshShared(); // 401 path: must succeed, propagate failure\n if (Date.now() < refreshAt(timing)) return accessToken; // still fresh: current token\n // Proactive: best-effort — if the ahead-of-time refresh fails, proceed with the current token\n // and let a real 401 drive the mandatory refresh.\n return refreshShared().catch(() => accessToken);\n };\n\n return { getAccessToken, notifyExpired: () => onSessionExpired?.() };\n};\n"],"mappings":";;;AAmBA,MAAM,4BAA4B;AAElC,MAAa,kBAAkB,UAC7B,iBAAiB,YAAY,MAAM,SAAS,WAAW,WAAW;AAQpE,MAAa,0BAA0B,EACrC,SACA,UACA,kBACA,mBAAmB,gCACY;CAC/B,MAAM,YAAY,YAA6B;EAC7C,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO;GACd,IAAI,eAAe,KAAK,GAAG,mBAAmB;GAC9C,MAAM;EACR;CACF;CAEA,MAAM,gBAAgB,OAAO,SAAS;CAEtC,MAAM,aAAa,WACjB,OAAO,WAAW,OAAO,YAAY,MAAO;CAE9C,MAAM,iBAAiB,OAAO,EAAE,eAAe,UAAU,CAAC,MAA8B;EACtF,MAAM,WAAW,SAAS;EAC1B,IAAI,aAAa,MAAM,OAAO;EAC9B,MAAM,EAAE,aAAa,WAAW;EAChC,IAAI,cAAc,OAAO,cAAc;EACvC,IAAI,KAAK,IAAI,IAAI,UAAU,MAAM,GAAG,OAAO;EAG3C,OAAO,cAAc,CAAC,CAAC,YAAY,WAAW;CAChD;CAEA,OAAO;EAAE;EAAgB,qBAAqB,mBAAmB;CAAE;AACrE"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_appLogs = require("../appLogs-CNG3yby-.cjs");
3
- const require_dataScience = require("../dataScience-C-JrA0Uk.cjs");
2
+ const require_appLogs = require("../appLogs-BCCi02w6.cjs");
3
+ const require_dataScience = require("../dataScience-BqNWX-Gr.cjs");
4
4
  exports.createDataScienceClient = require_dataScience.createDataScienceClient;
5
5
  exports.parseLogLines = require_appLogs.parseLogLines;
@@ -1,3 +1,3 @@
1
- import { n as parseLogLines } from "../appLogs-Dl5BcCSD.cjs";
2
- import { t as createDataScienceClient } from "../index-IN0qzs52.cjs";
1
+ import { n as parseLogLines } from "../appLogs-hQdKt_8J.cjs";
2
+ import { t as createDataScienceClient } from "../index-BSjfVDTr.cjs";
3
3
  export { createDataScienceClient, parseLogLines };
@@ -1,3 +1,3 @@
1
- import { n as parseLogLines } from "../appLogs-VdgP08aX.js";
2
- import { t as createDataScienceClient } from "../index-DNlX-H1V.js";
1
+ import { n as parseLogLines } from "../appLogs-BdMG6Cvn.js";
2
+ import { t as createDataScienceClient } from "../index-J1I2HlSm.js";
3
3
  export { createDataScienceClient, parseLogLines };
@@ -1,3 +1,3 @@
1
- import { t as parseLogLines } from "../appLogs-enL9XR9r.js";
2
- import { t as createDataScienceClient } from "../dataScience-CE0pSWbl.js";
1
+ import { t as parseLogLines } from "../appLogs-CLHhkQJn.js";
2
+ import { t as createDataScienceClient } from "../dataScience-jdbSSPYF.js";
3
3
  export { createDataScienceClient, parseLogLines };
@@ -1,3 +1,3 @@
1
- import { t as LogEntry } from "../appLogs-Dl5BcCSD.cjs";
2
- import { S as Sandbox, _ as PatchDataAppPath, a as DeleteSandboxPath, b as Runtime, c as GetDataAppLogsTailPath, d as GetDataAppPath, f as GetDataAppRunPath, g as PatchDataAppBody, h as GetSandboxPath, i as DeleteDataAppPath, l as GetDataAppLogsTailQuery, m as GetDataAppRunsQuery, n as DataApp, o as GetAppsQuery, p as GetDataAppRunsPath, r as DataAppRun, s as GetDataAppLogsDownloadPath, t as CreateDataAppBody, u as GetDataAppPasswordPath, v as RawAppRun, x as RuntimeImageKey, y as ResetDataAppPasswordPath } from "../types-QOIQ-dZU.cjs";
1
+ import { t as LogEntry } from "../appLogs-hQdKt_8J.cjs";
2
+ import { S as Sandbox, _ as PatchDataAppPath, a as DeleteSandboxPath, b as Runtime, c as GetDataAppLogsTailPath, d as GetDataAppPath, f as GetDataAppRunPath, g as PatchDataAppBody, h as GetSandboxPath, i as DeleteDataAppPath, l as GetDataAppLogsTailQuery, m as GetDataAppRunsQuery, n as DataApp, o as GetAppsQuery, p as GetDataAppRunsPath, r as DataAppRun, s as GetDataAppLogsDownloadPath, t as CreateDataAppBody, u as GetDataAppPasswordPath, v as RawAppRun, x as RuntimeImageKey, y as ResetDataAppPasswordPath } from "../types-CFhAduFK.cjs";
3
3
  export { CreateDataAppBody, DataApp, DataAppRun, DeleteDataAppPath, DeleteSandboxPath, GetAppsQuery, GetDataAppLogsDownloadPath, GetDataAppLogsTailPath, GetDataAppLogsTailQuery, GetDataAppPasswordPath, GetDataAppPath, GetDataAppRunPath, GetDataAppRunsPath, GetDataAppRunsQuery, GetSandboxPath, type LogEntry, PatchDataAppBody, PatchDataAppPath, RawAppRun, ResetDataAppPasswordPath, Runtime, RuntimeImageKey, Sandbox };
@@ -1,3 +1,3 @@
1
- import { t as LogEntry } from "../appLogs-VdgP08aX.js";
2
- import { S as Sandbox, _ as PatchDataAppPath, a as DeleteSandboxPath, b as Runtime, c as GetDataAppLogsTailPath, d as GetDataAppPath, f as GetDataAppRunPath, g as PatchDataAppBody, h as GetSandboxPath, i as DeleteDataAppPath, l as GetDataAppLogsTailQuery, m as GetDataAppRunsQuery, n as DataApp, o as GetAppsQuery, p as GetDataAppRunsPath, r as DataAppRun, s as GetDataAppLogsDownloadPath, t as CreateDataAppBody, u as GetDataAppPasswordPath, v as RawAppRun, x as RuntimeImageKey, y as ResetDataAppPasswordPath } from "../types-BCt0EMiO.js";
1
+ import { t as LogEntry } from "../appLogs-BdMG6Cvn.js";
2
+ import { S as Sandbox, _ as PatchDataAppPath, a as DeleteSandboxPath, b as Runtime, c as GetDataAppLogsTailPath, d as GetDataAppPath, f as GetDataAppRunPath, g as PatchDataAppBody, h as GetSandboxPath, i as DeleteDataAppPath, l as GetDataAppLogsTailQuery, m as GetDataAppRunsQuery, n as DataApp, o as GetAppsQuery, p as GetDataAppRunsPath, r as DataAppRun, s as GetDataAppLogsDownloadPath, t as CreateDataAppBody, u as GetDataAppPasswordPath, v as RawAppRun, x as RuntimeImageKey, y as ResetDataAppPasswordPath } from "../types-Co8WobOo.js";
3
3
  export { CreateDataAppBody, DataApp, DataAppRun, DeleteDataAppPath, DeleteSandboxPath, GetAppsQuery, GetDataAppLogsDownloadPath, GetDataAppLogsTailPath, GetDataAppLogsTailQuery, GetDataAppPasswordPath, GetDataAppPath, GetDataAppRunPath, GetDataAppRunsPath, GetDataAppRunsQuery, GetSandboxPath, type LogEntry, PatchDataAppBody, PatchDataAppPath, RawAppRun, ResetDataAppPasswordPath, Runtime, RuntimeImageKey, Sandbox };
@@ -1,7 +1,7 @@
1
- const require_createGenericFetchClient = require("./createGenericFetchClient-DLbjX0eM.cjs");
2
- const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-Cr90VXY4.cjs");
3
- const require_auth = require("./auth-5HCvCsZO.cjs");
4
- const require_appLogs = require("./appLogs-CNG3yby-.cjs");
1
+ const require_createGenericFetchClient = require("./createGenericFetchClient-BWoSkTki.cjs");
2
+ const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-yirrW6Tg.cjs");
3
+ const require_auth = require("./auth-DmgTH0uY.cjs");
4
+ const require_appLogs = require("./appLogs-BCCi02w6.cjs");
5
5
  //#region src/clients/dataScience/utils.ts
6
6
  const prepareAppRun = (appRun) => {
7
7
  return {
@@ -111,4 +111,4 @@ Object.defineProperty(exports, "createDataScienceClient", {
111
111
  }
112
112
  });
113
113
 
114
- //# sourceMappingURL=dataScience-C-JrA0Uk.cjs.map
114
+ //# sourceMappingURL=dataScience-BqNWX-Gr.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataScience-C-JrA0Uk.cjs","names":["createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient","readAppLogsDownload","readAppLogsTail"],"sources":["../src/clients/dataScience/utils.ts","../src/clients/dataScience/dataScienceClient.ts"],"sourcesContent":["import type { RawAppRun } from './types';\n\nexport const prepareAppRun = (appRun: RawAppRun) => {\n return {\n ...appRun,\n state: appRun.state ?? (appRun.stoppedAt ? 'finished' : 'running'), // fallback state for historic non migrated runs\n };\n};\n","import { readAppLogsDownload, readAppLogsTail } from '../../domain/appLogs';\nimport { createGenericFetchClient, createOpenapiFetchClient } from '../../fetchClient';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport type {\n CreateDataAppBody,\n DeleteDataAppPath,\n DeleteSandboxPath,\n GetAppsQuery,\n GetDataAppLogsDownloadPath,\n GetDataAppLogsTailPath,\n GetDataAppLogsTailQuery,\n GetDataAppPasswordPath,\n GetDataAppPath,\n GetDataAppRunPath,\n GetDataAppRunsPath,\n GetDataAppRunsQuery,\n GetSandboxPath,\n PatchDataAppBody,\n PatchDataAppPath,\n ResetDataAppPasswordPath,\n} from './types';\nimport { prepareAppRun } from './utils';\n\nexport const createDataScienceClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const getAppRuns = async (\n appId: GetDataAppRunsPath['appId'],\n query?: GetDataAppRunsQuery,\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get('/apps/{appId}/runs', { path: { appId }, query }, { signal });\n\n return data.map(prepareAppRun);\n };\n\n const getAppRun = async (\n appId: GetDataAppRunPath['appId'],\n runId: GetDataAppRunPath['runId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get(\n '/apps/{appId}/runs/{runId}',\n { path: { appId, runId } },\n { signal },\n );\n\n return prepareAppRun(data);\n };\n\n const getAppLogsDownload = (id: GetDataAppLogsDownloadPath['appId'], signal?: AbortSignal) =>\n readAppLogsDownload(() =>\n client.get('/apps/{appId}/logs/download', { path: { appId: id } }, { signal }),\n );\n\n const getAppLogsTail = (\n id: GetDataAppLogsTailPath['appId'],\n { query, signal }: { query?: GetDataAppLogsTailQuery; signal?: AbortSignal } = {},\n ) =>\n readAppLogsTail(() =>\n client.get('/apps/{appId}/logs/tail', { query, path: { appId: id } }, { signal }),\n );\n\n const getApps = async (query: GetAppsQuery, signal?: AbortSignal) => {\n const { data } = await client.get('/apps', { query }, { signal });\n\n return data;\n };\n\n const getApp = async (appId: GetDataAppPath['appId'], signal?: AbortSignal) => {\n const { data } = await client.get('/apps/{appId}', { path: { appId } }, { signal });\n\n return data;\n };\n\n const createApp = async (body: CreateDataAppBody, signal?: AbortSignal) => {\n const { data } = await client.post('/apps', { body }, { signal });\n\n return data;\n };\n\n const patchApp = async (\n appId: PatchDataAppPath['appId'],\n body: PatchDataAppBody,\n signal?: AbortSignal,\n ) => {\n const { data } = await client.patch(\n '/apps/{appId}',\n {\n path: { appId: appId },\n body: body,\n },\n { signal },\n );\n return data;\n };\n\n const deleteApp = async (appId: DeleteDataAppPath['appId'], signal?: AbortSignal) => {\n return client.delete('/apps/{appId}', { path: { appId } }, { signal });\n };\n\n const getAppPassword = async (appId: GetDataAppPasswordPath['appId'], signal?: AbortSignal) => {\n const { data } = await client.get('/apps/{appId}/password', { path: { appId } }, { signal });\n\n return data;\n };\n\n const resetAppPassword = async (\n appId: ResetDataAppPasswordPath['appId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.post(\n '/apps/{appId}/reset-password',\n { path: { appId } },\n { signal },\n );\n\n return data;\n };\n\n const getRuntimes = async (signal?: AbortSignal) => {\n const { data } = await client.get('/runtimes', {}, { signal });\n\n return data;\n };\n\n const getSandbox = async (appId: GetSandboxPath['appId'], signal?: AbortSignal) => {\n const { data } = await client.get('/sandboxes/{appId}', { path: { appId } }, { signal });\n\n return data;\n };\n\n const deleteSandbox = async (appId: DeleteSandboxPath['appId'], signal?: AbortSignal) => {\n return client.delete('/sandboxes/{appId}', { path: { appId } }, { signal });\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n return {\n healthCheck,\n getAppRuns,\n getAppRun,\n getAppLogsDownload,\n getAppLogsTail,\n getApps,\n getApp,\n createApp,\n patchApp,\n deleteApp,\n getAppPassword,\n resetAppPassword,\n getRuntimes,\n getSandbox,\n deleteSandbox,\n };\n};\n"],"mappings":";;;;;AAEA,MAAa,iBAAiB,WAAsB;CAClD,OAAO;EACL,GAAG;EACH,OAAO,OAAO,UAAU,OAAO,YAAY,aAAa;CAC1D;AACF;;;ACmBA,MAAa,2BAA2B,EAAE,SAAS,aAAa,WAA8B;CAC5F,MAAM,SAASA,iCAAAA,yBAAgC;EAC7C;EACA;EACA,SAASC,aAAAA,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgBC,iCAAAA,yBAAyB;EAAE;EAAS;CAAY,CAAC;C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AAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,YAAY,OAAO,OAAmC,WAAyB;EACnF,OAAO,OAAO,OAAO,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;CACvE;CAEA,MAAM,iBAAiB,OAAO,OAAwC,WAAyB;EAC7F,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,0BAA0B,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;EAE3F,OAAO;CACT;CAEA,MAAM,mBAAmB,OACvB,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,gCACA,EAAE,MAAM,EAAE,MAAM,EAAE,GAClB,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC;EAE7D,OAAO;CACT;CAEA,MAAM,aAAa,OAAO,OAAgC,WAAyB;EACjF,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,sBAAsB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;EAEvF,OAAO;CACT;CAEA,MAAM,gBAAgB,OAAO,OAAmC,WAAyB;EACvF,OAAO,OAAO,OAAO,sBAAsB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;CAC5E;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"dataScience-BqNWX-Gr.cjs","names":["createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient","readAppLogsDownload","readAppLogsTail"],"sources":["../src/clients/dataScience/utils.ts","../src/clients/dataScience/dataScienceClient.ts"],"sourcesContent":["import type { RawAppRun } from './types';\n\nexport const prepareAppRun = (appRun: RawAppRun) => {\n return {\n ...appRun,\n state: appRun.state ?? (appRun.stoppedAt ? 'finished' : 'running'), // fallback state for historic non migrated runs\n };\n};\n","import { readAppLogsDownload, readAppLogsTail } from '../../domain/appLogs';\nimport { createGenericFetchClient, createOpenapiFetchClient } from '../../fetchClient';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport type {\n CreateDataAppBody,\n DeleteDataAppPath,\n DeleteSandboxPath,\n GetAppsQuery,\n GetDataAppLogsDownloadPath,\n GetDataAppLogsTailPath,\n GetDataAppLogsTailQuery,\n GetDataAppPasswordPath,\n GetDataAppPath,\n GetDataAppRunPath,\n GetDataAppRunsPath,\n GetDataAppRunsQuery,\n GetSandboxPath,\n PatchDataAppBody,\n PatchDataAppPath,\n ResetDataAppPasswordPath,\n} from './types';\nimport { prepareAppRun } from './utils';\n\nexport const createDataScienceClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const getAppRuns = async (\n appId: GetDataAppRunsPath['appId'],\n query?: GetDataAppRunsQuery,\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get('/apps/{appId}/runs', { path: { appId }, query }, { signal });\n\n return data.map(prepareAppRun);\n };\n\n const getAppRun = async (\n appId: GetDataAppRunPath['appId'],\n runId: GetDataAppRunPath['runId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get(\n '/apps/{appId}/runs/{runId}',\n { path: { appId, runId } },\n { signal },\n );\n\n return prepareAppRun(data);\n };\n\n const getAppLogsDownload = (id: GetDataAppLogsDownloadPath['appId'], signal?: AbortSignal) =>\n readAppLogsDownload(() =>\n client.get('/apps/{appId}/logs/download', { path: { appId: id } }, { signal }),\n );\n\n const getAppLogsTail = (\n id: GetDataAppLogsTailPath['appId'],\n { query, signal }: { query?: GetDataAppLogsTailQuery; signal?: AbortSignal } = {},\n ) =>\n readAppLogsTail(() =>\n client.get('/apps/{appId}/logs/tail', { query, path: { appId: id } }, { signal }),\n );\n\n const getApps = async (query: GetAppsQuery, signal?: AbortSignal) => {\n const { data } = await client.get('/apps', { query }, { signal });\n\n return data;\n };\n\n const getApp = async (appId: GetDataAppPath['appId'], signal?: AbortSignal) => {\n const { data } = await client.get('/apps/{appId}', { path: { appId } }, { signal });\n\n return data;\n };\n\n const createApp = async (body: CreateDataAppBody, signal?: AbortSignal) => {\n const { data } = await client.post('/apps', { body }, { signal });\n\n return data;\n };\n\n const patchApp = async (\n appId: PatchDataAppPath['appId'],\n body: PatchDataAppBody,\n signal?: AbortSignal,\n ) => {\n const { data } = await client.patch(\n '/apps/{appId}',\n {\n path: { appId: appId },\n body: body,\n },\n { signal },\n );\n return data;\n };\n\n const deleteApp = async (appId: DeleteDataAppPath['appId'], signal?: AbortSignal) => {\n return client.delete('/apps/{appId}', { path: { appId } }, { signal });\n };\n\n const getAppPassword = async (appId: GetDataAppPasswordPath['appId'], signal?: AbortSignal) => {\n const { data } = await client.get('/apps/{appId}/password', { path: { appId } }, { signal });\n\n return data;\n };\n\n const resetAppPassword = async (\n appId: ResetDataAppPasswordPath['appId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.post(\n '/apps/{appId}/reset-password',\n { path: { appId } },\n { signal },\n );\n\n return data;\n };\n\n const getRuntimes = async (signal?: AbortSignal) => {\n const { data } = await client.get('/runtimes', {}, { signal });\n\n return data;\n };\n\n const getSandbox = async (appId: GetSandboxPath['appId'], signal?: AbortSignal) => {\n const { data } = await client.get('/sandboxes/{appId}', { path: { appId } }, { signal });\n\n return data;\n };\n\n const deleteSandbox = async (appId: DeleteSandboxPath['appId'], signal?: AbortSignal) => {\n return client.delete('/sandboxes/{appId}', { path: { appId } }, { signal });\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n return {\n healthCheck,\n getAppRuns,\n getAppRun,\n getAppLogsDownload,\n getAppLogsTail,\n getApps,\n getApp,\n createApp,\n patchApp,\n deleteApp,\n getAppPassword,\n resetAppPassword,\n getRuntimes,\n getSandbox,\n deleteSandbox,\n };\n};\n"],"mappings":";;;;;AAEA,MAAa,iBAAiB,WAAsB;CAClD,OAAO;EACL,GAAG;EACH,OAAO,OAAO,UAAU,OAAO,YAAY,aAAa;CAC1D;AACF;;;ACmBA,MAAa,2BAA2B,EAAE,SAAS,aAAa,WAA8B;CAC5F,MAAM,SAASA,iCAAAA,yBAAgC;EAC7C;EACA;EACA,SAASC,aAAAA,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgBC,iCAAAA,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,aAAa,OACjB,OACA,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,sBAAsB;GAAE,MAAM,EAAE,MAAM;GAAG;EAAM,GAAG,EAAE,OAAO,CAAC;EAE9F,OAAO,KAAK,IAAI,aAAa;CAC/B;CAEA,MAAM,YAAY,OAChB,OACA,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,8BACA,EAAE,MAAM;GAAE;GAAO;EAAM,EAAE,GACzB,EAAE,OAAO,CACX;EAEA,OAAO,cAAc,IAAI;CAC3B;CAEA,MAAM,sBAAsB,IAAyC,WACnEC,gBAAAA,0BACE,OAAO,IAAI,+BAA+B,EAAE,MAAM,EAAE,OAAO,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAC/E;CAEF,MAAM,kBACJ,IACA,EAAE,OAAO,WAAsE,CAAC,MAEhFC,gBAAAA,sBACE,OAAO,IAAI,2BAA2B;EAAE;EAAO,MAAM,EAAE,OAAO,GAAG;CAAE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AAgC,WAAyB;EACjF,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,sBAAsB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;EAEvF,OAAO;CACT;CAEA,MAAM,gBAAgB,OAAO,OAAmC,WAAyB;EACvF,OAAO,OAAO,OAAO,sBAAsB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;CAC5E;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1,7 +1,7 @@
1
- import { t as createGenericFetchClient } from "./createGenericFetchClient-CVZYekDk.js";
2
- import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-B5U1fCHS.js";
3
- import { t as createAuthHeaders } from "./auth-D2jfNlpX.js";
4
- import { n as readAppLogsDownload, r as readAppLogsTail } from "./appLogs-enL9XR9r.js";
1
+ import { t as createGenericFetchClient } from "./createGenericFetchClient-DhpvUSlX.js";
2
+ import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-0_oqhdPv.js";
3
+ import { t as createAuthHeaders } from "./auth-CE6Hlc9W.js";
4
+ import { n as readAppLogsDownload, r as readAppLogsTail } from "./appLogs-CLHhkQJn.js";
5
5
  //#region src/clients/dataScience/utils.ts
6
6
  const prepareAppRun = (appRun) => {
7
7
  return {
@@ -106,4 +106,4 @@ const createDataScienceClient = ({ baseUrl, middlewares, auth }) => {
106
106
  //#endregion
107
107
  export { createDataScienceClient as t };
108
108
 
109
- //# sourceMappingURL=dataScience-CE0pSWbl.js.map
109
+ //# sourceMappingURL=dataScience-jdbSSPYF.js.map