@keboola/api-client 46.0.0 → 48.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 (485) hide show
  1. package/AGENTS.md +95 -24
  2. package/API-SURFACE.md +52 -30
  3. package/CHANGELOG.md +85 -0
  4. package/README.md +47 -37
  5. package/dist/{ManagementSessionMintError-5FFyvBZi.js → ManagementSessionMintError-4Pkn5Oob.js} +2 -2
  6. package/dist/{ManagementSessionMintError-5FFyvBZi.js.map → ManagementSessionMintError-4Pkn5Oob.js.map} +1 -1
  7. package/dist/{ManagementSessionMintError-Bm8s6yDB.cjs → ManagementSessionMintError-Cu9beG7j.cjs} +2 -2
  8. package/dist/{ManagementSessionMintError-Bm8s6yDB.cjs.map → ManagementSessionMintError-Cu9beG7j.cjs.map} +1 -1
  9. package/dist/QueryJobError-ZZZ043Nm.js +22 -0
  10. package/dist/QueryJobError-ZZZ043Nm.js.map +1 -0
  11. package/dist/{QueryJobTimeoutError-CVNPdCWX.cjs → QueryJobError-irGiP5zh.cjs} +1 -29
  12. package/dist/QueryJobError-irGiP5zh.cjs.map +1 -0
  13. package/dist/QueueJobError-6qSEizWo.cjs +30 -0
  14. package/dist/QueueJobError-6qSEizWo.cjs.map +1 -0
  15. package/dist/QueueJobError-8bThS_Mc.js +19 -0
  16. package/dist/QueueJobError-8bThS_Mc.js.map +1 -0
  17. package/dist/adminRoles-B40yBcmq.js.map +1 -1
  18. package/dist/{adminRoles-C696kD_U.d.ts → adminRoles-BgpaBE7h.d.cts} +4 -2
  19. package/dist/adminRoles-CO7J5qAy.cjs.map +1 -1
  20. package/dist/{adminRoles-C696kD_U.d.cts → adminRoles-DsoGQipO.d.ts} +4 -2
  21. package/dist/ai/index.cjs +2 -7
  22. package/dist/ai/index.cjs.map +1 -1
  23. package/dist/ai/index.d.cts +2 -3
  24. package/dist/ai/index.d.ts +2 -3
  25. package/dist/ai/index.js +2 -7
  26. package/dist/ai/index.js.map +1 -1
  27. package/dist/ai/types.d.cts +2 -2
  28. package/dist/ai/types.d.ts +2 -2
  29. package/dist/{appLogs-BG9ueGxA.cjs → appLogs-Cix2KWra.cjs} +2 -2
  30. package/dist/{appLogs-BG9ueGxA.cjs.map → appLogs-Cix2KWra.cjs.map} +1 -1
  31. package/dist/{appLogs-DGIctwbb.d.ts → appLogs-DpcqeOe5.d.ts} +2 -2
  32. package/dist/{appLogs-CEKz68bE.js → appLogs-KslK7qHr.js} +2 -2
  33. package/dist/{appLogs-CEKz68bE.js.map → appLogs-KslK7qHr.js.map} +1 -1
  34. package/dist/{appLogs-Dl0v684o.d.cts → appLogs-SjrflOHk.d.cts} +2 -2
  35. package/dist/apps/index.cjs +5 -5
  36. package/dist/apps/index.cjs.map +1 -1
  37. package/dist/apps/index.d.cts +3 -3
  38. package/dist/apps/index.d.ts +3 -3
  39. package/dist/apps/index.js +5 -5
  40. package/dist/apps/index.js.map +1 -1
  41. package/dist/apps/types.d.cts +2 -2
  42. package/dist/apps/types.d.ts +2 -2
  43. package/dist/assets/index.cjs +1 -1
  44. package/dist/assets/index.d.cts +1 -1
  45. package/dist/assets/index.d.ts +1 -1
  46. package/dist/assets/index.js +1 -1
  47. package/dist/auth/index.cjs +1 -1
  48. package/dist/auth/index.d.cts +1 -1
  49. package/dist/auth/index.d.ts +1 -1
  50. package/dist/auth/index.js +1 -1
  51. package/dist/auth/types.d.cts +2 -2
  52. package/dist/auth/types.d.ts +2 -2
  53. package/dist/{auth-C6cHWIWx.js → auth-4coY1uwo.js} +2 -2
  54. package/dist/{auth-C6cHWIWx.js.map → auth-4coY1uwo.js.map} +1 -1
  55. package/dist/{auth-C9o_0bft.cjs → auth-C8Pjl0Mu.cjs} +2 -2
  56. package/dist/{auth-C9o_0bft.cjs.map → auth-C8Pjl0Mu.cjs.map} +1 -1
  57. package/dist/{authClient-CACOwVt0.js → authClient-2e8ZmzSP.js} +71 -7
  58. package/dist/authClient-2e8ZmzSP.js.map +1 -0
  59. package/dist/{authClient-DSa5t2Ft.d.cts → authClient-BYIGzL_u.d.ts} +22 -4
  60. package/dist/{authClient-ZiaKSKpp.d.ts → authClient-D06srBQE.d.cts} +22 -4
  61. package/dist/{authClient-DZcAR-eW.cjs → authClient-DfkKlc-2.cjs} +82 -6
  62. package/dist/authClient-DfkKlc-2.cjs.map +1 -0
  63. package/dist/billing/index.cjs +2 -2
  64. package/dist/billing/index.d.cts +1 -1
  65. package/dist/billing/index.d.ts +1 -1
  66. package/dist/billing/index.js +2 -2
  67. package/dist/billing/types.d.cts +1 -1
  68. package/dist/billing/types.d.ts +1 -1
  69. package/dist/chat/index.cjs +3 -3
  70. package/dist/chat/index.d.cts +2 -2
  71. package/dist/chat/index.d.ts +2 -2
  72. package/dist/chat/index.js +3 -3
  73. package/dist/chat/types.d.cts +1 -1
  74. package/dist/chat/types.d.ts +1 -1
  75. package/dist/{collect-97WhfEpt.js → collectByOffset-2XzJqmvr.js} +6 -6
  76. package/dist/collectByOffset-2XzJqmvr.js.map +1 -0
  77. package/dist/{collect-B5TCNiT1.cjs → collectByOffset-DQsqtmJg.cjs} +7 -7
  78. package/dist/collectByOffset-DQsqtmJg.cjs.map +1 -0
  79. package/dist/componentsMcp/index.cjs +3 -0
  80. package/dist/componentsMcp/index.d.cts +2 -0
  81. package/dist/componentsMcp/index.d.ts +2 -0
  82. package/dist/componentsMcp/index.js +2 -0
  83. package/dist/componentsMcp/types.cjs +0 -0
  84. package/dist/componentsMcp/types.d.cts +2 -0
  85. package/dist/componentsMcp/types.d.ts +2 -0
  86. package/dist/componentsMcp/types.js +1 -0
  87. package/dist/componentsMcp-CHobIsuU.js +57 -0
  88. package/dist/componentsMcp-CHobIsuU.js.map +1 -0
  89. package/dist/componentsMcp-pG-PcQrg.cjs +62 -0
  90. package/dist/componentsMcp-pG-PcQrg.cjs.map +1 -0
  91. package/dist/{configurations-D_Rbs0Wl.cjs → configurations-B2O8AAy0.cjs} +2 -2
  92. package/dist/{configurations-D_Rbs0Wl.cjs.map → configurations-B2O8AAy0.cjs.map} +1 -1
  93. package/dist/{configurations-Chg_JwJ1.js → configurations-CL0ouUMa.js} +3 -3
  94. package/dist/configurations-CL0ouUMa.js.map +1 -0
  95. package/dist/{configurations-BTRHVSRq.cjs → configurations-D9J3jh3g.cjs} +3 -3
  96. package/dist/configurations-D9J3jh3g.cjs.map +1 -0
  97. package/dist/{configurations-DcpUlC8I.js → configurations-DKINmjA3.js} +2 -2
  98. package/dist/{configurations-DcpUlC8I.js.map → configurations-DKINmjA3.js.map} +1 -1
  99. package/dist/constants/index.cjs +1 -1
  100. package/dist/constants/index.d.cts +2 -3
  101. package/dist/constants/index.d.ts +2 -3
  102. package/dist/constants/index.js +1 -1
  103. package/dist/{constants-Cifrqsls.js → constants-CA4UN2Xv.js} +11 -10
  104. package/dist/constants-CA4UN2Xv.js.map +1 -0
  105. package/dist/{constants-BDGRQqij.cjs → constants-a0jswUeK.cjs} +10 -9
  106. package/dist/constants-a0jswUeK.cjs.map +1 -0
  107. package/dist/{createFetchClient-DITkTV2k.js → createFetchClient-CkHdS_IG.js} +5 -5
  108. package/dist/createFetchClient-CkHdS_IG.js.map +1 -0
  109. package/dist/{createFetchClient-ClWD4ua3.cjs → createFetchClient-lZ_93Yrb.cjs} +5 -5
  110. package/dist/createFetchClient-lZ_93Yrb.cjs.map +1 -0
  111. package/dist/{createGenericFetchClient-KqiJhw8G.js → createGenericFetchClient-CQdNcPC3.js} +2 -2
  112. package/dist/{createGenericFetchClient-KqiJhw8G.js.map → createGenericFetchClient-CQdNcPC3.js.map} +1 -1
  113. package/dist/{createGenericFetchClient-B81Iezpb.cjs → createGenericFetchClient-MOx97wi-.cjs} +2 -2
  114. package/dist/{createGenericFetchClient-B81Iezpb.cjs.map → createGenericFetchClient-MOx97wi-.cjs.map} +1 -1
  115. package/dist/{createOpenapiFetchClient-CioTX11-.cjs → createOpenapiFetchClient-DHYo_k3t.cjs} +2 -2
  116. package/dist/{createOpenapiFetchClient-CioTX11-.cjs.map → createOpenapiFetchClient-DHYo_k3t.cjs.map} +1 -1
  117. package/dist/{createOpenapiFetchClient-wq8iGLZM.js → createOpenapiFetchClient-DXiMv9WL.js} +2 -2
  118. package/dist/{createOpenapiFetchClient-wq8iGLZM.js.map → createOpenapiFetchClient-DXiMv9WL.js.map} +1 -1
  119. package/dist/dataScience/index.cjs +2 -2
  120. package/dist/dataScience/index.d.cts +2 -2
  121. package/dist/dataScience/index.d.ts +2 -2
  122. package/dist/dataScience/index.js +2 -2
  123. package/dist/dataScience/types.d.cts +2 -2
  124. package/dist/dataScience/types.d.ts +2 -2
  125. package/dist/{dataScience-BwHmDoQb.js → dataScience-AwPMeGfz.js} +5 -5
  126. package/dist/{dataScience-BwHmDoQb.js.map → dataScience-AwPMeGfz.js.map} +1 -1
  127. package/dist/{dataScience-Hhoqoql_.cjs → dataScience-BjS1p8WO.cjs} +5 -5
  128. package/dist/{dataScience-Hhoqoql_.cjs.map → dataScience-BjS1p8WO.cjs.map} +1 -1
  129. package/dist/developerPortal/index.cjs +1 -1
  130. package/dist/developerPortal/index.d.cts +2 -2
  131. package/dist/developerPortal/index.d.ts +2 -2
  132. package/dist/developerPortal/index.js +1 -1
  133. package/dist/developerPortal/types.d.cts +1 -1
  134. package/dist/developerPortal/types.d.ts +1 -1
  135. package/dist/{developerPortalClient-loKq7X_U.js → developerPortalClient-Bb2suezr.js} +13 -5
  136. package/dist/{developerPortalClient-loKq7X_U.js.map → developerPortalClient-Bb2suezr.js.map} +1 -1
  137. package/dist/{developerPortalClient-COm7wJxS.cjs → developerPortalClient-DUerKw-7.cjs} +13 -5
  138. package/dist/{developerPortalClient-COm7wJxS.cjs.map → developerPortalClient-DUerKw-7.cjs.map} +1 -1
  139. package/dist/domain/permissions/index.cjs +1 -1
  140. package/dist/domain/permissions/index.d.cts +2 -3
  141. package/dist/domain/permissions/index.d.ts +2 -3
  142. package/dist/domain/permissions/index.js +1 -1
  143. package/dist/editor/index.cjs +2 -2
  144. package/dist/editor/index.d.cts +2 -2
  145. package/dist/editor/index.d.ts +2 -2
  146. package/dist/editor/index.js +2 -2
  147. package/dist/editor/types.d.cts +1 -1
  148. package/dist/editor/types.d.ts +1 -1
  149. package/dist/encryption/index.cjs +1 -1
  150. package/dist/encryption/index.d.cts +1 -1
  151. package/dist/encryption/index.d.ts +1 -1
  152. package/dist/encryption/index.js +1 -1
  153. package/dist/encryption/types.d.cts +1 -1
  154. package/dist/encryption/types.d.ts +1 -1
  155. package/dist/import/index.cjs +1 -1
  156. package/dist/import/index.d.cts +3 -3
  157. package/dist/import/index.d.ts +3 -3
  158. package/dist/import/index.js +1 -1
  159. package/dist/{import-B5DcJGMI.cjs → import-BahNYv91.cjs} +3 -3
  160. package/dist/{import-B5DcJGMI.cjs.map → import-BahNYv91.cjs.map} +1 -1
  161. package/dist/{import-JlH_QaDd.js → import-FWy_wQZ1.js} +3 -3
  162. package/dist/{import-JlH_QaDd.js.map → import-FWy_wQZ1.js.map} +1 -1
  163. package/dist/{index-BP3choXr.d.ts → index-B3QTeqfL.d.ts} +19976 -14513
  164. package/dist/{index-x8ET_BTN.d.cts → index-BCjU-g9t.d.cts} +3 -3
  165. package/dist/{index-DCxVLGHH.d.ts → index-BHiJu8LF.d.cts} +16 -28
  166. package/dist/{index-DXcTukgn.d.ts → index-BIldED4N.d.ts} +4 -4
  167. package/dist/index-BLvmyehw.d.ts +46 -0
  168. package/dist/{index-BnPYPXGQ.d.ts → index-BTrxCk90.d.ts} +3 -3
  169. package/dist/{index-DS6O4UDB.d.cts → index-ByLCYBaw.d.cts} +4 -4
  170. package/dist/{index-syAYY5LC.d.cts → index-C40Fbj-6.d.cts} +19976 -14513
  171. package/dist/{index-DWFxcmVD.d.ts → index-CIqWOEWD.d.ts} +4 -4
  172. package/dist/{index-Bt43tKyu.d.cts → index-Cc5wSIRJ.d.cts} +5 -5
  173. package/dist/{types-CESP1ONj.d.ts → index-ChDl6ig5.d.cts} +3780 -549
  174. package/dist/index-Co2Cd-nw.d.cts +46 -0
  175. package/dist/{index-CTKC-mwi.d.cts → index-CpGmmJbt.d.cts} +4 -4
  176. package/dist/{index-D-4TT5yW.d.cts → index-CpUYVB-d.d.cts} +4 -4
  177. package/dist/{index-DeQDdut6.d.ts → index-CzHrIfZS.d.ts} +34 -2
  178. package/dist/{index-BhDxP0x4.d.cts → index-D91RxB_S.d.cts} +18 -13
  179. package/dist/{index-GVxpBH6j.d.cts → index-DlZiWfQb.d.ts} +16 -28
  180. package/dist/{index-DRaVzOLM.d.ts → index-DzLXtE4Q.d.ts} +5 -5
  181. package/dist/{index-DeQDdut6.d.cts → index-VlzlOBkc.d.cts} +34 -2
  182. package/dist/{index-se5ee8U1.d.ts → index-avzO5sLa.d.ts} +18 -13
  183. package/dist/{index-yJ0HrxY6.d.ts → index-m7fX76x3.d.ts} +4 -4
  184. package/dist/{types-GaOcVZ3d.d.cts → index-sDHBkJhU.d.ts} +3780 -549
  185. package/dist/index.cjs +551 -375
  186. package/dist/index.cjs.map +1 -1
  187. package/dist/index.d.cts +7 -7
  188. package/dist/index.d.ts +7 -7
  189. package/dist/index.js +493 -320
  190. package/dist/index.js.map +1 -1
  191. package/dist/{isLoginPageRedirect-CsyRa3_v.js → isLoginPageRedirect-B4QKSiSa.js} +2 -2
  192. package/dist/{isLoginPageRedirect-CsyRa3_v.js.map → isLoginPageRedirect-B4QKSiSa.js.map} +1 -1
  193. package/dist/{isLoginPageRedirect-iNbwl3iz.cjs → isLoginPageRedirect-r0Opgc1n.cjs} +2 -2
  194. package/dist/{isLoginPageRedirect-iNbwl3iz.cjs.map → isLoginPageRedirect-r0Opgc1n.cjs.map} +1 -1
  195. package/dist/kaiAgent/index.cjs +1 -1
  196. package/dist/kaiAgent/index.d.cts +3 -3
  197. package/dist/kaiAgent/index.d.ts +3 -3
  198. package/dist/kaiAgent/index.js +1 -1
  199. package/dist/kaiAgent/types.d.cts +1 -1
  200. package/dist/kaiAgent/types.d.ts +1 -1
  201. package/dist/{kaiAgent-CUeT53-K.js → kaiAgent-CYvrS8oZ.js} +16 -7
  202. package/dist/kaiAgent-CYvrS8oZ.js.map +1 -0
  203. package/dist/{kaiAgent-BhcUsBDk.cjs → kaiAgent-N2qbUFZm.cjs} +16 -7
  204. package/dist/kaiAgent-N2qbUFZm.cjs.map +1 -0
  205. package/dist/{kaiMemory-DaOh0zVn.js → kaiMemory-C9di17bd.js} +2 -2
  206. package/dist/{kaiMemory-DaOh0zVn.js.map → kaiMemory-C9di17bd.js.map} +1 -1
  207. package/dist/{kaiMemory-Cf81ghNd.cjs → kaiMemory-Qch09f-m.cjs} +2 -2
  208. package/dist/{kaiMemory-Cf81ghNd.cjs.map → kaiMemory-Qch09f-m.cjs.map} +1 -1
  209. package/dist/management/index.cjs +1 -1
  210. package/dist/management/index.d.cts +1 -1
  211. package/dist/management/index.d.ts +1 -1
  212. package/dist/management/index.js +1 -1
  213. package/dist/management/types.d.cts +2 -2
  214. package/dist/management/types.d.ts +2 -2
  215. package/dist/{management-0cWVLHei.cjs → management-CXHnxVaZ.cjs} +34 -10
  216. package/dist/management-CXHnxVaZ.cjs.map +1 -0
  217. package/dist/{management-eg4Ig-Cx.js → management-NYAD6ej4.js} +34 -10
  218. package/dist/management-NYAD6ej4.js.map +1 -0
  219. package/dist/metastore/index.cjs +1 -1
  220. package/dist/metastore/index.d.cts +1 -1
  221. package/dist/metastore/index.d.ts +1 -1
  222. package/dist/metastore/index.js +1 -1
  223. package/dist/metastore/types.d.cts +1 -1
  224. package/dist/metastore/types.d.ts +1 -1
  225. package/dist/{metastore-YPHUK3jJ.cjs → metastore-BXHg33ku.cjs} +4 -4
  226. package/dist/{metastore-YPHUK3jJ.cjs.map → metastore-BXHg33ku.cjs.map} +1 -1
  227. package/dist/{metastore-D0C6uaPX.js → metastore-Ywq08DBz.js} +4 -4
  228. package/dist/{metastore-D0C6uaPX.js.map → metastore-Ywq08DBz.js.map} +1 -1
  229. package/dist/microsoftGraph/index.cjs +2 -2
  230. package/dist/microsoftGraph/index.d.cts +2 -2
  231. package/dist/microsoftGraph/index.d.ts +2 -2
  232. package/dist/microsoftGraph/index.js +2 -2
  233. package/dist/microsoftGraph/types.d.cts +1 -1
  234. package/dist/microsoftGraph/types.d.ts +1 -1
  235. package/dist/{middleware-D_p5TctO.cjs → middleware-CEP6uu_D.cjs} +5 -5
  236. package/dist/middleware-CEP6uu_D.cjs.map +1 -0
  237. package/dist/{middleware-DmR6OhTY.js → middleware-GOfx8Apu.js} +5 -5
  238. package/dist/middleware-GOfx8Apu.js.map +1 -0
  239. package/dist/notifications/index.cjs +3 -3
  240. package/dist/notifications/index.d.cts +2 -2
  241. package/dist/notifications/index.d.ts +2 -2
  242. package/dist/notifications/index.js +3 -3
  243. package/dist/notifications/types.d.cts +1 -1
  244. package/dist/notifications/types.d.ts +1 -1
  245. package/dist/oauth/index.cjs +1 -1
  246. package/dist/oauth/index.d.cts +6 -2
  247. package/dist/oauth/index.d.ts +6 -2
  248. package/dist/oauth/index.js +1 -1
  249. package/dist/oauth/types.d.cts +2 -2
  250. package/dist/oauth/types.d.ts +2 -2
  251. package/dist/{oauth-DyUwTqHJ.cjs → oauth-DKZPuUlt.cjs} +17 -6
  252. package/dist/{oauth-DyUwTqHJ.cjs.map → oauth-DKZPuUlt.cjs.map} +1 -1
  253. package/dist/{oauth-Ck_Fe14o.js → oauth-GXmZ9agP.js} +17 -6
  254. package/dist/{oauth-Ck_Fe14o.js.map → oauth-GXmZ9agP.js.map} +1 -1
  255. package/dist/omnisearch/index.cjs +2 -2
  256. package/dist/omnisearch/index.d.cts +2 -2
  257. package/dist/omnisearch/index.d.ts +2 -2
  258. package/dist/omnisearch/index.js +2 -2
  259. package/dist/omnisearch/types.d.cts +1 -1
  260. package/dist/omnisearch/types.d.ts +1 -1
  261. package/dist/project-Dzu85cqr.d.cts +74 -0
  262. package/dist/project-nbv9yjpl.d.ts +74 -0
  263. package/dist/queryService/index.cjs +1 -1
  264. package/dist/queryService/index.d.cts +1 -1
  265. package/dist/queryService/index.d.ts +1 -1
  266. package/dist/queryService/index.js +1 -1
  267. package/dist/queryService/types.d.cts +2 -2
  268. package/dist/queryService/types.d.ts +2 -2
  269. package/dist/{queryService-Blfz59Ms.js → queryService-C-pZha5p.js} +36 -27
  270. package/dist/queryService-C-pZha5p.js.map +1 -0
  271. package/dist/{queryService-RlNYw7LG.cjs → queryService-CzK53q94.cjs} +36 -27
  272. package/dist/queryService-CzK53q94.cjs.map +1 -0
  273. package/dist/queue/index.cjs +1 -1
  274. package/dist/queue/index.d.cts +75 -7
  275. package/dist/queue/index.d.ts +75 -7
  276. package/dist/queue/index.js +1 -1
  277. package/dist/queue/types.d.cts +1 -1
  278. package/dist/queue/types.d.ts +1 -1
  279. package/dist/{queue-BrgRdtOr.cjs → queue-BJvDWriM.cjs} +35 -25
  280. package/dist/queue-BJvDWriM.cjs.map +1 -0
  281. package/dist/{queue-CNvR-M23.js → queue-D6-x4OGF.js} +35 -25
  282. package/dist/queue-D6-x4OGF.js.map +1 -0
  283. package/dist/scheduler/index.cjs +3 -3
  284. package/dist/scheduler/index.d.cts +2 -2
  285. package/dist/scheduler/index.d.ts +2 -2
  286. package/dist/scheduler/index.js +3 -3
  287. package/dist/scheduler/types.d.cts +1 -1
  288. package/dist/scheduler/types.d.ts +1 -1
  289. package/dist/sdk/configurations/index.cjs +1 -1
  290. package/dist/sdk/configurations/index.d.cts +2 -4
  291. package/dist/sdk/configurations/index.d.ts +2 -4
  292. package/dist/sdk/configurations/index.js +1 -1
  293. package/dist/sdk/developerPortal/index.cjs +3 -3
  294. package/dist/sdk/developerPortal/index.d.cts +3 -3
  295. package/dist/sdk/developerPortal/index.d.ts +3 -3
  296. package/dist/sdk/developerPortal/index.js +3 -3
  297. package/dist/sdk/kaiMemory/index.cjs +1 -1
  298. package/dist/sdk/kaiMemory/index.d.cts +1 -1
  299. package/dist/sdk/kaiMemory/index.d.ts +1 -1
  300. package/dist/sdk/kaiMemory/index.js +1 -1
  301. package/dist/sdk/kaiMemory/types.d.cts +1 -1
  302. package/dist/sdk/kaiMemory/types.d.ts +1 -1
  303. package/dist/sdk/queryService/index.cjs +34 -55
  304. package/dist/sdk/queryService/index.cjs.map +1 -1
  305. package/dist/sdk/queryService/index.d.cts +2 -2
  306. package/dist/sdk/queryService/index.d.ts +2 -2
  307. package/dist/sdk/queryService/index.js +34 -55
  308. package/dist/sdk/queryService/index.js.map +1 -1
  309. package/dist/sdk/semanticLayer/index.d.cts +1 -1
  310. package/dist/sdk/semanticLayer/index.d.ts +1 -1
  311. package/dist/sdk/semanticLayer/types.d.cts +1 -1
  312. package/dist/sdk/semanticLayer/types.d.ts +1 -1
  313. package/dist/sdk/storage/index.cjs +0 -119
  314. package/dist/sdk/storage/index.cjs.map +1 -1
  315. package/dist/sdk/storage/index.d.cts +103 -2
  316. package/dist/sdk/storage/index.d.ts +103 -2
  317. package/dist/sdk/storage/index.js +1 -119
  318. package/dist/sdk/storage/index.js.map +1 -1
  319. package/dist/sdk/tag/index.d.cts +2 -2
  320. package/dist/sdk/tag/index.d.ts +2 -2
  321. package/dist/sdk/tag/types.d.cts +1 -1
  322. package/dist/sdk/tag/types.d.ts +1 -1
  323. package/dist/sdk/vault/index.d.cts +1 -1
  324. package/dist/sdk/vault/index.d.ts +1 -1
  325. package/dist/status/index.cjs +1 -1
  326. package/dist/status/index.d.cts +1 -1
  327. package/dist/status/index.d.ts +1 -1
  328. package/dist/status/index.js +1 -1
  329. package/dist/storage/index.cjs +13 -9
  330. package/dist/storage/index.d.cts +3 -3
  331. package/dist/storage/index.d.ts +3 -3
  332. package/dist/storage/index.js +7 -6
  333. package/dist/storage/types.d.cts +6 -5
  334. package/dist/storage/types.d.ts +6 -5
  335. package/dist/{storage-RkNaOFJ-.js → storage-BR-Kgi-6.js} +353 -169
  336. package/dist/storage-BR-Kgi-6.js.map +1 -0
  337. package/dist/{storage-76Sf_z_H.cjs → storage-CVBXivpB.cjs} +372 -170
  338. package/dist/storage-CVBXivpB.cjs.map +1 -0
  339. package/dist/stream/index.cjs +3 -3
  340. package/dist/stream/index.d.cts +2 -2
  341. package/dist/stream/index.d.ts +2 -2
  342. package/dist/stream/index.js +3 -3
  343. package/dist/stream/types.d.cts +1 -1
  344. package/dist/stream/types.d.ts +1 -1
  345. package/dist/syncActions/index.cjs +1 -1
  346. package/dist/syncActions/index.d.cts +2 -2
  347. package/dist/syncActions/index.d.ts +2 -2
  348. package/dist/syncActions/index.js +1 -1
  349. package/dist/syncActions/types.d.cts +1 -1
  350. package/dist/syncActions/types.d.ts +1 -1
  351. package/dist/{syncActions-DlNPhZY4.cjs → syncActions-C1rE4R3f.cjs} +5 -5
  352. package/dist/{syncActions-DlNPhZY4.cjs.map → syncActions-C1rE4R3f.cjs.map} +1 -1
  353. package/dist/{syncActions-BvFUa9xV.js → syncActions-DM8vP7p3.js} +5 -5
  354. package/dist/{syncActions-BvFUa9xV.js.map → syncActions-DM8vP7p3.js.map} +1 -1
  355. package/dist/telemetry/index.cjs +3 -6
  356. package/dist/telemetry/index.cjs.map +1 -1
  357. package/dist/telemetry/index.d.cts +2 -5
  358. package/dist/telemetry/index.d.ts +2 -5
  359. package/dist/telemetry/index.js +3 -6
  360. package/dist/telemetry/index.js.map +1 -1
  361. package/dist/telemetry/types.d.cts +1 -1
  362. package/dist/telemetry/types.d.ts +1 -1
  363. package/dist/{jobStatus-BJdbZ72V.js → transientRetries-B4iusp69.js} +79 -37
  364. package/dist/transientRetries-B4iusp69.js.map +1 -0
  365. package/dist/{jobStatus-B0E-MZ9I.cjs → transientRetries-DdJfH9QK.cjs} +82 -40
  366. package/dist/transientRetries-DdJfH9QK.cjs.map +1 -0
  367. package/dist/{types-QroFANIW.d.cts → types-0ZAMQhva.d.cts} +3 -3
  368. package/dist/{types-BMWeCO5M.d.ts → types-1LENlL5h.d.ts} +3 -3
  369. package/dist/{types-BRvs3fXN.d.cts → types-6KabdIyO.d.cts} +3 -3
  370. package/dist/{types-B5kkD7h4.d.cts → types-9d8ihjZh.d.cts} +2 -2
  371. package/dist/{types-qGMVZGSB.d.ts → types-B7L6uSYb.d.ts} +50 -3
  372. package/dist/{types-qWA5iU0j.d.ts → types-BTy_FFSu.d.ts} +2 -2
  373. package/dist/{types-B1GN_I06.d.ts → types-BWYtQkHu.d.ts} +2 -2
  374. package/dist/types-BXHZQvGy.d.ts +2111 -0
  375. package/dist/{types-Btb8r9iw.d.ts → types-BYFU_6Iz.d.ts} +95 -26
  376. package/dist/{types-Nwq1QtYe.d.ts → types-BaqdM92a.d.ts} +3 -4
  377. package/dist/{types-CFurl1xe.d.cts → types-BbwrMl0Q.d.cts} +2 -2
  378. package/dist/{types-Br04cEri.d.ts → types-Bt8CEZ6K.d.ts} +2 -2
  379. package/dist/types-BtS3DhGu.d.cts +2111 -0
  380. package/dist/{types-CaBhH99H.d.ts → types-C-GSYDTN.d.ts} +3 -3
  381. package/dist/{types-BGICH80a.d.cts → types-C4eQ-Zcx.d.cts} +2 -2
  382. package/dist/{types-BTqxM-IN.d.ts → types-C9VaQSqV.d.ts} +2 -2
  383. package/dist/{types-C05ALlV6.d.cts → types-CNkQuWnO.d.cts} +3 -3
  384. package/dist/{types-DMWfdZ5C.d.cts → types-CXv_e6xC.d.cts} +2 -2
  385. package/dist/{types-C8oZX0oP.d.cts → types-C_raqbl-.d.cts} +3 -3
  386. package/dist/{types-BtII5RSD.d.ts → types-Cc4yTEdK.d.ts} +11 -3
  387. package/dist/{types-BoNqe_Lz.d.ts → types-Ce5Blzhg.d.ts} +2 -2
  388. package/dist/{types-UI2aZ74n.d.ts → types-CfZLdfAL.d.ts} +3 -3
  389. package/dist/{types-sg2xnYlr.d.cts → types-Cfc-fYbq.d.cts} +95 -26
  390. package/dist/{types-C4yryy-R.d.ts → types-Cn8I0vcr.d.ts} +3 -3
  391. package/dist/{types-DQauEri3.d.ts → types-CpWE6Yg2.d.ts} +2 -2
  392. package/dist/{types-XHNJRi3-.d.cts → types-CrJIILXf.d.cts} +2 -2
  393. package/dist/{types-DHdXufVf.d.cts → types-CwGbiMF-.d.cts} +3 -3
  394. package/dist/{types-fAqPUl-a.d.ts → types-CwQ8_n8q.d.ts} +320 -43
  395. package/dist/{types-BksK2Eo0.d.cts → types-D3H3EAre.d.ts} +2 -2
  396. package/dist/{types-CyO8qCKl.d.cts → types-D3mj56iq.d.cts} +2 -2
  397. package/dist/{types-YdE2VJzw.d.cts → types-D8d5tyGi.d.cts} +2 -2
  398. package/dist/{types-Csmy6qFk.d.cts → types-DMpiG2q4.d.cts} +3 -3
  399. package/dist/{types-ggpJFEWZ.d.cts → types-DSBrhK_K.d.cts} +2 -2
  400. package/dist/{types-5HdT1rSH.d.cts → types-DXF6faow.d.cts} +2 -2
  401. package/dist/{types-DDjp9lXD.d.ts → types-DfJP6Dti.d.ts} +2 -2
  402. package/dist/{types-DSv1XS7s.d.ts → types-DgOLSRiy.d.ts} +3 -3
  403. package/dist/{types-tJLoKlMX.d.cts → types-DlgqPU_4.d.cts} +2 -2
  404. package/dist/{types-sI3K5t3w.d.cts → types-Dn1G-qv4.d.cts} +320 -43
  405. package/dist/{types--owScV0r.d.cts → types-EkyQ0_10.d.cts} +11 -3
  406. package/dist/{types-LxDyOfdY.d.cts → types-EmIcG-8K.d.cts} +2 -2
  407. package/dist/{types-DGu-wPPm.d.cts → types-NSxpnYW5.d.cts} +50 -3
  408. package/dist/{types-Dvysi2Eo.d.ts → types-QPW-7dPm.d.ts} +2 -2
  409. package/dist/{types-BE7mRarT.d.ts → types-UySfduQo.d.ts} +2 -2
  410. package/dist/{types-BHxsCu0f.d.ts → types-VehpPOQX.d.ts} +2 -2
  411. package/dist/{types-DiE081mn.d.ts → types-Vu09EUZs.d.ts} +3 -3
  412. package/dist/{types-CoQET4Ep.d.ts → types-c4h2YDMC.d.ts} +2 -2
  413. package/dist/{types-BuKviWct.d.ts → types-sOM2_KPc.d.cts} +2 -2
  414. package/dist/{types-DUDQg4ry.d.cts → types-wNuJUhco.d.cts} +3 -4
  415. package/dist/{validateConnectionStatus-DR-0h35y.cjs → validateConnectionStatus-BalWEyRk.cjs} +3 -3
  416. package/dist/{validateConnectionStatus-DR-0h35y.cjs.map → validateConnectionStatus-BalWEyRk.cjs.map} +1 -1
  417. package/dist/{validateConnectionStatus-CdTV3gsP.js → validateConnectionStatus-DyrYpn0G.js} +3 -3
  418. package/dist/{validateConnectionStatus-CdTV3gsP.js.map → validateConnectionStatus-DyrYpn0G.js.map} +1 -1
  419. package/dist/vault/index.cjs +6 -6
  420. package/dist/vault/index.cjs.map +1 -1
  421. package/dist/vault/index.d.cts +1 -1
  422. package/dist/vault/index.d.ts +1 -1
  423. package/dist/vault/index.js +6 -6
  424. package/dist/vault/index.js.map +1 -1
  425. package/dist/vault/types.d.cts +1 -1
  426. package/dist/vault/types.d.ts +1 -1
  427. package/package.json +27 -1
  428. package/surface/ai.md +0 -1
  429. package/surface/apps.md +5 -5
  430. package/surface/auth.md +2 -0
  431. package/surface/chat.md +2 -2
  432. package/surface/componentsMcp.md +9 -0
  433. package/surface/dataScience.md +2 -2
  434. package/surface/kaiAgent.md +5 -4
  435. package/surface/management.md +5 -2
  436. package/surface/oauth.md +1 -0
  437. package/surface/queryService.md +4 -4
  438. package/surface/queue.md +2 -2
  439. package/surface/sdk.md +0 -24
  440. package/surface/storage.md +88 -57
  441. package/dist/QueryJobTimeoutError-C7JbNGOM.js +0 -38
  442. package/dist/QueryJobTimeoutError-C7JbNGOM.js.map +0 -1
  443. package/dist/QueryJobTimeoutError-CVNPdCWX.cjs.map +0 -1
  444. package/dist/authClient-CACOwVt0.js.map +0 -1
  445. package/dist/authClient-DZcAR-eW.cjs.map +0 -1
  446. package/dist/collect-97WhfEpt.js.map +0 -1
  447. package/dist/collect-B5TCNiT1.cjs.map +0 -1
  448. package/dist/configurations-BTRHVSRq.cjs.map +0 -1
  449. package/dist/configurations-Chg_JwJ1.js.map +0 -1
  450. package/dist/constants-BDGRQqij.cjs.map +0 -1
  451. package/dist/constants-Cifrqsls.js.map +0 -1
  452. package/dist/createFetchClient-ClWD4ua3.cjs.map +0 -1
  453. package/dist/createFetchClient-DITkTV2k.js.map +0 -1
  454. package/dist/index-BzhLY7el.d.cts +0 -254
  455. package/dist/index-CH5Sg3rk.d.ts +0 -77
  456. package/dist/index-CiwWDu-q.d.cts +0 -16
  457. package/dist/index-DCAnnlcL.d.ts +0 -16
  458. package/dist/index-DQwjlSJi.d.cts +0 -77
  459. package/dist/index-PyTPrtaL.d.ts +0 -254
  460. package/dist/jobStatus-B0E-MZ9I.cjs.map +0 -1
  461. package/dist/jobStatus-BJdbZ72V.js.map +0 -1
  462. package/dist/kaiAgent-BhcUsBDk.cjs.map +0 -1
  463. package/dist/kaiAgent-CUeT53-K.js.map +0 -1
  464. package/dist/management-0cWVLHei.cjs.map +0 -1
  465. package/dist/management-eg4Ig-Cx.js.map +0 -1
  466. package/dist/middleware-D_p5TctO.cjs.map +0 -1
  467. package/dist/middleware-DmR6OhTY.js.map +0 -1
  468. package/dist/project-BN7YRWFS.d.cts +0 -24
  469. package/dist/project-BpWTnoQ_.d.ts +0 -24
  470. package/dist/queryService-Blfz59Ms.js.map +0 -1
  471. package/dist/queryService-RlNYw7LG.cjs.map +0 -1
  472. package/dist/queue-BrgRdtOr.cjs.map +0 -1
  473. package/dist/queue-CNvR-M23.js.map +0 -1
  474. package/dist/serviceIds-DRcoTnSd.d.cts +0 -32
  475. package/dist/serviceIds-DRcoTnSd.d.ts +0 -32
  476. package/dist/storage-76Sf_z_H.cjs.map +0 -1
  477. package/dist/storage-RkNaOFJ-.js.map +0 -1
  478. package/dist/types-1B3ioN33.d.cts +0 -1868
  479. package/dist/types-BjIuVrAZ.d.ts +0 -66
  480. package/dist/types-CGhu0tID.d.cts +0 -1298
  481. package/dist/types-CclheyE7.d.cts +0 -66
  482. package/dist/types-M9vU_ONp.d.ts +0 -1868
  483. package/dist/types-P_61P9Nd.d.ts +0 -1298
  484. package/dist/types-j30rKMe6.d.ts +0 -957
  485. package/dist/types-q5lgElyc.d.cts +0 -957
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware-GOfx8Apu.js","names":[],"sources":["../src/keboola/bearer/credentials/middleware.ts"],"sourcesContent":["import { ApiError } from '../../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../../fetchClient';\nimport { HttpStatus } from '../../../internal';\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\n/** Where the middleware gets its token; whether the credential behind it is dead is not its call. */\nexport type AccessTokenSource = {\n /** `null` while anonymous — nothing to stamp. */\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n};\n\n/**\n * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.\n *\n * - A replay that still 401s passes on, not as expiry: an unreachable project gets the same 401.\n * - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.\n * - A `forceRefresh` answering `null` stops the replay.\n */\nexport const createBearerAuthMiddleware = (source: AccessTokenSource): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await source.getAccessToken({ forceRefresh: false });\n if (token === null) return next(request);\n\n // Cloned for the replay: the first attempt may consume the body.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${token}`);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await source.getAccessToken({ forceRefresh: true });\n // Went anonymous mid-flight — surface the original 401.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);\n\n return await next({ ...request, request: retryRequest });\n }\n };\n};\n"],"mappings":";;AAIA,MAAa,kBAAkB,UAC7B,iBAAiB,YAAY,MAAM,SAAS,WAAW,WAAW;;;;;;;;AAepE,MAAa,8BAA8B,WAA4C;CACrF,QAAQ,SAAS,OAAO,YAAY;EAClC,MAAM,QAAQ,MAAM,OAAO,eAAe,EAAE,cAAc,MAAM,CAAC;EACjE,IAAI,UAAU,MAAM,OAAO,KAAK,OAAO;EAGvC,MAAM,eAAe,QAAQ,QAAQ,MAAM;EAC3C,QAAQ,QAAQ,QAAQ,IAAI,WAAW,eAAe,UAAU,OAAO;EAEvE,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,CAAC,eAAe,KAAK,GAAG,MAAM;GAElC,MAAM,YAAY,MAAM,OAAO,eAAe,EAAE,cAAc,KAAK,CAAC;GAEpE,IAAI,cAAc,MAAM,MAAM;GAC9B,aAAa,QAAQ,IAAI,WAAW,eAAe,UAAU,WAAW;GAExE,OAAO,MAAM,KAAK;IAAE,GAAG;IAAS,SAAS;GAAa,CAAC;EACzD;CACF;AACF"}
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_concurrent = require("../concurrent-CdVfR1N5.cjs");
3
- const require_createGenericFetchClient = require("../createGenericFetchClient-B81Iezpb.cjs");
4
- const require_createOpenapiFetchClient = require("../createOpenapiFetchClient-CioTX11-.cjs");
5
- const require_auth = require("../auth-C9o_0bft.cjs");
3
+ const require_createGenericFetchClient = require("../createGenericFetchClient-MOx97wi-.cjs");
4
+ const require_createOpenapiFetchClient = require("../createOpenapiFetchClient-DHYo_k3t.cjs");
5
+ const require_auth = require("../auth-C8Pjl0Mu.cjs");
6
6
  //#region src/clients/notifications/notificationsClient.ts
7
7
  const createNotificationsClient = ({ baseUrl, middlewares, auth }) => {
8
8
  const client = require_createOpenapiFetchClient.createOpenapiFetchClient({
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BksK2Eo0.cjs";
2
- import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-XHNJRi3-.cjs";
1
+ import { n as ClientInitOptions } from "../types-sOM2_KPc.cjs";
2
+ import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-CrJIILXf.cjs";
3
3
  //#region src/clients/notifications/notificationsClient.d.ts
4
4
  declare const createNotificationsClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
5
5
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BuKviWct.js";
2
- import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-qWA5iU0j.js";
1
+ import { n as ClientInitOptions } from "../types-D3H3EAre.js";
2
+ import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-BTy_FFSu.js";
3
3
  //#region src/clients/notifications/notificationsClient.d.ts
4
4
  declare const createNotificationsClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
5
5
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
@@ -1,7 +1,7 @@
1
1
  import { t as concurrent } from "../concurrent-BacWxPwi.js";
2
- import { t as createGenericFetchClient } from "../createGenericFetchClient-KqiJhw8G.js";
3
- import { t as createOpenapiFetchClient } from "../createOpenapiFetchClient-wq8iGLZM.js";
4
- import { t as createAuthHeaders } from "../auth-C6cHWIWx.js";
2
+ import { t as createGenericFetchClient } from "../createGenericFetchClient-CQdNcPC3.js";
3
+ import { t as createOpenapiFetchClient } from "../createOpenapiFetchClient-DXiMv9WL.js";
4
+ import { t as createAuthHeaders } from "../auth-4coY1uwo.js";
5
5
  //#region src/clients/notifications/notificationsClient.ts
6
6
  const createNotificationsClient = ({ baseUrl, middlewares, auth }) => {
7
7
  const client = createOpenapiFetchClient({
@@ -1,2 +1,2 @@
1
- import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-XHNJRi3-.cjs";
1
+ import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-CrJIILXf.cjs";
2
2
  export { CreateSubscriptionBody, ListSubscriptionsQuery, ProjectSubscription, SubscriptionFilter, SubscriptionId, SubscriptionRecipient };
@@ -1,2 +1,2 @@
1
- import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-qWA5iU0j.js";
1
+ import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-BTy_FFSu.js";
2
2
  export { CreateSubscriptionBody, ListSubscriptionsQuery, ProjectSubscription, SubscriptionFilter, SubscriptionId, SubscriptionRecipient };
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_oauth = require("../oauth-DyUwTqHJ.cjs");
2
+ const require_oauth = require("../oauth-DKZPuUlt.cjs");
3
3
  exports.createOauthClient = require_oauth.createOauthClient;
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BksK2Eo0.cjs";
2
- import { a as CredentialInput, r as CreateCredentialInput, s as GetCredentialsInput } from "../types-sg2xnYlr.cjs";
1
+ import { n as ClientInitOptions } from "../types-sOM2_KPc.cjs";
2
+ import { a as CredentialInput, c as GetCredentialsInput, r as CreateCredentialInput } from "../types-Cfc-fYbq.cjs";
3
3
  //#region src/clients/oauth/oauthClient.d.ts
4
4
  declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
5
5
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
@@ -46,6 +46,10 @@ declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
46
46
  '#data': string;
47
47
  }>;
48
48
  deleteCredential: ({ componentId, id }: CredentialInput, signal?: AbortSignal) => Promise<void>;
49
+ getOrganizationConnections: (signal?: AbortSignal) => Promise<{
50
+ accountLogin: string;
51
+ host: string;
52
+ }[]>;
49
53
  };
50
54
  //#endregion
51
55
  export { createOauthClient };
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BuKviWct.js";
2
- import { a as CredentialInput, r as CreateCredentialInput, s as GetCredentialsInput } from "../types-Btb8r9iw.js";
1
+ import { n as ClientInitOptions } from "../types-D3H3EAre.js";
2
+ import { a as CredentialInput, c as GetCredentialsInput, r as CreateCredentialInput } from "../types-BYFU_6Iz.js";
3
3
  //#region src/clients/oauth/oauthClient.d.ts
4
4
  declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
5
5
  healthCheck: (signal?: AbortSignal) => Promise<unknown>;
@@ -46,6 +46,10 @@ declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
46
46
  '#data': string;
47
47
  }>;
48
48
  deleteCredential: ({ componentId, id }: CredentialInput, signal?: AbortSignal) => Promise<void>;
49
+ getOrganizationConnections: (signal?: AbortSignal) => Promise<{
50
+ accountLogin: string;
51
+ host: string;
52
+ }[]>;
49
53
  };
50
54
  //#endregion
51
55
  export { createOauthClient };
@@ -1,2 +1,2 @@
1
- import { t as createOauthClient } from "../oauth-Ck_Fe14o.js";
1
+ import { t as createOauthClient } from "../oauth-GXmZ9agP.js";
2
2
  export { createOauthClient };
@@ -1,2 +1,2 @@
1
- import { a as CredentialInput, i as Credential, n as CreateCredentialBody, o as CredentialPath, r as CreateCredentialInput, s as GetCredentialsInput, t as ComponentPath } from "../types-sg2xnYlr.cjs";
2
- export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, type GetCredentialsInput };
1
+ import { a as CredentialInput, c as GetCredentialsInput, i as Credential, n as CreateCredentialBody, o as CredentialPath, r as CreateCredentialInput, s as OrganizationConnection, t as ComponentPath } from "../types-Cfc-fYbq.cjs";
2
+ export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, type GetCredentialsInput, OrganizationConnection };
@@ -1,2 +1,2 @@
1
- import { a as CredentialInput, i as Credential, n as CreateCredentialBody, o as CredentialPath, r as CreateCredentialInput, s as GetCredentialsInput, t as ComponentPath } from "../types-Btb8r9iw.js";
2
- export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, type GetCredentialsInput };
1
+ import { a as CredentialInput, c as GetCredentialsInput, i as Credential, n as CreateCredentialBody, o as CredentialPath, r as CreateCredentialInput, s as OrganizationConnection, t as ComponentPath } from "../types-BYFU_6Iz.js";
2
+ export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, type GetCredentialsInput, OrganizationConnection };
@@ -1,7 +1,7 @@
1
- const require_createFetchClient = require("./createFetchClient-ClWD4ua3.cjs");
2
- const require_createGenericFetchClient = require("./createGenericFetchClient-B81Iezpb.cjs");
3
- const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-CioTX11-.cjs");
4
- const require_auth = require("./auth-C9o_0bft.cjs");
1
+ const require_createFetchClient = require("./createFetchClient-lZ_93Yrb.cjs");
2
+ const require_createGenericFetchClient = require("./createGenericFetchClient-MOx97wi-.cjs");
3
+ const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-DHYo_k3t.cjs");
4
+ const require_auth = require("./auth-C8Pjl0Mu.cjs");
5
5
  //#region src/clients/oauth/utils.ts
6
6
  /**
7
7
  * The credentials payload rides one of two fields, and only one of them is in the current spec:
@@ -65,6 +65,16 @@ const createOauthClient = ({ baseUrl, middlewares, auth }) => {
65
65
  name: id
66
66
  } }, { signal });
67
67
  };
68
+ /**
69
+ * The GitHub connections of the project's organization; any project member's token may read them.
70
+ *
71
+ * - Empty when the organization has none.
72
+ * - A listed connection does not guarantee a repository: the App installation must cover it.
73
+ */
74
+ const getOrganizationConnections = async (signal) => {
75
+ const { data } = await client.get("/organization-credentials/connections", {}, { signal });
76
+ return data.connections;
77
+ };
68
78
  const healthCheck = async (signal) => {
69
79
  const { data } = await genericClient.get("/health-check", {}, { signal });
70
80
  return data;
@@ -74,7 +84,8 @@ const createOauthClient = ({ baseUrl, middlewares, auth }) => {
74
84
  getCredentials,
75
85
  getCredential,
76
86
  createCredential,
77
- deleteCredential
87
+ deleteCredential,
88
+ getOrganizationConnections
78
89
  };
79
90
  };
80
91
  //#endregion
@@ -85,4 +96,4 @@ Object.defineProperty(exports, "createOauthClient", {
85
96
  }
86
97
  });
87
98
 
88
- //# sourceMappingURL=oauth-DyUwTqHJ.cjs.map
99
+ //# sourceMappingURL=oauth-DKZPuUlt.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-DyUwTqHJ.cjs","names":["createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient","isApiError","HttpStatus"],"sources":["../src/clients/oauth/utils.ts","../src/clients/oauth/oauthClient.ts"],"sourcesContent":["/**\n * Which credentials to list:\n *\n * - `all` — the whole project: branch-scoped and branchless alike.\n * - `branchless` — only what is tied to no branch at all, not even the default one.\n * - `branched` — only the branch whose id it carries.\n *\n * Discriminated on `scope`, not on `branchId` being present: a `string | 'all' | 'branchless'` union\n * collapses to `string`, so a mistyped scope would silently become a branch-id filter.\n */\nexport type GetCredentialsInput =\n | { scope: 'all'; componentId?: string }\n | { scope: 'branchless'; componentId?: string }\n | { scope: 'branched'; branchId: string; componentId?: string };\n\n/**\n * All three scopes ride the one `branchId` query parameter:\n *\n * - `all` → omitted, which the service reads as no filter.\n * - `branchless` → the literal string `'null'`, which it reads as `branchId IS NULL`.\n * - `branched` → the branch id itself.\n */\nexport type CredentialsDataFormat = 'encrypted' | 'plain';\n\n/**\n * The credentials payload rides one of two fields, and only one of them is in the current spec:\n *\n * - `encrypted` — `#data`, the payload serialized to a string. The `#` marks it for the service to\n * encrypt at rest.\n * - `plain` — `data`, the payload as an object. Only services predating the spec accept it.\n */\nexport const encodeCredentialsData = (\n data: Record<string, unknown>,\n format: CredentialsDataFormat,\n) => (format === 'encrypted' ? { '#data': JSON.stringify(data) } : { data });\n\nexport const getScopedBranchId = (scope: GetCredentialsInput) => {\n switch (scope.scope) {\n case 'all':\n return undefined;\n case 'branchless':\n return 'null';\n case 'branched':\n return scope.branchId;\n }\n};\n","import { createGenericFetchClient, createOpenapiFetchClient, isApiError } from '../../fetchClient';\nimport { HttpStatus } from '../../internal';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport type { CreateCredentialInput, CredentialInput } from './types';\nimport type { CredentialsDataFormat, GetCredentialsInput } from './utils';\nimport { encodeCredentialsData, getScopedBranchId } from './utils';\n\nexport const createOauthClient = ({ 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 getCredentials = async (scope: GetCredentialsInput, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/credentials',\n { query: { branchId: getScopedBranchId(scope), componentId: scope.componentId } },\n { signal },\n );\n return data;\n };\n\n const getCredential = async ({ componentId, id }: CredentialInput, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/credentials/{componentId}/{name}',\n { path: { componentId, name: id } },\n { signal },\n );\n return data;\n };\n\n const createCredential = async (\n { componentId, data, ...rest }: CreateCredentialInput,\n signal?: AbortSignal,\n ) => {\n const post = (format: CredentialsDataFormat) =>\n client\n .post(\n '/credentials/{componentId}',\n {\n path: { componentId },\n // The plain shape predates the spec, so no schema can describe it. It borrows the\n // encrypted field's type to get past the generated body — the one assertion here.\n body: { ...rest, ...(encodeCredentialsData(data, format) as { '#data': string }) },\n },\n { signal },\n )\n .then((response) => response.data);\n\n try {\n return await post('plain');\n } catch (error) {\n if (isApiError(error) && error.response.status === HttpStatus.UNPROCESSABLE_ENTITY) {\n return post('encrypted');\n }\n throw error;\n }\n };\n\n const deleteCredential = async ({ componentId, id }: CredentialInput, signal?: AbortSignal) => {\n await client.delete(\n '/credentials/{componentId}/{name}',\n { path: { componentId, name: id } },\n { signal },\n );\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n return {\n healthCheck,\n getCredentials,\n getCredential,\n createCredential,\n deleteCredential,\n };\n};\n"],"mappings":";;;;;;;;;;;;AA+BA,MAAa,yBACX,MACA,WACI,WAAW,cAAc,EAAE,SAAS,KAAK,UAAU,IAAI,EAAE,IAAI,EAAE,KAAK;AAE1E,MAAa,qBAAqB,UAA+B;CAC/D,QAAQ,MAAM,OAAd;EACE,KAAK,OACH;EACF,KAAK,cACH,OAAO;EACT,KAAK,YACH,OAAO,MAAM;CACjB;AACF;;;ACnCA,MAAa,qBAAqB,EAAE,SAAS,aAAa,WAA8B;CACtF,MAAM,SAASA,iCAAAA,yBAAgC;EAC7C;EACA;EACA,SAASC,aAAAA,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgBC,iCAAAA,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,iBAAiB,OAAO,OAA4B,WAAyB;EACjF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gBACA,EAAE,OAAO;GAAE,UAAU,kBAAkB,KAAK;GAAG,aAAa,MAAM;EAAY,EAAE,GAChF,EAAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,gBAAgB,OAAO,EAAE,aAAa,MAAuB,WAAyB;EAC1F,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EAAE,MAAM;GAAE;GAAa,MAAM;EAAG,EAAE,GAClC,EAAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,mBAAmB,OACvB,EAAE,aAAa,MAAM,GAAG,QACxB,WACG;EACH,MAAM,QAAQ,WACZ,OACG,KACC,8BACA;GACE,MAAM,EAAE,YAAY;GAGpB,MAAM;IAAE,GAAG;IAAM,GAAI,sBAAsB,MAAM,MAAM;GAA0B;EACnF,GACA,EAAE,OAAO,CACX,CAAC,CACA,MAAM,aAAa,SAAS,IAAI;EAErC,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAIC,0BAAAA,WAAW,KAAK,KAAK,MAAM,SAAS,WAAWC,0BAAAA,WAAW,sBAC5D,OAAO,KAAK,WAAW;GAEzB,MAAM;EACR;CACF;CAEA,MAAM,mBAAmB,OAAO,EAAE,aAAa,MAAuB,WAAyB;EAC7F,MAAM,OAAO,OACX,qCACA,EAAE,MAAM;GAAE;GAAa,MAAM;EAAG,EAAE,GAClC,EAAE,OAAO,CACX;CACF;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;CACF;AACF"}
1
+ {"version":3,"file":"oauth-DKZPuUlt.cjs","names":["createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient","isApiError","HttpStatus"],"sources":["../src/clients/oauth/utils.ts","../src/clients/oauth/oauthClient.ts"],"sourcesContent":["/**\n * Which credentials to list:\n *\n * - `all` — the whole project: branch-scoped and branchless alike.\n * - `branchless` — only what is tied to no branch at all, not even the default one.\n * - `branched` — only the branch whose id it carries.\n *\n * Discriminated on `scope`, not on `branchId` being present: a `string | 'all' | 'branchless'` union\n * collapses to `string`, so a mistyped scope would silently become a branch-id filter.\n */\nexport type GetCredentialsInput =\n | { scope: 'all'; componentId?: string }\n | { scope: 'branchless'; componentId?: string }\n | { scope: 'branched'; branchId: string; componentId?: string };\n\n/**\n * All three scopes ride the one `branchId` query parameter:\n *\n * - `all` → omitted, which the service reads as no filter.\n * - `branchless` → the literal string `'null'`, which it reads as `branchId IS NULL`.\n * - `branched` → the branch id itself.\n */\nexport type CredentialsDataFormat = 'encrypted' | 'plain';\n\n/**\n * The credentials payload rides one of two fields, and only one of them is in the current spec:\n *\n * - `encrypted` — `#data`, the payload serialized to a string. The `#` marks it for the service to\n * encrypt at rest.\n * - `plain` — `data`, the payload as an object. Only services predating the spec accept it.\n */\nexport const encodeCredentialsData = (\n data: Record<string, unknown>,\n format: CredentialsDataFormat,\n) => (format === 'encrypted' ? { '#data': JSON.stringify(data) } : { data });\n\nexport const getScopedBranchId = (scope: GetCredentialsInput) => {\n switch (scope.scope) {\n case 'all':\n return undefined;\n case 'branchless':\n return 'null';\n case 'branched':\n return scope.branchId;\n }\n};\n","import { createGenericFetchClient, createOpenapiFetchClient, isApiError } from '../../fetchClient';\nimport { HttpStatus } from '../../internal';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport type { CreateCredentialInput, CredentialInput } from './types';\nimport type { CredentialsDataFormat, GetCredentialsInput } from './utils';\nimport { encodeCredentialsData, getScopedBranchId } from './utils';\n\nexport const createOauthClient = ({ 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 getCredentials = async (scope: GetCredentialsInput, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/credentials',\n { query: { branchId: getScopedBranchId(scope), componentId: scope.componentId } },\n { signal },\n );\n return data;\n };\n\n const getCredential = async ({ componentId, id }: CredentialInput, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/credentials/{componentId}/{name}',\n { path: { componentId, name: id } },\n { signal },\n );\n return data;\n };\n\n const createCredential = async (\n { componentId, data, ...rest }: CreateCredentialInput,\n signal?: AbortSignal,\n ) => {\n const post = (format: CredentialsDataFormat) =>\n client\n .post(\n '/credentials/{componentId}',\n {\n path: { componentId },\n // The plain shape predates the spec, so no schema can describe it. It borrows the\n // encrypted field's type to get past the generated body — the one assertion here.\n body: { ...rest, ...(encodeCredentialsData(data, format) as { '#data': string }) },\n },\n { signal },\n )\n .then((response) => response.data);\n\n try {\n return await post('plain');\n } catch (error) {\n if (isApiError(error) && error.response.status === HttpStatus.UNPROCESSABLE_ENTITY) {\n return post('encrypted');\n }\n throw error;\n }\n };\n\n const deleteCredential = async ({ componentId, id }: CredentialInput, signal?: AbortSignal) => {\n await client.delete(\n '/credentials/{componentId}/{name}',\n { path: { componentId, name: id } },\n { signal },\n );\n };\n\n /**\n * The GitHub connections of the project's organization; any project member's token may read them.\n *\n * - Empty when the organization has none.\n * - A listed connection does not guarantee a repository: the App installation must cover it.\n */\n const getOrganizationConnections = async (signal?: AbortSignal) => {\n const { data } = await client.get('/organization-credentials/connections', {}, { signal });\n return data.connections;\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 getCredentials,\n getCredential,\n createCredential,\n deleteCredential,\n getOrganizationConnections,\n };\n};\n"],"mappings":";;;;;;;;;;;;AA+BA,MAAa,yBACX,MACA,WACI,WAAW,cAAc,EAAE,SAAS,KAAK,UAAU,IAAI,EAAE,IAAI,EAAE,KAAK;AAE1E,MAAa,qBAAqB,UAA+B;CAC/D,QAAQ,MAAM,OAAd;EACE,KAAK,OACH;EACF,KAAK,cACH,OAAO;EACT,KAAK,YACH,OAAO,MAAM;CACjB;AACF;;;ACnCA,MAAa,qBAAqB,EAAE,SAAS,aAAa,WAA8B;CACtF,MAAM,SAASA,iCAAAA,yBAAgC;EAC7C;EACA;EACA,SAASC,aAAAA,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgBC,iCAAAA,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,iBAAiB,OAAO,OAA4B,WAAyB;EACjF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gBACA,EAAE,OAAO;GAAE,UAAU,kBAAkB,KAAK;GAAG,aAAa,MAAM;EAAY,EAAE,GAChF,EAAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,gBAAgB,OAAO,EAAE,aAAa,MAAuB,WAAyB;EAC1F,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EAAE,MAAM;GAAE;GAAa,MAAM;EAAG,EAAE,GAClC,EAAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,mBAAmB,OACvB,EAAE,aAAa,MAAM,GAAG,QACxB,WACG;EACH,MAAM,QAAQ,WACZ,OACG,KACC,8BACA;GACE,MAAM,EAAE,YAAY;GAGpB,MAAM;IAAE,GAAG;IAAM,GAAI,sBAAsB,MAAM,MAAM;GAA0B;EACnF,GACA,EAAE,OAAO,CACX,CAAC,CACA,MAAM,aAAa,SAAS,IAAI;EAErC,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAIC,0BAAAA,WAAW,KAAK,KAAK,MAAM,SAAS,WAAWC,0BAAAA,WAAW,sBAC5D,OAAO,KAAK,WAAW;GAEzB,MAAM;EACR;CACF;CAEA,MAAM,mBAAmB,OAAO,EAAE,aAAa,MAAuB,WAAyB;EAC7F,MAAM,OAAO,OACX,qCACA,EAAE,MAAM;GAAE;GAAa,MAAM;EAAG,EAAE,GAClC,EAAE,OAAO,CACX;CACF;;;;;;;CAQA,MAAM,6BAA6B,OAAO,WAAyB;EACjE,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,yCAAyC,CAAC,GAAG,EAAE,OAAO,CAAC;EACzF,OAAO,KAAK;CACd;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;CACF;AACF"}
@@ -1,7 +1,7 @@
1
- import { g as HttpStatus, r as isApiError } from "./createFetchClient-DITkTV2k.js";
2
- import { t as createGenericFetchClient } from "./createGenericFetchClient-KqiJhw8G.js";
3
- import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-wq8iGLZM.js";
4
- import { t as createAuthHeaders } from "./auth-C6cHWIWx.js";
1
+ import { g as HttpStatus, r as isApiError } from "./createFetchClient-CkHdS_IG.js";
2
+ import { t as createGenericFetchClient } from "./createGenericFetchClient-CQdNcPC3.js";
3
+ import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-DXiMv9WL.js";
4
+ import { t as createAuthHeaders } from "./auth-4coY1uwo.js";
5
5
  //#region src/clients/oauth/utils.ts
6
6
  /**
7
7
  * The credentials payload rides one of two fields, and only one of them is in the current spec:
@@ -65,6 +65,16 @@ const createOauthClient = ({ baseUrl, middlewares, auth }) => {
65
65
  name: id
66
66
  } }, { signal });
67
67
  };
68
+ /**
69
+ * The GitHub connections of the project's organization; any project member's token may read them.
70
+ *
71
+ * - Empty when the organization has none.
72
+ * - A listed connection does not guarantee a repository: the App installation must cover it.
73
+ */
74
+ const getOrganizationConnections = async (signal) => {
75
+ const { data } = await client.get("/organization-credentials/connections", {}, { signal });
76
+ return data.connections;
77
+ };
68
78
  const healthCheck = async (signal) => {
69
79
  const { data } = await genericClient.get("/health-check", {}, { signal });
70
80
  return data;
@@ -74,10 +84,11 @@ const createOauthClient = ({ baseUrl, middlewares, auth }) => {
74
84
  getCredentials,
75
85
  getCredential,
76
86
  createCredential,
77
- deleteCredential
87
+ deleteCredential,
88
+ getOrganizationConnections
78
89
  };
79
90
  };
80
91
  //#endregion
81
92
  export { createOauthClient as t };
82
93
 
83
- //# sourceMappingURL=oauth-Ck_Fe14o.js.map
94
+ //# sourceMappingURL=oauth-GXmZ9agP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-Ck_Fe14o.js","names":[],"sources":["../src/clients/oauth/utils.ts","../src/clients/oauth/oauthClient.ts"],"sourcesContent":["/**\n * Which credentials to list:\n *\n * - `all` — the whole project: branch-scoped and branchless alike.\n * - `branchless` — only what is tied to no branch at all, not even the default one.\n * - `branched` — only the branch whose id it carries.\n *\n * Discriminated on `scope`, not on `branchId` being present: a `string | 'all' | 'branchless'` union\n * collapses to `string`, so a mistyped scope would silently become a branch-id filter.\n */\nexport type GetCredentialsInput =\n | { scope: 'all'; componentId?: string }\n | { scope: 'branchless'; componentId?: string }\n | { scope: 'branched'; branchId: string; componentId?: string };\n\n/**\n * All three scopes ride the one `branchId` query parameter:\n *\n * - `all` → omitted, which the service reads as no filter.\n * - `branchless` → the literal string `'null'`, which it reads as `branchId IS NULL`.\n * - `branched` → the branch id itself.\n */\nexport type CredentialsDataFormat = 'encrypted' | 'plain';\n\n/**\n * The credentials payload rides one of two fields, and only one of them is in the current spec:\n *\n * - `encrypted` — `#data`, the payload serialized to a string. The `#` marks it for the service to\n * encrypt at rest.\n * - `plain` — `data`, the payload as an object. Only services predating the spec accept it.\n */\nexport const encodeCredentialsData = (\n data: Record<string, unknown>,\n format: CredentialsDataFormat,\n) => (format === 'encrypted' ? { '#data': JSON.stringify(data) } : { data });\n\nexport const getScopedBranchId = (scope: GetCredentialsInput) => {\n switch (scope.scope) {\n case 'all':\n return undefined;\n case 'branchless':\n return 'null';\n case 'branched':\n return scope.branchId;\n }\n};\n","import { createGenericFetchClient, createOpenapiFetchClient, isApiError } from '../../fetchClient';\nimport { HttpStatus } from '../../internal';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport type { CreateCredentialInput, CredentialInput } from './types';\nimport type { CredentialsDataFormat, GetCredentialsInput } from './utils';\nimport { encodeCredentialsData, getScopedBranchId } from './utils';\n\nexport const createOauthClient = ({ 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 getCredentials = async (scope: GetCredentialsInput, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/credentials',\n { query: { branchId: getScopedBranchId(scope), componentId: scope.componentId } },\n { signal },\n );\n return data;\n };\n\n const getCredential = async ({ componentId, id }: CredentialInput, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/credentials/{componentId}/{name}',\n { path: { componentId, name: id } },\n { signal },\n );\n return data;\n };\n\n const createCredential = async (\n { componentId, data, ...rest }: CreateCredentialInput,\n signal?: AbortSignal,\n ) => {\n const post = (format: CredentialsDataFormat) =>\n client\n .post(\n '/credentials/{componentId}',\n {\n path: { componentId },\n // The plain shape predates the spec, so no schema can describe it. It borrows the\n // encrypted field's type to get past the generated body — the one assertion here.\n body: { ...rest, ...(encodeCredentialsData(data, format) as { '#data': string }) },\n },\n { signal },\n )\n .then((response) => response.data);\n\n try {\n return await post('plain');\n } catch (error) {\n if (isApiError(error) && error.response.status === HttpStatus.UNPROCESSABLE_ENTITY) {\n return post('encrypted');\n }\n throw error;\n }\n };\n\n const deleteCredential = async ({ componentId, id }: CredentialInput, signal?: AbortSignal) => {\n await client.delete(\n '/credentials/{componentId}/{name}',\n { path: { componentId, name: id } },\n { signal },\n );\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n return {\n healthCheck,\n getCredentials,\n getCredential,\n createCredential,\n deleteCredential,\n };\n};\n"],"mappings":";;;;;;;;;;;;AA+BA,MAAa,yBACX,MACA,WACI,WAAW,cAAc,EAAE,SAAS,KAAK,UAAU,IAAI,EAAE,IAAI,EAAE,KAAK;AAE1E,MAAa,qBAAqB,UAA+B;CAC/D,QAAQ,MAAM,OAAd;EACE,KAAK,OACH;EACF,KAAK,cACH,OAAO;EACT,KAAK,YACH,OAAO,MAAM;CACjB;AACF;;;ACnCA,MAAa,qBAAqB,EAAE,SAAS,aAAa,WAA8B;CACtF,MAAM,SAAS,yBAAgC;EAC7C;EACA;EACA,SAAS,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgB,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,iBAAiB,OAAO,OAA4B,WAAyB;EACjF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gBACA,EAAE,OAAO;GAAE,UAAU,kBAAkB,KAAK;GAAG,aAAa,MAAM;EAAY,EAAE,GAChF,EAAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,gBAAgB,OAAO,EAAE,aAAa,MAAuB,WAAyB;EAC1F,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EAAE,MAAM;GAAE;GAAa,MAAM;EAAG,EAAE,GAClC,EAAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,mBAAmB,OACvB,EAAE,aAAa,MAAM,GAAG,QACxB,WACG;EACH,MAAM,QAAQ,WACZ,OACG,KACC,8BACA;GACE,MAAM,EAAE,YAAY;GAGpB,MAAM;IAAE,GAAG;IAAM,GAAI,sBAAsB,MAAM,MAAM;GAA0B;EACnF,GACA,EAAE,OAAO,CACX,CAAC,CACA,MAAM,aAAa,SAAS,IAAI;EAErC,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,WAAW,KAAK,KAAK,MAAM,SAAS,WAAW,WAAW,sBAC5D,OAAO,KAAK,WAAW;GAEzB,MAAM;EACR;CACF;CAEA,MAAM,mBAAmB,OAAO,EAAE,aAAa,MAAuB,WAAyB;EAC7F,MAAM,OAAO,OACX,qCACA,EAAE,MAAM;GAAE;GAAa,MAAM;EAAG,EAAE,GAClC,EAAE,OAAO,CACX;CACF;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;CACF;AACF"}
1
+ {"version":3,"file":"oauth-GXmZ9agP.js","names":[],"sources":["../src/clients/oauth/utils.ts","../src/clients/oauth/oauthClient.ts"],"sourcesContent":["/**\n * Which credentials to list:\n *\n * - `all` — the whole project: branch-scoped and branchless alike.\n * - `branchless` — only what is tied to no branch at all, not even the default one.\n * - `branched` — only the branch whose id it carries.\n *\n * Discriminated on `scope`, not on `branchId` being present: a `string | 'all' | 'branchless'` union\n * collapses to `string`, so a mistyped scope would silently become a branch-id filter.\n */\nexport type GetCredentialsInput =\n | { scope: 'all'; componentId?: string }\n | { scope: 'branchless'; componentId?: string }\n | { scope: 'branched'; branchId: string; componentId?: string };\n\n/**\n * All three scopes ride the one `branchId` query parameter:\n *\n * - `all` → omitted, which the service reads as no filter.\n * - `branchless` → the literal string `'null'`, which it reads as `branchId IS NULL`.\n * - `branched` → the branch id itself.\n */\nexport type CredentialsDataFormat = 'encrypted' | 'plain';\n\n/**\n * The credentials payload rides one of two fields, and only one of them is in the current spec:\n *\n * - `encrypted` — `#data`, the payload serialized to a string. The `#` marks it for the service to\n * encrypt at rest.\n * - `plain` — `data`, the payload as an object. Only services predating the spec accept it.\n */\nexport const encodeCredentialsData = (\n data: Record<string, unknown>,\n format: CredentialsDataFormat,\n) => (format === 'encrypted' ? { '#data': JSON.stringify(data) } : { data });\n\nexport const getScopedBranchId = (scope: GetCredentialsInput) => {\n switch (scope.scope) {\n case 'all':\n return undefined;\n case 'branchless':\n return 'null';\n case 'branched':\n return scope.branchId;\n }\n};\n","import { createGenericFetchClient, createOpenapiFetchClient, isApiError } from '../../fetchClient';\nimport { HttpStatus } from '../../internal';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport type { CreateCredentialInput, CredentialInput } from './types';\nimport type { CredentialsDataFormat, GetCredentialsInput } from './utils';\nimport { encodeCredentialsData, getScopedBranchId } from './utils';\n\nexport const createOauthClient = ({ 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 getCredentials = async (scope: GetCredentialsInput, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/credentials',\n { query: { branchId: getScopedBranchId(scope), componentId: scope.componentId } },\n { signal },\n );\n return data;\n };\n\n const getCredential = async ({ componentId, id }: CredentialInput, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/credentials/{componentId}/{name}',\n { path: { componentId, name: id } },\n { signal },\n );\n return data;\n };\n\n const createCredential = async (\n { componentId, data, ...rest }: CreateCredentialInput,\n signal?: AbortSignal,\n ) => {\n const post = (format: CredentialsDataFormat) =>\n client\n .post(\n '/credentials/{componentId}',\n {\n path: { componentId },\n // The plain shape predates the spec, so no schema can describe it. It borrows the\n // encrypted field's type to get past the generated body — the one assertion here.\n body: { ...rest, ...(encodeCredentialsData(data, format) as { '#data': string }) },\n },\n { signal },\n )\n .then((response) => response.data);\n\n try {\n return await post('plain');\n } catch (error) {\n if (isApiError(error) && error.response.status === HttpStatus.UNPROCESSABLE_ENTITY) {\n return post('encrypted');\n }\n throw error;\n }\n };\n\n const deleteCredential = async ({ componentId, id }: CredentialInput, signal?: AbortSignal) => {\n await client.delete(\n '/credentials/{componentId}/{name}',\n { path: { componentId, name: id } },\n { signal },\n );\n };\n\n /**\n * The GitHub connections of the project's organization; any project member's token may read them.\n *\n * - Empty when the organization has none.\n * - A listed connection does not guarantee a repository: the App installation must cover it.\n */\n const getOrganizationConnections = async (signal?: AbortSignal) => {\n const { data } = await client.get('/organization-credentials/connections', {}, { signal });\n return data.connections;\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 getCredentials,\n getCredential,\n createCredential,\n deleteCredential,\n getOrganizationConnections,\n };\n};\n"],"mappings":";;;;;;;;;;;;AA+BA,MAAa,yBACX,MACA,WACI,WAAW,cAAc,EAAE,SAAS,KAAK,UAAU,IAAI,EAAE,IAAI,EAAE,KAAK;AAE1E,MAAa,qBAAqB,UAA+B;CAC/D,QAAQ,MAAM,OAAd;EACE,KAAK,OACH;EACF,KAAK,cACH,OAAO;EACT,KAAK,YACH,OAAO,MAAM;CACjB;AACF;;;ACnCA,MAAa,qBAAqB,EAAE,SAAS,aAAa,WAA8B;CACtF,MAAM,SAAS,yBAAgC;EAC7C;EACA;EACA,SAAS,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgB,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,iBAAiB,OAAO,OAA4B,WAAyB;EACjF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gBACA,EAAE,OAAO;GAAE,UAAU,kBAAkB,KAAK;GAAG,aAAa,MAAM;EAAY,EAAE,GAChF,EAAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,gBAAgB,OAAO,EAAE,aAAa,MAAuB,WAAyB;EAC1F,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EAAE,MAAM;GAAE;GAAa,MAAM;EAAG,EAAE,GAClC,EAAE,OAAO,CACX;EACA,OAAO;CACT;CAEA,MAAM,mBAAmB,OACvB,EAAE,aAAa,MAAM,GAAG,QACxB,WACG;EACH,MAAM,QAAQ,WACZ,OACG,KACC,8BACA;GACE,MAAM,EAAE,YAAY;GAGpB,MAAM;IAAE,GAAG;IAAM,GAAI,sBAAsB,MAAM,MAAM;GAA0B;EACnF,GACA,EAAE,OAAO,CACX,CAAC,CACA,MAAM,aAAa,SAAS,IAAI;EAErC,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,WAAW,KAAK,KAAK,MAAM,SAAS,WAAW,WAAW,sBAC5D,OAAO,KAAK,WAAW;GAEzB,MAAM;EACR;CACF;CAEA,MAAM,mBAAmB,OAAO,EAAE,aAAa,MAAuB,WAAyB;EAC7F,MAAM,OAAO,OACX,qCACA,EAAE,MAAM;GAAE;GAAa,MAAM;EAAG,EAAE,GAClC,EAAE,OAAO,CACX;CACF;;;;;;;CAQA,MAAM,6BAA6B,OAAO,WAAyB;EACjE,MAAM,EAAE,SAAS,MAAM,OAAO,IAAI,yCAAyC,CAAC,GAAG,EAAE,OAAO,CAAC;EACzF,OAAO,KAAK;CACd;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;CACF;AACF"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_createOpenapiFetchClient = require("../createOpenapiFetchClient-CioTX11-.cjs");
3
- const require_auth = require("../auth-C9o_0bft.cjs");
2
+ const require_createOpenapiFetchClient = require("../createOpenapiFetchClient-DHYo_k3t.cjs");
3
+ const require_auth = require("../auth-C8Pjl0Mu.cjs");
4
4
  //#region src/clients/omnisearch/omnisearchClient.ts
5
5
  /**
6
6
  * Omnisearch — data lineage.
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BksK2Eo0.cjs";
2
- import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-ggpJFEWZ.cjs";
1
+ import { n as ClientInitOptions } from "../types-sOM2_KPc.cjs";
2
+ import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-DSBrhK_K.cjs";
3
3
  //#region src/clients/omnisearch/omnisearchClient.d.ts
4
4
  /**
5
5
  * Omnisearch — data lineage.
@@ -1,5 +1,5 @@
1
- import { n as ClientInitOptions } from "../types-BuKviWct.js";
2
- import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-Br04cEri.js";
1
+ import { n as ClientInitOptions } from "../types-D3H3EAre.js";
2
+ import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-Bt8CEZ6K.js";
3
3
  //#region src/clients/omnisearch/omnisearchClient.d.ts
4
4
  /**
5
5
  * Omnisearch — data lineage.
@@ -1,5 +1,5 @@
1
- import { t as createOpenapiFetchClient } from "../createOpenapiFetchClient-wq8iGLZM.js";
2
- import { t as createAuthHeaders } from "../auth-C6cHWIWx.js";
1
+ import { t as createOpenapiFetchClient } from "../createOpenapiFetchClient-DXiMv9WL.js";
2
+ import { t as createAuthHeaders } from "../auth-4coY1uwo.js";
3
3
  //#region src/clients/omnisearch/omnisearchClient.ts
4
4
  /**
5
5
  * Omnisearch — data lineage.
@@ -1,2 +1,2 @@
1
- import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-ggpJFEWZ.cjs";
1
+ import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-DSBrhK_K.cjs";
2
2
  export { GetProjectsLineageQuery, GetTablesLineageQuery, LineageBucket, LineageConfiguration, LineageMetadata, LineageProject, LineageSource, LineageTable, ProjectLineageRelation, ProjectsLineage, ProjectsLineageResponse, TableLineageRelation, TablesLineage, TablesLineageResponse };
@@ -1,2 +1,2 @@
1
- import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-Br04cEri.js";
1
+ import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-Bt8CEZ6K.js";
2
2
  export { GetProjectsLineageQuery, GetTablesLineageQuery, LineageBucket, LineageConfiguration, LineageMetadata, LineageProject, LineageSource, LineageTable, ProjectLineageRelation, ProjectsLineage, ProjectsLineageResponse, TableLineageRelation, TablesLineage, TablesLineageResponse };
@@ -0,0 +1,74 @@
1
+ import { Lr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-ChDl6ig5.cjs";
2
+ import "./adminRoles-BgpaBE7h.cjs";
3
+ import { t as Backend } from "./backends-DKBz5OxE.cjs";
4
+ //#region src/clients/storage/tokens/types.d.ts
5
+ type ProjectId = number;
6
+ type CreateTokenSchemaBody = OpenapiBodyType<paths['/v2/storage/tokens']['post']>;
7
+ type UpdateTokenSchemaBody = OpenapiBodyType<paths['/v2/storage/tokens/{id}']['put']>;
8
+ type TokenListItem = OpenapiReturnType<paths['/v2/storage/tokens']['get']>[number];
9
+ type GetTokenEventsPath = OpenapiPathType<paths['/v2/storage/tokens/{id}/events']['get']>;
10
+ type GetTokenEventsInput = GetTokenEventsPath & NonNullable<OpenapiQueryType<paths['/v2/storage/tokens/{id}/events']['get']>>;
11
+ /**
12
+ * The create payload with `token` required.
13
+ *
14
+ * - The spec shares the schema with update, where `token` is omitted; create always returns it.
15
+ */
16
+ type CreateTokenResponse = Omit<OpenapiReturnType<paths['/v2/storage/tokens']['post']>, 'token'> & {
17
+ token: string;
18
+ };
19
+ /** The verify payload as the spec declares it — `StorageToken` is the corrected shape. */
20
+ type StorageTokenRaw = OpenapiReturnType<paths['/v2/storage/tokens/verify']['get']>;
21
+ /**
22
+ * `StorageTokenRaw` tightened to what an admin session always gets.
23
+ *
24
+ * - `admin` and `adminOwner` are optional in the spec (a token without an admin); every token the
25
+ * SDK verifies belongs to one, and `domain/permissions` narrows on `admin.role`.
26
+ * - `admin.role` stays the spec's enum and nullable: Connection stores memberships without a role.
27
+ * - `owner.assignedBackends` narrows to the backends the SDK knows; the spec types them `string`.
28
+ */
29
+ type StorageToken = Omit<StorageTokenRaw, 'owner' | 'admin' | 'adminOwner'> & {
30
+ owner: Omit<StorageTokenRaw['owner'], 'assignedBackends'> & {
31
+ assignedBackends: Backend[];
32
+ };
33
+ admin: NonNullable<StorageTokenRaw['admin']>;
34
+ adminOwner: NonNullable<StorageTokenRaw['adminOwner']>;
35
+ };
36
+ /**
37
+ * The create body with every field optional.
38
+ * - Connection defaults each boolean (`?? false`) and declares no `required` list; the generator
39
+ * marks a property with a `default` as required (`--default-non-nullable`), hence the `Partial`.
40
+ * - `canManageBuckets` only picks the full arm of the spec's union; the limited arm is a subset.
41
+ */
42
+ type CreateTokenBody = Partial<Extract<CreateTokenSchemaBody, {
43
+ canManageBuckets: boolean;
44
+ }>>;
45
+ /** Update takes these five fields and ignores the rest (`allowExtraFields`); `canManageBuckets` is set at creation only. */
46
+ type UpdateTokenBody = UpdateTokenSchemaBody;
47
+ type UpdateTokenPath = OpenapiPathType<paths['/v2/storage/tokens/{id}']['put']>;
48
+ type UpdateTokenInput = UpdateTokenPath & UpdateTokenBody;
49
+ type ShareTokenBody = OpenapiBodyType<paths['/v2/storage/tokens/{id}/share']['post']>;
50
+ type ShareTokenPath = OpenapiPathType<paths['/v2/storage/tokens/{id}/share']['post']>;
51
+ type ShareTokenInput = ShareTokenPath & ShareTokenBody;
52
+ //#endregion
53
+ //#region src/domain/project.d.ts
54
+ type Options = {
55
+ sapiToken: StorageToken;
56
+ };
57
+ declare const hasFeature: (token: StorageToken, ...feature: string[]) => boolean;
58
+ /**
59
+ * The admin's features as the Storage token carries them.
60
+ *
61
+ * - The same list `createAdminAccount` reads from the Manage token: Connection serialises both
62
+ * from the admin row, so prefer the account where one is at hand — it also knows `isSuperAdmin`.
63
+ */
64
+ declare const hasAdminFeature: (token: StorageToken, ...feature: string[]) => boolean;
65
+ declare const createProject: ({ sapiToken }: Options) => {
66
+ hasFeature: (...feature: string[]) => boolean;
67
+ hasAdminFeature: (...feature: string[]) => boolean;
68
+ hasBackend: (backend: Backend) => boolean;
69
+ sapiToken: StorageToken;
70
+ };
71
+ type Project = ReturnType<typeof createProject>;
72
+ //#endregion
73
+ export { UpdateTokenInput as _, CreateTokenResponse as a, GetTokenEventsPath as c, ShareTokenInput as d, ShareTokenPath as f, UpdateTokenBody as g, TokenListItem as h, CreateTokenBody as i, ProjectId as l, StorageTokenRaw as m, hasAdminFeature as n, CreateTokenSchemaBody as o, StorageToken as p, hasFeature as r, GetTokenEventsInput as s, Project as t, ShareTokenBody as u, UpdateTokenPath as v, UpdateTokenSchemaBody as y };
74
+ //# sourceMappingURL=project-Dzu85cqr.d.cts.map
@@ -0,0 +1,74 @@
1
+ import { Lr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-sDHBkJhU.js";
2
+ import "./adminRoles-DsoGQipO.js";
3
+ import { t as Backend } from "./backends-DKBz5OxE.js";
4
+ //#region src/clients/storage/tokens/types.d.ts
5
+ type ProjectId = number;
6
+ type CreateTokenSchemaBody = OpenapiBodyType<paths['/v2/storage/tokens']['post']>;
7
+ type UpdateTokenSchemaBody = OpenapiBodyType<paths['/v2/storage/tokens/{id}']['put']>;
8
+ type TokenListItem = OpenapiReturnType<paths['/v2/storage/tokens']['get']>[number];
9
+ type GetTokenEventsPath = OpenapiPathType<paths['/v2/storage/tokens/{id}/events']['get']>;
10
+ type GetTokenEventsInput = GetTokenEventsPath & NonNullable<OpenapiQueryType<paths['/v2/storage/tokens/{id}/events']['get']>>;
11
+ /**
12
+ * The create payload with `token` required.
13
+ *
14
+ * - The spec shares the schema with update, where `token` is omitted; create always returns it.
15
+ */
16
+ type CreateTokenResponse = Omit<OpenapiReturnType<paths['/v2/storage/tokens']['post']>, 'token'> & {
17
+ token: string;
18
+ };
19
+ /** The verify payload as the spec declares it — `StorageToken` is the corrected shape. */
20
+ type StorageTokenRaw = OpenapiReturnType<paths['/v2/storage/tokens/verify']['get']>;
21
+ /**
22
+ * `StorageTokenRaw` tightened to what an admin session always gets.
23
+ *
24
+ * - `admin` and `adminOwner` are optional in the spec (a token without an admin); every token the
25
+ * SDK verifies belongs to one, and `domain/permissions` narrows on `admin.role`.
26
+ * - `admin.role` stays the spec's enum and nullable: Connection stores memberships without a role.
27
+ * - `owner.assignedBackends` narrows to the backends the SDK knows; the spec types them `string`.
28
+ */
29
+ type StorageToken = Omit<StorageTokenRaw, 'owner' | 'admin' | 'adminOwner'> & {
30
+ owner: Omit<StorageTokenRaw['owner'], 'assignedBackends'> & {
31
+ assignedBackends: Backend[];
32
+ };
33
+ admin: NonNullable<StorageTokenRaw['admin']>;
34
+ adminOwner: NonNullable<StorageTokenRaw['adminOwner']>;
35
+ };
36
+ /**
37
+ * The create body with every field optional.
38
+ * - Connection defaults each boolean (`?? false`) and declares no `required` list; the generator
39
+ * marks a property with a `default` as required (`--default-non-nullable`), hence the `Partial`.
40
+ * - `canManageBuckets` only picks the full arm of the spec's union; the limited arm is a subset.
41
+ */
42
+ type CreateTokenBody = Partial<Extract<CreateTokenSchemaBody, {
43
+ canManageBuckets: boolean;
44
+ }>>;
45
+ /** Update takes these five fields and ignores the rest (`allowExtraFields`); `canManageBuckets` is set at creation only. */
46
+ type UpdateTokenBody = UpdateTokenSchemaBody;
47
+ type UpdateTokenPath = OpenapiPathType<paths['/v2/storage/tokens/{id}']['put']>;
48
+ type UpdateTokenInput = UpdateTokenPath & UpdateTokenBody;
49
+ type ShareTokenBody = OpenapiBodyType<paths['/v2/storage/tokens/{id}/share']['post']>;
50
+ type ShareTokenPath = OpenapiPathType<paths['/v2/storage/tokens/{id}/share']['post']>;
51
+ type ShareTokenInput = ShareTokenPath & ShareTokenBody;
52
+ //#endregion
53
+ //#region src/domain/project.d.ts
54
+ type Options = {
55
+ sapiToken: StorageToken;
56
+ };
57
+ declare const hasFeature: (token: StorageToken, ...feature: string[]) => boolean;
58
+ /**
59
+ * The admin's features as the Storage token carries them.
60
+ *
61
+ * - The same list `createAdminAccount` reads from the Manage token: Connection serialises both
62
+ * from the admin row, so prefer the account where one is at hand — it also knows `isSuperAdmin`.
63
+ */
64
+ declare const hasAdminFeature: (token: StorageToken, ...feature: string[]) => boolean;
65
+ declare const createProject: ({ sapiToken }: Options) => {
66
+ hasFeature: (...feature: string[]) => boolean;
67
+ hasAdminFeature: (...feature: string[]) => boolean;
68
+ hasBackend: (backend: Backend) => boolean;
69
+ sapiToken: StorageToken;
70
+ };
71
+ type Project = ReturnType<typeof createProject>;
72
+ //#endregion
73
+ export { UpdateTokenInput as _, CreateTokenResponse as a, GetTokenEventsPath as c, ShareTokenInput as d, ShareTokenPath as f, UpdateTokenBody as g, TokenListItem as h, CreateTokenBody as i, ProjectId as l, StorageTokenRaw as m, hasAdminFeature as n, CreateTokenSchemaBody as o, StorageToken as p, hasFeature as r, GetTokenEventsInput as s, Project as t, ShareTokenBody as u, UpdateTokenPath as v, UpdateTokenSchemaBody as y };
74
+ //# sourceMappingURL=project-nbv9yjpl.d.ts.map
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_queryService = require("../queryService-RlNYw7LG.cjs");
2
+ const require_queryService = require("../queryService-CzK53q94.cjs");
3
3
  exports.createQueryServiceClient = require_queryService.createQueryServiceClient;
@@ -1,2 +1,2 @@
1
- import { t as createQueryServiceClient } from "../index-syAYY5LC.cjs";
1
+ import { S as createQueryServiceClient } from "../index-C40Fbj-6.cjs";
2
2
  export { createQueryServiceClient };
@@ -1,2 +1,2 @@
1
- import { t as createQueryServiceClient } from "../index-BP3choXr.js";
1
+ import { S as createQueryServiceClient } from "../index-B3QTeqfL.js";
2
2
  export { createQueryServiceClient };
@@ -1,2 +1,2 @@
1
- import { t as createQueryServiceClient } from "../queryService-Blfz59Ms.js";
1
+ import { t as createQueryServiceClient } from "../queryService-C-pZha5p.js";
2
2
  export { createQueryServiceClient };
@@ -1,2 +1,2 @@
1
- import { a as GetQueryJobPath, c as JobStatusResponse, d as PostQueryPath, f as QueryJobStatus, i as GetQueriesPath, l as PostCancelQueryJobPath, m as Statements, n as GetExportResultsQuery, o as GetQueryResultsPath, p as QueryResult, r as GetQueriesHistoryQuery, s as GetQueryResutsQuery, t as ExportResultsResponse, u as PostQueryBody } from "../types-q5lgElyc.cjs";
2
- export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, QueryJobStatus, QueryResult, Statements };
1
+ import { $ as PostQueryBody, G as GetExportResultsQuery, J as GetQueryJobPath, K as GetQueriesHistoryQuery, Q as PostCancelQueryJobPath, U as QueryJobPollOptions, W as ExportResultsResponse, X as GetQueryResutsQuery, Y as GetQueryResultsPath, Z as JobStatusResponse, et as PostQueryPath, nt as QueryResult, q as GetQueriesPath, rt as Statements, tt as QueryJobStatus } from "../index-C40Fbj-6.cjs";
2
+ export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, type QueryJobPollOptions, QueryJobStatus, QueryResult, Statements };
@@ -1,2 +1,2 @@
1
- import { a as GetQueryJobPath, c as JobStatusResponse, d as PostQueryPath, f as QueryJobStatus, i as GetQueriesPath, l as PostCancelQueryJobPath, m as Statements, n as GetExportResultsQuery, o as GetQueryResultsPath, p as QueryResult, r as GetQueriesHistoryQuery, s as GetQueryResutsQuery, t as ExportResultsResponse, u as PostQueryBody } from "../types-j30rKMe6.js";
2
- export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, QueryJobStatus, QueryResult, Statements };
1
+ import { $ as PostQueryBody, G as GetExportResultsQuery, J as GetQueryJobPath, K as GetQueriesHistoryQuery, Q as PostCancelQueryJobPath, U as QueryJobPollOptions, W as ExportResultsResponse, X as GetQueryResutsQuery, Y as GetQueryResultsPath, Z as JobStatusResponse, et as PostQueryPath, nt as QueryResult, q as GetQueriesPath, rt as Statements, tt as QueryJobStatus } from "../index-B3QTeqfL.js";
2
+ export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, type QueryJobPollOptions, QueryJobStatus, QueryResult, Statements };
@@ -1,31 +1,40 @@
1
- import { a as poller, t as jobStatus } from "./jobStatus-BJdbZ72V.js";
2
- import { f as parseContentDispositionHeader, s as HttpHeader } from "./createFetchClient-DITkTV2k.js";
3
- import { t as createGenericFetchClient } from "./createGenericFetchClient-KqiJhw8G.js";
4
- import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-wq8iGLZM.js";
5
- import { t as createAuthHeaders } from "./auth-C6cHWIWx.js";
1
+ import { a as poller, n as jobStatus, t as transientRetries } from "./transientRetries-B4iusp69.js";
2
+ import { f as parseContentDispositionHeader, s as HttpHeader } from "./createFetchClient-CkHdS_IG.js";
3
+ import { t as QueryJobError } from "./QueryJobError-ZZZ043Nm.js";
4
+ import { t as createGenericFetchClient } from "./createGenericFetchClient-CQdNcPC3.js";
5
+ import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-DXiMv9WL.js";
6
+ import { t as createAuthHeaders } from "./auth-4coY1uwo.js";
6
7
  //#region src/clients/queryService/poller.ts
7
8
  const DEFAULT_POLL_INTERVAL = 2e3;
8
- /**
9
- * Waits on a query job.
10
- *
11
- * - Takes the job rather than its id, so a caller hands over what `createQueryJob` gave it.
12
- * - The request reads the id off the key rather than out of a closure, which is what makes the key
13
- * the whole input.
14
- * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a
15
- * statement that failed, and what that means is the caller's business.
16
- */
17
- const createJobPoller = ({ getQueryJob }) => ({ id }, { interval, maxAttempts, timeout, signal } = {}) => poller({
18
- pollKey: ["queryService.job", { queryJobId: id }],
19
- pollFn: ({ pollKey: [, params], signal: pollSignal }) => getQueryJob(params.queryJobId, pollSignal),
20
- until: ({ data }) => jobStatus.query.isTerminal(data.status),
21
- backoff: {
22
- type: "constant",
23
- interval: interval ?? DEFAULT_POLL_INTERVAL
24
- },
25
- maxAttempts,
26
- timeout,
27
- signal
28
- });
9
+ const createJobPoller = ({ getQueryJob }) => ({ init, interval, maxAttempts, timeout, signal }) => {
10
+ const retries = transientRetries();
11
+ return poller({
12
+ pollKey: ({ id }) => ["queryService.job", { id }],
13
+ init,
14
+ pollFn: async ({ init: { id }, signal: pollSignal }) => {
15
+ const job = await getQueryJob(id, pollSignal);
16
+ retries.reset();
17
+ return job;
18
+ },
19
+ isRetryable: retries.isRetryable,
20
+ until: ({ data }) => jobStatus.query.isTerminal(data.status),
21
+ failed: (job) => {
22
+ if (job.status !== "failed") return void 0;
23
+ const failedStatements = job.statements.filter((statement) => statement.status === "failed").map((statement) => ({
24
+ id: statement.id,
25
+ error: statement.error
26
+ }));
27
+ return new QueryJobError(failedStatements[0]?.error ?? "Job failed", job.queryJobId, { failedStatements });
28
+ },
29
+ backoff: {
30
+ type: "constant",
31
+ interval: interval ?? DEFAULT_POLL_INTERVAL
32
+ },
33
+ maxAttempts,
34
+ timeout,
35
+ signal
36
+ });
37
+ };
29
38
  //#endregion
30
39
  //#region src/clients/queryService/queryServiceClient.ts
31
40
  const createQueryServiceClient = ({ baseUrl, middlewares, auth }) => {
@@ -111,4 +120,4 @@ const createQueryServiceClient = ({ baseUrl, middlewares, auth }) => {
111
120
  //#endregion
112
121
  export { createQueryServiceClient as t };
113
122
 
114
- //# sourceMappingURL=queryService-Blfz59Ms.js.map
123
+ //# sourceMappingURL=queryService-C-pZha5p.js.map